/* ============================================================
   HEADER ONLY — scoped under .site-header to avoid site conflicts
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 4px 20px rgba(31, 43, 55, .08);
  backdrop-filter: blur(12px);
  box-sizing: border-box;
  color: #2f3944;
  line-height: 1.55;
}

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

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

.site-header button,
.site-header input {
  font: inherit;
}

.site-header button {
  cursor: pointer;
}

.site-header ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-header h4 {
  margin: 0;
  color: #263747;
  line-height: 1.18;
}

/* Inner width (was .container — renamed to avoid conflicts) */
.site-header .header-container {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
}

/* Visually hidden label (was .sr-only) */
.site-header .header-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* CTA in nav (was .btn.btn-primary.btn-sm) */
.site-header .header-cta {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 13px;
  border-radius: 11px;
  border: 1px solid transparent;
  color: #fff;
  background: #d32f2f;
  box-shadow: 0 8px 20px rgba(211, 47, 47, .22);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  transition: .2s ease;
}

.site-header .header-cta:hover {
  background: #b71c1c;
}

/* Mega-menu links (was .text-link) */
.site-header .header-text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #d32f2f;
  font-weight: 800;
}

.site-header .header-text-link:hover {
  color: #b71c1c;
}

.site-header .service-bar {
  background: #f5f6f8;
  border-bottom: 1px solid #e0e5ea;
  font-size: 12px;
}

.site-header .service-bar__inner {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.site-header .service-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap;
}

.site-header .service-group a:hover {
  color: #d32f2f;
}

.site-header .service-group--links a:nth-child(3),
.site-header .service-group--links a:nth-child(5),
.site-header .service-group:last-child a:last-child {
  display: none;
}

.site-header .region {
  font-weight: 800;
  color: #263747;
}

.site-header .region button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #d32f2f;
  font-size: 12px;
  font-weight: 700;
}

.site-header .main-header {
  min-height: 92px;
  display: grid;
  grid-template-columns: 260px 1fr auto;
  gap: 26px;
  align-items: center;
}

.site-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.site-header .brand-mark {
  width: 44px;
  height: 50px;
  color: #d32f2f;
  display: block;
  max-width: 100%;
}

.site-header .brand-name {
  display: block;
  color: #263747;
  font-size: 27px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.site-header .brand-name span {
  color: #d32f2f;
}

.site-header .brand-caption {
  display: block;
  color: #66727f;
  font-size: 11px;
  margin-top: 5px;
}

.site-header .header-search {
  position: relative;
  display: flex;
}

.site-header .header-search input {
  width: 100%;
  height: 48px;
  border: 2px solid #d32f2f;
  border-radius: 11px 0 0 11px;
  padding: 0 16px;
  outline: 0;
}

.site-header .header-search input:focus {
  box-shadow: 0 0 0 3px rgba(211, 47, 47, .10);
}

.site-header .header-search button {
  min-width: 100px;
  border: 0;
  border-radius: 0 11px 11px 0;
  color: #fff;
  background: #d32f2f;
  font-weight: 800;
}

.site-header .header-contacts {
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-header .header-phone {
  white-space: nowrap;
}

.site-header .header-phone a {
  color: #263747;
  font-size: 18px;
  font-weight: 900;
}

.site-header .header-phone small {
  display: block;
  font-size: 11px;
}

.site-header .messengers {
  display: flex;
  gap: 8px;
}

.site-header .messenger {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
}

.site-header .messenger--tg {
  background: #229ed9;
}

.site-header .messenger--wa {
  background: #25d366;
}

.site-header .nav-row {
  border-top: 1px solid #e0e5ea;
}

.site-header .nav-inner {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-header .catalog-menu {
  position: relative;
}

.site-header .catalog-trigger {
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: #d32f2f;
  font-weight: 900;
}

.site-header .mega-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  width: min(1000px, calc(100vw - 40px));
  padding: 26px;
  border: 1px solid #e0e5ea;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 44px rgba(33, 46, 58, .10);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: .2s ease;
  z-index: 20;
}

.site-header .catalog-menu:hover .mega-menu,
.site-header .catalog-menu:focus-within .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.site-header .mega-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.site-header .mega-menu h4 {
  margin-bottom: 10px;
}

.site-header .mega-menu li + li {
  margin-top: 7px;
}

.site-header .mega-menu a {
  color: #66727f;
  font-size: 14px;
}

.site-header .mega-menu a:hover {
  color: #d32f2f;
}

.site-header .mega-footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e0e5ea;
  display: flex;
  gap: 24px;
}

.site-header .main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.site-header .main-nav > a {
  padding: 10px 11px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
}

.site-header .main-nav > a:hover {
  color: #d32f2f;
  background: #fff1f1;
}

.site-header .header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.site-header .header-icon {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #e0e5ea;
  border-radius: 10px;
  color: #263747;
  background: #fff;
}

.site-header .header-icon .count {
  position: absolute;
  top: -6px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  color: #fff;
  background: #d32f2f;
  font-size: 10px;
  font-weight: 800;
}

.site-header .cart-total {
  font-size: 12px;
  font-weight: 800;
  color: #263747;
  white-space: nowrap;
}

.site-header #mobile-nav-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.site-header .mobile-menu-toggle {
  display: none;
  position: relative;
  font-size: 0;
  cursor: pointer;
}

.site-header .mobile-menu-toggle::before,
.site-header .mobile-menu-toggle::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  height: 2px;
  border-radius: 99px;
  background: #263747;
  box-shadow: 0 6px 0 #263747;
}

.site-header .mobile-menu-toggle::before {
  top: 12px;
}

.site-header .mobile-menu-toggle::after {
  display: none;
}

.site-header .mobile-drawer {
  display: none;
  border-top: 1px solid #e0e5ea;
  background: #fff;
}

.site-header .mobile-drawer__inner {
  padding: 14px 0 18px;
  display: grid;
  gap: 8px;
}

.site-header .mobile-drawer a {
  padding: 11px 13px;
  border-radius: 9px;
  background: #f5f6f8;
  font-size: 14px;
  font-weight: 800;
}

.site-header .mobile-drawer a:hover {
  color: #d32f2f;
  background: #fff1f1;
}

@media (max-width: 1120px) {
  .site-header .main-header {
    grid-template-columns: 230px 1fr;
  }

  .site-header .header-contacts {
    display: none;
  }

  .site-header .main-nav > a:nth-last-child(-n+3) {
    display: none;
  }
}

@media (max-width: 900px) {
  .site-header .service-group--links {
    display: none;
  }

  .site-header .main-header {
    min-height: 78px;
    grid-template-columns: 1fr auto;
  }

  .site-header .header-search {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-bottom: 14px;
  }

  .site-header .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .site-header .nav-row {
    display: none;
  }

  .site-header .mobile-menu-toggle {
    display: grid;
    grid-column: 2;
    grid-row: 1;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid #e0e5ea;
    border-radius: 10px;
    background: #fff;
    color: #263747;
  }

  .site-header #mobile-nav-toggle:checked ~ .mobile-drawer {
    display: block;
  }
}

@media (max-width: 640px) {
  .site-header .service-bar {
    display: none;
  }

  .site-header .main-header {
    padding-top: 8px;
  }

  .site-header .brand-caption {
    display: none;
  }

  .site-header .brand-name {
    font-size: 22px;
  }

  .site-header .brand-mark {
    width: 34px;
    height: 40px;
  }

  .site-header .header-actions {
    display: none;
  }

  .site-header .header-search button {
    min-width: 72px;
  }
}
