:root {
  --blue: #3b6fd0;
  --blue-dark: #2a55a8;
  --navy: #1f3b73;
  --ink: #1d2433;
  --muted: #5d6679;
  --line: #e3e7ef;
  --bg: #f6f8fb;
  --card: #ffffff;
  --ok: #1f8a4c;
  --warn: #b45309;
  --radius: 12px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: var(--blue-dark); }
button, input, select, textarea { font: inherit; color: inherit; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; outline: none; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); font-weight: 700; font-size: 1.15rem; }
.header-nav { display: flex; align-items: center; gap: 18px; }
.nav-link { text-decoration: none; color: var(--ink); font-weight: 500; font-size: .95rem; }
.nav-link:hover { color: var(--blue); }
.bag-link { position: relative; color: var(--ink); display: inline-flex; padding: 6px; }
.bag-count[hidden] { display: none; }
.bag-count {
  position: absolute; top: -2px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: var(--blue); color: #fff; font-size: .72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
@media (max-width: 640px) {
  .nav-link.phone { display: none; }
  .brand span { font-size: 1rem; }
  .header-nav { gap: 12px; }
}

/* Hero */
.hero {
  margin: 24px 0; padding: 40px 32px; border-radius: 18px; color: #fff;
  background: linear-gradient(120deg, var(--navy), var(--blue));
  display: grid; gap: 12px;
}
.hero h1 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.2; max-width: 22ch; }
.hero p { margin: 0; opacity: .92; max-width: 60ch; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.hero .btn-light { background: #fff; color: var(--navy); }
.hero .btn-ghost { border: 1px solid rgba(255,255,255,.6); color: #fff; background: transparent; }
@media (max-width: 640px) { .hero { padding: 28px 20px; } }

.promo {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 24px; font-size: .95rem;
}
.promo code { font-family: inherit; letter-spacing: .02em; background: #eef3fc; color: var(--blue-dark); padding: 2px 6px; border-radius: 6px; font-weight: 600; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px; border: 0; cursor: pointer;
  font-weight: 600; text-decoration: none; background: var(--blue); color: #fff;
}
.btn:hover { background: var(--blue-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover { background: #f1f4f9; }
.link-btn { background: none; border: 0; color: var(--blue-dark); cursor: pointer; padding: 0; text-decoration: underline; }

/* Catalog */
.catalog { display: grid; grid-template-columns: 240px 1fr; gap: 28px; margin-bottom: 48px; }
@media (max-width: 860px) { .catalog { grid-template-columns: 1fr; } }
.filters { align-self: start; position: sticky; top: 84px; }
@media (max-width: 860px) { .filters { position: static; } }
.filters details { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px; }
.filters summary { font-weight: 600; cursor: pointer; }
.filters label { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: .93rem; cursor: pointer; }
.filters .count { color: var(--muted); margin-left: auto; font-size: .82rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.toolbar .search { flex: 1 1 220px; }
.toolbar select, .field input, .field select, .field textarea, .toolbar input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.toolbar select { width: auto; }
.result-count { color: var(--muted); font-size: .9rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
@media (max-width: 480px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column;
  transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: 0 8px 24px rgba(31,59,115,.12); transform: translateY(-2px); }
.card .thumb { aspect-ratio: 1; background: #fff; display: flex; align-items: center; justify-content: center; padding: 12px; }
.card .thumb img { max-height: 100%; object-fit: contain; }
.card .body { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; border-top: 1px solid var(--line); }
.card .brandtag { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.card .name { font-size: .92rem; font-weight: 500; line-height: 1.35; }
.card .price { margin-top: auto; font-weight: 700; color: var(--navy); }
.empty { padding: 40px; text-align: center; color: var(--muted); background: #fff; border-radius: var(--radius); border: 1px dashed var(--line); }

/* Product */
.crumbs { margin: 20px 0; font-size: .9rem; }
.product { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 56px; }
@media (max-width: 860px) { .product { grid-template-columns: 1fr; gap: 20px; } }
.product .gallery { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; display: flex; align-items: center; justify-content: center; aspect-ratio: 1; }
.product .gallery img { max-height: 100%; object-fit: contain; }
.product h1 { margin: 0 0 6px; font-size: clamp(1.3rem, 3vw, 1.8rem); line-height: 1.25; }
.product .sku { color: var(--muted); font-size: .85rem; }
.product .price { font-size: 1.6rem; font-weight: 700; color: var(--navy); margin: 14px 0; }
.product .note { background: #eef3fc; border-radius: 10px; padding: 12px 14px; font-size: .92rem; margin: 16px 0; }
.field { margin-bottom: 14px; }
.field > label, .field > .label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field .req { color: #c0392b; }
.radios { display: flex; flex-wrap: wrap; gap: 8px; }
.radios label {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; cursor: pointer; background: #fff; font-size: .9rem;
}
.radios input { position: absolute; opacity: 0; pointer-events: none; }
.radios label:has(input:checked) { border-color: var(--blue); background: #eef3fc; color: var(--blue-dark); font-weight: 600; }
.radios label:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.qty { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.qty button { border: 0; background: #fff; width: 38px; cursor: pointer; font-size: 1.1rem; }
.qty input { width: 48px; text-align: center; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); padding: 8px 0; }
.add-row { display: flex; gap: 12px; align-items: stretch; margin-top: 18px; }
.add-row .btn { flex: 1; }
.error { color: #c0392b; font-size: .88rem; margin-top: 4px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.2); z-index: 50; display: flex; gap: 14px; align-items: center;
}
.toast a { color: #9ec0ff; font-weight: 600; }

/* Bag & checkout */
.page-title { margin: 24px 0 18px; font-size: 1.6rem; }
.two-col { display: grid; grid-template-columns: 1fr 340px; gap: 28px; margin-bottom: 56px; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.line { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line img { width: 72px; height: 72px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.line .opts { color: var(--muted); font-size: .84rem; }
.line .controls { display: flex; gap: 12px; align-items: center; margin-top: 8px; }
.line .amount { font-weight: 600; white-space: nowrap; }
.summary .row { display: flex; justify-content: space-between; padding: 6px 0; }
.summary .total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-weight: 700; font-size: 1.1rem; }
.summary .hint { font-size: .85rem; color: var(--muted); margin: 8px 0 0; }
.summary .discount { color: var(--ok); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.panel h2 { margin: 0 0 14px; font-size: 1.1rem; }
.panel + .panel { margin-top: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; }

/* Contact / footer */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 24px 0 56px; }
@media (max-width: 760px) { .contact { grid-template-columns: 1fr; } }
.map { border: 0; width: 100%; height: 100%; min-height: 320px; border-radius: var(--radius); }
.site-footer { background: var(--navy); color: #dbe4f5; margin-top: 40px; padding: 32px 0; font-size: .9rem; }
.site-footer a { color: #fff; }
.footer-inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.footer-inner h3 { color: #fff; font-size: .95rem; margin: 0 0 8px; }
.footer-inner p { margin: 0 0 6px; }
.small { font-size: .82rem; color: var(--muted); }
.success { text-align: center; padding: 48px 16px; }
.success .tick { width: 64px; height: 64px; border-radius: 50%; background: #e6f4ec; color: var(--ok); display: inline-flex; align-items: center; justify-content: center; font-size: 2rem; }
