/* ==========================================================================
   Header Component
   ========================================================================== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: #ffffff;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  transition: height var(--transition-base), box-shadow var(--transition-base);
}

.header.scrolled {
  height: var(--header-height-scrolled);
  box-shadow: var(--shadow-lg);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

@media (min-width: 768px) {
  .header-container {
    padding: 0 var(--space-md);
  }
}

/* Logo
   ========================================================================== */
.header-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header-logo img {
  height: 50px;
  width: auto;
  transition: height var(--transition-base);
}

.header.scrolled .header-logo img {
  height: 40px;
}

/* Navigation
   ========================================================================== */
.nav-main {
  display: none;
}

@media (min-width: 992px) {
  .nav-main {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
  }
}

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.nav-item {
  position: relative;
}

.nav-link {
  display: block;
  padding: var(--space-xs) var(--space-sm);
  color: var(--color-primary);
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link:focus {
  color: var(--color-secondary);
}

.nav-link.active {
  color: var(--color-secondary);
}

/* Dropdown Menu
   ========================================================================== */
.nav-dropdown {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.nav-dropdown-icon {
  width: 12px;
  height: 12px;
  fill: currentColor;
  transition: transform var(--transition-fast);
}

.nav-item:hover .nav-dropdown-icon {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition-fast);
  z-index: 100;
}

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

.dropdown-menu-list {
  padding: var(--space-xs) 0;
  max-height: 400px;
  overflow-y: auto;
}

.dropdown-menu-item a {
  display: block;
  padding: var(--space-xs) var(--space-md);
  color: var(--color-text);
  font-size: var(--fs-sm);
  transition: background-color var(--transition-fast);
}

.dropdown-menu-item a:hover {
  background-color: var(--color-background);
  color: var(--color-secondary);
}

/* Search Button
   ========================================================================== */
.header-search {
  display: flex;
  align-items: center;
}

.search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-primary);
  transition: color var(--transition-fast);
}

.search-btn:hover {
  color: var(--color-secondary);
}

.search-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Mobile Menu Button
   ========================================================================== */
.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-primary);
  padding: 0;
}

@media (min-width: 992px) {
  .mobile-menu-btn {
    display: none;
  }
}

.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Mobile Navigation
   ========================================================================== */
.nav-mobile {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-primary);
  transform: translateX(-100%);
  transition: transform var(--transition-base);
  overflow-y: auto;
  z-index: 999;
}

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

.header.scrolled + .nav-mobile,
.header.scrolled ~ .nav-mobile {
  top: var(--header-height-scrolled);
}

.nav-mobile-list {
  padding: var(--space-md);
}

.nav-mobile-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-mobile-link {
  display: block;
  padding: var(--space-sm) 0;
  color: white;
  font-family: var(--font-heading);
  font-size: var(--fs-md);
  font-weight: 600;
}

.nav-mobile-link:hover {
  color: var(--color-secondary);
}

/* Mobile Dropdown */
.nav-mobile-dropdown {
  padding-left: var(--space-md);
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base);
}

.nav-mobile-item.expanded .nav-mobile-dropdown {
  max-height: 500px;
}

.nav-mobile-dropdown a {
  display: block;
  padding: var(--space-xs) 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: var(--fs-sm);
}

.nav-mobile-dropdown a:hover {
  color: var(--color-secondary);
}

/* Search Overlay
   ========================================================================== */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(26, 26, 46, 0.95);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20vh;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  z-index: 1001;
}

.search-overlay.active {
  opacity: 1;
  visibility: visible;
}

.search-overlay-content {
  width: 90%;
  max-width: 600px;
}

.search-overlay-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 48px;
  height: 48px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: white;
}

.search-overlay-close svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.search-input-wrapper {
  position: relative;
}

.search-input {
  width: 100%;
  padding: var(--space-md);
  font-size: var(--fs-lg);
  font-family: var(--font-body);
  background-color: transparent;
  border: none;
  border-bottom: 2px solid white;
  color: white;
  outline: none;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}
