/**
 * Nuclear Swiss / «Сценарии» overrides for /kupit-steklo/
 * Loaded LAST. Kill orange/peach Place selection language.
 */
.page-kupit-steklo,
.page-kupit-steklo main {
  --blue: #070d12 !important;
  --orange: #070d12 !important;
  --brand-orange: #ee791c; /* keep only for rare eyebrow */
  --accent-soft: #fff !important;
  --accent-dim: transparent !important;
}

/* Type toggle Стекло/Зеркало */
.page-kupit-steklo .tabs {
  background: #e8eef5 !important;
  border: 1px solid #d5dee9 !important;
  border-radius: 999px !important;
  padding: 4px !important;
}
.page-kupit-steklo .tabs button {
  background: transparent !important;
  color: #070d12 !important;
  border: 0 !important;
  border-radius: 999px !important;
  box-shadow: none !important;
}
.page-kupit-steklo .tabs button.selected {
  background: #070d12 !important;
  color: #fff !important;
  box-shadow: none !important;
  font-weight: 600 !important;
}

/* Subtype chips — NEVER white text on peach */
.page-kupit-steklo .chip,
.page-kupit-steklo .material-kinds .chip {
  background: #fff !important;
  color: #070d12 !important;
  border: 1px solid #d5dee9 !important;
  border-radius: 999px !important;
  box-shadow: none !important;
}
.page-kupit-steklo .chip.selected,
.page-kupit-steklo .material-kinds .chip.selected,
.page-kupit-steklo button.chip.selected {
  background: #070d12 !important;
  color: #ffffff !important;
  border-color: #070d12 !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Material / shape / construction cards */
.page-kupit-steklo .material-card,
.page-kupit-steklo .construction-card,
.page-kupit-steklo .shape,
.page-kupit-steklo .shape-menu-card,
.page-kupit-steklo .pattern,
.page-kupit-steklo .option,
.page-kupit-steklo .paint-color {
  background: #ffffff !important;
  color: #070d12 !important;
  border: 1px solid #d5dee9 !important;
  box-shadow: none !important;
}
.page-kupit-steklo .material-card.selected,
.page-kupit-steklo .construction-card.selected,
.page-kupit-steklo .shape.selected,
.page-kupit-steklo .shape-menu-card.selected,
.page-kupit-steklo .pattern.selected,
.page-kupit-steklo .option.selected,
.page-kupit-steklo .paint-color.selected,
.page-kupit-steklo .hole.active,
.page-kupit-steklo .corner.active {
  background: #ffffff !important;
  border: 1.5px solid #070d12 !important;
  box-shadow: none !important;
}

/* Material selected: DOM ✓ badge (theme-safe); kill broken :after letters */
.page-kupit-steklo .material-card .material-check {
  position: absolute !important;
  right: 9px !important;
  top: 9px !important;
  width: 21px !important;
  height: 21px !important;
  border-radius: 50% !important;
  background: #070d12 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font: 700 12px/21px Arial, Helvetica, sans-serif !important;
  text-align: center !important;
  line-height: 21px !important;
  z-index: 2 !important;
  pointer-events: none !important;
}
.page-kupit-steklo .material-card.selected:after {
  content: none !important;
  display: none !important;
  background: none !important;
  background-image: none !important;
}

.page-kupit-steklo .option.selected .radio {
  border-color: #070d12 !important;
  border-width: 5px !important;
}
.page-kupit-steklo .option.selected .radio:after {
  background: #070d12 !important;
}

/* Stepper */
.page-kupit-steklo #steps,
.page-kupit-steklo nav#steps {
  background: #fff !important;
  border: 1px solid #d5dee9 !important;
  box-shadow: none !important;
}
.page-kupit-steklo #steps button,
.page-kupit-steklo nav#steps button {
  background: transparent !important;
  color: #4a667d !important;
}
.page-kupit-steklo #steps button.active,
.page-kupit-steklo nav#steps button.active {
  background: #070d12 !important;
  color: #ffffff !important;
}

