/* ============================================================
   Navbar & Sidebar (extracted from main.css)
   ============================================================ */

/* Navbar */
/* The shared header occupies its actual height on every public page. */
body:has(> .navbar) { margin-top: 0; }

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background-color: var(--surface-alt);
  /* A hairline and a soft spread, not a 6px band at 10% black. The old
     shadow read as a hard dark edge sitting on top of whatever the page
     started with — most visibly the breadcrumb row. */
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 2px rgba(35, 31, 32, 0.04), 0 8px 24px -12px rgba(35, 31, 32, 0.18);
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 100;
}

.logo img {
  width: 150px;
}

.nav-options {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 1.2vw, 1.5rem);
}

.nav-options a {
  color: var(--brand-black);
  display: block;
  padding-block: var(--space-2);
  position: relative;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  text-transform: none;
  white-space: nowrap;
}

.nav-options a i { display: none; }

/* Navigation Link Underline Animation */
.nav-options a::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--brand-black);
  border-radius: 1px;
  transition: var(--transition-slow);
}

.nav-options a:hover::before,
.nav-options a.active::before {
  background-color: var(--brand-gold);
}

.nav-options a:hover,
.nav-options a.active {
  color: var(--brand-gold);
}

.nav-options a i,
.login-button a i {
  margin-right: 10px;
}

/* Login Button */
.login-button a {
  color: var(--surface);
  background-color: var(--brand-gold);
  font-size: var(--fs-sm);
  padding: 10px 20px;
  border-radius: var(--radius-lg);
  text-transform: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition-slow);
}

.login-button a:hover {
  background-color: var(--brand-black);
}

/* Container for Login and Language */
.login-lang-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* One language selector for desktop and mobile. */
.language-switcher { position: relative; flex: 0 0 auto; color: var(--brand-black); }
.language-switcher__trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.875rem;
  font-weight: var(--fw-semibold);
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}
.language-switcher__trigger::-webkit-details-marker { display: none; }
.language-switcher__trigger:hover,
.language-switcher[open] > summary { background: var(--surface-sunken); }
.language-switcher__code { display: none; }
.language-switcher .fi {
  width: 22px;
  height: 16px;
  flex: 0 0 22px;
  border-radius: 2px;
  background-size: cover;
  box-shadow: 0 0 0 1px rgba(35, 31, 32, 0.08);
}
.language-switcher__chevron { flex: 0 0 16px; transition: transform 0.15s ease; }
.language-switcher[open] .language-switcher__chevron { transform: rotate(180deg); }
.language-switcher__panel {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  width: 224px;
  max-width: calc(100vw - 24px);
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 10px 32px rgba(35, 31, 32, 0.16);
  z-index: 2;
}
.language-switcher:not([open]) > .language-switcher__panel { display: none; }
.language-switcher__heading {
  margin: 0;
  padding: 8px 12px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.language-switcher__option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--brand-black);
  font-size: 0.9375rem;
  font-weight: var(--fw-medium);
  text-align: start;
  white-space: nowrap;
}
.language-switcher__option:hover { background: var(--surface-sunken); }
.language-switcher__option[aria-current] { background: var(--surface-alt); font-weight: var(--fw-semibold); }
.language-switcher__check { margin-inline-start: auto; flex: 0 0 18px; color: var(--brand-gold-dark); }

.show {
  display: block;
}

