/* =============================================
   Navbar
   ============================================= */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #243b2f;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

/* Logo */
.navbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.navbar-logo-image {
  height: 38px;
  width: auto;
  display: block;
  object-fit: contain;
}

.navbar-logo-text {
  font-family: var(--heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}

/* Nav links */
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Search */
.navbar-search {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 0 8px;
  position: relative;
}

.navbar-search-input {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.9rem;
  padding: 8px 8px;
  width: 140px;
  font-family: var(--sans);
  outline: none;
}

.navbar-search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.navbar-search-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 4px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.navbar-search-btn:hover {
  color: #fff;
}

.navbar-search-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  list-style: none;
  padding: 4px 0;
  margin: 0;
  z-index: 200;
  max-height: 280px;
  overflow-y: auto;
}

.navbar-search-suggestion {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  text-align: left;
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.12s;
  font-family: var(--sans);
}

.navbar-search-suggestion:hover {
  background: var(--green-light);
  color: var(--green-dark);
}

.navbar-search-suggestion:active {
  background: #d4e9dd;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: var(--radius);
  color: rgba(255,255,255,0.88);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--sans);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255,255,255,0.14);
  color: #fff;
  text-decoration: none;
}

.nav-shop {
  color: var(--amber-light);
  font-weight: 600;
}
.nav-shop:hover {
  color: #fff;
}

/* Dropdown */
.nav-item.dropdown {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
}

.chevron {
  transition: transform 0.2s;
  opacity: 0.75;
}

.dropdown.active .chevron {
  transform: rotate(180deg);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  list-style: none;
  padding: 6px 0;
  margin: 0;
  z-index: 200;
}

.dropdown.active .dropdown-menu {
  display: block;
}

.dropdown-link {
  display: block;
  padding: 9px 18px;
  color: var(--text);
  font-size: 0.92rem;
  text-decoration: none;
  transition: background 0.12s;
}

.dropdown-link:hover,
.dropdown-link.active {
  background: var(--green-light);
  color: var(--green-dark);
  text-decoration: none;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.25s;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Desktop: varmistaa että JS:n asettama inline-transform ei häiritse layoutia */
@media (min-width: 901px) {
  .navbar-nav {
    transform: none !important;
  }
}

/* Mobile */
@media (max-width: 900px) {
  .navbar-search {
    display: none;
  }

  .navbar-logo-image {
    height: 34px;
  }

  .navbar-logo-text {
    font-size: 1.35rem;
  }

  .hamburger {
    display: flex;
  }

  .navbar-nav {
    position: fixed;
    inset: 64px 0 0 0;
    background: #243b2f;
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 16px 32px;
    gap: 2px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.28s ease;
  }

  .navbar-nav.open {
    transform: translateX(0);
  }

  .nav-link {
    width: 100%;
    font-size: 1rem;
    padding: 12px 16px;
  }

  .nav-item.dropdown {
    width: 100%;
  }

  .dropdown-toggle {
    width: 100%;
    justify-content: space-between;
  }

  .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: rgba(255,255,255,0.07);
    padding: 0;
    margin: 4px 0 4px 16px;
  }

  .dropdown-link {
    color: rgba(255,255,255,0.85);
    padding: 10px 16px;
  }

  .dropdown-link:hover,
  .dropdown-link.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
  }
}
