/* Mirasoles site header
   Covers public, authenticated, desktop, and mobile navigation. */

/* Accessibility */

.skip-link {
  position: fixed;
  z-index: 1200;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--color-white);
  color: var(--color-text);
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Header shell */

.header {
  --header-control-height: 40px;
  position: fixed;
  z-index: 900;
  top: 0;
  right: 0;
  left: 0;
  min-height: 60px;
  border-bottom: 1px solid rgb(255 255 255 / 14%);
  background: rgb(10 13 11 / 76%);
  box-shadow: 0 4px 14px rgb(0 0 0 / 9%);
  color: var(--color-white);
  backdrop-filter: blur(10px) saturate(115%);
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.header--light {
  border-bottom-color: rgb(17 17 17 / 11%);
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 4px 14px rgb(17 17 17 / 5.5%);
  color: var(--color-text);
}

.header-inner {
  width: min(1200px, calc(100% - 32px));
  min-height: 60px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-inline: auto;
}

.brand {
  min-width: 154px;
  display: inline-flex;
  align-items: center;
}

.brand img {
  width: 148px;
  max-width: 100%;
  height: auto;
  opacity: 1;
}

.header .brand__logo--inverse {
  filter: brightness(0) invert(1) drop-shadow(0 0 0.35px rgb(255 255 255 / 82%));
}

.header--light .brand__logo--inverse {
  filter: none;
}

/* Desktop navigation */

.header .nav {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  transform: translateX(-12px);
  flex-wrap: nowrap;
}

.header .nav-link {
  position: relative;
  min-height: var(--header-control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgb(255 255 255 / 86%);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

.header--light .nav-link {
  color: rgb(17 17 17 / 76%);
}

.header .nav > .nav-link::after,
.header .nav-products-menu > .nav-link::after {
  content: '';
  position: absolute;
  right: 1px;
  bottom: 4px;
  left: 1px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: #86d68f;
  opacity: 0;
  transform: scaleX(0.45);
  transform-origin: center;
  transition: opacity 160ms ease, transform 160ms ease;
}

.header--light .nav > .nav-link::after,
.header--light .nav-products-menu > .nav-link::after {
  background: var(--color-primary-strong);
}

.header .nav-link:hover,
.header .nav-link:focus-visible,
.header .nav-link.is-active,
.header .nav-link[aria-current='page'] {
  background: transparent;
  color: var(--color-white);
}

.header .nav-link.is-active,
.header .nav-link[aria-current='page'] {
  font-weight: 750;
}

.header--light .nav-link:hover,
.header--light .nav-link:focus-visible,
.header--light .nav-link.is-active,
.header--light .nav-link[aria-current='page'] {
  color: var(--color-text);
}

.header .nav > .nav-link:hover::after,
.header .nav > .nav-link:focus-visible::after,
.header .nav > .nav-link.is-active::after,
.header .nav > .nav-link[aria-current='page']::after,
.header .nav-products-menu > .nav-link:hover::after,
.header .nav-products-menu > .nav-link:focus-visible::after,
.header .nav-products-menu > .nav-link.is-active::after,
.header .nav-products-menu > .nav-link[aria-current='page']::after {
  opacity: 1;
  transform: scaleX(1);
}

/* Product navigation dropdown */

.nav-products-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-products-menu__trigger {
  appearance: none;
  gap: 6px;
  cursor: pointer;
}

.nav-products-menu__chevron,
.header-auth-menu__toggle i {
  width: 12px;
  height: 12px;
  display: inline-grid;
  flex: 0 0 12px;
  place-items: center;
  margin-top: 1px;
  font-size: 12px;
  line-height: 1;
  opacity: 0.58;
  transition: transform 160ms ease;
}

.nav-products-menu.is-open .nav-products-menu__chevron {
  transform: rotate(180deg);
}

.header .nav-products-menu.is-open > .nav-products-menu__trigger {
  color: var(--color-white);
  font-weight: 750;
}

.header--light .nav-products-menu.is-open > .nav-products-menu__trigger {
  color: var(--color-text);
}

.header .nav-products-menu.is-open > .nav-products-menu__trigger::after {
  opacity: 1;
  transform: scaleX(1);
}

.is-header-products-open .header .nav > .nav-link:hover::after {
  opacity: 0;
  transform: scaleX(0.45);
}

.nav-products-menu__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  width: min(620px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgb(17 17 17 / 10%);
  border-radius: 12px;
  background: var(--color-white);
  box-shadow: 0 18px 42px rgb(17 17 17 / 14%), 0 3px 8px rgb(17 17 17 / 5%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition: opacity 150ms ease, visibility 150ms ease, transform 150ms ease;
}

.nav-products-menu__dropdown::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  width: 10px;
  height: 10px;
  border-top: 1px solid rgb(17 17 17 / 10%);
  border-left: 1px solid rgb(17 17 17 / 10%);
  background: var(--color-white);
  transform: translateX(-50%) rotate(45deg);
}

.nav-products-menu.is-open .nav-products-menu__dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.nav-products-menu__heading-row {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 2px 9px;
  border-bottom: 1px solid rgb(17 17 17 / 9%);
}

.nav-products-menu__heading {
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.nav-products-menu__view-all {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0;
  color: #297d36;
  font-size: 13px;
  font-weight: 700;
}

.nav-products-menu__view-all:hover,
.nav-products-menu__view-all:focus-visible,
.nav-products-menu__view-all.is-active {
  color: #1f692b;
}

.nav-products-menu__dropdown-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.nav-products-menu__dropdown-link {
  min-width: 0;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 7px;
  border: 1px solid #e5ebe4;
  border-radius: 9px;
  background: var(--color-white);
  color: #1b211c;
  font-size: 13px;
  font-weight: 650;
  box-shadow: 0 1px 2px rgb(17 17 17 / 2%);
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease, color 150ms ease, transform 150ms ease;
}

.nav-products-menu__dropdown-link:hover,
.nav-products-menu__dropdown-link:focus-visible,
.nav-products-menu__dropdown-link.is-active,
.nav-products-menu__dropdown-link[aria-current='page'] {
  border-color: rgb(57 172 74 / 28%);
  background: rgb(57 172 74 / 7%);
  color: #245f2e;
  box-shadow: 0 7px 18px rgb(34 91 43 / 9%);
  transform: translateY(-2px);
}

.nav-products-menu__thumb {
  width: 48px;
  height: 48px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #f1f5ef;
}

.nav-products-menu__thumb img {
  width: 100%;
  height: 100%;
  display: block;
  padding: 4px;
  object-fit: contain;
  transition: transform 150ms ease;
}

.nav-products-menu__dropdown-link:hover .nav-products-menu__thumb img,
.nav-products-menu__dropdown-link:focus-visible .nav-products-menu__thumb img {
  transform: scale(1.045);
}

.nav-products-menu__dropdown-title {
  min-width: 0;
  flex: 1 1 auto;
}

.nav-products-menu__dropdown-arrow {
  width: 25px;
  height: 25px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgb(57 172 74 / 8%);
  color: #297d36;
  font-size: 15px;
  line-height: 1;
  opacity: 0.42;
  transform: translateX(-2px);
  transition: background-color 150ms ease, opacity 150ms ease, transform 150ms ease;
}

.nav-products-menu__dropdown-link:hover .nav-products-menu__dropdown-arrow,
.nav-products-menu__dropdown-link:focus-visible .nav-products-menu__dropdown-arrow,
.nav-products-menu__dropdown-link.is-active .nav-products-menu__dropdown-arrow,
.nav-products-menu__dropdown-link[aria-current='page'] .nav-products-menu__dropdown-arrow {
  opacity: 1;
  background: rgb(57 172 74 / 14%);
  transform: translateX(2px);
}

body.is-header-products-open::before {
  content: '';
  position: fixed;
  z-index: 850;
  inset: 60px 0 0;
  pointer-events: auto;
  background: rgb(8 16 10 / 20%);
  animation: header-products-scrim-in 160ms ease both;
}

@keyframes header-products-scrim-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Header actions */

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  transform: translateX(-16px);
}

.header-actions > .lang-switch {
  order: 1;
}

.header-actions > [data-auth] {
  order: 2;
}

.header-actions > .header-quote-link,
.header-actions > .header-mobile-cart-link {
  order: 3;
}

.header-actions > .header-menu-toggle {
  order: 4;
}

.lang-switch {
  min-height: var(--header-control-height);
  display: inline-flex;
  align-items: center;
  color: inherit;
}

.header .lang-switch {
  min-height: 36px;
  gap: 10px;
  padding: 0 2px;
  border: 0;
  background: transparent;
}

.header .lang-switch::before {
  content: none;
}

.header--light .lang-switch {
  background: transparent;
}

.header .lang-switch__btn {
  min-width: 24px;
  min-height: 36px;
  padding: 0;
  border-radius: 2px;
  font-size: 12px;
  transition: color 150ms ease, opacity 150ms ease;
}

.header .lang-switch__btn + .lang-switch__btn {
  margin-left: 0;
}

.header .lang-switch__btn + .lang-switch__btn::before {
  content: '|';
  left: -8px;
}

.header .lang-switch__btn:hover,
.header .lang-switch__btn:focus-visible,
.header .lang-switch__btn[aria-pressed='true'],
.header .lang-switch__btn.is-active {
  background: transparent;
}

.header--light .lang-switch__btn:hover,
.header--light .lang-switch__btn:focus-visible,
.header--light .lang-switch__btn[aria-pressed='true'],
.header--light .lang-switch__btn.is-active {
  background: transparent;
  box-shadow: none;
}

.header .lang-switch__btn:focus-visible {
  outline-color: currentColor;
}

.nav-link.nav-user,
.header-auth-menu__toggle {
  min-height: var(--header-control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: rgb(255 255 255 / 86%);
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
}

.header--light .nav-link.nav-user,
.header--light .header-auth-menu__toggle {
  color: rgb(17 17 17 / 76%);
}

.header-auth-menu {
  position: relative;
}

.header-auth-menu summary::-webkit-details-marker {
  display: none;
}

.header-auth-menu[open] .header-auth-menu__toggle i {
  transform: rotate(180deg);
}

.header-auth-menu__toggle:hover,
.header-auth-menu__toggle:focus-visible,
.header-auth-menu[open] .header-auth-menu__toggle,
.nav-link.nav-user:hover,
.nav-link.nav-user:focus-visible {
  color: var(--color-white);
}

.header--light .header-auth-menu__toggle:hover,
.header--light .header-auth-menu__toggle:focus-visible,
.header--light .header-auth-menu[open] .header-auth-menu__toggle,
.header--light .nav-link.nav-user:hover,
.header--light .nav-link.nav-user:focus-visible {
  color: var(--color-text);
}

.header-auth-menu__dropdown {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 20;
  width: 180px;
  display: grid;
  gap: 2px;
  padding: 7px;
  border: 1px solid rgb(17 17 17 / 8%);
  border-radius: 13px;
  background: var(--color-white);
  box-shadow: 0 12px 28px rgb(17 17 17 / 10%), 0 2px 6px rgb(17 17 17 / 4%);
  transform-origin: top right;
}

.header-auth-menu:not([open]) .header-auth-menu__dropdown {
  display: none;
}

.header-auth-menu[open] .header-auth-menu__dropdown {
  animation: header-auth-menu-in 150ms cubic-bezier(0.2, 0.72, 0.24, 1) both;
}

@keyframes header-auth-menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.header-auth-menu__dropdown a,
.header-auth-menu__dropdown button {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 0;
  gap: 9px;
  border-radius: 8px;
  background: transparent;
  color: #1b211c;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  text-align: left;
}

.header-auth-menu__item-icon {
  width: 16px;
  display: inline-grid;
  flex: 0 0 16px;
  place-items: center;
  color: #4c6551;
  font-size: 13px;
  line-height: 1;
  opacity: 0.78;
}

.header-auth-menu__dropdown a:hover,
.header-auth-menu__dropdown a:focus-visible,
.header-auth-menu__dropdown button:hover,
.header-auth-menu__dropdown button:focus-visible {
  background: rgb(57 172 74 / 9%);
  color: var(--color-primary-strong);
}

.header-auth-menu__dropdown :is(a, button):hover .header-auth-menu__item-icon,
.header-auth-menu__dropdown :is(a, button):focus-visible .header-auth-menu__item-icon {
  color: var(--color-primary-strong);
  opacity: 1;
}

.header-quote-link,
.header-mobile-cart-link {
  position: relative;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid var(--color-primary);
  border-radius: 9px;
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.header-quote-link:hover,
.header-quote-link:focus-visible,
.header-quote-link[aria-current='page'],
.header-mobile-cart-link:hover,
.header-mobile-cart-link:focus-visible,
.header-mobile-cart-link[aria-current='page'] {
  border-color: var(--color-primary-strong);
  background: var(--color-primary-strong);
  color: var(--color-white);
  transform: translateY(-1px);
}

.header-quote-link__icon {
  width: 20px;
  height: 20px;
  display: none;
  flex: 0 0 20px;
  align-items: center;
  justify-content: center;
}

.header-quote-link__icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-quote-link__badge,
.header-mobile-cart-link__badge {
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 7px;
  padding: 0 5px;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: var(--radius-pill);
  background: rgb(0 0 0 / 18%);
  color: var(--color-white);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding-top: 1px;
}



.header :is(a, button, summary):focus-visible,
.mobile-header-menu :is(a, button, summary):focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* Mobile trigger */

.header-menu-toggle {
  width: 44px;
  height: 44px;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
}

.header-menu-toggle__line {
  width: 22px;
  height: 2px;
  display: block;
  background: currentColor;
}

.mobile-header-menu {
  display: none;
}

body.mobile-menu-open {
  overflow: hidden;
}

/* Dark mode */

.portal-dark-mode .header--light {
  border-bottom-color: rgb(232 245 234 / 12%);
  background: rgb(9 16 12 / 92%);
  color: var(--color-white);
}

.portal-dark-mode .header--light .brand__logo--inverse {
  filter: brightness(0) invert(1);
}

.portal-dark-mode .header--light .lang-switch {
  background: transparent;
}

.portal-dark-mode .header--light .lang-switch__btn:hover,
.portal-dark-mode .header--light .lang-switch__btn:focus-visible,
.portal-dark-mode .header--light .lang-switch__btn[aria-pressed='true'],
.portal-dark-mode .header--light .lang-switch__btn.is-active {
  background: transparent;
  box-shadow: none;
}

.portal-dark-mode .header--light .nav-link,
.portal-dark-mode .header--light .nav-link.nav-user,
.portal-dark-mode .header--light .header-auth-menu__toggle {
  color: rgb(255 255 255 / 82%);
}

.portal-dark-mode .header--light .nav-link:hover,
.portal-dark-mode .header--light .nav-link:focus-visible,
.portal-dark-mode .header--light .nav-link.is-active,
.portal-dark-mode .header--light .nav-link[aria-current='page'],
.portal-dark-mode .header--light .header-auth-menu__toggle:hover,
.portal-dark-mode .header--light .header-auth-menu[open] .header-auth-menu__toggle {
  color: var(--color-white);
}

/* Admin header: account controls only */

.is-admin-user .header .nav,
.is-admin-user .header-mobile-cart-link,
.is-admin-user .header-quote-link,
.is-admin-user .header-menu-toggle,
.is-admin-user .mobile-header-menu__nav,
.is-admin-user .mobile-header-menu__cart {
  display: none;
}

.is-admin-user .header-inner {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

/* Compact desktop */

@media (min-width: 981px) and (max-width: 1120px) {
  .header-inner {
    width: calc(100% - 24px);
    gap: 12px;
  }

  .brand {
    min-width: 140px;
  }

  .brand img {
    width: 140px;
  }

  .header .nav {
    gap: 12px;
    transform: translateX(-6px);
  }

  .header .nav-link {
    font-size: 14px;
  }

  .header-actions {
    gap: 6px;
    transform: translateX(-6px);
  }

  .header-quote-link,
  .header-mobile-cart-link {
    padding-inline: 11px;
    font-size: 13px;
  }
}

/* Mobile header and navigation */

@media (max-width: 980px) {
  .header {
    min-height: 56px;
  }

  .header-inner {
    width: 100%;
    min-height: 56px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding-inline: 12px;
  }

  .brand {
    min-width: 0;
  }

  .brand img {
    width: 140px;
  }

  .header .nav,
  .header-actions > .lang-switch,
  .header-actions > [data-auth] {
    display: none;
  }

  .header-actions {
    gap: 0;
    transform: none;
  }

  .header-actions > .header-quote-link,
  .header-actions > .header-mobile-cart-link {
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--color-white);
  }

  .header--light .header-actions > .header-quote-link,
  .header--light .header-actions > .header-mobile-cart-link {
    color: var(--color-text);
  }

  .portal-dark-mode .header--light .header-actions > .header-quote-link,
  .portal-dark-mode .header--light .header-actions > .header-mobile-cart-link {
    color: var(--color-white);
  }

  .header-actions > .header-quote-link:hover,
  .header-actions > .header-quote-link:focus-visible,
  .header-actions > .header-mobile-cart-link:hover,
  .header-actions > .header-mobile-cart-link:focus-visible {
    border: 0;
    background: transparent;
    color: inherit;
    transform: none;
  }

  .header--light .header-actions > .header-quote-link:hover,
  .header--light .header-actions > .header-mobile-cart-link:hover {
    background: transparent;
  }

  .header-actions .header-quote-link__icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    flex-basis: 30px;
    margin: 0;
  }

  .header-actions .header-quote-link__icon svg {
    stroke-width: 2.1;
  }

  .header-actions .header-quote-link__label,
  .header-actions .header-mobile-cart-link__label {
    display: none;
  }

  .header-actions .header-quote-link__badge,
  .header-actions .header-mobile-cart-link__badge {
    position: absolute;
    top: 0;
    right: -1px;
    min-width: 18px;
    height: 18px;
    margin: 0;
    padding-inline: 4px;
    border: 2px solid var(--color-white);
    background: var(--color-primary);
    font-size: 10px;
  }

  .header-menu-toggle {
    display: inline-flex;
  }

  .header-menu-toggle:hover,
  .header-menu-toggle:focus-visible {
    background: transparent;
  }

  .header--light .header-menu-toggle:hover,
  .header--light .header-menu-toggle:focus-visible {
    background: transparent;
  }

  .mobile-header-menu {
    position: fixed;
    z-index: 1000;
    inset: 0;
    min-height: 100dvh;
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--color-white);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 160ms ease, visibility 160ms ease;
  }

  

  .mobile-header-menu.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-header-menu__topbar {
    position: sticky;
    z-index: 2;
    top: 0;
    min-height: calc(56px + env(safe-area-inset-top));
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: env(safe-area-inset-top) 12px 0;
    border-bottom: 1px solid var(--color-border-subtle);
    background: rgb(255 255 255 / 98%);
  }

  .mobile-header-menu__brand {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .mobile-header-menu__brand img {
    width: 144px;
    height: auto;
  }

  .mobile-header-menu__close {
    position: relative;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--color-text);
  }

  .mobile-header-menu__close > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .mobile-header-menu__close::before,
  .mobile-header-menu__close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: currentColor;
  }

  .mobile-header-menu__close::before {
    transform: rotate(45deg);
  }

  .mobile-header-menu__close::after {
    transform: rotate(-45deg);
  }

  .mobile-header-menu__close:hover,
  .mobile-header-menu__close:focus-visible {
    background: rgb(17 17 17 / 5.5%);
  }

  .mobile-header-menu__sheet {
    width: min(100%, 560px);
    min-height: calc(100dvh - 56px - env(safe-area-inset-top));
    display: grid;
    align-content: start;
    gap: 16px;
    margin-inline: auto;
    padding: 18px 20px calc(30px + env(safe-area-inset-bottom));
  }

  .mobile-header-menu:not(.mobile-header-menu--public) .mobile-header-menu__close {
    position: absolute;
    z-index: 2;
    top: 10px;
    right: 12px;
  }

  .mobile-header-menu:not(.mobile-header-menu--public) .mobile-header-menu__sheet {
    padding-top: 72px;
  }

  .mobile-header-menu__nav,
  .mobile-header-menu__products-block {
    width: 100%;
    display: grid;
    gap: 2px;
  }

  .mobile-header-menu__link {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 0 4px;
    border: 0;
    border-bottom: 1px solid var(--color-border-subtle);
    border-radius: 0;
    background: transparent;
    color: #171b18;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
  }

  .mobile-header-menu__link:hover,
  .mobile-header-menu__link:focus-visible,
  .mobile-header-menu__link.is-active {
    background: transparent;
    color: #267433;
  }

  .mobile-header-menu__products-toggle {
    appearance: none;
    justify-content: space-between;
    cursor: pointer;
  }

  .mobile-header-menu__products-toggle i {
    margin-right: 4px;
    font-size: 14px;
    opacity: 0.62;
    transition: transform 160ms ease;
  }

  .mobile-header-menu__products-block.is-open .mobile-header-menu__products-toggle i {
    transform: rotate(180deg);
  }

  .mobile-header-menu__products {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 0 14px;
  }

  .mobile-header-menu__sublink {
    min-width: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 8px 11px;
    border: 1px solid rgb(17 17 17 / 7%);
    border-radius: 8px;
    background: #f6f8f5;
    color: rgb(17 17 17 / 78%);
    font-size: 14px;
    font-weight: 650;
    line-height: 1.2;
  }

  .mobile-header-menu__sublink:hover,
  .mobile-header-menu__sublink:focus-visible,
  .mobile-header-menu__sublink.is-active,
  .mobile-header-menu__sublink[aria-current='page'] {
    border-color: rgb(57 172 74 / 20%);
    background: rgb(57 172 74 / 9%);
    color: #245f2e;
  }

  .mobile-header-menu__sublink--all {
    grid-column: 1 / -1;
    justify-content: space-between;
    background: var(--color-white);
    color: #267433;
  }

  .mobile-header-menu__quote {
    width: 100%;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    color: var(--color-white);
    font-size: 16px;
    font-weight: 750;
  }

  .mobile-header-menu__quote:hover,
  .mobile-header-menu__quote:focus-visible,
  .mobile-header-menu__quote:visited {
    border-color: var(--color-primary-strong);
    background: var(--color-primary-strong);
    color: var(--color-white);
  }

  .mobile-header-menu__quote .header-quote-link__label {
    display: inline-flex;
  }

  .mobile-header-menu__quote .header-quote-link__icon {
    display: none;
  }

  .mobile-header-menu__auth {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .mobile-header-menu__link--auth {
    min-height: 44px;
    justify-content: center;
    padding: 0 10px;
    border: 1px solid var(--color-border-emphasis);
    border-radius: var(--radius-pill);
    background: var(--color-white);
    color: #262b27;
    font-size: 14px;
  }

  .mobile-header-menu__utility {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 0;
    color: #171b18;
  }

  .mobile-header-menu__lang {
    width: 100%;
  }

  .mobile-header-menu__lang .lang-switch {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    padding: 0 4px;
    border-bottom: 1px solid var(--color-border-subtle);
    color: inherit;
  }

  .mobile-header-menu__lang .lang-switch__btn {
    min-width: 44px;
    min-height: 48px;
    color: inherit;
    font-size: 16px;
    font-weight: 700;
  }

}

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

@media (max-width: 360px) {
  .mobile-header-menu__sheet {
    padding-inline: 14px;
  }

  .mobile-header-menu__sublink {
    padding-inline: 9px;
    font-size: 13px;
  }
}

/* ==========================================================================
   Public product navigation
   ========================================================================== */

/* Full-width product navigation */
@media (min-width: 981px) {
  .header--public {
    border-bottom-color: rgba(29, 29, 31, 0.08);
    background: rgba(251, 251, 253, 0.86);
    box-shadow: none;
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
  }

  .header--public .header-inner {
    min-height: 64px;
  }

  .header--public .nav {
    transform: none;
  }

  .header--public .nav > .nav-link,
  .header--public .nav-products-menu > .nav-link {
    color: #4a4a4f;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    font-weight: 560;
  }

  .header--public .nav > .nav-link::after,
  .header--public .nav-products-menu > .nav-link::after {
    display: none;
  }

  .header--public .header-quote-link {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: var(--color-white);
    box-shadow: none;
  }

  .header--public .header-quote-link:hover,
  .header--public .header-quote-link:focus-visible {
    border-color: var(--color-primary-strong);
    background: var(--color-primary-strong);
  }

  .nav-products-menu__dropdown {
    position: fixed;
    top: 64px;
    right: 0;
    left: 0;
    width: 100vw;
    max-width: 100vw;
    max-height: calc(100vh - 64px);
    box-sizing: border-box;
    gap: 12px;
    padding: 20px max(28px, calc((100vw - 1240px) / 2)) 24px;
    overflow-x: hidden;
    overflow-y: auto;
    border: 0;
    border-top: 1px solid rgba(29, 29, 31, 0.06);
    border-bottom: 1px solid rgba(29, 29, 31, 0.08);
    border-radius: 0 0 22px 22px;
    background: #fbfbfd;
    box-shadow: 0 24px 58px rgba(29, 29, 31, 0.12);
    transform: translateY(-12px);
    transition: opacity 180ms ease, visibility 180ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .nav-products-menu__dropdown::before {
    display: none;
  }

  .nav-products-menu.is-open .nav-products-menu__dropdown {
    transform: translateY(0);
  }

  .nav-products-menu__heading-row {
    min-height: 32px;
    padding: 0 8px;
    border: 0;
  }

  .nav-products-menu__heading {
    color: var(--product-ink, #1d1d1f);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
    font-size: 22px;
    font-weight: 620;
    letter-spacing: -0.035em;
  }

  .nav-products-menu__view-all {
    min-height: 32px;
    gap: 9px;
    color: var(--product-ink, #1d1d1f);
    font-size: 13px;
    font-weight: 610;
    margin-right: 2px;
  }

  .nav-products-menu__view-all:hover,
  .nav-products-menu__view-all:focus-visible,
  .nav-products-menu__view-all.is-active {
    color: var(--color-black);
  }

  .nav-products-menu__dropdown-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
  }

  .nav-products-menu__dropdown-link {
    position: relative;
    min-height: 112px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: space-between;
    gap: 11px;
    padding: 8px;
    border: 0;
    border-radius: 18px;
    background: transparent;
    color: var(--product-ink, #1d1d1f);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    font-size: 12.5px;
    font-weight: 580;
    box-shadow: none;
    transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
  }

  .nav-products-menu__dropdown-link:hover,
  .nav-products-menu__dropdown-link:focus-visible,
  .nav-products-menu__dropdown-link.is-active,
  .nav-products-menu__dropdown-link[aria-current='page'] {
    border-color: transparent;
    background: #f1f1f3;
    color: var(--color-black);
    box-shadow: none;
    transform: translateY(-2px);
  }

  .nav-products-menu__dropdown-link:focus-visible {
    outline: 2px solid rgba(29, 29, 31, 0.44);
    outline-offset: 2px;
  }

  .nav-products-menu__thumb {
    width: 100%;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 13px;
    background: #eef1ed;
  }

  .nav-products-menu__thumb img {
    width: auto;
    height: auto;
    max-width: calc(100% - 20px);
    max-height: calc(100% - 14px);
    box-sizing: border-box;
    padding: 0;
    object-fit: contain;
    object-position: center center;
    transform: none;
    transition: transform 180ms ease;
  }

  .nav-products-menu__dropdown-link:hover .nav-products-menu__thumb img,
  .nav-products-menu__dropdown-link:focus-visible .nav-products-menu__thumb img {
    transform: scale(1.035);
  }

  .nav-products-menu__dropdown-title {
    padding: 0 30px 0 4px;
    line-height: 1.2;
  }

  .nav-products-menu__dropdown-arrow {
    position: absolute;
    right: 10px;
    bottom: 8px;
    width: 24px;
    height: 24px;
    display: grid;
    border-radius: 999px;
    background: rgba(29, 29, 31, 0.07);
    color: var(--product-ink, #1d1d1f);
    font-size: 13px;
    opacity: 0;
    transform: translateX(-3px);
    transition: opacity 180ms ease, transform 180ms ease, background-color 180ms ease;
  }

  .nav-products-menu__dropdown-link:hover .nav-products-menu__dropdown-arrow,
  .nav-products-menu__dropdown-link:focus-visible .nav-products-menu__dropdown-arrow,
  .nav-products-menu__dropdown-link.is-active .nav-products-menu__dropdown-arrow,
  .nav-products-menu__dropdown-link[aria-current='page'] .nav-products-menu__dropdown-arrow {
    background: rgba(29, 29, 31, 0.1);
    opacity: 1;
    transform: translateX(0);
  }

  body.is-header-products-open::before {
    inset: 64px 0 0;
    background: rgba(17, 17, 19, 0.14);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }
}

@media (min-width: 981px) and (max-width: 1160px) {
  .nav-products-menu__dropdown-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav-products-menu__dropdown-link {
    min-height: 84px;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
  }

  .nav-products-menu__thumb {
    width: 76px;
    height: 64px;
  }

  .nav-products-menu__dropdown-title {
    padding-right: 26px;
  }
}
