/* Шрифт со знаком белорусского рубля (НБРБ). Символ — код U+E901 */
@font-face {
  font-family: "nbrb";
  src: url("fonts/nbrb.woff2") format("woff2"),
       url("fonts/nbrb.woff") format("woff"),
       url("fonts/nbrb.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
/* Знак рубля берётся из шрифта nbrb; цифры и остальное — из основного шрифта (fallback) */
.byn { font-family: "nbrb", system-ui, sans-serif; }

/* Скрытые элементы должны действительно скрываться, даже если у них задан display */
[hidden] { display: none !important; }

:root {
  --bg: #eef1f5;
  --card: #ffffff;
  --ink: #12151a;
  --muted: #5b6b7a;
  --line: #d9e0e8;
  --accent: #0066b1;         /* фирменный синий BMW */
  --accent-ink: #ffffff;
  --primary: #0a2e63;        /* тёмно-синий */
  --danger: #e30613;         /* красный M */
  --radius: 20px;
  --shadow: 0 12px 34px rgba(10, 46, 99, 0.16);
  --grad-brand: linear-gradient(135deg, #3aa5e0 0%, #0066b1 55%, #0a2e63 100%);
  --grad-hero: linear-gradient(120deg, #2e9bd6 0%, #0066b1 50%, #0a2e63 100%);
  --grad-cyan: linear-gradient(135deg, #4bb0e6 0%, #0066b1 100%);
}

* { box-sizing: border-box; }
/* Блокировка прокрутки фона при открытой корзине/модалке */
body.no-scroll { overflow: hidden; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(0, 102, 177, 0.12), transparent 42%),
    radial-gradient(circle at 88% 4%, rgba(46, 155, 214, 0.14), transparent 40%),
    radial-gradient(circle at 70% 90%, rgba(10, 46, 99, 0.10), transparent 45%);
  background-attachment: fixed;
  line-height: 1.5;
}
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 16px; height: 68px; }
.logo { font-size: 24px; font-weight: 900; text-decoration: none; color: var(--ink); letter-spacing: -0.5px; }
.logo-mark { color: var(--accent); animation: spin 6s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.logo-accent {
  background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.filters { display: flex; gap: 8px; margin-left: 8px; flex: 1; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  padding: 7px 14px; border-radius: 999px; cursor: pointer; font-size: 14px; font-weight: 600;
  transition: all .15s;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.main-nav { display: flex; gap: 4px; margin-left: 8px; flex-wrap: wrap; }
.main-nav a {
  padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--muted);
  font-weight: 700; font-size: 15px; transition: background .15s, color .15s;
}
.main-nav a:hover { color: var(--ink); }
.main-nav a.active { background: var(--primary); color: #fff; }

.header-phone {
  margin-left: auto; white-space: nowrap; text-decoration: none;
  color: var(--primary); font-weight: 800; font-size: 16px; letter-spacing: .2px;
  transition: color .15s;
}
.header-phone:hover { color: var(--accent); }
.header-phone + .cart-btn { margin-left: 12px; }

/* Режим витрины: цен и заказа нет, вместо них — приглашение позвонить */
.showcase-note {
  margin: 12px 0 0; padding: 10px 14px; border-radius: 12px;
  background: #eef4fb; color: var(--primary); font-size: 14px; font-weight: 600;
}
.btn.add.call {
  display: block; text-align: center; text-decoration: none; margin-top: 10px;
  background: #fff; color: var(--primary); border: 1px solid var(--primary); font-weight: 800;
}
.btn.add.call:hover { background: var(--primary); color: #fff; }
.showcase .card-foot { justify-content: flex-end; }
/* Скрытая корзина не должна занимать место в шапке */
.showcase .cart-btn[hidden] { display: none; }
.showcase .contacts { margin-left: auto; }
.showcase-call { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.showcase-call p { margin: 0 0 4px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.showcase-call .btn { text-decoration: none; text-align: center; }

/* Кнопка «Контакты» с выпадающим списком телефонов */
.contacts { position: relative; margin-left: auto; }
.contacts-btn {
  border: 1px solid var(--line); background: #fff; color: var(--primary);
  padding: 9px 16px; border-radius: 999px; cursor: pointer; font-weight: 800; font-size: 15px;
  white-space: nowrap; font-family: inherit; display: inline-flex; align-items: center; gap: 6px;
  transition: border-color .15s, color .15s;
}
.contacts-btn:hover { border-color: var(--primary); }
.contacts-caret { font-size: 11px; transition: transform .18s; }
.contacts.open .contacts-caret { transform: rotate(180deg); }
.contacts-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .16);
  padding: 10px; min-width: 224px; display: flex; flex-direction: column; gap: 2px;
}
.contacts-panel a {
  text-decoration: none; color: var(--primary); font-weight: 800; font-size: 16px;
  padding: 9px 12px; border-radius: 10px; white-space: nowrap; transition: background .15s;
}
.contacts-panel a:hover { background: #eef4fb; }
.contacts-hours {
  color: var(--muted); font-size: 12px; padding: 6px 12px 2px;
  border-top: 1px solid var(--line); margin-top: 4px;
}
.contacts + .cart-btn { margin-left: 12px; }

.cart-btn {
  border: none; background: var(--grad-brand); color: var(--accent-ink);
  padding: 11px 18px; border-radius: 999px; cursor: pointer; font-weight: 800; font-size: 14px;
  white-space: nowrap; margin-left: auto; box-shadow: 0 6px 18px rgba(0, 102, 177, 0.35);
  transition: transform .15s, box-shadow .15s;
}
.cart-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 102, 177, 0.45); }
.cart-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  background: #fff; color: var(--primary); border-radius: 999px; font-size: 12px; margin-left: 4px; font-weight: 800;
}

/* Главный экран: слоган + слайдер брендов в одну строку */
.hero-inner { display: flex; align-items: center; gap: 32px; }
.hero-text { flex: 1 1 320px; min-width: 0; }
.promo { flex: 0 1 620px; max-width: 620px; }
.promo-dots { margin-top: 8px; }
.promo-stage { position: relative; }
.promo-frame {
  position: relative; width: 100%; aspect-ratio: 12 / 5; border-radius: 22px; overflow: hidden;
  background: linear-gradient(135deg, #eef1f6, #e7ecf3); box-shadow: var(--shadow);
}
.promo-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255, 255, 255, 0.82); color: var(--primary); font-size: 24px; line-height: 1;
  display: grid; place-items: center; box-shadow: 0 4px 14px rgba(10, 46, 99, 0.22);
  transition: background .15s, transform .15s;
}
.promo-nav:hover { background: #fff; transform: translateY(-50%) scale(1.08); }
.promo-nav.prev { left: 12px; }
.promo-nav.next { right: 12px; }
.promo-slide {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .8s ease;
}
.promo-slide.active { opacity: 1; }
.promo-frame { cursor: pointer; }
@keyframes cardFlash {
  0%, 100% { box-shadow: var(--shadow); }
  30% { box-shadow: 0 0 0 3px var(--accent), 0 12px 34px rgba(10, 46, 99, 0.28); }
}
.card.flash { animation: cardFlash 1.5s ease; border-color: var(--accent); }
.promo-dots { display: flex; gap: 7px; justify-content: center; margin-top: 10px; }
.promo-dot {
  width: 9px; height: 9px; border-radius: 999px; border: none; padding: 0; cursor: pointer;
  background: var(--line); transition: transform .2s, background .2s, width .2s;
}
.promo-dot.active { background: #fff; width: 22px; }
.hero .promo-dot { background: rgba(255, 255, 255, 0.45); }
.hero .promo-dot.active { background: #fff; }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  background: var(--grad-hero); background-size: 200% 200%;
  animation: heroFlow 12s ease infinite;
  color: #fff; padding: 44px 0;
}
@keyframes heroFlow { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.hero h1 {
  margin: 0 0 12px;
  font-family: "Oswald", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 42px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; line-height: 1.1;
  text-shadow: 0 2px 20px rgba(0,0,0,0.15); transition: opacity .6s ease;
  /* место под две строки — чтобы блок не «прыгал» при смене лозунга */
  min-height: 2.2em; display: flex; align-items: center;
}
.hero p { margin: 0; color: rgba(255,255,255,0.92); font-size: 17px; }

/* Панель подбора шин */
.filter-panel {
  margin: 24px 0 16px; padding: 18px 20px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.filter-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-title { font-weight: 900; font-size: 17px; background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brands-link {
  text-decoration: none; font-weight: 700; font-size: 14px; color: var(--accent);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s;
}
.brands-link:hover { border-color: var(--accent); background: #eef4fb; }
.filter-fields { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 150px; min-width: 130px; }
.filter-field label { font-size: 12px; font-weight: 700; color: var(--muted); }
.filter-field select {
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px;
  background: #fff; color: var(--ink); cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%236b7280' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px;
}
.filter-field select:focus { outline: none; border-color: var(--ink); }
.reset-btn { flex: 0 0 auto; background: #f3f4f6; color: var(--ink); height: 44px; }
.reset-btn:hover { background: #e5e7eb; }
.filter-result { margin-top: 12px; font-size: 13px; color: var(--muted); font-weight: 600; }

/* Grid */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px; padding-bottom: 40px;
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s, border-color .2s;
  position: relative;
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad-brand);
  opacity: 0; transition: opacity .2s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-4px); border-color: transparent; }
.card:hover::before { opacity: 1; }
.card-img { aspect-ratio: 4/3; display: grid; place-items: center; background: linear-gradient(135deg, #f7fafd, #eef3f8); overflow: hidden; }
.card-img.has-photo { background: #fff; padding: 8px; }
.tire-photo { width: 100%; height: 100%; object-fit: contain; display: block; }
.card-img .tire-photo { transition: transform .2s; }
.card-open:hover .card-img .tire-photo { transform: scale(1.05); }
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-brand { font-size: 12px; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .5px; }
.card-model { font-weight: 800; font-size: 16px; }
.card-meta { color: var(--muted); font-size: 13px; }
.badge {
  display: inline-block; font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 999px;
  background: #eef2ff; color: #4338ca; width: fit-content; letter-spacing: .3px;
}
.badge.summer { background: linear-gradient(135deg, #ffb347, #ff5f6d); color: #fff; }
.badge.winter { background: linear-gradient(135deg, #00d4ff, #4b7bff); color: #fff; }
.badge.allseason { background: linear-gradient(135deg, #2af598, #009efd); color: #fff; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; }
.price { font-size: 19px; font-weight: 900; background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.price .byn { -webkit-text-fill-color: var(--accent); }
.price .req { font-size: 13px; font-weight: 700; color: var(--muted); -webkit-text-fill-color: var(--muted); background: none; }
/* Цена в рассрочку (+7%) под основной ценой */
.price-wrap { display: flex; flex-direction: column; gap: 2px; }
.inst { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.inst .byn { font-family: "nbrb", system-ui, sans-serif; }

/* Итог в окне заказа */
.order-total { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #f7fafd; }
.order-total .ot-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; color: var(--muted); font-weight: 600; }
.order-total .ot-row + .ot-row { margin-top: 6px; }
.order-total .ot-row.main { font-size: 16px; color: var(--ink); font-weight: 800; }
.order-total .ot-row.main b { font-size: 19px; color: var(--primary); }
.order-total .ot-note { margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.4; }
.size-select {
  width: 100%; padding: 9px 30px 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; background: #fff; color: var(--ink); cursor: pointer; appearance: none; margin-top: 2px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%236b7280' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.size-select:focus { outline: none; border-color: var(--ink); }
.card-variants { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.card-open { cursor: pointer; }
.card-open:hover .card-model { color: var(--accent); }
.card-open:hover .card-img { filter: saturate(1.15); }
.card-head { padding: 14px 14px 0; display: flex; flex-direction: column; gap: 6px; }
.card-stock { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.card-stock .in { color: #16a34a; }
.card-stock .low { color: #d97706; }
.card-stock .out { color: var(--danger); }
.card-buy { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.card-buy .btn.add { flex: 1; }
.qty-picker { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qp-btn { width: 32px; height: 38px; border: none; background: #f9fafb; cursor: pointer; font-size: 18px; color: var(--ink); }
.qp-btn:hover { background: #eef0f3; }
.qp-val { min-width: 30px; text-align: center; font-weight: 700; font-size: 15px; }
.btn {
  border: none; cursor: pointer; border-radius: 12px; padding: 11px 16px; font-weight: 800; font-size: 14px;
  transition: transform .15s, box-shadow .15s, opacity .15s, filter .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--grad-brand); color: #fff; box-shadow: 0 6px 16px rgba(10, 46, 99, 0.3); }
.btn.primary:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 10px 22px rgba(10, 46, 99, 0.4); }
.btn.add { background: var(--grad-cyan); color: #fff; box-shadow: 0 6px 16px rgba(0, 102, 177, 0.28); }
.btn.add:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.05); }
.btn.block { width: 100%; }
.empty { text-align: center; color: var(--muted); padding: 40px; }

/* Пагинация */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; padding: 8px 0 48px; }
.page-btn {
  min-width: 40px; height: 40px; padding: 0 12px; border: 1px solid var(--line); background: #fff;
  color: var(--ink); border-radius: 12px; cursor: pointer; font-weight: 700; font-size: 14px;
  transition: border-color .15s, background .15s, color .15s;
}
.page-btn:hover:not(:disabled):not(.active) { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--grad-brand); color: #fff; border-color: transparent; cursor: default; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }
.page-btn.nav { font-size: 18px; }
.page-gap { color: var(--muted); padding: 0 4px; }

/* Drawer (cart) */
.drawer-overlay, .modal-overlay {
  position: fixed; inset: 0; background: rgba(17,24,39,0.5); z-index: 40;
}
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: 400px; max-width: 92vw;
  background: #fff; z-index: 50; display: flex; flex-direction: column; box-shadow: -8px 0 30px rgba(0,0,0,.15);
}
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.drawer-head h2 { margin: 0; font-size: 19px; font-weight: 900; background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.icon-btn { border: none; background: #eef3f8; width: 34px; height: 34px; border-radius: 50%; font-size: 18px; cursor: pointer; color: var(--primary); transition: background .15s; }
.icon-btn:hover { background: #ece7fb; }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 20px; }
.drawer-foot { border-top: 1px solid var(--line); padding: 16px 20px; }
.cart-total { display: flex; justify-content: space-between; font-weight: 800; font-size: 18px; margin-bottom: 12px; }

.cart-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-item-img { width: 56px; height: 56px; border-radius: 10px; background: #f3f4f6; display: grid; place-items: center; flex-shrink: 0; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-title { font-weight: 700; font-size: 14px; }
.cart-item-sub { color: var(--muted); font-size: 12px; }
.qty { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; }
.qty button { width: 26px; height: 26px; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; font-size: 15px; }
.qty span { min-width: 18px; text-align: center; font-weight: 700; }
.cart-item-price { font-weight: 800; white-space: nowrap; }
.remove { border: none; background: none; color: var(--danger); cursor: pointer; font-size: 12px; margin-top: 4px; padding: 0; }
.cart-empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* Modal */
.modal-overlay { display: grid; place-items: center; padding: 20px; }
.modal {
  position: relative;
  background: #fff; border-radius: 24px; width: 420px; max-width: 100%;
  box-shadow: 0 20px 60px rgba(30, 27, 58, 0.28); overflow: hidden;
  animation: popIn .22s cubic-bezier(.2,.8,.3,1.2);
  /* высокие формы не должны вылезать за экран — содержимое прокручивается */
  max-height: 92vh; display: flex; flex-direction: column;
}
.modal .drawer-head { flex: 0 0 auto; }
.modal form { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: var(--grad-brand); z-index: 2;
}
@keyframes popIn { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal form { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); position: relative; }
.modal input {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; color: var(--ink);
}
.modal input:focus { outline: none; border-color: var(--ink); }
.link-btn { position: absolute; right: 0; top: 0; border: none; background: none; color: var(--accent); font-size: 12px; cursor: pointer; font-weight: 700; }
/* Способ доставки в оформлении заказа */
.delivery { display: flex; flex-direction: column; gap: 8px; }
.dlv-title { font-size: 13px; font-weight: 700; color: var(--muted); }
.dlv-opt {
  display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 10px;
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; cursor: pointer;
  transition: border-color .15s, background .15s; margin: 0;
}
.dlv-opt input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }
.dlv-opt b { display: block; font-size: 14px; color: var(--ink); font-weight: 800; }
.dlv-opt em { display: block; font-style: normal; font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 3px; line-height: 1.45; }
.dlv-opt:has(input:checked) { border-color: var(--accent); background: #eef4fb; }

.agree { color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; margin: 0 0 10px; }
.agree a { color: var(--accent); font-weight: 700; text-decoration: underline; }

.hint { color: var(--muted); font-size: 12px; text-align: center; margin: 0; }
.form-error { color: var(--danger); font-size: 13px; margin: 0; font-weight: 600; }

/* Страница товара */
.modal.detail { width: 480px; max-height: 90vh; display: flex; flex-direction: column; }
.detail-head { justify-content: flex-end; border-bottom: none; padding-bottom: 0; }
.detail-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.detail-top { display: flex; gap: 16px; }
.detail-img { width: 150px; height: 150px; flex-shrink: 0; background: linear-gradient(135deg, #f7fafd, #eef3f8); border-radius: 16px; display: grid; place-items: center; overflow: hidden; }
.detail-img.has-photo { background: #fff; padding: 8px; border: 1px solid var(--line); }
.detail-gallery { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.detail-thumbs { display: flex; gap: 6px; }
.thumb {
  width: 42px; height: 42px; padding: 3px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; cursor: pointer; overflow: hidden; transition: border-color .15s;
}
.thumb.active { border-color: var(--primary); border-width: 2px; }
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cart-item-img.has-photo { background: #fff; padding: 3px; }
.cart-item-img.has-photo .tire-photo { border-radius: 6px; }
.detail-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.detail-model { margin: 2px 0 4px; font-size: 20px; line-height: 1.2; }
.detail-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin-top: 6px; }
.detail-specs div { display: flex; justify-content: space-between; font-size: 13px; border-bottom: 1px dashed var(--line); padding-bottom: 3px; }
.detail-specs span { color: var(--muted); }
.detail-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.detail-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price-lg { font-size: 26px; }
.modal.detail .card-buy { margin-top: 0; }

/* Описание модели в карточке товара */
.detail-more { border-top: 1px solid var(--line); padding-top: 12px; }
.detail-more summary {
  cursor: pointer; font-weight: 800; font-size: 15px; list-style: none;
  background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent;
  width: fit-content;
}
.detail-more summary::-webkit-details-marker { display: none; }
.detail-more summary::before { content: "▸ "; -webkit-text-fill-color: var(--accent); }
.detail-more[open] summary::before { content: "▾ "; }
.detail-desc { margin: 10px 0 8px; font-size: 14px; color: var(--ink); line-height: 1.6; }
.detail-feats { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.detail-feats li { font-size: 13px; color: var(--muted); line-height: 1.45; }
.detail-feats li::marker { color: var(--accent); }

.modal.success { text-align: center; padding: 32px 24px; }
.success-icon {
  width: 60px; height: 60px; border-radius: 50%; background: #dcfce7; color: #16a34a;
  display: grid; place-items: center; font-size: 30px; margin: 0 auto 12px;
}
.modal.success h2 { margin: 0 0 6px; }
.modal.success p { color: var(--muted); margin: 0 0 18px; }

/* Уведомление (тост) */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100;
  transform: translateX(-50%) translateY(12px);
  display: flex; align-items: center; gap: 8px;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 14px;
  padding: 12px 20px; border-radius: 999px; box-shadow: 0 10px 30px rgba(10, 46, 99, 0.35);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  max-width: 92vw;
}
.toast::before { content: "✓"; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #fff; color: var(--primary); font-size: 13px; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.warn { background: var(--danger); }
.toast.warn::before { content: "!"; color: var(--danger); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 22px 0 30px; color: var(--muted); font-size: 13px; margin-top: 40px; }
.site-footer .legal { margin: 0 0 8px; font-size: 12px; line-height: 1.6; }
.site-footer .legal.note { font-style: italic; color: #7b8794; }
.site-footer .legal a { color: var(--accent); text-decoration: none; font-weight: 700; font-style: normal; }
.site-footer .legal a:hover { text-decoration: underline; }

/* Планшеты и уже: слоган сверху, слайдер под ним */
@media (max-width: 900px) {
  /* В столбик flex-basis задаёт высоту — поэтому явно сбрасываем, иначе появляется пустота */
  .hero-inner { flex-direction: column; align-items: stretch; gap: 18px; }
  .hero-text { flex: 0 0 auto; }
  .promo { flex: 0 0 auto; max-width: 100%; }
}

/* Телефоны */
@media (max-width: 640px) {
  .container { padding: 0 14px; }
  /* Шапка: логотип и корзина в строке, навигация — отдельной строкой во всю ширину */
  .header-inner { height: auto; padding: 10px 0; flex-wrap: wrap; align-items: center; gap: 8px; }
  .logo { font-size: 19px; order: 1; flex: 0 0 auto; }
  /* Корзина всегда прижата вправо в первой строке (перебиваем правило для телефона) */
  .cart-btn, .header-phone + .cart-btn, .contacts + .cart-btn { order: 2; margin-left: auto; padding: 9px 14px; font-size: 13px; flex: 0 0 auto; }
  .header-phone { order: 3; width: 100%; margin-left: 0; text-align: center; font-size: 15px; }
  /* «Контакты» — отдельной строкой во всю ширину, список раскрывается по центру */
  .contacts { order: 3; width: 100%; margin-left: 0; }
  .contacts-btn { width: 100%; justify-content: center; font-size: 14px; padding: 8px 14px; }
  .contacts-panel { left: 0; right: 0; min-width: 0; }
  .contacts-panel a { text-align: center; }
  .contacts-hours { text-align: center; }
  .main-nav { order: 4; width: 100%; margin-left: 0; justify-content: center; gap: 6px; }
  .main-nav a { padding: 7px 14px; font-size: 14px; }

  .hero { padding: 30px 0; border-radius: 0 0 22px 22px; }
  /* на телефоне длинные слоганы занимают до 3 строк — резервируем место, чтобы не прыгало */
  .hero h1 { font-size: 23px; min-height: 3.3em; align-items: flex-start; }
  .hero p { font-size: 14px; }

  .promo-nav { width: 34px; height: 34px; font-size: 20px; }

  .filter-panel { padding: 14px; }
  .filter-field { flex: 1 1 46%; min-width: 0; }
  .reset-btn { width: 100%; flex: 1 1 100%; }

  /* Каталог — 2 колонки */
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-head { padding: 12px 12px 0; }
  .card-body { padding: 12px; gap: 5px; }
  .card-model { font-size: 14px; }
  .card-brand { font-size: 11px; }
  .price { font-size: 16px; }
  /* цена и наличие в столбик — иначе «Осталось N шт» обрезается */
  .card-foot { flex-direction: column; align-items: flex-start; gap: 2px; }
  .card-stock { white-space: normal; font-size: 12px; }
  .size-select { font-size: 13px; padding: 8px 26px 8px 10px; }
  /* Количество и кнопка — в столбик, чтобы не сжимались */
  .card-buy { flex-direction: column; align-items: stretch; gap: 6px; }
  .card-buy .btn.add { width: 100%; }
  .qty-picker { justify-content: space-between; }
  .qp-btn { flex: 1; }

  /* Модалки — на всю ширину экрана */
  .modal-overlay { padding: 12px; }
  .modal { width: 100%; max-width: 100%; }
  .modal form { padding: 16px; }
  .modal.detail { width: 100%; max-height: 94vh; }
  .detail-body { padding: 16px; }
  .detail-top { flex-direction: column; align-items: center; text-align: center; }
  .detail-gallery, .detail-img { width: 100%; }
  .detail-img { width: 190px; height: 190px; margin: 0 auto; }
  .detail-thumbs { justify-content: center; }
  .detail-info { align-items: center; }
  .detail-specs { width: 100%; }

  .modal { border-radius: 20px; }
  .drawer { width: 100%; max-width: 100%; }

  .pagination { padding: 8px 0 32px; }
  .page-btn { min-width: 36px; height: 36px; }
}
