/* ============================================
   IZIHOME · STICKY HEADER (общий для всех страниц)
   Источник: /assets/partials/header.html
   Инжектится: /assets/js/header.js (или build/inline-partials.mjs в prod)
   Зависит от CSS-переменных: --mint, --mint-deep, --mint-soft, --mint-border,
   --bg-info, --bg-block, --bg-elevated, --border-subtle, --border-default,
   --text-primary, --text-secondary, --text-tertiary, --text-inverse.
   ============================================ */

.site-header,
.nav-drawer,
.drawer-backdrop {
  --header-h-mobile: 56px;
  --header-h-desktop: 64px;
  --drawer-w: min(88vw, 380px);
  --ease-apple: cubic-bezier(.22, .61, .36, 1);
}

/* Защита горизонтального переполнения. */
html, body { overflow-x: clip; }

/* Шапка фиксируется к viewport, поэтому резервируем под неё высоту
   на body — иначе контент уйдёт под шапку. scroll-padding-top нужен,
   чтобы переход по якорям (#section) не уезжал под шапку. */
html { scroll-padding-top: 56px; }
body { padding-top: 56px; }
@media (min-width: 1024px) {
  html { scroll-padding-top: 64px; }
  body { padding-top: 64px; }
}

/* Placeholder до инжекта header.html — занимает то же место, что
   и реальная шапка, чтобы первый кадр не дёргался. */
#site-header:empty {
  display: block;
  height: 56px;
  background: rgba(10, 14, 13, 0.85);
  border-bottom: 0.5px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}
@media (min-width: 1024px) {
  #site-header:empty { height: 64px; }
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 14, 13, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 0.5px solid var(--border-subtle);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 56px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
@media (min-width: 1024px) {
  .header-inner {
    height: 64px;
    padding: 0 24px;
    gap: 16px;
    justify-content: space-between;
  }
}

.site-header .logo {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.018em;
  color: var(--text-primary);
  text-decoration: none;
  margin-right: auto;
}
.site-header .logo span { color: var(--mint); }
@media (min-width: 1024px) {
  .site-header .logo { font-size: 17px; margin-right: 0; }
}

.main-nav { display: none; gap: 2px; align-items: center; }
@media (min-width: 1024px) { .main-nav { display: flex; } }

.nav-item { position: relative; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--text-secondary);
  border-radius: 7px;
  transition: color 180ms ease, background 180ms ease;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}

.nav-link--toggle {
  background: transparent;
  border: 0;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: inherit;
}

.nav-link:hover,
.nav-link.is-active,
.nav-item:hover > .nav-link,
.nav-item:focus-within > .nav-link,
.nav-item.is-open > .nav-link {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.nav-link .caret {
  font-size: 9px;
  opacity: 0.5;
  transition: transform 180ms ease, opacity 180ms ease;
}
.nav-item:hover > .nav-link .caret,
.nav-item:focus-within > .nav-link .caret,
.nav-item.is-open > .nav-link .caret,
.nav-link--toggle[aria-expanded="true"] .caret {
  transform: rotate(180deg);
  opacity: 1;
}
.nav-item::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 8px;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 280px;
  padding: 8px;
  background: rgba(15, 20, 18, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 0.5px solid var(--border-default);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 255, 178, 0.04);
  display: flex;
  flex-direction: column;
  gap: 1px;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 110;
}
.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.nav-dropdown a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--text-secondary);
  border-radius: 7px;
  transition: color 180ms ease, background 180ms ease;
  white-space: nowrap;
  text-decoration: none;
}
.nav-dropdown a:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}
.nav-dropdown .dim {
  font-size: 11.5px;
  color: var(--text-tertiary);
  font-weight: 400;
  margin-left: auto;
}

.header-right { display: flex; align-items: center; gap: 6px; }
@media (min-width: 1024px) { .header-right { gap: 8px; } }

.header-cta {
  display: none;
  padding: 8px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #0A0E0D;
  background: var(--mint);
  border: 0;
  transition: background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
@media (min-width: 1024px) {
  .header-cta { display: inline-flex; align-items: center; }
}
.header-cta:hover {
  background: #00ffc6;
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(0, 255, 178, 0.25);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg-block);
  border: 0.5px solid var(--border-default);
  color: var(--text-secondary);
  transition: border-color 180ms ease, background 180ms ease;
  text-decoration: none;
  flex: 0 0 auto;
}

/* ───────── Ghost CTA (mobile only) ─────────
   Невидимая кнопка под цвет шапки. По контуру время от времени
   пробегает мятный огонёк — мягко привлекает внимание, не давит. */
