/* ============================================================
   Navigation - Mobile & Desktop Styles
   ============================================================ */

/* Mobile overlay */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.nav-mobile-open .nav-overlay {
  display: block;
  opacity: 1;
}

/* Hamburger open state */
.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: translateX(-8px);
}
.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================================
   DESKTOP — > 1024px: everything inline
   ============================================================ */
@media (min-width: 1025px) {
  .hamburger { display: none; }
}

/* ============================================================
   TABLET — 768px – 1024px
   ============================================================ */
@media (max-width: 1024px) {
  .nav-menu li a {
    padding: 18px 7px;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
  }
  .lang-toggle { margin-left: 8px; }
  .lang-btn { padding: 4px 8px; font-size: 0.65rem; }
}

/* ============================================================
   MOBILE — < 768px
   ============================================================ */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
    order: -1;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: white;
    flex-direction: column;
    padding: 72px 0 24px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 999;
    justify-content: flex-start;
    gap: 0;
  }

  .nav-mobile-open .nav-menu {
    transform: translateX(0);
  }

  .nav-menu li {
    border-bottom: 1px solid rgba(44, 24, 16, 0.06);
  }

  .nav-menu li a {
    padding: 16px 24px;
    font-size: 0.8rem;
    display: block;
    white-space: normal;
    border-bottom: none !important;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
  }

  .nav-menu li a:hover,
  .nav-menu li a.active {
    border-left-color: #D4AF37;
    background: #FAF7F2;
    padding-left: 28px;
  }

  /* Mobile dropdown toggle button.
     Anchored to the parent link row (top), NOT the li centre — when the
     submenu expands, a centred arrow floats over the sub-links and steals
     their taps. */
  .nav-toggle-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 50px;
    background: none;
    border: none;
    cursor: pointer;
    color: #D4AF37;
    font-size: 0.9rem;
    transition: transform 0.22s;
    position: absolute;
    right: 8px;
    top: 0;
    transform: none;
  }
  .nav-toggle-btn.rotated { transform: rotate(180deg); }

  /* The link's own inline arrow duplicates the toggle button on mobile */
  .nav-menu li a .nav-arrow { display: none; }

  .nav-menu li { position: relative; }

  .nav-dropdown-mobile {
    display: none;
    flex-direction: column;
    background: #FAF7F2;
    border-left: 3px solid #D4AF37;
    width: 100%;
  }
  .nav-dropdown-mobile.open { display: flex; }
  .nav-dropdown-mobile a {
    padding: 12px 36px !important;
    font-size: 0.75rem !important;
    border-bottom: 1px solid rgba(44,24,16,0.05) !important;
    border-left: none !important;
    color: #1a1a2e !important;
  }
  .nav-dropdown-mobile a:hover {
    padding-left: 44px !important;
    color: #D4AF37 !important;
  }

  /* Hide desktop dropdowns on mobile */
  .nav-dropdown { display: none !important; }

  .lang-toggle {
    margin-left: auto;
  }

  .nav-inner {
    padding: 0 12px;
  }
}