/* Primary CTA */
.page-kupit-steklo .primary,
.page-kupit-steklo button.primary {
  background: #070d12 !important;
  color: #ffffff !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 999px !important;
}
.page-kupit-steklo .primary:hover {
  background: #122433 !important;
}

.page-kupit-steklo .secondary {
  background: #fff !important;
  color: #070d12 !important;
  border: 1px solid #070d12 !important;
  border-radius: 999px !important;
}

/* Panels */
.page-kupit-steklo .settings,
.page-kupit-steklo .preview,
.page-kupit-steklo .modal-inner {
  background: #fff !important;
  border: 1px solid #d5dee9 !important;
  box-shadow: none !important;
}

/* Kill leftover orange accents in calc UI */
.page-kupit-steklo .step-label,
.page-kupit-steklo .preview-head > span,
.page-kupit-steklo .bottom-info > div > span {
  color: #4a667d !important;
}
.page-kupit-steklo .eyebrow {
  color: #4a667d !important;
}
.page-kupit-steklo h1 span {
  color: #070d12 !important;
}
.page-kupit-steklo .msm-calc-cart {
  border-color: #d5dee9 !important;
  background: #fff !important;
  color: #070d12 !important;
}
.page-kupit-steklo .msm-calc-cart:hover {
  border-color: #070d12 !important;
  background: #e8eef5 !important;
}
.page-kupit-steklo .stack-film,
.page-kupit-steklo .construction-legend i {
  background: #4a667d !important;
}
.page-kupit-steklo .badge {
  background: #e8eef5 !important;
  color: #4a667d !important;
}
.page-kupit-steklo .number-control:focus-within,
.page-kupit-steklo input:focus,
.page-kupit-steklo select:focus,
.page-kupit-steklo textarea:focus {
  border-color: #070d12 !important;
  box-shadow: 0 0 0 3px rgba(7, 13, 18, 0.1) !important;
  outline: none !important;
}

/* ========== Mobile UI harden (≤1280 / ≤768 / ≤640 / ≤390) ========== */
html:has(body.page-kupit-steklo),
body.page-kupit-steklo {
  overflow-x: hidden;
  max-width: 100%;
}
body.page-kupit-steklo {
  overflow-x: clip;
  width: 100%;
}

