/* Черновой дизайн: нейтральный, без бренда. Цвета и шрифты меняются в :root */

:root {
  --ink: #16181d;
  --ink-2: #4a505c;
  --muted: #7a808c;
  --line: #e4e6ea;
  --bg: #f5f6f8;
  --card: #ffffff;
  --brand: #1d2433;        /* шапка, подвал */
  --accent: #e8590c;       /* кнопки, цены */
  --accent-hover: #c94a06;
  --ok: #2b8a3e;
  --warn: #b7791f;
  --sale: #d6336c;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1 { font-size: 28px; line-height: 1.2; margin: 8px 0 20px; }
h2 { font-size: 21px; margin: 0 0 14px; }
small, .muted { color: var(--muted); font-weight: 400; }
h1 small { font-size: 15px; margin-left: 6px; }
[hidden] { display: none !important; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 16px; padding-bottom: 48px; min-height: 60vh; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 100; background: #fff; padding: 8px 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 0 20px; border: 0; border-radius: 8px;
  background: var(--accent); color: #fff; font: 600 15px var(--font);
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s;
}
.btn:hover { background: var(--accent-hover); }
.btn:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid rgba(232, 89, 12, .35); outline-offset: 2px; }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn--ghost:hover { background: #fff; }
.btn--light { background: #fff; color: var(--ink); }
.btn--light:hover { background: #f1f1f1; }
.btn[disabled] { opacity: .6; cursor: default; }

/* ---------- шапка ---------- */
.header { background: var(--brand); color: #fff; }
.topbar { font-size: 13px; color: #b8bfcc; border-bottom: 1px solid rgba(255,255,255,.08); }
.topbar__inner { display: flex; justify-content: space-between; gap: 16px; padding-top: 6px; padding-bottom: 6px; }
.header__main { display: flex; align-items: center; gap: 20px; padding-top: 14px; padding-bottom: 14px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; text-decoration: none; white-space: nowrap; }
.logo__icon { width: 32px; height: 32px; color: var(--accent); }
.search { flex: 1; display: flex; max-width: 520px; }
.search input { flex: 1; min-width: 0; height: 42px; padding: 0 14px; border: 0; border-radius: 8px 0 0 8px; font: inherit; }
.search button { height: 42px; padding: 0 16px; border: 0; border-radius: 0 8px 8px 0; background: var(--accent); color: #fff; font: 600 14px var(--font); cursor: pointer; }
.header__contacts { display: flex; flex-direction: column; align-items: flex-end; margin-left: auto; }
.header__phone { font-weight: 700; font-size: 17px; text-decoration: none; white-space: nowrap; }
.header__msgs { display: flex; gap: 10px; font-size: 13px; color: #b8bfcc; }
.cart-link { position: relative; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 10px; background: rgba(255,255,255,.08); }
.cart-link svg { width: 26px; height: 26px; fill: currentColor; }
.cart-link__count { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--accent); font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.nav { background: rgba(0,0,0,.18); }
.nav__inner { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav__inner a { padding: 10px 12px; text-decoration: none; font-weight: 500; white-space: nowrap; color: #dde2ea; }
.nav__inner a:hover { color: #fff; background: rgba(255,255,255,.06); }

/* ---------- блоки ---------- */
.section { margin-top: 40px; }
.section__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section__head a { color: var(--accent); text-decoration: none; font-weight: 600; white-space: nowrap; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs > * + *::before { content: "/"; margin-right: 6px; color: #c3c7cf; }
.empty { padding: 32px; text-align: center; background: var(--card); border-radius: var(--radius); color: var(--muted); }
.note { font-size: 13px; color: var(--ink-2); }
.warn { padding: 12px 16px; background: #fff4e6; border-left: 4px solid var(--warn); }
.prose { max-width: 760px; }

.hero {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 32px; align-items: center;
  padding: 36px; border-radius: 16px; color: #fff;
  background: linear-gradient(135deg, #273047 0%, #1d2433 60%, #3b2a20 100%);
}
.hero h1 { font-size: 34px; margin: 0 0 12px; }
.hero p { color: #c9cfda; margin: 0; }

.picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 18px; background: #fff; border-radius: 12px; color: var(--ink); box-shadow: var(--shadow); }
.picker .btn { grid-column: 1 / -1; }
.picker__field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.picker select { height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; color: var(--ink); background: #fff; }
.picker select:disabled { background: #f5f6f8; }
.picker--compact { grid-template-columns: repeat(3, 1fr) auto; align-items: end; margin-bottom: 24px; }
.picker--compact .btn { grid-column: auto; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 18px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; transition: transform .15s; }
.tile:hover { transform: translateY(-2px); }
.tile__name { font-weight: 700; }
.tile__count { font-size: 13px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip { padding: 7px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 14px; }
.chip:hover, .chip[aria-current="true"] { border-color: var(--accent); color: var(--accent); }

/* ---------- карточка товара ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card__img { position: relative; display: block; aspect-ratio: 4 / 3; background: #eef0f3; }
.card__img img { width: 100%; height: 100%; object-fit: cover; }
.card__badges { position: absolute; top: 8px; left: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.badge { padding: 2px 8px; border-radius: 6px; background: rgba(29,36,51,.85); color: #fff; font-size: 12px; font-weight: 600; }
.badge--sale { background: var(--sale); }
.badge--new { background: var(--ok); }
.card__body { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; }
.card__title { font-weight: 600; font-size: 14px; line-height: 1.35; text-decoration: none; }
.card__title:hover { color: var(--accent); }
.card__meta { font-size: 12px; color: var(--muted); }
.card__stock { font-size: 12px; font-weight: 600; }
.stock--ok { color: var(--ok); }
.stock--order { color: var(--warn); }
.stock--none { color: var(--muted); }
.card__bottom { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; }
.price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price__now { font-weight: 800; font-size: 18px; white-space: nowrap; }
.price__old { color: var(--muted); font-size: 13px; white-space: nowrap; }
.price--big .price__now { font-size: 30px; }
.price--big .price__old { font-size: 16px; }

/* ---------- страница товара ---------- */
.product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 32px; margin-top: 12px; }
.product__photo { position: relative; aspect-ratio: 4 / 3; background: var(--card); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.product__photo img { width: 100%; height: 100%; object-fit: cover; }
.product__thumbs { display: flex; gap: 8px; margin-top: 10px; }
.product__thumbs button { width: 72px; height: 56px; padding: 0; border: 2px solid transparent; border-radius: 8px; background: #fff; cursor: pointer; overflow: hidden; }
.product__thumbs button[aria-current="true"] { border-color: var(--accent); }
.product__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.product__info h1 { margin-top: 0; font-size: 24px; }
.product__sku { font-size: 13px; color: var(--muted); margin: -12px 0 14px; }
.product__buy { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 8px; }
.qty input { width: 72px; height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; text-align: center; }
.specs { width: 100%; margin-top: 20px; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); font-size: 14px; }
.specs th, .specs td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.specs th { width: 44%; font-weight: 500; color: var(--ink-2); }
.specs tr:last-child th, .specs tr:last-child td { border-bottom: 0; }

/* ---------- услуги, контакты ---------- */
.services { display: grid; gap: 10px; }
.service { display: flex; justify-content: space-between; gap: 16px; padding: 16px 18px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; }
.service:hover .service__name { color: var(--accent); }
.service__name { font-weight: 600; }
.service__meta { color: var(--ink-2); white-space: nowrap; }
.service-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 16px; }
.contacts dl { display: grid; grid-template-columns: 180px 1fr; gap: 12px 24px; max-width: 720px; padding: 24px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.contacts dt { color: var(--muted); }
.contacts dd { margin: 0; font-weight: 500; }

.callbox { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 40px; padding: 22px 26px; border-radius: 12px; background: var(--brand); color: #fff; }
.callbox p { margin: 0; max-width: 640px; }

/* ---------- корзина ---------- */
.cart { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.cart__items { display: grid; gap: 10px; }
.cart-row { display: grid; grid-template-columns: 72px 1fr auto auto 32px; gap: 14px; align-items: center; padding: 12px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.cart-row img { width: 72px; height: 54px; object-fit: cover; background: #eef0f3; border-radius: 6px; }
.cart-row__name { font-weight: 600; font-size: 14px; text-decoration: none; }
.cart-row__sku { font-size: 12px; color: var(--muted); }
.cart-row__qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; }
.cart-row__qty button { width: 30px; height: 32px; border: 0; background: none; font-size: 18px; cursor: pointer; }
.cart-row__qty span { min-width: 24px; text-align: center; }
.cart-row__sum { font-weight: 700; white-space: nowrap; }
.cart-row__del { width: 32px; height: 32px; border: 0; background: none; color: var(--muted); font-size: 20px; cursor: pointer; border-radius: 6px; }
.cart-row__del:hover { background: #f1f2f4; color: var(--sale); }
.order { position: sticky; top: 16px; display: grid; gap: 12px; padding: 22px; background: var(--card); border-radius: 12px; box-shadow: var(--shadow); }
.order h2 { margin: 0; }
.order label { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.order input:not([type="checkbox"]), .order textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: 15px var(--font); color: var(--ink); }
.order .invalid { border-color: var(--sale); }
.order .check { display: flex; gap: 8px; align-items: flex-start; }
.order .check input { margin-top: 3px; }
.order .hp { position: absolute; left: -9999px; }
.order__total { font-size: 18px; }
.order__msg:empty { display: none; }
.order__msg { padding: 10px 12px; border-radius: 8px; background: #f1f3f5; font-size: 14px; }
.order__msg.is-ok { background: #ebfbee; color: var(--ok); }
.order__msg.is-err { background: #fff0f6; color: var(--sale); }

.notfound { text-align: center; padding: 40px 0; }
.notfound .picker { text-align: left; max-width: 820px; margin: 24px auto; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translateX(-50%); padding: 12px 18px; border-radius: 10px; background: var(--ink); color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.2); font-size: 14px; }
.toast a { color: #ffb37f; margin-left: 10px; font-weight: 600; }

/* ---------- подвал ---------- */
.footer { background: var(--brand); color: #c9cfda; font-size: 14px; }
.footer a { text-decoration: none; }
.footer a:hover { color: #fff; }
.footer__grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 32px; padding-top: 36px; padding-bottom: 24px; }
.footer__grid p { margin: 0 0 6px; }
.footer__brand { color: #fff; font-weight: 800; font-size: 18px; margin-bottom: 8px; }
.footer__title { color: #fff; font-weight: 700; margin-bottom: 8px; }
.footer__bottom { padding-top: 16px; padding-bottom: 24px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: #8a92a2; }

/* ---------- адаптив ---------- */
@media (max-width: 960px) {
  .hero, .product, .cart { grid-template-columns: 1fr; }
  .hero { padding: 24px; }
  .order { position: static; }
  .header__main { flex-wrap: wrap; }
  .search { order: 5; flex-basis: 100%; max-width: none; }
}
@media (max-width: 640px) {
  h1 { font-size: 23px; }
  .hero h1 { font-size: 26px; }
  .topbar__addr, .header__msgs { display: none; }
  .header__main { gap: 12px; }
  .logo { font-size: 17px; }
  .header__phone { font-size: 15px; }
  .picker, .picker--compact { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card__bottom { flex-direction: column; align-items: stretch; }
  .callbox { flex-direction: column; align-items: flex-start; }
  .contacts dl { grid-template-columns: 1fr; gap: 4px; }
  .contacts dd { margin-bottom: 10px; }
  .footer__grid { grid-template-columns: 1fr; gap: 20px; }
  .cart-row { grid-template-columns: 56px 1fr 32px; }
  .cart-row img { width: 56px; height: 42px; }
  .cart-row__qty { grid-column: 2; justify-self: start; }
  .cart-row__sum { grid-column: 2; }
  .cart-row__del { grid-row: 1; grid-column: 3; }
}
