:root {
  --bg: #ffffff;
  --panel: #f5f5f4;
  --ink: #0a0a0a;
  --muted: #9b9b9b;
  --line: #e9e9e7;
  --rl: #c33; --m1: #36c; --rs: #ca0; --rm: #3a5;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

/* Header */
.hdr {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.hdr-in {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
}
.logo {
  text-decoration: none; color: var(--ink);
  font-size: 18px; font-weight: 800; letter-spacing: -.03em;
  text-transform: lowercase;
}
.logo b { font-weight: 800; }
.cart-btn { position: relative; padding: 6px; color: var(--ink); }
.cart-count {
  position: absolute; top: -2px; right: -4px;
  background: var(--ink); color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 17px; height: 17px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* Hero */
.hero {
  max-width: 1200px; margin: 0 auto;
  padding: 72px 20px 56px; text-align: left;
}
.hero h1 {
  font-size: clamp(38px, 8vw, 84px); line-height: .98;
  font-weight: 800; letter-spacing: -.045em; text-transform: lowercase;
  max-width: 900px;
}
.hero p {
  color: var(--muted); margin: 26px 0 34px; font-size: 16px; line-height: 1.6;
  text-transform: lowercase; max-width: 480px;
}
.btn-main {
  display: inline-block; text-decoration: none; text-align: center;
  background: var(--ink); color: #fff; font-weight: 700; font-size: 15px;
  letter-spacing: .01em; text-transform: lowercase;
  padding: 17px 36px; border-radius: 0;
  transition: background .15s, transform .1s;
}
.btn-main:active { transform: scale(.98); }
.btn-main:hover { background: #2b2b2b; }
.w100 { width: 100%; }
.trust {
  display: flex; flex-wrap: wrap; margin-top: 56px;
  border-top: 1px solid var(--line);
}
.trust-i {
  flex: 1 1 auto; padding: 16px 24px 0 0;
  font-size: 13px; color: var(--muted); text-transform: lowercase; letter-spacing: .01em;
}

/* Filters */
.catalog { max-width: 1200px; margin: 0 auto; padding: 8px 20px 72px; }
.filters {
  display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 26px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap; padding: 10px 18px; border-radius: 0;
  background: transparent; border: 1px solid var(--line);
  font-size: 13.5px; color: var(--ink); font-weight: 600;
  text-transform: lowercase; letter-spacing: .01em;
  transition: all .15s;
}
.chip:hover { border-color: var(--ink); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.hex { width: 7px; height: 7px; display: inline-block; border-radius: 50%; }
.hex-rl { background: var(--rl); } .hex-m1 { background: var(--m1); }
.hex-rs { background: var(--rs); } .hex-rm { background: var(--rm); }
.chip.active .hex { background: #fff; }

/* Grid + cards */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 14px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 40px 20px; } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: transparent; border: 0; border-radius: 0; padding: 0;
  display: flex; flex-direction: column; gap: 3px;
}
.card.hide { display: none; }
.card-visual {
  position: relative; background: var(--panel);
  aspect-ratio: 1 / 1.05;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  transition: background .2s;
}
.card:hover .card-visual { background: #efefed; }
.badge {
  position: absolute; top: 12px; left: 12px;
  font-size: 11px; font-weight: 700; color: var(--ink);
  letter-spacing: .06em; background: none; padding: 0;
}
.badge::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.badge-rl::before { background: var(--rl); } .badge-m1::before { background: var(--m1); }
.badge-rs::before { background: var(--rs); } .badge-rm::before { background: var(--rm); }
.pcs {
  position: absolute; bottom: 12px; right: 12px;
  font-size: 11px; color: var(--muted); text-transform: lowercase;
}
.code {
  font-size: clamp(20px, 3.2vw, 30px); font-weight: 800; letter-spacing: -.03em;
  text-align: center; line-height: 1.2; padding: 0 10px;
}
.name { font-size: 14px; font-weight: 600; text-transform: lowercase; }
.meta { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; text-transform: lowercase; }
.card-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.price { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.add {
  background: transparent; color: var(--ink); font-weight: 700; font-size: 13.5px;
  text-transform: lowercase; letter-spacing: .01em;
  padding: 12px; border: 1px solid var(--ink); border-radius: 0;
  transition: all .15s;
}
.add:hover { background: var(--ink); color: #fff; }
.soldout {
  text-align: center; padding: 12px; border: 1px solid var(--line); border-radius: 0;
  color: var(--muted); font-size: 13.5px; font-weight: 600; text-transform: lowercase;
}
.card:has(.soldout) .card-visual { opacity: .5; }
.card:has(.soldout) .code { color: var(--muted); }
.stepper {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--ink); color: #fff; border-radius: 0; overflow: hidden;
}
.stepper button { color: #fff; font-size: 17px; font-weight: 700; padding: 10px 18px; }
.st-qty { font-weight: 700; font-size: 14px; }

/* Footer */
.foot {
  max-width: 1200px; margin: 0 auto;
  text-align: left; padding: 56px 20px 110px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 14px;
}
.foot > div:first-child {
  color: var(--ink); font-size: clamp(24px, 4vw, 40px); font-weight: 800;
  letter-spacing: -.04em; text-transform: lowercase;
}
.foot > div:first-child b { font-weight: 800; }
.foot-sub { margin-top: 10px; font-size: 13px; line-height: 1.6; text-transform: lowercase; }
.foot-links {
  display: flex; flex-wrap: wrap; gap: 8px 28px;
  margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line);
  font-size: 13.5px;
}
.foot-links a {
  color: var(--ink); text-decoration: none; font-weight: 600;
  text-transform: lowercase; letter-spacing: .01em;
}
.foot-links a:hover { opacity: .55; }
.pay-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.pay-badge {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line); border-radius: 0; background: transparent;
  padding: 6px 14px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em;
  color: #6b6b6b;
}
.foot-req { margin-top: 28px; font-size: 12px; line-height: 1.8; color: var(--muted); }
.foot-req a { color: var(--muted); }

/* Doc pages (оферта, оплата и т.п.) */
.doc { max-width: 720px; margin: 0 auto; padding: 56px 20px 72px; line-height: 1.7; }
.doc h1 {
  font-size: clamp(30px, 6vw, 52px); margin-bottom: 14px;
  font-weight: 800; letter-spacing: -.04em; line-height: 1.02; text-transform: lowercase;
}
.doc h2 {
  font-size: 19px; margin: 40px 0 12px;
  font-weight: 800; letter-spacing: -.02em; text-transform: lowercase;
}
.doc p, .doc li { font-size: 15px; color: var(--ink); margin-bottom: 10px; }
.doc ul, .doc ol { padding-left: 20px; margin-bottom: 12px; }
.doc li { margin-bottom: 6px; }
.doc a { color: var(--ink); text-decoration-color: var(--muted); text-underline-offset: 3px; }
.doc a:hover { opacity: .6; }
.doc .pay-badges { justify-content: flex-start; margin: 4px 0 14px; }
.doc-date { color: var(--muted); font-size: 13px; }
.doc-back {
  color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600;
  text-transform: lowercase;
}
.doc-back:hover { opacity: .55; }
.agree-note { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin-top: 12px; text-align: left; }
.agree-note a { color: var(--muted); }

/* Sticky checkout bar */
.sticky-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.sticky-bar .btn-main { max-width: 560px; margin: 0 auto; display: block; }

/* Drawer */
.overlay {
  position: fixed; inset: 0; background: rgba(10,10,10,.4); z-index: 40;
  opacity: 0; transition: opacity .2s;
}
.overlay.show { opacity: 1; }
.drawer {
  position: fixed; z-index: 50; background: var(--bg);
  left: 0; right: 0; bottom: 0; max-height: 90dvh; overflow-y: auto;
  border-radius: 0; border-top: 1px solid var(--line);
  padding: 22px 20px calc(28px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .25s ease;
}
.drawer.show { transform: translateY(0); }
@media (min-width: 640px) {
  .drawer {
    left: auto; top: 0; bottom: 0; width: 440px; max-height: none;
    border-top: 0; border-left: 1px solid var(--line);
    transform: translateX(100%);
  }
  .drawer.show { transform: translateX(0); }
}
.drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 22px; margin-bottom: 20px;
  font-weight: 800; letter-spacing: -.03em; text-transform: lowercase;
}
.x { font-size: 15px; color: var(--ink); padding: 6px 10px; }
.x:hover { opacity: .55; }

.cart-items { display: flex; flex-direction: column; margin-bottom: 16px; }
.ci {
  display: flex; align-items: center; gap: 12px;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  padding: 14px 0;
}
.ci:first-child { border-top: 1px solid var(--line); }
.ci-info { flex: 1; min-width: 0; }
.ci-code { font-weight: 800; font-size: 14px; letter-spacing: -.01em; }
.ci-price { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.ci-stepper { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); }
.ci-stepper button {
  width: 32px; height: 32px; border-radius: 0; background: transparent;
  color: var(--ink); font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.ci-stepper button:hover { background: var(--panel); }
.ci-qty { font-weight: 700; min-width: 22px; text-align: center; font-size: 13.5px; }
.cart-empty { color: var(--muted); text-align: center; padding: 32px 0; text-transform: lowercase; font-size: 14px; }
.cart-total { font-size: 16px; margin: 16px 0; text-transform: lowercase; }
.cart-total b { font-weight: 800; }

/* Checkout form */
#checkoutView label {
  display: block; font-size: 12px; font-weight: 700; margin-bottom: 14px;
  text-transform: lowercase; letter-spacing: .03em; color: var(--ink);
}
#checkoutView input, #checkoutView textarea {
  display: block; width: 100%; margin-top: 6px;
  font: inherit; font-size: 16px; font-weight: 500;
  border: 1px solid var(--line); border-radius: 0;
  padding: 12px 14px; background: var(--bg); color: var(--ink);
  transition: border-color .15s;
}
#checkoutView input:focus, #checkoutView textarea:focus { outline: none; border-color: var(--ink); }
#checkoutView input::placeholder, #checkoutView textarea::placeholder { color: #c4c4c4; }
.dlv { border: 0; margin-bottom: 14px; }
.dlv legend { font-size: 12px; font-weight: 700; margin-bottom: 8px; text-transform: lowercase; letter-spacing: .03em; }
.dlv-opt {
  display: flex !important; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 0;
  padding: 12px 14px; margin-bottom: 8px !important; cursor: pointer;
  transition: border-color .15s;
}
.dlv-opt:has(input:checked) { border-color: var(--ink); background: transparent; }
.dlv-opt input { width: auto !important; margin: 0 !important; accent-color: var(--ink); }
.dlv-opt span { display: flex; flex-direction: column; }
.dlv-opt b { font-size: 14px; font-weight: 700; text-transform: lowercase; }
.dlv-opt small { color: var(--muted); font-weight: 400; font-size: 12.5px; text-transform: lowercase; }
.pay-note { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; line-height: 1.6; }
.err { color: #c22; font-size: 13.5px; margin-top: 10px; text-align: center; }

/* Success */
.success { text-align: center; padding: 28px 0; }
.success-ico {
  width: 56px; height: 56px; margin: 0 auto 18px;
  background: var(--ink); color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700;
}
.success h2 { margin-bottom: 10px; font-weight: 800; letter-spacing: -.03em; text-transform: lowercase; }
.success p { color: var(--muted); line-height: 1.7; margin-bottom: 24px; font-size: 14.5px; }
