
:root {
  color-scheme: dark;
  --bg: #111315;
  --panel: #1a1d20;
  --panel2: #22262a;
  --text: #f3f3f0;
  --muted: #9b9fa3;
  --line: #34383c;
  --accent: #872436;
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

body.cart-drawer-open,
body.detail-open { overflow: hidden; }

button, input, textarea { font: inherit; }
button { cursor: pointer; }

.topbar {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 17px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(17, 19, 21, .96);
  backdrop-filter: blur(12px);
}

.mark {
  width: 42px;
  height: 42px;
  border: 1px solid #565b60;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 24px;
  letter-spacing: -3px;
}

.mark span { color: var(--accent); }

.brand {
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 2px;
}

.tagline { font-size: 11px; color: var(--muted); }

.cart-mini {
  margin-left: auto;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  padding: 9px 11px;
  font-size: 12px;
  white-space: nowrap;
}

.cart-mini b {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
}

main {
  max-width: 720px;
  margin: auto;
  padding: 0 16px;
}

.hero {
  position: relative;
  isolation: isolate;
  padding: 35px 16px 28px;
  margin: 0 -16px;
  background:
    linear-gradient(
      180deg,
      rgba(10, 10, 12, .35),
      rgba(10, 10, 12, .55) 55%,
      #111315 100%
    ),
    url("/static/5CCF7B28-79ED-4936-93E9-E9158F6C328E.png")
      center top / cover no-repeat;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: rgba(0, 0, 0, .16);
}

.eyebrow {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.7px;
}

h1 {
  font-size: clamp(34px, 9vw, 52px);
  line-height: 1.04;
  letter-spacing: -1.9px;
  margin: 15px 0;
}

h1 span { color: var(--muted); }

.hero > p {
  color: #b8bbbe;
  max-width: 440px;
  font-size: 14px;
}

.hero-visual {
  background: transparent;
  border: 0;
  border-radius: 0;
  margin: 24px 0 18px;
  padding: 0;
  overflow: visible;
}

.hero-board-photo {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  object-position: center;
  border-radius: 12px;
}

.hero-caption {
  text-align: center;
  color: #a9b0ad;
  font-size: 9px;
  letter-spacing: 2px;
  margin-top: 15px;
}

.primary {
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 13px;
  padding: 15px 17px;
  font-weight: 800;
  min-height: 50px;
}

.primary:active { transform: scale(.99); }
.primary span { float: right; font-size: 18px; }
.primary:disabled { opacity: .5; cursor: not-allowed; }
.full { width: 100%; }

.section {
  padding: 27px 0;
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 19px;
}

h2 {
  margin: 5px 0 0;
  font-size: 24px;
  letter-spacing: -.7px;
}

.step {
  font-size: 10px;
  color: var(--muted);
  text-align: right;
}

.board-option {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
}

.board-thumb {
  width: 112px;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #282c2f;
  border-radius: 10px;
  padding: 8px;
}

.mini-board {
  width: 100%;
  height: 100%;
  aspect-ratio: 3 / 1;
  border: 1px solid #555b5d;
  border-radius: 4px;
  background-color: #191b1d;
  background-image: radial-gradient(#070809 2px, transparent 2.5px);
  background-size: 12px 12px;
  box-shadow: 0 4px 8px #0008;
}

.board-info { min-width: 0; }
.board-info h3 { font-size: 13px; margin: 0 0 4px; }
.board-info p { color: var(--muted); font-size: 11px; margin: 0 0 7px; }
.board-info strong { font-size: 17px; }

.board-choice {
  margin-top: 17px;
  display: grid;
  gap: 12px;
}

.board-choice-title {
  margin: 0 0 2px;
  color: #f4f4f5;
  font-size: 16px;
  font-weight: 600;
}

.board-choice-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 76px;
  padding: 18px;
  border: 1px solid #45464b;
  border-radius: 18px;
  background: #202023;
  color: #fff;
  cursor: pointer;
  transition: background .18s, border-color .18s;
}

.board-choice-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.board-choice-option.selected {
  background: #872436;
  border-color: #872436;
}

.choice-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 2px solid #999ba1;
  border-radius: 50%;
  color: #fff;
  font-size: 21px;
}

