/* Витрина Apple Stock YKT.
   Мобильный макет — основной: с телефона приходит большинство покупателей,
   поэтому навигация вынесена в нижнюю панель, а карточки рассчитаны на палец. */

:root {
  --bg:          #f2f4f7;
  --surface:     #ffffff;
  --surface-2:   #e9edf2;
  --line:        #dde3ea;
  --ink:         #14181f;
  --ink-2:       #59616d;
  --ink-3:       #858e9b;
  --accent:      #1d5fd6;
  --accent-ink:  #ffffff;
  --accent-soft: #e6eefc;
  --good:        #16794f;
  --warn:        #a35b06;
  --radius:      16px;
  --radius-sm:   10px;
  --shadow-1:    0 1px 2px rgba(20, 24, 31, .05);
  --shadow-2:    0 4px 16px rgba(20, 24, 31, .08);
  --bar:         64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1015; --surface: #161a21; --surface-2: #1f242c; --line: #2a313a;
    --ink: #e8ecf1; --ink-2: #a7b0bc; --ink-3: #7b8494;
    --accent: #6aa0f5; --accent-ink: #0b0e13; --accent-soft: #17263d;
    --good: #56c294; --warn: #d9a441;
    --shadow-1: 0 1px 2px rgba(0,0,0,.5); --shadow-2: 0 4px 16px rgba(0,0,0,.45);
  }
}
:root[data-theme="dark"] {
  --bg: #0d1015; --surface: #161a21; --surface-2: #1f242c; --line: #2a313a;
  --ink: #e8ecf1; --ink-2: #a7b0bc; --ink-3: #7b8494;
  --accent: #6aa0f5; --accent-ink: #0b0e13; --accent-soft: #17263d;
  --good: #56c294; --warn: #d9a441;
  --shadow-1: 0 1px 2px rgba(0,0,0,.5); --shadow-2: 0 4px 16px rgba(0,0,0,.45);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--bar) + env(safe-area-inset-bottom));
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.015em; text-wrap: balance; }
button, input, select, textarea { font: inherit; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.error { color: #c0392b; font-weight: 600; }
.empty { color: var(--ink-2); padding: 40px 0; text-align: center; }
.nowrap { white-space: nowrap; }

/* ── Шапка ── */
.site-header {
  position: sticky; top: 0; z-index: 30; background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 14px; padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 14px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 15px; }
.brand-text small { color: var(--ink-3); font-size: 11.5px; }
.search { flex: 1 1 auto; display: flex; gap: 8px; min-width: 0; }
.search input {
  flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--bg); color: var(--ink); font-size: 15px;
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.search button {
  padding: 10px 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
}
.header-actions { display: flex; gap: 6px; align-items: center; }
.icon-link {
  position: relative; display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 12px; color: var(--ink-2); font-size: 19px;
}
.icon-link:hover { background: var(--surface-2); color: var(--accent); }
.badge {
  position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink);
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
}

/* ── Нижняя панель (телефон) ── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: none;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 0 7px; color: var(--ink-3); font-size: 11px; position: relative;
}
.tabbar a.on { color: var(--accent); }
.tabbar i { font-style: normal; font-size: 20px; line-height: 1; }
.tabbar .badge { top: 2px; right: calc(50% - 20px); }

/* ── Главная ── */
.hero {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: center;
  padding: 36px 0 10px;
}
.hero h1 { font-size: clamp(28px, 5vw, 44px); }
.hero p { color: var(--ink-2); font-size: 17px; margin: 14px 0 0; max-width: 52ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.hero-points { display: flex; gap: 22px; list-style: none; padding: 0; margin: 22px 0 0; flex-wrap: wrap; }
.hero-points li { display: flex; flex-direction: column; }
.hero-points b { font-size: 15px; }
.hero-points span { color: var(--ink-3); font-size: 13px; }
.hero-art { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hero-art img {
  aspect-ratio: 1; object-fit: contain; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-1); padding: 8px;
}

/* ── Кнопки ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 12px; border: 1px solid transparent;
  cursor: pointer; font-weight: 600; font-size: 15px; min-height: 46px;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.07); color: var(--accent-ink); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; min-height: 38px; font-size: 14px; }
.btn-icon {
  background: var(--surface); border: 1px solid var(--line); width: 42px; height: 42px;
  border-radius: 11px; color: var(--ink-2); cursor: pointer; display: grid;
  place-items: center; font-size: 16px;
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }

/* ── Сетки ── */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 36px 0 14px; gap: 12px; }
.section-head h2 { font-size: 22px; }
.section-head a { color: var(--accent); font-size: 14px; font-weight: 600; }
.grid { display: grid; gap: 12px; }
.grid-sections { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.grid-products { grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); }

.section-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 3px; min-height: 108px;
  box-shadow: var(--shadow-1); transition: border-color .15s, transform .15s;
}
.section-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.section-card .emoji { font-size: 24px; margin-bottom: 4px; }
.section-card b { font-size: 15px; }
.section-card small { color: var(--ink-3); font-size: 13px; }