.header-cta-ghost {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 11px;
  margin: 0;
  background: var(--bg-block);
  border: 0.5px solid var(--border-default);
  border-radius: 9px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.003em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 180ms ease, background 180ms ease;
  flex: 0 1 auto;
  min-width: 0;
}
@media (min-width: 1024px) { .header-cta-ghost { display: none; } }
@media (max-width: 359.98px) { .header-cta-ghost { padding: 0 9px; font-size: 12px; } }

.header-cta-ghost:active { background: var(--bg-elevated); }

.header-cta-ghost__label { position: relative; z-index: 2; }

/* Огонёк по контуру: вращающийся конический градиент,
   маскированный под тонкую рамку через ::after с фоном кнопки. */
.header-cta-ghost::before {
  content: "";
  position: absolute;
  inset: -120%;
  z-index: 0;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 300deg,
    rgba(0, 255, 178, 0.45) 332deg,
    #00ffd0 345deg,
    rgba(0, 255, 178, 0.45) 352deg,
    transparent 360deg
  );
  animation: header-cta-ghost-runner 7s linear infinite;
  pointer-events: none;
  will-change: transform, opacity;
}
.header-cta-ghost::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: 1;
  background: var(--bg-block);
  border-radius: inherit;
  pointer-events: none;
}

@keyframes header-cta-ghost-runner {
  0%, 70%   { transform: rotate(0turn); opacity: 0; }
  72%       { opacity: 1; }
  98%       { opacity: 1; }
  100%      { transform: rotate(1turn); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .header-cta-ghost::before { animation: none; opacity: 0; }
}
.icon-btn.wa { color: #25D366; border-color: rgba(37, 211, 102, 0.30); }
.icon-btn.tg { color: #2BA8E0; border-color: rgba(43, 168, 224, 0.30); }
.icon-btn:hover { border-color: var(--mint-border); }
.icon-btn svg { width: 16px; height: 16px; }

/* ───────── Бургер (mobile only, слева) ───────── */
.nav-burger {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  background: transparent;
  border: 0;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0;
  margin-left: -6px;
  border-radius: 8px;
  font-family: inherit;
  transition: background 160ms ease;
}
.nav-burger:hover { background: var(--bg-elevated); }
.nav-burger .bars {
  width: 20px; height: 14px; position: relative;
  display: block;
}
.nav-burger .bars span {
  position: absolute; left: 0; right: 0; height: 2px;
  background: currentColor; border-radius: 1px;
  transition: transform 240ms var(--ease-apple),
              top 240ms var(--ease-apple),
              opacity 160ms ease;
}
.nav-burger .bars span:nth-child(1) { top: 0; }
.nav-burger .bars span:nth-child(2) { top: 6px; }
.nav-burger .bars span:nth-child(3) { top: 12px; }
.nav-burger[aria-expanded="true"] .bars span:nth-child(1) {
  top: 6px; transform: rotate(45deg);
}
.nav-burger[aria-expanded="true"] .bars span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] .bars span:nth-child(3) {
  top: 6px; transform: rotate(-45deg);
}
@media (min-width: 1024px) { .nav-burger { display: none; } }

/* ───────── DRAWER (slide from left, mobile only) ───────── */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms var(--ease-apple);
  z-index: 200;
}
.drawer-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--drawer-w);
  height: 100vh;
  height: 100dvh;
  background: #0C1110;
  border-right: 0.5px solid var(--border-default, rgba(255, 255, 255, 0.10));
  transform: translateX(-100%);
  transition: transform 280ms var(--ease-apple);
  z-index: 201;
  display: flex;
  flex-direction: column;
  box-shadow: 8px 0 40px rgba(0, 0, 0, 0.5);
}
.nav-drawer.is-open { transform: translateX(0); }
@media (min-width: 1024px) {
  .nav-drawer, .drawer-backdrop { display: none !important; }
}