/* Hamburger Menu */
.hamburger-menu {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.hamburger-menu i {
  transition: transform 0.5s ease, opacity 0.5s ease;
  font-size: 2rem;
}

.hamburger-menu.active i {
  transform: rotate(90deg);
  opacity: 0;
}

/* Sidebar */
.sidebar {
  visibility: hidden;
  position: fixed;
  top: 0;
  left: -16.875rem;
  width: 16.875rem;
  height: 100%;
  background-color: var(--surface-alt);
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
  padding: 60px 0;
  transition: left 0.5s ease;
  z-index: 101;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar.active {
  visibility: visible;
  left: 0;
}

body.nav-menu-open { overflow: hidden; }

.sidebar ul {
  list-style: none;
  padding-left: 20px;
  flex-grow: 1;
}

.sidebar ul li a {
  display: block;
  padding: 15px 0;
  font-size: 1.1rem;
  color: var(--text);
  text-transform: uppercase;
}

.sidebar ul li a:hover {
  color: var(--brand-gold);
}

.sidebar-options a.active {
  color: var(--brand-gold);
}

/* Sidebar Logo */
.sidebar .logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: -25px;
}

.sidebar .logo img {
  max-width: 120px;
  height: auto;
}

/* Sidebar Login and Language Controls */
.sidebar .login-item {
  margin-top: auto;
  padding: 15px;
  text-align: center;
}

.sidebar .login-button a {
  display: block;
  text-align: center;
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  display: none;
}

/* Responsive Navbar Styles */
@media (min-width: 1200px) {
  .navbar { gap: var(--space-5); }
  .navbar .logo img { width: 130px; }
}

@media (width < 1200px) {

  .nav-options,
  .navbar .login-button {
    display: none;
  }

  .hamburger-menu {
    display: flex;
  }

  .sidebar {
    display: block;
  }

  .sidebar.active {
    display: flex;
  }
}

/* ============================================================
   Phase 6 — one navbar, sized for a thumb

   Three changes, all of them for the phone case:
     1. .nav-mobile-actions keeps the cart and the account on the
        bar at every width (they used to vanish into the menu).
     2. Sidebar rows are 56px with a visible separator, and the
        panel has its own close button.
     3. The active page is marked, so "where am I" is answered
        without reading.
   ============================================================ */

.nav-mobile-actions {
  display: none;             /* desktop keeps the full nav */
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
  margin-right: var(--space-2);
}

/* :visited in base.css is a (0,1,1) selector and was beating the class here,
   which is why the cart and account icons came out link-blue. */
.nav-icon-link,
.nav-icon-link:visited {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: var(--brand-black);
  font-size: var(--fs-md);
  transition: background var(--transition), color var(--transition);
}

.nav-icon-link:hover,
.nav-icon-link:focus-visible {
  background: var(--surface-sunken);
  color: var(--brand-gold-dark);
}

.nav-icon-link .cart-badge-navbar {
  position: absolute;
  top: 4px;
  right: 2px;
}

/* Sidebar close button */
.sidebar-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-sunken);
  color: var(--brand-black);
  font-size: var(--fs-lg);
}

.sidebar-close:hover,
.sidebar-close:focus-visible {
  background: var(--brand-black);
  color: var(--brand-gold);
}

/* Bigger, separated sidebar rows */
.sidebar ul li a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 56px;
  padding: var(--space-3) var(--space-4) var(--space-3) 0;
  border-bottom: 1px solid var(--border-color);
  font-size: var(--fs-base);
  text-transform: none;
  font-weight: var(--fw-semibold);
}

.sidebar ul li:last-child a {
  border-bottom: none;
}

.sidebar ul li a i {
  width: 1.5rem;
  text-align: center;
  color: var(--brand-gold);
}

/* Current page */
.sidebar-options a.active,
.nav-options a.active {
  color: var(--brand-gold);
}

.sidebar-options a.active i {
  color: var(--brand-gold-dark);
}

@media (width < 1200px) {
  .nav-mobile-actions {
    display: flex;
  }
}

@media (max-width: 400px) {
  /* Very small screens: the logo shrinks before the controls do. */
  .logo img { width: 110px; }
}

/* Language remains directly available when navigation moves into the drawer. */
@media (width < 1200px) {
  .login-lang-container { margin-inline-start: auto; margin-inline-end: 12px; }
  .nav-mobile-actions { margin-left: 0; }
}
@media (max-width: 600px) {
  .navbar { padding-inline: 12px; }
  .login-lang-container { margin-inline-end: 8px; }
  .language-switcher__name { display: none; }
  .language-switcher__code { display: inline; }
  .language-switcher__trigger { gap: 7px; padding-inline: 9px; }
  .hamburger-menu { width: 44px; min-height: 44px; align-items: center; justify-content: center; }
}
@media (max-width: 400px) {
  .navbar .logo img { width: 90px; }
  .nav-mobile-actions { gap: 0; margin-right: 4px; }
  .nav-icon-link { width: 36px; height: 44px; }
  .navbar:has(.nav-mobile-actions) .language-switcher__trigger > .fi { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .language-switcher__chevron { transition: none; }
}