.board-choice-option.selected .choice-icon { border-color: #fff; }

.board-choice-option.selected .choice-icon::after {
  content: "✓";
  font-weight: 700;
  line-height: 1;
}

.choice-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.choice-copy strong {
  color: #f5f5f5;
  font-size: 16px;
  line-height: 1.35;
}

.choice-copy small {
  color: #b9bbc0;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 400;
}

.board-choice-option.selected .choice-copy small { color: #f0d8dc; }

.note {
  color: #96969d;
  font-size: 12px;
  line-height: 1.55;
  margin-top: 14px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 16px;
}

.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 18px;
  overflow: hidden;
}

.product-card .product-art {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  margin: 0;
  overflow: hidden;
  background: #191b1d;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.product-card .product-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.product-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 12px;
}

.product-content h3 {
  margin: 0 0 5px;
  min-height: 2.6em;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 700;
}

.product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 8px;
}

.price {
  color: #f5f5f5;
  font-weight: 850;
  font-size: 15px;
  white-space: nowrap;
}

.product-card .details-btn,
.product-card .catalog-add-btn {
  width: 100%;
  min-height: 40px;
  height: 40px;
  padding: 8px;
  margin-top: 9px;
  font-size: 14px;
  line-height: 1.2;
  border-radius: 10px;
  font-weight: 700;
}

.product-card .details-btn {
  color: #f5f5f5;
  background: #242628;
  border: 1px solid #414347;
}

.product-card .catalog-add-btn {
  color: #fff;
  background: #b52b43;
  border: 1px solid #b52b43;
}

.loading, .empty {
  color: var(--muted);
  padding: 20px 0;
  font-size: 13px;
}

.summary { margin-top: 5px; }
.cart-lines { margin-bottom: 17px; }

.cart-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.cart-line span:last-child {
  white-space: nowrap;
  font-weight: 700;
}

.muted { color: var(--muted); }

.total-row, .form-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 17px 0;
  border-top: 1px solid var(--line);
}

.total-row strong, .form-total strong { font-size: 24px; }

.delivery-note {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 17px;
}

.footer-note {
  border-top: 1px solid var(--line);
  text-align: center;
  padding: 30px 0 40px;
}

.footer-note p { font-size: 12px; color: #c2c4c2; }
.footer-note span { font-size: 10px; color: var(--muted); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #000b;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: 20px;
}

.modal-backdrop[hidden] { display: none; }

.modal {
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  overflow-y: auto;
  position: relative;
  background: #191c1f;
  border: 1px solid #414649;
  border-radius: 23px 23px 0 0;
  padding: 25px 19px calc(22px + env(safe-area-inset-bottom));
}

.close {
  position: absolute;
  right: 16px;
  top: 13px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 28px;
}

.modal h2 { margin: 8px 0; }
.modal > p { font-size: 12px; }

form label {
  display: block;
  margin: 15px 0;
  font-size: 12px;
}

form input, form textarea {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 13px;
  background: #101214;
  border: 1px solid #3b4145;
  border-radius: 11px;
  color: var(--text);
  outline: none;
}

form input:focus, form textarea:focus { border-color: var(--accent); }
.tiny { color: var(--muted); font-size: 10px; }

.result {
  background: #242a21;
  border-radius: 12px;
  padding: 15px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  bottom: 18px;
  left: 16px;
  right: 16px;
  background: #f1f3ed;
  color: #141613;
  padding: 13px;
  border-radius: 12px;
  z-index: 30;
  text-align: center;
  font-size: 12px;
}

.toast[hidden] { display: none; }

/* Карточка товара */

#productDetail {
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow-y: auto;
  padding: 12px;
  background: rgba(0, 0, 0, .94);
  color: #f5f5f5;
}

#productDetail[hidden] { display: none !important; }

.detail-panel {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #343638;
  border-radius: 18px;
  background: #151719;
}

.detail-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .75);
  color: white;
  font-size: 25px;
}

.detail-main-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #202023;
}

.detail-main-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.detail-body { padding: 18px; }

.detail-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  font-size: 21px;
  font-weight: 700;
}