.drawer-top {
  flex: 0 0 auto;
  height: 56px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 0.5px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
}
.drawer-close {
  width: 40px; height: 40px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  background: transparent; border: 0;
  color: var(--text-primary, #F0F0EC);
  border-radius: 8px;
  cursor: pointer;
  margin-left: -6px;
  padding: 0;
  font-family: inherit;
  transition: background 160ms ease;
}
.drawer-close:hover { background: var(--bg-elevated, #161B20); }
.drawer-close svg { width: 18px; height: 18px; }
.drawer-top .logo { font-size: 16px; color: var(--text-primary, #F0F0EC); }
.drawer-top .logo span { color: var(--mint, #00FFB2); }

.drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 0 24px;
  -webkit-overflow-scrolling: touch;
}

.drawer-section { padding: 16px 16px 8px; }
.drawer-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-tertiary, #6B7A78);
  padding: 0 8px 8px;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 10px 16px;
  color: var(--text-primary, #F0F0EC);
  text-decoration: none;
  position: relative;
  transition: background 140ms ease;
}
.drawer-link:active { background: var(--bg-elevated, #161B20); }
.drawer-link.is-active { background: var(--mint-soft, rgba(0, 255, 178, 0.10)); }
.drawer-link.is-active::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px; width: 3px;
  background: var(--mint, #00FFB2);
  border-radius: 0 2px 2px 0;
}
.drawer-link.is-active .drawer-link-label { color: var(--mint, #00FFB2); }

.drawer-link-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--bg-block, #11161A);
  border: 0.5px solid var(--border-default, rgba(255, 255, 255, 0.10));
  display: grid; place-items: center;
  flex: 0 0 auto;
  color: var(--text-secondary, #B0B8B5);
}
.drawer-link.is-active .drawer-link-icon {
  color: var(--mint, #00FFB2);
  border-color: var(--mint-border, rgba(0, 255, 178, 0.30));
  background: var(--mint-soft, rgba(0, 255, 178, 0.10));
}
.drawer-link-icon svg { width: 16px; height: 16px; }

.drawer-link-label {
  flex: 1 1 auto;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary, #F0F0EC);
}
.drawer-link-meta {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary, #6B7A78);
  padding: 3px 8px;
  background: var(--bg-block, #11161A);
  border: 0.5px solid var(--border-default, rgba(255, 255, 255, 0.10));
  border-radius: 999px;
  min-width: 32px;
  text-align: center;
}
.drawer-link-badge {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mint, #00FFB2);
  padding: 3px 7px;
  background: var(--mint-soft, rgba(0, 255, 178, 0.10));
  border: 0.5px solid var(--mint-border, rgba(0, 255, 178, 0.30));
  border-radius: 6px;
}
.drawer-link-arrow {
  flex: 0 0 auto;
  color: var(--text-tertiary, #6B7A78);
  font-size: 16px;
  line-height: 1;
}

/* ───── Вложенные пункты под .drawer-link (mobile catalog children) ───── */
.drawer-sublist {
  position: relative;
  margin: -2px 0 8px 32px; /* 32px = центр иконки родителя относительно секции */
  padding-left: 18px;
  border-left: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.drawer-sublink {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px 8px 4px;
  color: var(--text-primary, #F0F0EC);
  text-decoration: none;
  position: relative;
  border-radius: 7px;
  transition: background 140ms ease;
}
.drawer-sublink::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 50%;
  width: 12px;
  height: 1px;
  background: var(--border-default, rgba(255, 255, 255, 0.10));
  transition: background 140ms ease;
}
.drawer-sublink:active { background: var(--bg-elevated, #161B20); }

.drawer-sublink-label {
  flex: 1 1 auto;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary, #F0F0EC);
  letter-spacing: -0.005em;
}
.drawer-sublink-arrow {
  flex: 0 0 auto;
  color: var(--text-tertiary, #6B7A78);
  font-size: 16px;
  line-height: 1;
}

.drawer-sublink.is-active .drawer-sublink-label { color: var(--mint, #00FFB2); }
.drawer-sublink.is-active::before { background: var(--mint, #00FFB2); }
.drawer-sublink.is-active .drawer-sublink-arrow { color: var(--mint, #00FFB2); }

.drawer-foot {
  flex: 0 0 auto;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg,
    transparent,
    rgba(10, 14, 13, 0.95) 40%,
    rgba(10, 14, 13, 1));
  border-top: 0.5px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
}
.drawer-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 14px 16px;
  background: var(--mint, #00FFB2);
  color: #0A0E0D;
  font-size: 15px;
  font-weight: 700;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 0 24px rgba(0, 255, 178, 0.15);
}
.drawer-cta:active {
  background: var(--mint-deep, #00C68C);
  transform: translateY(1px);
}
.drawer-socials {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.drawer-social {
  flex: 1 1 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-block, #11161A);
  border: 0.5px solid var(--border-default, rgba(255, 255, 255, 0.10));
  border-radius: 10px;
  color: var(--text-secondary, #B0B8B5);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: border-color 160ms ease;
}
.drawer-social.wa { color: #25D366; border-color: rgba(37, 211, 102, 0.30); }
.drawer-social.tg { color: #2BA8E0; border-color: rgba(43, 168, 224, 0.30); }
.drawer-social.tel { color: var(--text-primary, #F0F0EC); }
.drawer-social svg { width: 16px; height: 16px; flex: 0 0 auto; }

body.drawer-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .nav-drawer, .drawer-backdrop, .nav-burger .bars span { transition: none; }
}
