/* Site-Wide Premium Navigation Bar Stylesheet */

:root {
  --nav-bg: #faf7f2;
  --nav-text: #1a1a1a;
  --nav-text-hover: #c5a880;
  --nav-gold: #c5a880;
  --nav-gold-hover: #b3946b;
  --nav-border: rgba(0, 0, 0, 0.1);
  --nav-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  --nav-font: 'Montserrat', sans-serif;
  --nav-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Fix anchor scrolling offset for fixed navbar */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 130px; /* Desktop navbar (106px) + extra gap */
}

/* Header Container */
.site-header {
  width: 100%;
  background-color: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  position: relative;
  z-index: 9000;
  box-shadow: var(--nav-shadow);
  transition: var(--nav-transition);
}

/* Sticky behavior class */
.site-header.is-sticky {
  position: fixed;
  top: 0;
  left: 0;
  background-color: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  box-shadow: var(--nav-shadow);
  animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

.header-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 60px;
  height: 106px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

/* Logo Area */
.logo-area {
  display: flex;
  align-items: center;
  height: 100%;
}

.logo-area a {
  display: flex;
  align-items: center;
}

.nav-logo {
  max-height: 90px;
  width: auto;
  object-fit: contain;
  transition: var(--nav-transition);
}

.nav-logo:hover {
  transform: scale(1.03);
}

/* Main Navigation */
.main-nav {
  display: flex;
  align-items: center;
  height: 100%;
}

/* Hide mobile-only elements on desktop */
.sidebar-header,
.nav-backdrop {
  display: none;
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
  align-items: center;
}

.nav-item {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

/* Navigation Links & Toggle Buttons */
.nav-link {
  color: var(--nav-text);
  text-decoration: none;
  font-family: var(--nav-font);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0 10px;
  height: 100%;
  display: flex;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  outline: none;
  white-space: nowrap;
  transition: var(--nav-transition);
}

/* Extra large screens (1920px and above) */
@media (min-width: 1920px) {
  .nav-link {
    font-size: 0.9rem;
    letter-spacing: 1.2px;
  }
}

/* Laptop breakpoint - tighten spacing so all items fit */
@media (max-width: 1400px) {
  .header-container {
    padding: 0 30px;
  }
  .nav-link {
    font-size: 0.7rem;
    letter-spacing: 0.8px;
    padding: 0 8px;
  }
  .nav-logo {
    max-height: 75px;
  }
}

.nav-link i {
  margin-left: 6px;
  font-size: 0.75rem;
  transition: transform 0.3s ease;
}

.nav-link:hover,
.nav-link:focus,
.nav-item.active > .nav-link {
  color: var(--nav-gold);
}

.dropdown.open > .nav-link i {
  transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--nav-bg);
  border: 1px solid var(--nav-border);
  border-top: none;
  list-style: none;
  margin: 0;
  padding: 10px 0;
  min-width: 250px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  z-index: 100;
}

.dropdown.open > .dropdown-menu {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}

.dropdown-item {
  color: var(--nav-text);
  text-decoration: none;
  font-family: var(--nav-font);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: var(--nav-transition);
}

.dropdown-item i {
  font-size: 0.7rem;
  transition: transform 0.3s ease;
}

.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-submenu.open > .dropdown-item {
  color: var(--nav-gold);
  background-color: rgba(0, 0, 0, 0.03);
}

.dropdown-submenu.open > .dropdown-item i {
  transform: rotate(90deg);
}

/* Submenu */
.dropdown-submenu {
  position: relative;
}

.submenu-menu {
  position: absolute;
  top: 0;
  left: 100%;
  background-color: var(--nav-bg);
  border: 1px solid var(--nav-border);
  list-style: none;
  margin: 0;
  padding: 10px 0;
  min-width: 230px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  z-index: 110;
}

.dropdown-submenu.open > .submenu-menu {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
  transform: translateX(0);
}

.submenu-item {
  color: var(--nav-text);
  text-decoration: none;
  font-family: var(--nav-font);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 10px 20px;
  display: block;
  transition: var(--nav-transition);
}

.nested-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
}

