/* ==========================================================================
   AVCO Design System - Header, Mega Menu, Mobile Menu
   Based on header.html reference design.
   ========================================================================== */

/* ===== STICKY WRAPPER ===== */
body.avco-page .avco-header-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

/* ===== MAIN HEADER ===== */
body.avco-page .avco-header {
  background: var(--avco-white);
  border-bottom: var(--avco-border-light);
  height: var(--avco-header-height);
  padding: 0 var(--avco-space-15);
  display: flex;
  align-items: center;
  transition: box-shadow var(--avco-transition-base);
  position: relative;
}

body.avco-page .avco-header.avco-scrolled {
  box-shadow: 0 1rem 1.5rem rgba(30, 30, 30, 0.08);
}

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

body.avco-page .avco-header .avco-header__left {
  display: flex;
  align-items: center;
  gap: var(--avco-space-12);
}

/* Logo */
body.avco-page .avco-header a.avco-logo,
body.avco-page .avco-header a.avco-logo:hover {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  height: 3.375rem;
  width: 7.375rem;
}

body.avco-page .avco-header .avco-logo img {
  height: 100%;
  width: 100%;
  object-fit: contain;
}

/* ===== DESKTOP NAV ===== */
body.avco-page .avco-nav-desktop {
  display: flex;
  align-items: center;
  gap: var(--avco-space-6);
}

body.avco-page .avco-nav-item {
  display: flex;
  align-items: center;
  gap: var(--avco-space-1);
  font-size: var(--avco-text-base);
  font-weight: 500;
  color: var(--avco-primary-950);
  cursor: pointer;
  line-height: 1.5;
  padding: var(--avco-space-2) 0;
  position: relative;
  text-decoration: none;
  transition: color var(--avco-transition-fast);
  white-space: nowrap;
  background: none;
  border: none;
  font-family: var(--avco-font-body);
}

body.avco-page .avco-nav-item:hover,
body.avco-page .avco-nav-item.avco-active {
  color: var(--avco-primary-800);
}

body.avco-page .avco-nav-item__arrow {
  display: flex;
  align-items: center;
  padding-top: 0.125rem;
  transition: transform var(--avco-transition-base);
}

body.avco-page .avco-nav-item__arrow svg {
  width: var(--avco-space-4);
  height: var(--avco-space-4);
}

body.avco-page .avco-nav-item.avco-active .avco-nav-item__arrow {
  transform: rotate(180deg);
}

/* ===== SCROLLED STATE: contact info replaces nav ===== */
body.avco-page .avco-header__contact {
  display: none;
  align-items: center;
  gap: var(--avco-space-12);
}

body.avco-page .avco-header.avco-scrolled .avco-header__contact {
  display: flex;
}

body.avco-page .avco-header.avco-scrolled .avco-nav-desktop {
  display: none;
}

body.avco-page .avco-header__contact-item {
  display: flex;
  gap: var(--avco-space-2);
  align-items: center;
  font-size: var(--avco-text-xs);
  font-weight: 500;
  color: var(--avco-gray-600);
  line-height: 1.5;
  white-space: nowrap;
}

body.avco-page .avco-header__contact-item svg {
  width: var(--avco-space-6);
  height: var(--avco-space-6);
  flex-shrink: 0;
  color: var(--avco-primary-800);
  fill: var(--avco-primary-800);
}

body.avco-page .avco-header__contact-item a {
  color: var(--avco-gray-600);
  transition: color var(--avco-transition-fast);
}

body.avco-page .avco-header__contact-item a:hover {
  color: var(--avco-primary-800);
}

/* ===== HEADER RIGHT ===== */
body.avco-page .avco-header .avco-header__right {
  display: flex;
  align-items: center;
  gap: 1.375rem;
  height: 100%;
}

body.avco-page .avco-header .avco-header__divider {
  width: 0.0625rem;
  height: 100%;
  background: var(--avco-primary-100);
}

body.avco-page .avco-header .avco-header-cta {
  height: 100%;
  min-width: auto;
}

/* Search button */
body.avco-page .avco-header__search {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: none;
  box-shadow: none;
  text-shadow: none;
}

body.avco-page .avco-header__search svg {
  width: var(--avco-space-6);
  height: var(--avco-space-6);
  color: var(--avco-primary-950);
  transition: color var(--avco-transition-fast);
}

body.avco-page .avco-header__search:hover svg {
  color: var(--avco-primary-800);
}

/* Hamburger (scrolled desktop) */
body.avco-page .avco-header__hamburger {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  display: none;
  align-items: center;
  justify-content: center;
  width: var(--avco-space-6);
  height: var(--avco-space-6);
  background-image: none;
  box-shadow: none;
  text-shadow: none;
}

body.avco-page .avco-header.avco-scrolled .avco-header__hamburger {
  display: flex;
}

body.avco-page .avco-header.avco-scrolled .avco-header__search {
  display: none;
}

body.avco-page .avco-header__hamburger svg {
  width: var(--avco-space-6);
  height: var(--avco-space-6);
  color: var(--avco-primary-950);
  transition: color var(--avco-transition-fast);
}

