/* ========================================
   HEADER - BASE LAYOUT
======================================== */
.header {
  top: 0;
  z-index: 1000;
  width: 100%;
}

.header__container {
  width: 100%;
}

.header__wrapper {
  padding: 0 1rem;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  width: 100%;
}

/* ========================================
   LOGO
======================================== */
.header__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header__logo-inner {
  display: flex;
  align-items: center;
}

.header__logo-link {
  display: flex;
  align-items: center;
}

.header__logo svg {
  width: 120px;
  height: auto;
}

/* ========================================
   CONTROLS (RIGHT SIDE ICONS)
======================================== */
.header__controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.header__controls-item {
  display: flex;
  align-items: center;
}

.header__controls-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem;
  text-decoration: none;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
}

.header__toggler {
  font-size: 0.875rem;
  white-space: nowrap;
}

/* ========================================
   DESKTOP NAVIGATION
======================================== */

/* ========================================
   MOBILE NAVIGATION
======================================== */
.mobile-navigation {
  position: fixed;
  top: 0;
  left: -100%;
  width: 85%;
  max-width: 380px;
  height: 100vh;
  overflow-y: auto;
  z-index: 9999;
  transition: left 0.3s ease;
  display: flex;
  flex-direction: column;
}

.mobile-navigation.is-open {
  left: 0;
}

.mobile-navigation--header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  flex-shrink: 0;
}

.mobile-navigation--header .logo {
  flex: 1;
}

.mobile-navigation--header .close-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
}

/* Mobile nav menu items */
.mobile-navigation-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}

.mobile-navigation-menu-li {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.mobile-navigation-menu-li .main-navigation-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  width: 100%;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
}

.mobile-navigation-menu-li .main-navigation-primary svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

/* Mobile category panels */
.mobile-navigation-cat {
  display: none;
  position: fixed;
  top: 0;
  left: -100%;
  width: 85%;
  max-width: 380px;
  height: 100vh;
  overflow-y: auto;
  z-index: 10000;
  transition: left 0.3s ease;
}

.mobile-navigation-cat.is-open {
  left: 0;
}

.mobile-navigation-cat-ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.back-navigation {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  gap: 0.5rem;
}

.section-two-back-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  padding: 0.5rem 0;
  cursor: pointer;
  font-size: 0.95rem;
  min-height: 44px;
}

.section-two-back-button span {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.mobile-navigation-cat-li {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.mobile-navigation-cat-a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  width: 100%;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
}

.mobile-navigation-cat-li-chev {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Level 3 - sub categories */
.mobile-navigation-cat-cat {
  display: none;
  padding: 0 0 0.5rem 0;
}

.mobile-navigation-cat-cat.is-open {
  display: block;
}

.mobile-navigation-cat-cat-ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-navigation-cat-cat-li {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.mobile-navigation-cat-cat-link {
  display: block;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  text-decoration: none;
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* Mobile footer links */
.mobile-navigation-footer {
  flex-shrink: 0;
  padding: 1rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.mobile-navigation-footer ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: space-around;
}

.mobile-navigation-footer li {
  flex: 1;
}

.mobile-navigation-footer a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 0.5rem;
  font-size: 0.75rem;
  text-decoration: none;
  min-height: 44px;
  justify-content: center;
}

.mobile-navigation-footer svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* Mobile territory selector */
.mobile-navigation-territory-selector {
  flex-shrink: 0;
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* ========================================
   TERRITORY SELECTOR
======================================== */
.territory-selector-dropdown {
  position: relative;
}

.territory-selector-dropdown-toggle {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  min-height: 44px;
  min-width: 44px;
}

.territory-selector-dropdown-toggle .inner-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.territory-selector-dropdown-toggle .inner-col-text {
  font-size: 0.875rem;
  white-space: nowrap;
}

.territory-selector-dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 200px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 9999;
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  border-radius: 8px;
  display: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.territory-selector-dropdown-menu.top {
  top: auto;
  bottom: 100%;
}

.territory-selector-dropdown.is-open .territory-selector-dropdown-menu {
  display: block;
}

.territory-selector-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  text-decoration: none;
  min-height: 44px;
}

.territory-selector-dropdown-item svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
}

.territory-selector-dropdown-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: none;
}

.territory-selector-dropdown.is-open .territory-selector-dropdown-menu-overlay {
  display: block;
}

/* ========================================
   SEARCH PANEL
======================================== */
.navigation-search {
  display: none;
  width: 100%;
  padding: 1rem;
}

.navigation-search.is-open {
  display: block;
}

.search-bar__wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.search-bar__input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  outline: none;
}

.search-bar__btn-container {
  flex-shrink: 0;
}

.search__button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.search__items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
======================================== */

/* Large screens - show desktop nav, hide mobile */
@media (min-width: 992px) {
  .mobile-navigation,
  .mobile-menu-button {
    display: none !important;
  }

  .desktop-navigation {
    display: block;
  }

  .header__logo svg {
    width: 159px;
  }

  .header__inner {
    height: 72px;
  }

  .territory-selector .inner-col-text {
    display: inline;
  }
}

/* Tablet & below - hide desktop nav, show mobile button */
@media (max-width: 991px) {
  .desktop-navigation {
    display: none;
  }

  .mobile-menu-button {
    display: flex !important;
  }

  .header__logo svg {
    width: 130px;
  }

  .header__inner {
    height: 60px;
  }

  /* Hide text labels on controls, show only icons */
  .header__toggler.d-md-inline-block,
  .header__toggler.navigation__top-font {
    display: none !important;
  }

  .header__controls {
    gap: 0.25rem;
  }

  .header__controls-link {
    padding: 0.4rem;
  }
}

/* Mobile */
@media (max-width: 767px) {
  .header__wrapper {
    padding: 0 0.75rem;
  }

  .header__logo svg {
    width: 110px;
  }

  .header__inner {
    height: 56px;
  }

  .header__controls {
    gap: 0.15rem;
  }

  /* Hide territory selector text on mobile */
  .territory-selector .inner-col-text,
  .territory-selector .inner-col-icon {
    display: none;
  }

  .territory-selector-dropdown-toggle {
    padding: 0.4rem;
  }

  .mobile-navigation {
    width: 90%;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .header__logo svg {
    width: 100px;
  }

  .header__inner {
    height: 52px;
  }

  /* On very small screens, hide search & contact text */
  .search-toggler .header__toggler,
  .contact-toggler .header__toggler {
    display: none !important;
  }

  .mobile-navigation {
    width: 100%;
    max-width: 100%;
  }

  .mobile-navigation-footer ul {
    gap: 0;
  }

  .search-bar__input {
    font-size: 0.875rem;
    padding: 0.625rem 0.75rem;
  }
}

/* Extra small */
@media (max-width: 360px) {
  .header__logo svg {
    width: 90px;
  }

  .header__controls-link {
    padding: 0.3rem;
    min-width: 36px;
    min-height: 36px;
  }
}