.product-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-1);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.product-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-2); }
.product-card .shot {
  aspect-ratio: 1; background: var(--surface-2); display: grid; place-items: center;
  padding: 10px;
}
.product-card .shot img { width: 100%; height: 100%; object-fit: contain; }
.product-card .body { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.product-card b { font-size: 14.5px; line-height: 1.3; }
.product-card small { color: var(--ink-3); font-size: 12.5px; }
.product-card .price { margin-top: auto; padding-top: 8px; font-weight: 700; font-size: 16px; }
.product-card .price span { font-weight: 500; color: var(--ink-3); font-size: 12.5px; }

/* ── Каталог ── */
.crumbs { color: var(--ink-3); font-size: 13.5px; padding: 18px 0 4px; }
.crumbs a:hover { color: var(--accent); }
.page-title { font-size: clamp(24px, 4.5vw, 32px); margin: 6px 0 4px; }
.page-lead { color: var(--ink-2); max-width: 62ch; margin: 8px 0 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip-link {
  flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line); font-size: 14px; white-space: nowrap;
}
.chip-link.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ── Карточка товара ── */
.product { display: grid; grid-template-columns: minmax(0, 420px) 1fr; gap: 32px; padding: 10px 0 32px; }
.product-media {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: grid; place-items: center; aspect-ratio: 1;
  box-shadow: var(--shadow-1);
}
.product-media img { width: 100%; height: 100%; object-fit: contain; }
.product-info h1 { font-size: clamp(22px, 4vw, 30px); margin: 10px 0 8px; }
.tag {
  display: inline-block; padding: 4px 11px; border-radius: 999px; background: var(--accent-soft);
  color: var(--accent); font-size: 13px; font-weight: 600;
}
.variants { margin: 20px 0; display: grid; gap: 10px; }
.variant {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
}
.variant:hover { border-color: var(--accent); }
.variant-name { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.variant-name b { font-size: 15px; }
.spec-row { display: flex; gap: 6px; flex-wrap: wrap; }
.spec {
  font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2);
  color: var(--ink-2);
}
.variant-buy { display: flex; align-items: center; gap: 10px; }
.variant-buy .price { font-weight: 700; font-size: 17px; min-width: 108px; }
.notes { display: grid; gap: 8px; margin: 20px 0; padding: 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); }
.notes h3 { font-size: 15px; margin-bottom: 2px; }
.notes p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.assurances { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 7px; color: var(--ink-2); font-size: 14.5px; }

/* ── Корзина, формы ── */
.cart { display: grid; grid-template-columns: 1fr 330px; gap: 22px; align-items: start; padding-bottom: 32px; }
.cart-rows { display: grid; gap: 10px; }
.cart-row {
  display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px;
}
.cart-row .shot { width: 76px; aspect-ratio: 1; background: var(--surface-2); border-radius: var(--radius-sm); display: grid; place-items: center; padding: 6px; }
.cart-row .shot img { width: 100%; height: 100%; object-fit: contain; }
.cart-row-main small { display: block; color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.cart-row-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.qty button { width: 38px; height: 38px; border: 0; background: var(--surface); color: var(--ink); cursor: pointer; font-size: 17px; }
.qty button:hover { background: var(--surface-2); color: var(--accent); }
.qty span { min-width: 38px; text-align: center; font-weight: 600; font-size: 15px; }
.cart-sum { font-weight: 700; min-width: 104px; text-align: right; }
.cart-total, .card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-1);
}
.cart-total { position: sticky; top: 78px; }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.row:last-child { border-bottom: 0; }
.row.total { border-bottom: 0; font-size: 18px; padding-top: 12px; }
.card-narrow { max-width: 440px; margin: 32px auto; }
.card-center { max-width: 680px; margin: 32px auto; }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.form input, .form select, .form textarea {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--bg); color: var(--ink); font-weight: 400; min-height: 46px;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ── Кабинет ── */
.account-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding-top: 20px; flex-wrap: wrap; }
.orders { display: grid; gap: 12px; }
.order-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; background: var(--surface-2); color: var(--ink-2); }
.chip.good { background: rgba(22,121,79,.12); color: var(--good); }

/* ── Как купить ── */
.how { margin: 40px 0; }
.how ol { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; padding: 0; margin: 14px 0 0; list-style: none; counter-reset: step; }
.how li { counter-increment: step; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 5px; }
.how li::before { content: counter(step); width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px; }
.how span { color: var(--ink-2); font-size: 14px; }

/* ── Подвал ── */
.site-footer { margin-top: 44px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 26px; padding: 30px 16px 16px; }
.footer-grid p { color: var(--ink-2); font-size: 14px; max-width: 44ch; }
.footer-grid ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; color: var(--ink-2); font-size: 14px; }
.copy { color: var(--ink-3); font-size: 13px; padding: 0 16px 24px; }

/* ── Планшет и телефон ── */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding-top: 24px; }
  .hero-art { grid-template-columns: repeat(4, 1fr); }
  .product { grid-template-columns: 1fr; gap: 18px; }
  .cart { grid-template-columns: 1fr; }
  .cart-total { position: static; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { padding-bottom: calc(var(--bar) + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; }
  .header-actions { display: none; }
  .brand-text { display: none; }
  .header-inner { padding: 8px 12px; gap: 10px; }
  .wrap { padding: 0 12px; }
  .grid-products { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid-sections { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .section-head { margin: 26px 0 10px; }
  .cart-row { grid-template-columns: 64px 1fr; }
  .cart-row .shot { width: 64px; }
  .cart-row-side { grid-column: 1 / -1; justify-content: space-between; }
  .cart-sum { text-align: left; }
  .variant { flex-direction: column; align-items: stretch; }
  .variant-buy { justify-content: space-between; }
  .variant-buy .price { min-width: 0; }
  .product-media { aspect-ratio: 4 / 3; padding: 12px; }
  .site-footer { margin-bottom: 0; }
}