.detail-price { color: #f05269; white-space: nowrap; }
.detail-description { color: #b9bbc0; line-height: 1.55; margin: 14px 0; }
.detail-section-title { font-weight: 700; margin: 20px 0 12px; }
.detail-feature { margin: 10px 0; color: #d0d0d4; }
.detail-feature::before { content: "✓ "; color: #f05269; }

.detail-spec {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid #303236;
  color: #b9bbc0;
}

.detail-spec strong { color: #eee; text-align: right; }

.detail-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid #303236;
  background: #151719;
}

.detail-purchase-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-quantity { display: flex; align-items: center; gap: 12px; }

.detail-quantity button {
  width: 44px;
  height: 44px;
  border: 1px solid #444;
  border-radius: 12px;
  background: #222;
  color: white;
  font-size: 22px;
}

.detail-quantity strong { min-width: 20px; text-align: center; }
.detail-unit-price { color: #a8a8a8; font-size: 13px; white-space: nowrap; }

.detail-add {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 12px;
  background: #b52b43;
  color: white;
  font-size: 15px;
  font-weight: 700;
}

/* Боковая корзина */

#cartDrawerOverlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, .62);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s, visibility .22s;
}

#cartDrawerOverlay.open { opacity: 1; visibility: visible; }
#cartDrawerOverlay[hidden] { display: none !important; }

#cartDrawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(440px, 92vw);
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #151719;
  border-left: 1px solid #343638;
  transform: translateX(100%);
  transition: transform .25s ease;
  padding-bottom: env(safe-area-inset-bottom);
}

#cartDrawerOverlay.open #cartDrawer { transform: translateX(0); }

.cart-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  border-bottom: 1px solid #343638;
}

.cart-drawer-title { font-size: 20px; font-weight: 800; }

.cart-drawer-title span {
  display: inline-grid;
  place-items: center;
  min-width: 25px;
  height: 25px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
}

.cart-drawer-close {
  width: 38px;
  height: 38px;
  border: 1px solid #343638;
  border-radius: 50%;
  background: #22262a;
  color: #fff;
  font-size: 24px;
}

.cart-drawer-lines { overflow: auto; flex: 1; padding: 16px; }

.cart-drawer-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #303236;
}

.cart-drawer-item-main { flex: 1; min-width: 0; }

.cart-drawer-item-name {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.cart-drawer-item-price { margin-top: 5px; color: var(--muted); font-size: 12px; }

.cart-drawer-line-total {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 13px;
}

.cart-qty-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.cart-qty-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #41464b;
  border-radius: 10px;
  background: #24282c;
  color: #fff;
  font-size: 21px;
  line-height: 1;
}

.cart-qty-value { min-width: 18px; text-align: center; font-size: 14px; font-weight: 700; }

.cart-remove {
  border: 0;
  background: transparent;
  color: #d28a96;
  padding: 7px 2px;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cart-board-fixed { color: var(--muted); font-size: 12px; padding: 0 4px; }

.cart-empty { padding: 24px 8px; text-align: center; color: var(--muted); }
.cart-empty p { margin: 0 0 5px; color: var(--text); font-weight: 700; }
.cart-empty span { font-size: 12px; }

.cart-drawer-foot {
  padding: 18px;
  border-top: 1px solid #343638;
  background: #151719;
}

.cart-drawer-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 14px;
}

#cartDrawerCheckout:disabled { opacity: .5; cursor: not-allowed; }

@media (min-width: 560px) {
  main { padding: 0 25px; }
  .hero { padding-top: 50px; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .modal { border-radius: 23px; margin-bottom: 20px; }
  .modal-backdrop { align-items: center; }
}

@media (max-width: 480px) {
  .product-card .details-btn,
  .product-card .catalog-add-btn {
    height: 38px;
    min-height: 38px;
    font-size: 13px;
  }

  .board-choice-option { padding: 15px; }
  .choice-copy strong { font-size: 15px; }
}

@media (max-width: 380px) {
  .cart-drawer-head, .cart-drawer-foot { padding-left: 14px; padding-right: 14px; }
  .cart-drawer-lines { padding: 12px; }
  .cart-drawer-line { gap: 8px; }
  .cart-drawer-line-total { font-size: 12px; }
}
