/* D3X Shop — стиль в палитре d3x-3d.ru (assets/d3x.css): тёмный фон, оранжевый акцент #ff5b1f,
   Space Grotesk для заголовков, Inter для текста, логотип «D» на оранжевой плашке. */
:root {
  color-scheme: dark;
  --bg: #07070a;
  --bg-2: #101016;
  --surface: #14141c;
  --surface-2: #1a1a24;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f5f5f7;
  --text-muted: #9a9aa8;
  --text-dim: #6a6a78;
  --d3x: #ff5b1f;
  --d3x-2: #ff9a55;
  --neon: #ff7a3d;
  --success: #2ee6a6;
  --danger: #ff4d6a;
  --warn: #ffc24d;
  --radius: 18px;
  --radius-sm: 10px;
  --container: 1240px;
  --font-display: "Space Grotesk", Inter, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* атрибут hidden сильнее любых display у классов */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  font-family: Inter, system-ui, -apple-system, sans-serif; font-size: 16px; line-height: 1.5;
  color: var(--text); -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(60% 50% at 80% 0%, rgba(255,91,31,.10), transparent 60%),
    radial-gradient(50% 50% at 0% 40%, rgba(60,90,255,.07), transparent 60%),
    radial-gradient(70% 50% at 50% 100%, rgba(255,91,31,.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 .5em; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.accent { color: var(--d3x); }
.text-gradient {
  background: linear-gradient(100deg, #fff 0%, var(--d3x-2) 55%, var(--d3x) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---- шапка ---- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(7,7,10,.78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar .container { display: flex; align-items: center; gap: 16px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 900; }
.logo-mark {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: var(--d3x); color: #000; font-size: 24px; letter-spacing: -0.04em;
  box-shadow: 0 8px 24px -6px rgba(255,91,31,.6), inset 0 1px 0 rgba(255,255,255,.25);
}
.logo-text { font-size: 22px; letter-spacing: -0.04em; }
.logo-text small { font-size: 13px; font-weight: 600; color: var(--text-muted); letter-spacing: 0; margin-left: 6px; }
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a { padding: 8px 12px; border-radius: 999px; font-size: 14px; color: var(--text-muted); }
.nav a:hover, .nav a.active { color: var(--text); background: var(--surface-2); }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; min-width: 42px; padding: 0 14px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: 14px; font-weight: 600;
}
.icon-btn:hover { border-color: var(--border-strong); }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--d3x); color: #000;
  font-size: 12px; font-weight: 800; display: inline-grid; place-items: center;
}
.badge[hidden] { display: none; }

/* ---- кнопки, поля ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font: 700 15px/1 Inter, sans-serif; cursor: pointer; transition: transform .15s, box-shadow .2s, background .2s;
  background: var(--surface-2); color: var(--text); border-color: var(--border-strong);
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--d3x-2), var(--d3x)); color: #140600; border-color: transparent;
  box-shadow: 0 10px 30px -10px rgba(255,91,31,.7);
}
.btn-primary:hover { box-shadow: 0 14px 38px -10px rgba(255,91,31,.9); }
.btn-ghost { background: transparent; }
.btn-danger { background: rgba(255,77,106,.12); border-color: rgba(255,77,106,.4); color: #ff8da0; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; }
label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=search],
input[type=url], select, textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg-2); color: var(--text); border: 1px solid var(--border-strong);
  font: 15px/1.4 Inter, sans-serif; outline: none; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--d3x); box-shadow: 0 0 0 3px rgba(255,91,31,.18); }
textarea { min-height: 96px; resize: vertical; }
.field { margin-bottom: 14px; }
.field-error { color: #ff8da0; font-size: 13px; margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text); font-weight: 500; }
.check input { margin-top: 3px; accent-color: var(--d3x); width: 18px; height: 18px; flex: none; }

/* ---- карточки ---- */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01)), var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.pad { padding: 20px; }
.hero { padding: 56px 0 32px; }
.hero-badge {
  display: inline-flex; gap: 8px; align-items: center; padding: 6px 14px; border-radius: 999px;
  background: rgba(255,91,31,.1); border: 1px solid rgba(255,91,31,.3); color: var(--d3x-2); font-size: 13px; font-weight: 600;
}
.hero h1 { font-size: clamp(2rem, 6vw, 3.6rem); margin-top: 18px; font-weight: 700; }
.hero p { font-size: 1.1rem; max-width: 620px; color: var(--text-muted); }
.section { padding: 28px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-head h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); margin: 0; }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); font-weight: 700; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.cat-card { padding: 18px; display: flex; flex-direction: column; gap: 10px; min-height: 132px; transition: border-color .2s, transform .2s; }
.cat-card:hover { border-color: rgba(255,91,31,.45); transform: translateY(-2px); }
.cat-card h3 { font-size: 1.1rem; margin: 0; }
.cat-card .cnt { margin-top: auto; font-size: 13px; color: var(--d3x-2); font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.pcard { display: flex; flex-direction: column; overflow: hidden; transition: border-color .2s, transform .2s; }
.pcard:hover { border-color: rgba(255,91,31,.45); transform: translateY(-3px); }
.pcard-img { aspect-ratio: 1 / 1; background: var(--bg-2); position: relative; overflow: hidden; }
.pcard-img img { width: 100%; height: 100%; object-fit: cover; }
.pcard-img .noimg { position: absolute; inset: 0; display: grid; place-items: center; font: 900 54px var(--font-display); color: rgba(255,91,31,.25); }
.pcard-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pcard-title { font-weight: 600; font-size: 15px; line-height: 1.35; }
.pcard-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { font: 700 1.25rem var(--font-display); }
.price-old { color: var(--text-dim); text-decoration: line-through; font-size: .9rem; margin-left: 6px; font-weight: 500; }
.tag { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); }
.tag-ok { color: var(--success); border-color: rgba(46,230,166,.3); background: rgba(46,230,166,.08); }
.tag-warn { color: var(--warn); border-color: rgba(255,194,77,.3); background: rgba(255,194,77,.08); }
.tag-bad { color: #ff8da0; border-color: rgba(255,77,106,.35); background: rgba(255,77,106,.08); }
.tag-test { color: #000; background: var(--warn); border-color: var(--warn); }
.tags-abs { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- каталог ---- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filters input[type=search] { flex: 1 1 260px; }
.filters select { width: auto; flex: 0 0 auto; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: thin; }
.chip { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  font-size: 14px; color: var(--text-muted); white-space: nowrap; }
.chip.active, .chip:hover { color: #140600; background: var(--d3x); border-color: var(--d3x); }
.empty { text-align: center; padding: 56px 20px; color: var(--text-muted); }
.empty .big { font: 700 1.4rem var(--font-display); color: var(--text); margin-bottom: 6px; }

/* ---- карточка товара ---- */
.product { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; padding: 28px 0; }
.gallery-main { aspect-ratio: 1/1; border-radius: var(--radius); overflow: hidden; background: var(--bg-2); border: 1px solid var(--border); position: relative; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.thumbs button { flex: none; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; padding: 0;
  border: 2px solid transparent; background: var(--bg-2); cursor: pointer; }
.thumbs button.active { border-color: var(--d3x); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.product h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.buy-box { padding: 20px; margin: 18px 0; }
.variants { display: grid; gap: 8px; margin: 12px 0; }
.variant { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--border-strong); cursor: pointer; background: var(--bg-2); }
.variant input { accent-color: var(--d3x); }
.variant.selected { border-color: var(--d3x); background: rgba(255,91,31,.08); }
.variant small { color: var(--text-muted); display: block; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 999px; overflow: hidden; height: 48px; }
.qty button { width: 44px; height: 100%; background: transparent; border: 0; color: var(--text); font-size: 20px; cursor: pointer; }
.qty input { width: 52px; text-align: center; border: 0; background: transparent; padding: 0; box-shadow: none; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.buy-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.buy-row .btn-primary { flex: 1 1 200px; }
.specs { width: 100%; border-collapse: collapse; font-size: 14px; }
.specs td { padding: 9px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.specs td:first-child { color: var(--text-muted); width: 45%; padding-right: 12px; }
.desc { white-space: pre-line; color: #d8d8de; }
.crumbs { font-size: 13px; color: var(--text-dim); padding-top: 20px; }
.crumbs a:hover { color: var(--text); }

.colors { margin: 12px 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.swatch { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 6px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--bg-2); color: var(--text); font: 600 13px Inter, sans-serif; cursor: pointer; }
.swatch span { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.swatch[aria-pressed="true"] { border-color: var(--d3x); background: rgba(255,91,31,.12); }

/* ---- корзина и заказ ---- */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; padding: 24px 0 48px; align-items: start; }
.cart-line { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.cart-line img, .cart-line .ph { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; background: var(--bg-2); }
.cart-line .ttl { font-weight: 600; }
.cart-line .ctl { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.cart-line .qty { height: 36px; }
.cart-line .qty button { width: 34px; font-size: 16px; }
.cart-line .qty input { width: 40px; }
.link-btn { background: none; border: 0; color: var(--text-dim); cursor: pointer; font-size: 13px; padding: 4px; }
.link-btn:hover { color: #ff8da0; }
.total-row { display: flex; justify-content: space-between; font: 700 1.3rem var(--font-display); margin: 14px 0; }
.radio-cards { display: grid; gap: 8px; }
.radio-cards label { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-strong);
  background: var(--bg-2); color: var(--text); font-size: 15px; cursor: pointer; margin: 0; }
.radio-cards input { accent-color: var(--d3x); }
.radio-cards label:has(input:checked) { border-color: var(--d3x); background: rgba(255,91,31,.08); }
.alert { padding: 12px 16px; border-radius: 12px; font-size: 14px; margin-bottom: 14px; }
.alert-ok { background: rgba(46,230,166,.1); border: 1px solid rgba(46,230,166,.35); color: #9ff5d6; }
.alert-err { background: rgba(255,77,106,.1); border: 1px solid rgba(255,77,106,.4); color: #ffb3c0; }
.alert-warn { background: rgba(255,194,77,.1); border: 1px solid rgba(255,194,77,.4); color: #ffe0a3; }
.test-banner { background: var(--warn); color: #000; text-align: center; font-weight: 700; font-size: 13px; padding: 6px 12px; }

.footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 28px 0 40px; color: var(--text-dim); font-size: 14px; }
.site-btn { border-color: rgba(255,91,31,.45); color: var(--d3x-2); }
.site-btn:hover { background: rgba(255,91,31,.1); }
.site-short { display: none; }
.footer .site-cta { align-items: center; padding: 20px; margin-bottom: 24px; border: 1px solid rgba(255,91,31,.3);
  border-radius: var(--radius); background: rgba(255,91,31,.06); color: var(--text); }
.footer .container { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; }
.footer a:hover { color: var(--text); }

/* ---- мобильная нижняя панель ---- */
.mobile-bar { display: none; }
@media (max-width: 860px) {
  .nav { display: none; }
  .product, .cart-layout { grid-template-columns: 1fr; gap: 18px; }
  .hero { padding: 32px 0 16px; }
  .logo-text small { display: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pcard-body { padding: 10px 12px 12px; }
  .pcard-title { font-size: 14px; }
  .price { font-size: 1.05rem; }
  .pcard-foot .btn { display: none; }
  .site-full { display: none; }
  .site-short { display: inline; }
  .footer .site-cta .btn { flex: 1 1 100%; }
  .mobile-bar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: rgba(7,7,10,.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .mobile-bar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--text-muted); padding: 6px; position: relative; }
  .mobile-bar a.active { color: var(--d3x); }
  .mobile-bar .ic { font-size: 20px; line-height: 1; }
  .mobile-bar .badge { position: absolute; top: 0; right: 22%; }
  body.has-mobile-bar { padding-bottom: 72px; }
  .topbar .icon-btn.cart-top { display: none; }
}
@media (max-width: 380px) {
  .grid { gap: 8px; }
}
