/*
 * santrade-header-v2.css
 * v6 — desktop mega menu title balance: smaller heading scale and tighter icon/title gap so the third column fits into 2 lines.
 * v5 — mobile icon file /img/header/mobile-phone.svg, stable mobile header grid, restored desktop contact link style from v3.
 * v4 — mobile polishing: no mobile "Весь каталог", non-sticky drawer contact card.
 * v3 — Header v2 polish: 1100px breakpoint, compact desktop nav/account, mobile drawer first catalog group logic.
 * v2 — Header v2 base layout, desktop mega menu, mobile sticky drawer, contacts sheet.
 * Scope: only .st-header / .st-mega / .st-mobile-* / .st-contacts.
 */

:root {
  --st-bordo: #66281d;
  --st-bordo-dark: #532017;
  --st-bordo-soft: #7b3024;
  --st-text: #252525;
  --st-muted: #8c8c8c;
  --st-muted-soft: #aaa3a0;
  --st-line: #e8e2df;
  --st-surface: #ffffff;
  --st-soft: #faf8f7;
  --st-shadow: 0 18px 55px rgba(43, 30, 26, 0.16);
}

.st-header,
.st-header *,
.st-header *::before,
.st-header *::after {
  box-sizing: border-box;
}

.st-header {
  position: relative;
  z-index: 1000;
  width: 100%;
  background: var(--st-surface);
  color: var(--st-text);
  font-family: "Rubik", sans-serif;
  box-shadow: 0 1px 0 rgba(102, 40, 29, 0.06);
}

.st-header a {
  color: inherit;
  text-decoration: none;
}

.st-header button {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.st-header__inner {
  width: 100%;
  max-width: 1280px;
  height: 130px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 12px;
}

.st-header__logo {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.st-header__logo img {
  display: block;
  width: 82px;
  height: auto;
}

.st-header__account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  color: var(--st-text);
  text-transform: uppercase;
  font-size: 14px;
  line-height: 1.08;
  font-weight: 300;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

.st-header__account:hover,
.st-header__account:focus-visible {
  color: var(--st-bordo);
}

.st-header__account img {
  display: block;
  width: 22px;
  height: 22px;
}

.st-header .st-header__nav {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 18px;
  border-left: 1px solid var(--st-line);
  border-right: 1px solid var(--st-line);
  background: transparent;
  text-transform: none;
}

.st-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.st-nav__item {
  margin: 0;
  padding: 0;
  list-style: none;
}

.st-nav__item--catalog {
  position: static;
}

.st-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 14px 13px;
  color: var(--st-text);
  text-transform: uppercase;
  font-size: 15px;
  line-height: 1.1;
  font-weight: 300;
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.st-nav__link:hover,
.st-nav__link:focus-visible,
.st-nav__link.is-active {
  color: var(--st-bordo);
}

.st-nav__link::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 4px;
  height: 1px;
  background: var(--st-bordo);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}

.st-nav__link:hover::after,
.st-nav__link:focus-visible::after,
.st-nav__link.is-active::after {
  transform: scaleX(1);
}

.st-nav__link--catalog {
  padding-right: 27px;
}

.st-nav__link--catalog::before {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 0;
  height: 0;
  margin-top: -2px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--st-bordo);
  transition: transform 0.2s ease;
}

.st-nav__link--catalog[aria-expanded="true"]::before {
  transform: rotate(180deg);
}

.st-header__contacts {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 0 0 186px;
  min-width: 186px;
  line-height: 1.25;
}

