/* ==========================================================================
   Header and Navigation Layout Styling (Floating Capsule Design)
   ========================================================================== */

.site-header {
  position: fixed;
  top: 16px; /* Space from top to float */
  left: 50%;
  transform: translateX(-50%);
  width: 92%; /* Takes up 92% of layout width */
  max-width: 1200px;
  height: 64px;
  background: linear-gradient(135deg, rgba(15, 81, 50, 0.94) 0%, rgba(25, 135, 84, 0.94) 100%); /* Leaf green to fresh green gradient */
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 99px; /* Pill capsule corners */
  box-shadow: 0 10px 30px rgba(15, 27, 18, 0.08); /* Soft drop shadow */
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: var(--transition-smooth);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Scroll Active State (applied by JS) */
.site-header.scrolled {
  background: linear-gradient(135deg, rgba(15, 81, 50, 0.98) 0%, rgba(25, 135, 84, 0.98) 100%);
  box-shadow: 0 12px 35px rgba(15, 27, 18, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.header-container {
  width: 100%;
  padding: 0 var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-xl);
}

/* Brand Logo (Primary Teal) */
.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  color: white; /* White brand logo */
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

.header-brand:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
}

.brand-logo-icon {
  width: 24px;
  height: 24px;
  color: white; /* White logo icon */
  transition: var(--transition-smooth);
}

.header-brand:hover .brand-logo-icon {
  transform: rotate(30deg);
}

/* Desktop Navigation Menu (Dark Neutral text) */
.desktop-navigation {
  display: flex;
  justify-content: center;
  flex-grow: 1;
}

.nav-menu {
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav-link {
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85); /* High contrast white text links */
  position: relative;
  padding: var(--space-xs) 0;
  transition: var(--transition-smooth);
}

.nav-link:hover {
  color: white;
}

.nav-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
}

/* Underline slide interaction */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2.5px;
  background-color: var(--color-accent); /* Accent Orange hover underlines */
  border-radius: var(--radius-full);
  transition: var(--transition-smooth);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link.active {
  color: white;
}

.nav-link.active::after {
  width: 100%;
}

.login-nav-btn {
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 700;
  color: white;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.12); /* Subtle glass pill fill */
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: var(--transition-smooth);
}

.login-nav-btn:hover {
  background-color: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

/* Header Actions Block */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

/* Search bar */
.header-search-bar {
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.15); /* Translucent white box overlay */
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 99px; /* Pill search bar */
  padding: 0 var(--space-md);
  height: 38px;
  width: 220px;
  transition: var(--transition-smooth);
}

.header-search-bar:focus-within {
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
  background-color: rgba(255, 255, 255, 0.2);
}

.header-search-bar input {
  border: none;
  background: transparent;
  width: 100%;
  height: 100%;
  padding-left: var(--space-xs);
  font-size: 13px;
  font-family: var(--font-body);
  color: white;
}

.header-search-bar input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.header-search-bar input:focus {
  outline: none;
}

.header-search-bar button {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  transition: var(--transition-smooth);
  width: 20px;
  height: 20px;
}

.header-search-bar button:hover {
  color: white;
}

.header-search-bar button svg {
  width: 16px;
  height: 16px;
}

/* CTA Primary Header Capsule Button */
.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 var(--space-xl);
  background-color: var(--color-accent); /* Eco golden yellow */
  color: #ffffff; /* white text for contrast on green */
  border-radius: 99px; /* Capsule shape book button */
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: var(--transition-smooth);
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(0, 168, 107, 0.25);
}

.cta-button:hover {
  background-color: var(--color-accent-dark);
  color: #ffffff;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 168, 107, 0.4);
}

.cta-button:active {
  transform: translateY(0);
}

.cta-button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
}

/* Hamburger button toggle */
.hamburger-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 22px;
  height: 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1100;
}

.hamburger-bar {
  width: 100%;
  height: 2px;
  background-color: white; /* White hamburger toggle lines */
  border-radius: var(--radius-full);
  transition: var(--transition-smooth);
}

/* hamburger to X morphing animation */
.hamburger-toggle[aria-expanded="true"] .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger-toggle[aria-expanded="true"] .hamburger-bar:nth-child(2) {
  opacity: 0;
}

.hamburger-toggle[aria-expanded="true"] .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   Mobile Drawer Styling
   ========================================================================== */

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 320px;
  height: 100vh;
  background-color: white;
  box-shadow: var(--shadow-lg);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  height: 72px;
  padding: 0 var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
}

.drawer-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-title);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xs);
  transition: var(--transition-smooth);
}

.drawer-close:hover {
  color: var(--color-primary);
}

.drawer-close svg {
  width: 24px;
  height: 24px;
}

.drawer-content {
  flex-grow: 1;
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  overflow-y: auto;
}

/* Mobile search */
.drawer-search-bar {
  display: flex;
  align-items: center;
  background-color: var(--color-bg-main);
  border: 1px solid var(--color-border);
  border-radius: 99px;
  padding: 0 var(--space-md);
  height: 44px;
  width: 100%;
  transition: var(--transition-smooth);
}

.drawer-search-bar:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.drawer-search-bar input {
  border: none;
  background: transparent;
  width: 100%;
  height: 100%;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--color-text-title);
}

.drawer-search-bar input:focus {
  outline: none;
}

.drawer-search-bar button {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
}

.drawer-search-bar button svg {
  width: 18px;
  height: 18px;
}

/* Mobile Links list */
.drawer-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.drawer-link {
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-title);
  display: block;
  padding: var(--space-xs) 0;
  transition: var(--transition-smooth);
}

.drawer-link:hover {
  color: var(--color-primary);
  padding-left: var(--space-xs);
}

.drawer-link.active {
  color: var(--color-primary);
}

.drawer-cta {
  margin-top: auto;
  height: 44px;
}

.drawer-cta .cta-button {
  width: 100%;
  height: 100%;
}

/* Drawer Backdrop Overlay */
.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.4);
  z-index: 1020;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.drawer-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   Responsive Media Queries
   ========================================================================== */

@media (max-width: 1024px) {
  .site-header {
    width: 94%;
    top: 12px;
  }
  
  .desktop-navigation,
  .header-search-bar,
  .site-header .cta-button {
    display: none;
  }

  .hamburger-toggle {
    display: flex;
  }
  
  .header-container {
    padding: 0 var(--space-lg);
  }
}