body.page-kupit-steklo > header.site-header {
  color: var(--ink-1000, #070d12) !important;
  background: color-mix(in srgb, var(--paper-1000, #fff) 92%, transparent);
  border-bottom-color: var(--paper-800, #d5dee9);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}

body.page-kupit-steklo > header.site-header.is-scrolled {
  background: color-mix(in srgb, var(--paper-1000, #fff) 88%, transparent);
}

/* Place style.css `nav{}` must not restyle site chrome / drawer */
body.page-kupit-steklo > header.site-header nav.primary-nav,
body.page-kupit-steklo .mobile-drawer > nav {
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  overflow: visible !important;
}

@media (max-width: 1280px) {
  body.page-kupit-steklo > header.site-header .primary-nav {
    display: none !important;
  }

  body.page-kupit-steklo .mobile-drawer {
    width: 100% !important;
    max-width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  body.page-kupit-steklo .mobile-drawer > nav,
  body.page-kupit-steklo .mobile-drawer .mobile-drawer__list,
  body.page-kupit-steklo .mobile-drawer .mobile-drawer__footer {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* —— Tablet / mobile chrome ≤1280: no KalkChat (matches mobile-megamenu MQ) —— */
@media (max-width: 1280px) {
  body.page-kupit-steklo .kp-chat-root,
  body.page-kupit-steklo [class*='kp-chat'],
  body.page-kupit-steklo [id*='kp-chat'],
  body.page-kupit-steklo iframe[src*='kalkplace'],
  body.page-kupit-steklo iframe[src*='kalkchat'] {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
  }
}

/* —— Mobile ≤768: calculator-only, no chat FAB, no horizontal scroll —— */
@media (max-width: 768px) {
  body.page-kupit-steklo {
    padding-top: 4.75rem;
    padding-bottom: calc(148px + env(safe-area-inset-bottom, 0px));
  }

  html:has(body.page-kupit-steklo) {
    scroll-padding-bottom: calc(148px + env(safe-area-inset-bottom, 0px));
  }

  /* Decorative / SEO chrome stays in HTML for desktop + crawlers */
  body.page-kupit-steklo .desktop-only,
  body.page-kupit-steklo .intro .eyebrow,
  body.page-kupit-steklo .intro-note,
  body.page-kupit-steklo .bottom-info,
  body.page-kupit-steklo .msm-bridge,
  body.page-kupit-steklo .msm-faq,
  body.page-kupit-steklo .step-label,
  body.page-kupit-steklo .helper,
  body.page-kupit-steklo .subtitle,
  body.page-kupit-steklo .site-footer__big,
  body.page-kupit-steklo .construction-card small,
  body.page-kupit-steklo .construction-legend,
  body.page-kupit-steklo .material-card small,
  body.page-kupit-steklo .chosen-material > p,
  body.page-kupit-steklo .chosen-material > small,
  body.page-kupit-steklo .option small,
  body.page-kupit-steklo .nav-bottom > .helper {
    display: none !important;
  }

  /* Side preview causes dual-column feel + SVG overflow; чертёж via sticky CTA */
  body.page-kupit-steklo .preview {
    display: none !important;
  }

  /* Cart sits in header row left of burger */
  body.page-kupit-steklo .msm-calc-cart {
    top: max(0.7rem, env(safe-area-inset-top, 0px)) !important;
    right: calc(44px + max(1rem, env(safe-area-inset-right, 0px)) + 0.75rem) !important;
    z-index: 115 !important;
    padding: 0.45rem 0.65rem !important;
    font-size: 0.62rem !important;
    letter-spacing: 0.04em !important;
    box-shadow: 0 6px 18px -12px rgba(7, 13, 18, 0.35) !important;
  }

  body.page-kupit-steklo > header.site-header.is-scrolled ~ .msm-calc-cart {
    top: max(0.5rem, env(safe-area-inset-top, 0px)) !important;
  }

  body.page-kupit-steklo > header.site-header,
  body.page-kupit-steklo > header.site-header .site-header__inner,
  body.page-kupit-steklo > header.site-header .container {
    max-width: 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  body.page-kupit-steklo main {
    margin-left: 12px !important;
    margin-right: 12px !important;
    max-width: none !important;
    width: auto !important;
    padding-top: 0.55rem !important;
    overflow-x: hidden;
    min-width: 0;
  }

  body.page-kupit-steklo .intro {
    padding-right: 0 !important;
    margin-bottom: 10px !important;
    gap: 0 !important;
  }

  body.page-kupit-steklo h1 {
    font-size: clamp(1.35rem, 6.5vw, 1.75rem) !important;
    line-height: 1.12 !important;
    margin: 0 !important;
  }

  body.page-kupit-steklo #steps,
  body.page-kupit-steklo nav#steps {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 10px !important;
    gap: 0 !important;
  }

  body.page-kupit-steklo #steps::-webkit-scrollbar {
    display: none;
  }

  body.page-kupit-steklo #steps button,
  body.page-kupit-steklo nav#steps button {
    min-width: 0 !important;
    flex: 1 1 0 !important;
    padding: 8px 2px !important;
    font-size: 9px !important;
    gap: 3px !important;
  }

  body.page-kupit-steklo .workspace {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: 1fr !important;
  }

  body.page-kupit-steklo .settings {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 14px 12px 16px !important;
    overflow-x: hidden;
  }

  body.page-kupit-steklo .shape-entry {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  body.page-kupit-steklo .row,
  body.page-kupit-steklo .primary-sizes,
  body.page-kupit-steklo .extra-sizes {
    grid-template-columns: 1fr !important;
    min-width: 0 !important;
  }

  body.page-kupit-steklo .field,
  body.page-kupit-steklo .unit,
  body.page-kupit-steklo .number-control {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body.page-kupit-steklo .number-control {
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  body.page-kupit-steklo .number-control input,
  body.page-kupit-steklo .unit input,
  body.page-kupit-steklo input[type='number'],
  body.page-kupit-steklo select,
  body.page-kupit-steklo textarea {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  body.page-kupit-steklo .unit:has(.number-control) {
    width: 100% !important;
    max-width: 100% !important;
    gap: 6px !important;
  }

  body.page-kupit-steklo .unit:has(.number-control) > span {
    flex-shrink: 0;
    font-size: 11px !important;
  }

  body.page-kupit-steklo .quantity-field {
    max-width: none !important;
    width: 100% !important;
  }

  body.page-kupit-steklo .material-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body.page-kupit-steklo .construction-grid,
  body.page-kupit-steklo .paint-colors,
  body.page-kupit-steklo .laminate-layers {
    grid-template-columns: 1fr !important;
  }

  body.page-kupit-steklo .ral-row {
    grid-template-columns: 56px minmax(0, 1fr) !important;
  }

  body.page-kupit-steklo #mobileTools {
    z-index: 50 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    gap: 8px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  body.page-kupit-steklo #mobileTools .mobile-total {
    flex: 1 1 auto;
    min-width: 0;
  }

  body.page-kupit-steklo #mobileTools .mobile-total strong {
    font-size: 17px !important;
  }

  body.page-kupit-steklo #mobileTools .mobile-actions {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    margin-left: 0 !important;
    flex: 0 0 auto;
  }

  body.page-kupit-steklo #mobileTools .mobile-actions button {
    white-space: nowrap;
    min-height: 42px !important;
    padding: 8px 11px !important;
  }

  body.page-kupit-steklo .scroll-top {
    bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 48 !important;
  }

  body.page-kupit-steklo:has(#mobileTools:not([hidden])) .scroll-top {
    bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Mega panels portaled to body — never paint / never force 100vw scroll */
  body.page-kupit-steklo .mega-menu,
  body.page-kupit-steklo .mega-menu--v2,
  body.page-kupit-steklo > .mega-menu--v2 {
    display: none !important;
    width: 0 !important;
    max-width: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body.page-kupit-steklo .modal {
    z-index: 320 !important;
  }

  body.page-kupit-steklo > footer.site-footer {
    max-width: 100% !important;
    overflow-x: hidden;
    width: 100% !important;
  }

  body.page-kupit-steklo .shape-menu-modal .modal-inner {
    width: calc(100% - 20px) !important;
    max-width: 100% !important;
  }
}

@media (max-width: 390px) {
  body.page-kupit-steklo .msm-calc-cart {
    padding: 0.4rem 0.55rem !important;
    font-size: 0.58rem !important;
  }

  body.page-kupit-steklo #steps button,
  body.page-kupit-steklo nav#steps button {
    font-size: 8px !important;
    padding: 8px 2px !important;
    gap: 4px !important;
  }

  body.page-kupit-steklo .shape-entry .shape {
    min-height: 96px !important;
    font-size: 11px !important;
    padding: 10px 6px !important;
  }
}

@media (max-width: 320px) {
  body.page-kupit-steklo main {
    margin-left: 8px !important;
    margin-right: 8px !important;
    max-width: none !important;
  }

  body.page-kupit-steklo .msm-calc-cart span {
    padding: 0.1rem 0.3rem !important;
  }

  body.page-kupit-steklo #mobileTools {
    padding-left: 8px !important;
  }

  body.page-kupit-steklo #mobileTools .mobile-total strong {
    font-size: 16px !important;
  }
}