.st-header__phone {
  color: var(--st-text);
  font-size: 16px;
  font-weight: 300;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.st-header__phone:hover,
.st-header__phone:focus-visible {
  color: var(--st-bordo);
}

.st-header__contacts-button {
  margin-top: 4px !important;
  color: var(--st-muted-soft) !important;
  font-size: 13px !important;
  line-height: 1.2 !important;
  font-weight: 300 !important;
  font-style: italic !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  transition: color 0.2s ease;
}

.st-header__contacts-button:hover,
.st-header__contacts-button:focus-visible {
  color: var(--st-bordo) !important;
}

.st-header .st-header__contacts button.st-header__contacts-button {
  color: var(--st-muted-soft) !important;
  font-size: 13px !important;
  font-weight: 300 !important;
  font-style: italic !important;
  line-height: 1.2 !important;
  text-transform: none !important;
}

.st-header__mobile-contact,
.st-header__burger {
  display: none;
}

/* Desktop mega menu */

.st-mega {
  position: absolute;
  left: 50%;
  top: 100%;
  z-index: 1020;
  width: min(1280px, calc(100vw - 32px));
  transform: translateX(-50%) translateY(12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0.18s ease;
}

.st-mega[hidden] {
  display: none;
}

.st-mega.is-open {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.st-mega__inner {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  min-height: 420px;
  background: var(--st-surface);
  border: 1px solid rgba(102, 40, 29, 0.08);
  border-radius: 0 0 10px 10px;
  box-shadow: var(--st-shadow);
}

.st-mega__accent {
  position: absolute;
  left: 0;
  right: 0;
  height: 22px;
  background: linear-gradient(90deg, var(--st-bordo-dark), var(--st-bordo), var(--st-bordo-soft));
  pointer-events: none;
}

.st-mega__accent--top {
  top: 0;
}

.st-mega__accent--bottom {
  bottom: 0;
}

.st-mega__column {
  min-width: 0;
  padding: 46px 42px 44px;
}

.st-mega__column + .st-mega__column {
  border-left: 1px solid var(--st-line);
}

.st-mega__head {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  margin-bottom: 24px;
}

.st-mega__icon {
  display: block;
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  object-fit: contain;
}

.st-mega__title {
  margin: 0;
  color: var(--st-bordo);
  text-align: left;
  text-transform: uppercase;
  font-family: "Rubik", sans-serif;
  font-size: 21px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0.025em;
}

.st-mega__list {
  display: flex;
  flex-direction: column;
}

.st-mega__link {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid var(--st-line);
  color: #202936;
  font-size: 17px;
  line-height: 1.22;
  font-weight: 300;
  transition:
    color 0.18s ease,
    padding-left 0.18s ease,
    border-color 0.18s ease;
}

.st-mega__link:hover,
.st-mega__link:focus-visible {
  padding-left: 8px;
  color: var(--st-bordo);
  border-color: rgba(102, 40, 29, 0.25);
}

/* Contacts modal / sheet */

.st-contacts {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(28, 22, 20, 0.56);
}

.st-contacts[hidden] {
  display: none;
}

.st-contacts__panel {
  position: relative;
  width: min(560px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
  padding: 34px 34px 30px;
  background: var(--st-surface);
  border-radius: 14px;
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.24);
}

.st-contacts__close,
.st-mobile-drawer__close {
  position: absolute;
  width: 42px;
  height: 42px;
}

.st-contacts__close {
  top: 18px;
  right: 18px;
}

.st-contacts__close::before,
.st-contacts__close::after,
.st-mobile-drawer__close::before,
.st-mobile-drawer__close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 2px;
  background: var(--st-text);
  transform-origin: center;
}

.st-contacts__close::before,
.st-mobile-drawer__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.st-contacts__close::after,
.st-mobile-drawer__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.st-contacts__head {
  padding-right: 50px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--st-line);
}

.st-contacts__eyebrow {
  margin-bottom: 6px;
  color: var(--st-muted);
  font-size: 13px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.st-contacts__title {
  margin: 0;
  color: var(--st-bordo);
  text-align: left;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 600;
}

.st-contacts__group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 18px 0;
  border-bottom: 1px solid var(--st-line);
}

.st-contacts__group:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.st-contacts__label {
  color: var(--st-muted);
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.st-contacts__group a {
  color: var(--st-text);
  font-size: 17px;
  line-height: 1.25;
  font-weight: 300;
  transition: color 0.18s ease;
}

.st-contacts__group a:hover,
.st-contacts__group a:focus-visible {
  color: var(--st-bordo);
}

/* Mobile drawer */

.st-mobile-drawer,
.st-header-backdrop {
  position: fixed;
  inset: 0;
}

.st-mobile-drawer {
  z-index: 1210;
  pointer-events: none;
}

.st-mobile-drawer[hidden],
.st-header-backdrop[hidden] {
  display: none;
}

.st-mobile-drawer.is-open {
  pointer-events: auto;
}

.st-mobile-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(420px, 100vw);
  height: 100%;
  display: block;
  overflow: auto;
  background: var(--st-surface);
  transform: translateX(100%);
  transition: transform 0.24s ease;
  box-shadow: -22px 0 60px rgba(0, 0, 0, 0.18);
  -webkit-overflow-scrolling: touch;
}

.st-mobile-drawer.is-open .st-mobile-drawer__panel {
  transform: translateX(0);
}

.st-header-backdrop {
  z-index: 1200;
  background: rgba(28, 22, 20, 0.46);
}

.st-mobile-drawer__head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--st-line);
}

