/* ==========================================================================
   QUORIT GLOBAL HEADER & NAVIGATION STYLES (header-nav.css)
   Clean, stable, accessible navigation tokens & responsive layout
   ========================================================================== */

/* 1. Header Layout & Sticky State */
#site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

#site-header.header-scrolled {
  background-color: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px -2px rgba(37, 37, 37, 0.06);
  border-bottom: 1px solid #E8E1DC;
}

/* 2. Anchor Section Scroll Offset */
[id] {
  scroll-margin-top: 96px;
}

/* 3. Desktop Navigation Items */
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 2px;
  color: #667085;
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.15s ease;
}

@media (min-width: 1536px) {
  .nav-link {
    font-size: 14px;
    gap: 5px;
  }
}

.nav-link:hover,
.nav-item-dropdown:hover > .nav-link,
.nav-item-dropdown.is-open > .nav-link {
  color: #F78545;
}

.nav-link.active,
.nav-link[aria-current="page"] {
  color: #D3171D !important;
  font-weight: 700;
}

.nav-link.active::after,
.nav-link[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #D3171D;
  border-radius: 9999px;
}

/* 4. Desktop Dropdown Menu */
.nav-item-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
}

.nav-dropdown-arrow {
  font-size: 18px !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: -1px;
}

.nav-item-dropdown:hover .nav-dropdown-arrow,
.nav-item-dropdown.is-open .nav-dropdown-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  min-width: 290px;
  background-color: #FFFFFF;
  border: 1px solid #E8E1DC;
  border-radius: 12px;
  box-shadow: 0 16px 36px -4px rgba(37, 37, 37, 0.12), 0 4px 12px -2px rgba(37, 37, 37, 0.04);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
  pointer-events: none;
  z-index: 60;
}

.nav-item-dropdown:hover .nav-dropdown-menu,
.nav-item-dropdown:focus-within .nav-dropdown-menu,
.nav-item-dropdown.is-open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-item-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  color: #252525;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dropdown-item-link:hover {
  background-color: #FCFAF8;
  color: #D3171D;
}

.dropdown-item-link.active {
  background-color: #FBE4E5;
  color: #D3171D;
  font-weight: 600;
}

/* 5. Mobile Drawer & Backdrop */
#mobile-drawer {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-overflow-scrolling: touch;
}

#mobile-drawer.drawer-closed {
  transform: translateX(100%);
  pointer-events: none;
}

#mobile-drawer.drawer-open {
  transform: translateX(0);
  pointer-events: auto;
}

#drawer-backdrop {
  transition: opacity 0.25s ease;
}

.mobile-drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  color: #252525;
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.mobile-drawer-link:hover {
  background-color: #FCFAF8;
  color: #F78545;
}

.mobile-drawer-link.active,
.mobile-drawer-link[aria-current="page"] {
  color: #D3171D;
  font-weight: 700;
  background-color: #FBE4E5;
  border-left: 3px solid #D3171D;
}

.mobile-submenu {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.mobile-submenu.is-expanded {
  max-height: 400px;
  opacity: 1;
}

.mobile-submenu-toggle {
  transition: background-color 0.15s ease;
}

.mobile-submenu-toggle.is-expanded span {
  transform: rotate(180deg);
}

.mobile-submenu-toggle span {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-submenu-link {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: #667085;
  font-size: 14px;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.mobile-submenu-link:hover {
  color: #D3171D;
  background-color: #FCFAF8;
}

.mobile-submenu-link.active {
  color: #D3171D;
  font-weight: 600;
  background-color: #FBE4E5;
}