body.avco-page .avco-header__hamburger:hover svg {
  color: var(--avco-primary-800);
}

/* Mobile menu button (hidden on desktop) */
body.avco-page .avco-mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--avco-space-1);
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  background-image: none;
  box-shadow: none;
  text-shadow: none;
}

body.avco-page .avco-mobile-menu-btn svg {
  width: var(--avco-space-6);
  height: var(--avco-space-6);
  color: var(--avco-primary-950);
}

/* ===== MEGA MENU ===== */
body.avco-page .avco-mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--avco-white);
  display: flex;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  opacity: 0;
  z-index: 999;
}

body.avco-page .avco-mega-menu.avco-open {
  max-height: 35.25rem;
  opacity: 1;
}

body.avco-page .avco-mega-menu__inner {
  display: flex;
  width: 100%;
  max-width: var(--avco-container-max);
  margin: 0 auto;
}

body.avco-page .avco-mega-menu__left {
  flex: 1;
  border-right: 0.0625rem solid var(--avco-primary-100);
  padding: var(--avco-space-12) var(--avco-space-15) var(--avco-space-12) 0;
  display: flex;
  gap: var(--avco-space-12);
}

body.avco-page .avco-mega-menu__column {
  display: flex;
  flex-direction: column;
  gap: var(--avco-space-5);
}

body.avco-page .avco-mega-menu__heading {
  font-size: var(--avco-text-base);
  font-weight: 600;
  color: var(--avco-primary-800);
  line-height: 1.5;
}

body.avco-page .avco-mega-menu__heading--hidden {
  opacity: 0;
}

body.avco-page .avco-mega-menu__list {
  display: flex;
  flex-direction: column;
  gap: var(--avco-space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}

body.avco-page .avco-mega-menu__list a {
  font-size: var(--avco-text-sm);
  font-weight: 400;
  color: var(--avco-gray-600);
  line-height: 1.5;
  transition: color var(--avco-transition-fast);
}

body.avco-page .avco-mega-menu__list a:hover {
  color: var(--avco-primary-800);
}

body.avco-page .avco-mega-menu__right {
  flex: 1;
  position: relative;
  padding: var(--avco-space-12) 0 var(--avco-space-12) var(--avco-space-15);
  display: flex;
  flex-direction: column;
  gap: var(--avco-space-6);
}

body.avco-page .avco-mega-menu__right::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100%;
  background: var(--avco-primary-50);
  z-index: -1;
}

body.avco-page .avco-mega-menu__about-title {
  font-size: var(--avco-text-base);
  font-weight: 600;
  color: var(--avco-primary-950);
  line-height: 1.5;
}

body.avco-page .avco-mega-menu__about-text {
  font-size: var(--avco-text-sm);
  font-weight: 400;
  color: var(--avco-gray-600);
  line-height: 1.5;
  margin-top: var(--avco-space-4);
}

body.avco-page .avco-mega-menu__image {
  flex: 1;
  background: var(--avco-primary-200);
  overflow: hidden;
  min-height: 12.5rem;
  position: relative;
}

body.avco-page .avco-mega-menu__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

/* ===== MENU OVERLAY ===== */
body.avco-page .avco-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(18, 18, 18, 0.7);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--avco-transition-base);
}

body.avco-page .avco-menu-overlay.avco-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ===== MOBILE MENU ===== */
body.avco-page .avco-mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--avco-white);
  z-index: 999;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

body.avco-page .avco-mobile-menu.avco-open {
  max-height: 100vh;
  overflow-y: auto;
}

body.avco-page .avco-mobile-menu__inner {
  padding: var(--avco-space-6) var(--avco-space-6) var(--avco-space-8);
  display: flex;
  flex-direction: column;
  gap: var(--avco-space-2);
}

body.avco-page .avco-mobile-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--avco-space-3) 0;
  font-size: var(--avco-text-base);
  font-weight: 600;
  color: var(--avco-primary-950);
  text-decoration: none;
  border-bottom: 0.0625rem solid var(--avco-primary-100);
  cursor: pointer;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  width: 100%;
  font-family: var(--avco-font-body);
  text-align: left;
}

body.avco-page .avco-mobile-nav-item:hover {
  color: var(--avco-primary-800);
}

body.avco-page .avco-mobile-nav-item.avco-active .avco-nav-item__arrow {
  transform: rotate(180deg);
}

body.avco-page .avco-mobile-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding-left: var(--avco-space-4);
}

body.avco-page .avco-mobile-submenu.avco-open {
  max-height: 31.25rem;
}

body.avco-page .avco-mobile-submenu a {
  display: block;
  padding: var(--avco-space-2) 0;
  font-size: var(--avco-text-sm);
  font-weight: 400;
  color: var(--avco-gray-600);
  line-height: 1.5;
  transition: color var(--avco-transition-fast);
}

body.avco-page .avco-mobile-submenu a:hover {
  color: var(--avco-primary-800);
}