.st-mobile-drawer__logo {
  display: inline-flex;
  align-items: center;
  width: 64px;
  flex: 0 0 64px;
}

.st-mobile-drawer__logo img {
  display: block;
  width: 64px;
  height: auto;
}

.st-mobile-drawer__close {
  top: 15px;
  right: 18px;
}

.st-mobile-drawer__nav {
  overflow: visible;
  padding: 26px 24px 0;
}

.st-mobile-drawer__nav > a,
.st-mobile-catalog__summary,
.st-mobile-catalog__group > summary,
.st-mobile-catalog__all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  border-bottom: 1px solid var(--st-line);
  color: var(--st-text);
  text-transform: uppercase;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 300;
  letter-spacing: 0.035em;
}

.st-mobile-drawer__nav > a:hover,
.st-mobile-drawer__nav > a:focus-visible,
.st-mobile-catalog__summary:hover,
.st-mobile-catalog__group > summary:hover,
.st-mobile-catalog__all:hover {
  color: var(--st-bordo);
}

.st-mobile-catalog,
.st-mobile-catalog__group {
  display: block;
}

.st-mobile-catalog summary,
.st-mobile-catalog__group summary {
  cursor: pointer;
  list-style: none;
}

.st-mobile-catalog summary::-webkit-details-marker,
.st-mobile-catalog__group summary::-webkit-details-marker {
  display: none;
}

.st-mobile-catalog__summary::after,
.st-mobile-catalog__group > summary::after {
  content: "+";
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--st-bordo);
  font-size: 18px;
  line-height: 1;
  font-weight: 300;
}

.st-mobile-catalog[open] > .st-mobile-catalog__summary::after,
.st-mobile-catalog__group[open] > summary::after {
  content: "−";
}

.st-mobile-catalog__body {
  padding: 8px 0 14px;
}

.st-mobile-catalog__group > summary {
  min-height: 42px;
  padding-left: 12px;
  color: var(--st-bordo);
  font-size: 14px;
  font-weight: 600;
}

.st-mobile-catalog__links {
  display: flex;
  flex-direction: column;
  padding: 4px 0 10px 22px;
}

.st-mobile-catalog__links .st-mega__link {
  padding: 9px 0;
  border-bottom: 1px solid rgba(232, 226, 223, 0.75);
  font-size: 14px;
  line-height: 1.25;
  text-transform: none;
}

.st-mobile-catalog__all {
  display: none !important;
}

.st-mobile-drawer__footer {
  display: grid;
  gap: 10px;
  margin: 28px 24px 34px;
  padding: 16px;
  border: 1px solid rgba(102, 40, 29, 0.12);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfaf9 100%);
  box-shadow: 0 12px 34px rgba(43, 30, 26, 0.06);
}

.st-mobile-drawer__phone,
.st-mobile-drawer__contacts,
.st-mobile-drawer__account {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 14px;
  border-radius: 8px;
  text-align: center;
  font-size: 15px;
  line-height: 1.2;
}

.st-mobile-drawer__phone {
  position: relative;
  min-height: 34px;
  padding: 0 0 12px 0;
  border-bottom: 1px solid rgba(102, 40, 29, 0.12);
  border-radius: 0;
  color: var(--st-text);
  font-size: 17px;
  font-weight: 600;
}

.st-mobile-drawer__contacts {
  border: 1px solid rgba(102, 40, 29, 0.72);
  color: var(--st-bordo);
  background: var(--st-surface);
  font-weight: 500;
}

