/* МОТОМИР34: белый фон, тёмно-синий лазуритовый акцент. */
:root {
  --bg: #ffffff; --soft: #f3f6fb; --line: #dfe5ee; --text: #131c2b; --muted: #5a6779;
  --accent: #1c4587; --accent-dark: #14336a; --accent-soft: #e6edf8; --on-accent: #ffffff;
  --ok: #1d7a46; --warn: #8a5a00; --bad: #b3261e; --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: clamp(24px, 4vw, 32px); line-height: 1.2; margin: 0 0 16px; }
h2 { font-size: 22px; line-height: 1.25; margin: 32px 0 14px; }
h3 { font-size: 16px; margin: 20px 0 8px; }
small { color: var(--muted); font-weight: 400; }
img { max-width: 100%; }
[hidden] { display: none !important; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=checkbox], input[type=radio] { width: auto; padding: 0; accent-color: var(--accent); }
label { display: block; margin: 0 0 12px; font-size: 14px; color: var(--muted); }
label > input, label > select, label > textarea { margin-top: 4px; font-size: 16px; color: var(--text); }
mark { background: #fff1c2; padding: 0 4px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
main.wrap { flex: 1; padding-top: 24px; padding-bottom: 48px; }
main.narrow { max-width: 820px; }

.btn { display: inline-block; padding: 9px 18px; border: 0; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-weight: 600; cursor: pointer; text-align: center; white-space: nowrap; }
.btn:hover { background: var(--accent-dark); text-decoration: none; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.big { padding: 12px 26px; font-size: 17px; }
.btn.added { background: var(--ok); }
.link { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; }
.link:hover { text-decoration: underline; }
.link.danger { color: var(--bad); }
.hint { color: var(--muted); font-size: 14px; }
.error { color: var(--bad); font-weight: 600; }
.ok { color: var(--ok); font-weight: 600; }

/* шапка */
.head { border-bottom: 1px solid var(--line); background: #fff; }
.head-row { display: flex; align-items: center; gap: 20px; padding-top: 14px; padding-bottom: 14px; }
.logo { font-size: 26px; font-weight: 800; letter-spacing: .02em; color: var(--accent); white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo b { color: var(--text); }
.logo.small { font-size: 20px; }
.search { flex: 1; display: flex; max-width: 560px; }
.search input { border-radius: 8px 0 0 8px; border-right: 0; }
.search button { padding: 9px 18px; border: 0; border-radius: 0 8px 8px 0; background: var(--accent); color: var(--on-accent); font-weight: 600; cursor: pointer; }
.head-side { margin-left: auto; display: flex; align-items: center; gap: 20px; white-space: nowrap; }
.phone { font-weight: 700; color: var(--text); }
.cart-link { font-weight: 600; }
.cart-count { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 13px; text-align: center; }
.nav { background: var(--accent); }
.nav-row { display: flex; gap: 4px; overflow-x: auto; }
.nav a { padding: 10px 14px; color: var(--on-accent); font-weight: 600; white-space: nowrap; }
.nav a:first-child { padding-left: 0; }
.nav a:hover { text-decoration: underline; }

/* подвал */
.foot { background: var(--soft); border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; padding-top: 28px; padding-bottom: 28px; }
.foot p { margin: 6px 0 0; }
.foot-links { display: flex; flex-direction: column; gap: 6px; }

/* главная */
.hero { padding: 44px 32px; border-radius: 16px; background: linear-gradient(120deg, var(--accent-dark), var(--accent)); color: var(--on-accent); }
.hero h1 { font-size: clamp(28px, 5vw, 44px); margin-bottom: 10px; }
.hero p { max-width: 560px; margin: 0 0 22px; font-size: 18px; opacity: .92; }
.hero .btn { background: #fff; color: var(--accent); }
.hero .btn:hover { background: var(--accent-soft); }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.cat { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); font-weight: 600; }
.cat:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.perks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 40px; }
.perks div { padding: 16px; border-radius: var(--radius); background: var(--soft); }
.perks b { display: block; color: var(--accent); }
.perks span { color: var(--muted); font-size: 14px; }
.empty { padding: 40px 20px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); }
.empty h2 { margin-top: 0; color: var(--text); }

/* карточки */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(28, 69, 135, .12); }
.card-img { display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--soft); }
.card-img img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.nophoto { display: grid; place-items: center; width: 100%; height: 100%; min-height: 80px; color: var(--muted); font-size: 13px; background: var(--soft); }
.card-name { color: var(--text); font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.sku { color: var(--muted); }
.badge { padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.in { background: #e3f4ea; color: var(--ok); }
.badge.order { background: #fdf1d8; color: var(--warn); }
.card-buy { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.price { font-size: 19px; font-weight: 700; white-space: nowrap; }
.price s { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.price.big { font-size: 30px; margin: 14px 0; }

/* каталог */
.cols { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.side h3:first-child { margin-top: 0; }
.side > a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 6px; color: var(--text); font-size: 15px; }
.side > a:hover { background: var(--soft); text-decoration: none; }
.side > a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.list-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin-bottom: 16px; }
.list-head h1 { margin: 0; }
.sorts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.sorts a { color: var(--muted); }
.sorts a.on { color: var(--accent); font-weight: 600; }
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 28px; }
.pager a, .pager b, .pager span { min-width: 38px; padding: 7px 10px; border-radius: 8px; text-align: center; }
.pager a { border: 1px solid var(--line); }
.pager b { background: var(--accent); color: var(--on-accent); }

/* товар */
.crumbs { margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.shot { aspect-ratio: 1; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.shot img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumbs button { width: 64px; height: 64px; padding: 2px; border: 2px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.thumbs button.on { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: contain; }
.buy h1 { font-size: clamp(22px, 3vw, 28px); margin-bottom: 10px; }
.buy-row { display: flex; gap: 10px; margin-bottom: 14px; }
.qty { width: 84px; text-align: center; }
.text { max-width: 820px; }
.text p { margin: 0 0 12px; }
.text li { margin-bottom: 6px; }
.attrs { width: 100%; max-width: 820px; border-collapse: collapse; }
.attrs th, .attrs td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.attrs th { width: 42%; color: var(--muted); font-weight: 400; }
.attrs .sum th, .attrs .sum td { border-bottom: 0; color: var(--text); font-weight: 700; font-size: 18px; }

/* корзина */
.cart-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto 110px auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-img { display: block; width: 76px; height: 76px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cart-img img { width: 100%; height: 100%; object-fit: contain; }
.cart-name a { display: block; color: var(--text); font-weight: 600; }
.cart-sum { text-align: right; white-space: nowrap; }
.stepper { display: flex; }
.stepper button { width: 34px; border: 1px solid var(--line); background: var(--soft); cursor: pointer; font-size: 18px; }
.stepper button:first-child { border-radius: 8px 0 0 8px; }
.stepper button:last-child { border-radius: 0 8px 8px 0; }
.stepper input { width: 54px; border-radius: 0; border-left: 0; border-right: 0; text-align: center; padding: 8px 4px; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.cart-total { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; font-size: 20px; }
.cart-total small { display: block; font-size: 14px; }

/* оформление */
.checkout { grid-template-columns: minmax(0, 1fr) 340px; }
fieldset { margin: 0 0 20px; padding: 16px 18px 6px; border: 1px solid var(--line); border-radius: var(--radius); }
legend { padding: 0 6px; font-weight: 700; }
.radio, .check { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; color: var(--text); cursor: pointer; }
.radio input, .check input { margin-top: 5px; flex: none; }
.radio b { color: var(--accent); white-space: nowrap; }
.radio.off { color: var(--muted); cursor: default; }
.radio.off b { color: var(--muted); font-weight: 400; }
.suggest-box { position: relative; }
.suggest { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin-top: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 8px 24px rgba(19, 28, 43, .14); overflow: hidden; }
.suggest button { display: block; width: 100%; padding: 8px 12px; border: 0; background: none; text-align: left; cursor: pointer; font-size: 15px; }
.suggest button:hover { background: var(--accent-soft); }
select[size] { padding: 4px; }
select[size] option { padding: 5px 8px; border-radius: 4px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.summary { position: sticky; top: 16px; padding: 18px; border-radius: var(--radius); background: var(--soft); }
.summary h3 { margin-top: 0; font-size: 18px; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14px; }
.sum-row b { white-space: nowrap; }
.sum-row.total { margin: 6px 0 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 18px; }
.summary .check { font-size: 14px; color: var(--muted); }
.summary .btn { width: 100%; }
.done { max-width: 720px; }
.done .attrs { margin: 16px 0; }

@media (max-width: 860px) {
  .head-row { flex-wrap: wrap; gap: 10px 16px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .phone { display: none; }
  .cols, .checkout, .product { grid-template-columns: minmax(0, 1fr); }
  .side:not(.summary) { display: flex; flex-wrap: wrap; gap: 6px; }
  .side:not(.summary) h3 { flex-basis: 100%; margin: 6px 0 0; }
  .side:not(.summary) > a { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
  .summary { position: static; }
  .foot-row { grid-template-columns: 1fr; }
  .hero { padding: 28px 20px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .cart-row { grid-template-columns: 60px minmax(0, 1fr) auto; }
  .cart-img { width: 60px; height: 60px; }
  .cart-name { grid-column: 2 / 4; }
  .stepper { grid-column: 2; }
  .cart-sum { grid-column: 3; }
  .cart-row > .link { grid-column: 2 / 4; justify-self: start; }
}
