/* =================== hc-hdr.css =================== */
/* hc-hdr — sticky site header (the one shown on every page).
   Owns: header bar, brand logo, primary nav, mega-panel under "Каталог",
   right-rail icons with their badges and tooltips, phone link, CTA button,
   and the responsive collapse to burger ≤1024px. The drawer that the burger
   opens lives in its own block (hc-mobile-menu). Strictly .hc-hdr*. */

.hc-hdr {
position: sticky;
  top: 0;
  z-index: var(--hc-z-header);
  height: var(--hc-hdr-h);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--hc-dur-base), background var(--hc-dur-base), box-shadow var(--hc-dur-base);
}
.hc-hdr__in {
display: flex;
  align-items: center;
  gap: var(--hc-sp-4);
  min-height: var(--hc-hdr-h);
  padding: var(--hc-sp-3) 0;
}
.hc-hdr__logo {
font-family: var(--hc-serif);
  font-size: var(--hc-fs-xl);
  font-weight: 500;
  color: var(--hc-ink);
  letter-spacing: var(--hc-ls-tight);
  white-space: nowrap;
  flex-shrink: 0;
}
.hc-hdr__logo b {
color: var(--hc-accent);
  font-weight: 500;
}

/* burger — hidden on desktop, shown ≤1024 (see @media block below). */
.hc-hdr__burger {
display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  background: transparent;
  border: 0.5px solid rgba(141, 109, 71, 0.18);
  border-radius: var(--hc-r-sm, 6px);
  color: var(--hc-ink, #1a1714);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.hc-hdr__burger:hover {
background: rgba(212, 184, 150, 0.10);
  border-color: rgba(141, 109, 71, 0.35);
}

/* primary nav */
.hc-hdr__nav {
display: flex;
  align-items: center;
  gap: var(--hc-sp-1);
  margin: 0 0 0 var(--hc-sp-3);
}
.hc-hdr__mega {
display: flex;
  align-items: center;
  position: relative;
}
.hc-hdr__link {
display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 37px;
  padding: var(--hc-sp-2) var(--hc-sp-3);
  border-radius: var(--hc-r-pill);
  font-size: var(--hc-fs-md);
  line-height: 1;
  color: var(--hc-ink-soft);
  transition: color var(--hc-dur-fast), background var(--hc-dur-fast);
}
.hc-hdr__link:hover, .hc-hdr__link--active {
color: var(--hc-ink);
  background: var(--hc-accent-soft);
}

/* mega-panel — drops below "Каталог". Closed by default; opens on hover
   or when the trigger gets .hc-hdr__mega--open. No: closed-state
   selector is more specific than open-state, but we order rules so open wins. */
.hc-hdr__mega-panel {
position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 560px;
  padding: var(--hc-sp-5);
  background: var(--hc-paper);
  border: 1px solid var(--hc-line);
  border-radius: var(--hc-r-lg);
  box-shadow: var(--hc-sh-3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--hc-dur-base), visibility var(--hc-dur-base), transform var(--hc-dur-base);
}
.hc-hdr__mega-panel.hc-hdr__mega--open {
opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.hc-hdr__mega-grid {
display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--hc-sp-4);
  min-width: 540px;
}

/* right-rail: icons, badges, phone, CTA */
.hc-hdr__right {
margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--hc-sp-2);
}
.hc-hdr__phone {
font-family: var(--hc-serif);
  font-size: var(--hc-fs-md);
  color: var(--hc-ink);
  margin: 0 var(--hc-sp-2);
  white-space: nowrap;
}
.hc-hdr__ico {
position: relative;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 0;
  border-radius: var(--hc-r-sm);
  background: transparent;
  color: var(--hc-ink, #1a1714);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.hc-hdr__ico:hover {
background: rgba(212, 184, 150, 0.10);
  color: var(--hc-accent-dark, #7a6548);
}
.hc-hdr__badge {
position: absolute;
  top: -6px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--hc-accent);
  color: var(--hc-paper, #ffffff);
  border-radius: var(--hc-r-pill);
  font-size: 10px;
  font-weight: 600;
  box-shadow: 0 0 0 2px var(--hc-paper);
}
/* hide the badge when count is zero — JS sets data-count / data-cart-count */
.hc-hdr [data-count="0"] .hc-hdr__count, .hc-hdr [data-cart-count="0"] {
display: none;
}

/* tooltip on icon buttons that carry an aria-label */
.hc-hdr__icon-btn, .hc-hdr__nav a[aria-label] {
position: relative;
}
.hc-hdr__icon-btn[aria-label]:hover::after, .hc-hdr__nav a[aria-label]:hover::after {
content: attr(aria-label);
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  background: var(--hc-ink, #1a1714);
  color: var(--hc-paper, #ffffff);
  font: 500 11px/1 var(--hc-sans, "Outfit", sans-serif);
  white-space: nowrap;
  border-radius: 6px;
  z-index: 100;
  pointer-events: none;
}

/* ≤1024px: collapse desktop nav, surface burger, drop phone + CTA so only
   the essential icons + cart stay in the right rail. Burger toggles
   .hc-mobile-menu (own block). */
@media (max-width: 1024px) {
  .hc-hdr__burger { display: inline-flex; }
  .hc-hdr__nav    { display: none; }
  .hc-hdr__phone  { display: none; }
  .hc-hdr__right .hc-btn { display: none; }
  .hc-hdr__right { gap: var(--hc-sp-1); }
}

/* ≤480px: tighten the bar so a small viewport doesn't crush the logo. */
@media (max-width: 480px) {
  .hc-hdr__in   { gap: var(--hc-sp-2); }
  .hc-hdr__logo { font-size: var(--hc-fs-lg); }
  /* v8.6 — at ≤420px the four-icon right-rail used to spill past edge by ~12px.
     Shrink icons to 32px and zero out gap so all four still fit inside 375px. */
  .hc-hdr__right { gap: 0; }
  .hc-hdr__ico { width: 32px; height: 32px; }
}

.hc-hdr__mega:hover .hc-hdr__mega-panel {
opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