.st-mobile-drawer__account {
  color: #ffffff !important;
  background: var(--st-bordo);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.035em;
}

.st-scroll-lock {
  overflow: hidden;
}

html.st-scroll-lock,
body.st-scroll-lock {
  width: 100%;
}

/* Responsive */

@media (max-width: 1180px) and (min-width: 1101px) {
  .st-header__inner {
    gap: 16px;
  }

  .st-header .st-header__nav {
    padding: 0 12px;
  }

  .st-nav__link {
    padding-left: 10px;
    padding-right: 10px;
    font-size: 14px;
    letter-spacing: 0.025em;
  }

  .st-nav__link--catalog {
    padding-right: 24px;
  }

  .st-header__contacts {
    flex-basis: 176px;
    min-width: 176px;
  }

  .st-header__phone {
    font-size: 15px;
  }
}

@media (max-width: 1100px) {
  .st-header {
    position: sticky;
    top: 0;
    z-index: 1100;
  }

  .st-header__inner {
    height: 72px;
    display: grid;
    grid-template-columns: 64px 1fr 44px 46px;
    align-items: center;
    gap: 8px;
    padding: 0 24px;
    transform: translateZ(0);
  }

  .st-header__logo {
    grid-column: 1;
    width: 64px;
    min-width: 64px;
    max-width: 64px;
    margin: 0;
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: auto;
  }

  .st-header__logo img {
    width: 64px;
    max-width: none;
    transform: translateZ(0);
    backface-visibility: hidden;
  }

  .st-header__account--desktop,
  .st-header__nav,
  .st-header__contacts {
    display: none !important;
  }

  .st-header__mobile-contact,
  .st-header__burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 10px;
    color: var(--st-text);
    transition: color 0.18s ease, background-color 0.18s ease;
  }

  .st-header__mobile-contact {
    grid-column: 3;
    justify-self: end;
    margin: 0;
  }

  .st-header__mobile-contact:hover,
  .st-header__mobile-contact:focus-visible,
  .st-header__burger:hover,
  .st-header__burger:focus-visible {
    color: var(--st-bordo);
    background: rgba(102, 40, 29, 0.04);
  }

  .st-header__mobile-contact img {
    display: block !important;
    width: 26px;
    height: 26px;
    max-width: none;
    object-fit: contain;
  }

  .st-header__mobile-contact::before {
    content: none;
  }

  .st-header__burger {
    grid-column: 4;
    justify-self: end;
    position: relative;
    margin: 0;
  }

  .st-header__burger span,
  .st-header__burger span::before,
  .st-header__burger span::after {
    position: absolute;
    width: 31px;
    height: 2px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .st-header__burger span {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }

  .st-header__burger span::before,
  .st-header__burger span::after {
    content: "";
    left: 0;
  }

  .st-header__burger span::before {
    top: -9px;
  }

  .st-header__burger span::after {
    top: 9px;
  }

  .st-header__burger[aria-expanded="true"] span {
    background: transparent;
  }

  .st-header__burger[aria-expanded="true"] span::before {
    transform: translateY(9px) rotate(45deg);
  }

  .st-header__burger[aria-expanded="true"] span::after {
    transform: translateY(-9px) rotate(-45deg);
  }

  .st-mega {
    display: none !important;
  }

  .st-contacts {
    align-items: flex-end;
    padding: 0;
  }

  .st-contacts__panel {
    width: 100%;
    max-height: calc(100vh - 54px);
    padding: 28px 22px 26px;
    border-radius: 18px 18px 0 0;
  }

  .st-contacts__title {
    font-size: 24px;
  }
}

@media (max-width: 420px) {
  .st-header__inner {
    grid-template-columns: 64px 1fr 44px 46px;
    padding: 0 24px;
  }

  .st-mobile-drawer__panel {
    width: 100vw;
  }

  .st-mobile-drawer__head,
  .st-mobile-drawer__nav {
    padding-left: 24px;
    padding-right: 24px;
  }

  .st-mobile-drawer__footer {
    margin-left: 24px;
    margin-right: 24px;
  }
}