body.avco-page .avco-mobile-menu__cta {
  margin-top: var(--avco-space-4);
  background: var(--avco-primary-800);
  color: var(--avco-white);
  font-family: var(--avco-font-body);
  font-size: var(--avco-text-base);
  font-weight: 600;
  line-height: 1.5;
  padding: 0.875rem var(--avco-space-6);
  text-align: center;
  text-decoration: none;
  display: block;
  width: 100%;
  transition: background var(--avco-transition-fast);
}

body.avco-page .avco-mobile-menu__cta:hover {
  background: var(--avco-primary-950);
}

body.avco-page .avco-mobile-menu__contact {
  margin-top: var(--avco-space-4);
  display: flex;
  flex-direction: column;
  gap: var(--avco-space-3);
}

body.avco-page .avco-mobile-menu__contact-item {
  display: flex;
  gap: var(--avco-space-2);
  align-items: center;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--avco-gray-600);
}

body.avco-page .avco-mobile-menu__contact-item svg {
  width: var(--avco-space-5);
  height: var(--avco-space-5);
  flex-shrink: 0;
  fill: var(--avco-primary-800);
}

body.avco-page .avco-mobile-menu__contact-item a {
  color: var(--avco-gray-600);
}

/* ===== SEARCH OVERLAY ===== */
body.avco-page .avco-search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 6rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--avco-transition-base), visibility var(--avco-transition-base);
}

body.avco-page .avco-search-overlay.open {
  opacity: 1;
  visibility: visible;
}

body.avco-page .avco-search-overlay-inner {
  background: var(--avco-white);
  width: 100%;
  max-width: 42rem;
  padding: var(--avco-space-6);
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.2);
  transform: translateY(-1rem);
  transition: transform var(--avco-transition-base);
}

body.avco-page .avco-search-overlay.open .avco-search-overlay-inner {
  transform: translateY(0);
}

body.avco-page .avco-search-form {
  display: flex;
  align-items: center;
  gap: var(--avco-space-3);
  border-bottom: 0.125rem solid var(--avco-primary-800);
  padding-bottom: var(--avco-space-3);
}

body.avco-page .avco-search-form-icon {
  width: var(--avco-space-6);
  height: var(--avco-space-6);
  flex-shrink: 0;
  color: var(--avco-primary-800);
}

body.avco-page .avco-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: var(--avco-text-lg);
  font-family: var(--avco-font-body);
  font-weight: 400;
  color: var(--avco-primary-950);
  background: transparent;
  padding: 0;
  line-height: 1.5;
}

body.avco-page .avco-search-input::placeholder {
  color: var(--avco-gray-400);
}

body.avco-page .avco-search-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--avco-space-1);
  color: var(--avco-gray-600);
  transition: color var(--avco-transition-fast);
  background-image: none;
  box-shadow: none;
  text-shadow: none;
}

body.avco-page .avco-search-close:hover {
  color: var(--avco-primary-950);
}

body.avco-page .avco-search-close svg {
  width: var(--avco-space-6);
  height: var(--avco-space-6);
}

/* ── Search Results Suggestions ── */
body.avco-page .avco-search-results { max-height: 25rem; overflow-y: auto; }
body.avco-page .avco-search-results:empty { display: none; }
body.avco-page .avco-search-results-hint { padding: var(--avco-space-3) 0; font-size: var(--avco-text-xs); color: var(--avco-gray-400); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
body.avco-page .avco-search-result-item { display: flex; align-items: center; gap: var(--avco-space-3); padding: var(--avco-space-3); color: var(--avco-primary-950); transition: background var(--avco-transition-fast); border-bottom: 0.0625rem solid var(--avco-primary-50); }
body.avco-page .avco-search-result-item:last-child { border-bottom: none; }
body.avco-page .avco-search-result-item:hover, body.avco-page .avco-search-result-item.active { background: var(--avco-primary-50); }
body.avco-page .avco-search-result-img { width: 3rem; height: 3rem; background: var(--avco-primary-50); flex-shrink: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
body.avco-page .avco-search-result-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
body.avco-page .avco-search-result-text { flex: 1; min-width: 0; }
body.avco-page .avco-search-result-name { font-size: var(--avco-text-sm); font-weight: 600; line-height: 1.4; color: var(--avco-primary-950); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.avco-page .avco-search-result-cat { font-size: var(--avco-text-xs); color: var(--avco-gray-500); line-height: 1.4; }
body.avco-page .avco-search-result-arrow { width: var(--avco-space-4); height: var(--avco-space-4); flex-shrink: 0; color: var(--avco-gray-400); }
body.avco-page .avco-search-loading { padding: var(--avco-space-4); text-align: center; color: var(--avco-gray-500); font-size: var(--avco-text-sm); }
body.avco-page .avco-search-no-results { padding: var(--avco-space-4); text-align: center; color: var(--avco-gray-500); font-size: var(--avco-text-sm); }
body.avco-page .avco-search-view-all { display: block; padding: var(--avco-space-3); text-align: center; font-size: var(--avco-text-sm); font-weight: 600; color: var(--avco-primary-800); transition: background var(--avco-transition-fast); border-top: 0.0625rem solid var(--avco-primary-100); }
body.avco-page .avco-search-view-all:hover { background: var(--avco-primary-50); }
