/* ── Дропшип-магазин: витрина ── */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #14161a;
  --muted: #6b7280;
  --line: #e6e8eb;
  --accent: #ff5a1f;
  --accent-ink: #ffffff;
  --ok: #16a34a;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16,22,26,.05), 0 8px 24px rgba(16,22,26,.06);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
.wrap { width: min(1200px, 92%); margin: 0 auto; }

/* Header */
.hdr { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.hdr-in { display: flex; align-items: center; gap: 20px; padding: 14px 0; }
.logo { font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.logo .dot { width: 12px; height: 12px; border-radius: 4px; background: var(--accent); display: inline-block; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; max-width: 460px; }
.search input { border: none; background: transparent; outline: none; width: 100%; font-size: .95rem; color: var(--ink); }
.search svg { width: 18px; height: 18px; stroke: var(--muted); flex-shrink: 0; }
.hdr-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-btn { position: relative; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 9px 16px; font-weight: 600; font-size: .9rem; transition: border-color .15s, transform .15s; }
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; }
.cart-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .72rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }

/* Hero band */
.hero { background: linear-gradient(120deg, #14161a, #24272e); color: #fff; }
.hero-in { padding: 54px 0; display: grid; gap: 14px; }
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); letter-spacing: -.03em; line-height: 1.05; max-width: 640px; }
.hero p { color: rgba(255,255,255,.72); max-width: 560px; font-size: 1.05rem; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: none; border-radius: 12px; padding: 12px 22px; font-weight: 700; font-size: .95rem; transition: transform .12s, opacity .15s, background .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: rgba(255,255,255,.1); color: #fff; }
.btn-line { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* Toolbar */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 22px 0 6px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.chip { white-space: nowrap; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 15px; font-size: .88rem; font-weight: 600; color: var(--muted); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.sort { margin-left: auto; }
.sort select { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 12px; font-size: .88rem; font-weight: 600; color: var(--ink); }

/* Grid */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 20px 0 60px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-img { aspect-ratio: 1/1; background: #f0f1f3; overflow: hidden; position: relative; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card-img img { transform: scale(1.04); }
.card-img .ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #c4c8cf; font-size: .8rem; }
.badge { position: absolute; top: 10px; left: 10px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 800; padding: 4px 9px; border-radius: 999px; }
.badge.out { background: #9ca3af; }
.badge.hit { background: #111827; }
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-cat { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.card-title { font-weight: 600; font-size: .96rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a:hover { color: var(--accent); }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; }
.price { font-weight: 800; font-size: 1.05rem; }
.price .old { font-weight: 500; font-size: .82rem; color: var(--muted); text-decoration: line-through; margin-left: 6px; }
.add-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; transition: background .15s, color .15s, border-color .15s; }
.add-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.add-btn svg { width: 18px; height: 18px; stroke: currentColor; }

/* States */
.state { padding: 80px 0; text-align: center; color: var(--muted); }
.state h3 { color: var(--ink); font-size: 1.3rem; margin-bottom: 8px; }
.skeleton { background: linear-gradient(90deg,#eef0f2,#f6f7f9,#eef0f2); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-card { height: 300px; border-radius: var(--radius); }
.pager { display: flex; justify-content: center; gap: 10px; padding-bottom: 60px; }

/* Cart drawer */
.overlay { position: fixed; inset: 0; background: rgba(16,22,26,.45); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60; }
.overlay.show { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(420px, 100%); background: var(--surface); z-index: 70; transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column; }
.drawer.show { transform: none; }
.drawer-hd { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-hd h3 { font-size: 1.15rem; }
.x { border: none; background: transparent; font-size: 1.5rem; line-height: 1; color: var(--muted); }
.drawer-body { flex: 1; overflow-y: auto; padding: 10px 20px; }
.ci { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ci img, .ci .ph { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: #f0f1f3; flex-shrink: 0; }
.ci-main { flex: 1; min-width: 0; }
.ci-title { font-size: .9rem; font-weight: 600; line-height: 1.25; }
.ci-price { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; }
.qty button { width: 28px; height: 28px; border: none; background: transparent; font-size: 1rem; }
.qty span { min-width: 28px; text-align: center; font-size: .9rem; font-weight: 600; }
.ci-rm { border: none; background: transparent; color: var(--muted); font-size: .8rem; align-self: flex-start; }
.drawer-ft { border-top: 1px solid var(--line); padding: 18px 20px; display: grid; gap: 12px; }
.total-row { display: flex; justify-content: space-between; font-weight: 800; font-size: 1.1rem; }
.field { display: grid; gap: 5px; }
.field label { font-size: .78rem; font-weight: 700; color: var(--muted); }
.field input, .field textarea { border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; font-size: .95rem; font-family: inherit; outline: none; }
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.form-note { font-size: .78rem; color: var(--muted); text-align: center; }
.direct { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.tag { font-size: .78rem; font-weight: 700; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); }
.tag.tg:hover { background: #229ED9; color: #fff; border-color: #229ED9; }

/* Footer */
footer { border-top: 1px solid var(--line); background: var(--surface); }
.foot-in { padding: 34px 0; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.foot-in .muted { color: var(--muted); font-size: .85rem; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; font-size: .9rem; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 90; }
.toast.show { opacity: 1; transform: translateX(-50%); }

/* Product page */
.pd { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 34px 0 60px; }
.pd-gallery { display: grid; gap: 12px; }
.pd-main { aspect-ratio: 1/1; background: #f0f1f3; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.pd-main img { width: 100%; height: 100%; object-fit: cover; }
.pd-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.pd-thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 2px solid transparent; cursor: pointer; }
.pd-thumbs img.active { border-color: var(--accent); }
.pd-info h1 { font-size: 1.9rem; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 10px; }
.pd-price { font-size: 2rem; font-weight: 800; margin: 12px 0; }
.pd-price .old { font-size: 1.1rem; color: var(--muted); text-decoration: line-through; margin-left: 10px; font-weight: 500; }
.pd-desc { color: #333; margin: 16px 0; white-space: pre-wrap; }
.pd-params { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 16px 0; }
.pd-params .row { display: flex; justify-content: space-between; padding: 10px 14px; font-size: .9rem; border-bottom: 1px solid var(--line); }
.pd-params .row:last-child { border-bottom: none; }
.pd-params .row span:first-child { color: var(--muted); }
.pd-actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.crumbs { padding: 16px 0 0; font-size: .85rem; color: var(--muted); }
.crumbs a:hover { color: var(--accent); }

/* Bundles section on catalog */
.bundles-band { padding: 8px 0 6px; }
.bundles-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.bundle-card { display: flex; gap: 14px; align-items: center; background: linear-gradient(120deg, #14161a, #24272e); color: #fff; border-radius: var(--radius); padding: 16px; }
.bundle-card img, .bundle-card .ph { width: 74px; height: 74px; border-radius: 12px; object-fit: cover; background: #2a2d34; flex-shrink: 0; }
.bundle-card .bc-body { flex: 1; min-width: 0; }
.bundle-card h3 { font-size: 1.05rem; margin-bottom: 3px; }
.bundle-card p { color: rgba(255,255,255,.65); font-size: .82rem; }
.bundle-card .bc-cta { font-size: .8rem; font-weight: 700; color: var(--accent); margin-top: 6px; display: inline-block; }
.section-h { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 12px; }
.section-h h2 { font-size: 1.3rem; letter-spacing: -.02em; }
.section-h span { color: var(--muted); font-size: .9rem; }

/* Bundle builder page */
.bd-head { padding: 20px 0 6px; }
.bd-head h1 { font-size: 1.9rem; letter-spacing: -.02em; }
.bd-sub { color: var(--muted); margin: 6px 0; max-width: 640px; }
.bd-rule { display: inline-block; background: #14161a; color: #fff; padding: 8px 14px; border-radius: 999px; font-size: .88rem; margin-top: 6px; }
.builder-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 16px 0; }
.opt { position: relative; text-align: left; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; display: grid; gap: 8px; transition: border-color .15s, transform .12s; }
.opt:hover { transform: translateY(-2px); }
.opt.selected { border-color: var(--accent); }
.opt img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 10px; background: #f0f1f3; }
.opt-ph { width: 100%; aspect-ratio: 1/1; border-radius: 10px; background: #f0f1f3; display: flex; align-items: center; justify-content: center; color: #c4c8cf; font-size: .8rem; }
.opt-title { font-weight: 600; font-size: .92rem; line-height: 1.25; }
.opt-price { font-weight: 800; }
.opt-check { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); background: #fff; z-index: 1; transition: background .15s, border-color .15s; }
.opt.selected .opt-check { background: var(--accent); border-color: var(--accent); }
.opt.selected .opt-check::after { content: '✓'; color: #fff; font-size: 14px; font-weight: 900; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.bd-bar { position: sticky; bottom: 0; z-index: 30; display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 14px; padding: 14px 18px; margin-top: 6px; }
.bd-bar .bd-price { font-size: 1.5rem; font-weight: 800; margin-left: auto; }
.bd-bar.ready .bd-price { color: var(--accent); }

@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .pd { grid-template-columns: 1fr; gap: 24px; }
  .builder-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  .hdr-in { flex-wrap: wrap; }
  .hero-in { padding: 38px 0; }
}