.nested-toggle i {
  font-size: 0.65rem;
  transition: transform 0.3s ease;
}

.dropdown-submenu.open > .nested-toggle i {
  transform: rotate(90deg);
}

.submenu-item:hover,
.submenu-item:focus {
  color: var(--nav-gold);
  background-color: rgba(0, 0, 0, 0.03);
  padding-left: 24px;
}

/* Mobile Toggle */
.menu-toggle {
  display: none;
  font-size: 1.5rem;
  color: var(--nav-text);
  cursor: pointer;
  transition: var(--nav-transition);
}

.menu-toggle:hover {
  color: var(--nav-gold);
}

/* ==============================
   MOBILE & TABLET RESPONSIVE
   ============================== */
@media (max-width: 1024px) {

  html {
    scroll-padding-top: 105px; /* Mobile navbar (85px) + extra gap */
  }

  .menu-toggle {
    display: block;
  }

  .header-container {
    padding: 0 16px;
    height: 85px;
  }

  .nav-logo {
    max-height: 70px;
  }

  /* Sidebar: slides from right side */
  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    height: 100dvh;
    background-color: #faf7f2;
    border-left: 1px solid rgba(0, 0, 0, 0.08);
    overflow-y: auto;
    overflow-x: hidden;
    transition: right 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
    z-index: 9001;
    padding-top: 0;
    display: block;
  }

  .main-nav.active {
    right: 0;
  }

  /* Sidebar header: logo left, close button right */
  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background-color: #faf7f2;
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .sidebar-logo {
    max-height: 80px;
    width: auto;
    object-fit: contain;
  }

  .sidebar-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #1a1a1a;
    font-size: 1.3rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
  }

  .sidebar-close:hover {
    color: #c5a880;
    background-color: rgba(197, 168, 128, 0.12);
  }

  /* Backdrop: dims page behind sidebar */
  .nav-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: transparent;
    z-index: 8999;
  }

  .nav-backdrop.active {
    display: block;
  }

  /* Nav list: vertical in sidebar */
  .nav-list {
    flex-direction: column;
    width: 100%;
    height: auto;
    align-items: stretch;
    padding: 0;
  }

  .nav-item {
    flex-direction: column;
    align-items: stretch;
    height: auto;
  }

  /* Nav link: MUST override white-space: nowrap from desktop */
  .nav-link {
    white-space: normal !important;
    font-size: 0.82rem;
    letter-spacing: 0.8px;
    padding: 15px 20px;
    height: auto;
    width: 100%;
    justify-content: space-between;
    color: #1a1a1a;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }

  .nav-link:hover {
    color: #c5a880;
    background-color: rgba(197, 168, 128, 0.05);
  }

  /* Dropdown: stacks vertically in sidebar */
  .dropdown-menu {
    position: static;
    border: none;
    box-shadow: none;
    background-color: rgba(0, 0, 0, 0.02);
    padding: 0;
    min-width: 0;
    transform: none;
    transition: none;
    display: none;
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
  }

  .dropdown.open > .dropdown-menu {
    display: block;
  }

  .dropdown-item {
    padding: 12px 32px;
    font-size: 0.76rem;
    color: #1a1a1a;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    white-space: normal;
  }

  .dropdown-item:hover,
  .dropdown-item:focus {
    color: #c5a880;
    background-color: rgba(197, 168, 128, 0.06);
  }

  /* Submenu: stacks inside dropdown */
  .submenu-menu {
    position: static;
    border: none;
    box-shadow: none;
    background-color: rgba(0, 0, 0, 0.03);
    padding: 0;
    min-width: 0;
    transform: none;
    transition: none;
    display: none;
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
  }

  .dropdown-submenu.open > .submenu-menu {
    display: block;
  }

  .submenu-item {
    padding: 10px 46px;
    font-size: 0.72rem;
    color: #1a1a1a;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    white-space: normal;
  }

  .submenu-item:hover,
  .submenu-item:focus {
    color: #c5a880;
    background-color: rgba(197, 168, 128, 0.06);
    padding-left: 52px;
  }
}
