/* FourStone — «Четыре камня».
   Палитра природного камня, формы-гальки, личный голос байера.
   Вёрстка от телефона: всё главное — под большим пальцем. */
:root {
  --limestone: #efede9;   /* фон страницы */
  --paper: #fbfaf8;       /* листы и карточки */
  --sand: #e2ddd4;        /* подложка под фото */
  --sand-deep: #b9ae9c;
  --graphite: #2c2b28;    /* текст */
  --slate: #6c6862;       /* второстепенный текст */
  --moss: #66705a;        /* акцент: «новое», активное */
  --rust: #8a4330;        /* только скидки */
  --line: #dcd8d1;
  --ok: #3f5a45;
  --warn: #8a5a14;
  --pebble: 46% 54% 52% 48% / 58% 50% 50% 42%;
  --r-photo: 18px;
  --r-sheet: 26px;
  --font-brand: "Tenor Sans", Georgia, serif;
  --font: "Golos Text", system-ui, -apple-system, sans-serif;
  --gutter: 16px;
  --bottom-bar: 64px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--limestone); color: var(--graphite); font: 400 15px/1.55 var(--font); }
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--moss); outline-offset: 2px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 900px) { :root { --gutter: 32px; } }
.mark { width: 30px; height: 30px; flex: none; }

/* ── шапка ── */
.top { position: sticky; top: 0; z-index: 30; background: rgba(239,237,233,.92); backdrop-filter: saturate(1.4) blur(10px); }
.top .wrap { display: flex; align-items: center; gap: 10px; height: 58px; }
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; font: 400 20px/1 var(--font-brand); letter-spacing: .04em; }
.top nav { margin-left: auto; display: none; gap: 26px; }
.top nav a { text-decoration: none; font-size: 14px; color: var(--slate); }
.top nav a[aria-current="true"], .top nav a:hover { color: var(--graphite); }
.top .wa-round { margin-left: auto; width: 40px; height: 40px; border-radius: var(--pebble); background: var(--paper); display: grid; place-items: center; }
.top .wa-round svg { width: 20px; height: 20px; }
@media (min-width: 900px) { .top nav { display: flex; } .top .wa-round { margin-left: 0; } }

/* ── нижнее меню на телефоне ── */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--bottom-bar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(251,250,248,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; font-size: 11px; color: var(--slate); }
.tabbar svg { width: 22px; height: 22px; }
.tabbar a[aria-current="true"] { color: var(--graphite); }
.tabbar a[aria-current="true"] svg { color: var(--moss); }
body.has-tabbar { padding-bottom: calc(var(--bottom-bar) + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { .tabbar { display: none; } body.has-tabbar { padding-bottom: 0; } }

/* ── приветствие байера ── */
.hello { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; background: var(--paper);
  border-radius: var(--r-sheet); padding: 16px; margin: 6px 0 0; }
.avatar { width: 64px; height: 64px; border-radius: var(--pebble); object-fit: cover; background: var(--sand); display: grid; place-items: center;
  font: 400 26px/1 var(--font-brand); color: var(--graphite); }
.hello b { display: block; font: 400 17px/1.25 var(--font-brand); margin-bottom: 3px; }
.hello p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--slate); }
.headline { font: 400 clamp(25px, 7vw, 44px)/1.12 var(--font-brand); margin: 26px 0 4px; letter-spacing: -.005em; max-width: 18ch; }
@media (min-width: 900px) { .hello { max-width: 560px; margin-top: 18px; } }

/* ── фильтры ── */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 16px calc(var(--gutter) * -1) 0; padding: 0 var(--gutter) 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; text-decoration: none; font-size: 14px; white-space: nowrap; padding: 9px 15px; border-radius: 999px; background: var(--paper); color: var(--graphite); }
.chip[aria-current="true"] { background: var(--graphite); color: var(--paper); }
.search { display: flex; gap: 8px; margin-top: 14px; }
.search input[type=search] { border-radius: 999px; background: var(--paper); border: 1px solid transparent; padding: 12px 18px; }
.search input[type=search]:focus { border-color: var(--line); }
@media (min-width: 900px) { .filters { display: flex; align-items: center; gap: 16px; } .filters .chips { margin: 16px 0 0; padding: 0; flex: 1; } .filters .search { width: 300px; } }

/* ── сетка товаров ── */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 10px; padding: 18px 0 36px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 34px 18px; } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.card { text-decoration: none; display: block; }
.card .ph { position: relative; aspect-ratio: 3/4; border-radius: var(--r-photo); overflow: hidden; background: var(--sand); }
.card .ph img { width: 100%; height: 100%; object-fit: cover; transition: opacity .35s; }
.card .ph img + img { position: absolute; inset: 0; opacity: 0; }
@media (hover: hover) { .card:hover .ph img + img { opacity: 1; } }
.pill { position: absolute; font-size: 11.5px; line-height: 1; padding: 6px 9px; border-radius: 999px; background: rgba(251,250,248,.92); color: var(--graphite); }
.pill.origin { left: 8px; top: 8px; }
.pill.new { right: 8px; top: 8px; background: var(--moss); color: var(--paper); }
.pill.sale { right: 8px; top: 8px; background: var(--rust); color: var(--paper); }
.pill.price { left: 8px; bottom: 8px; font-size: 13px; padding: 7px 11px; font-variant-numeric: tabular-nums; }
.card h3 { font: 400 14px/1.35 var(--font); margin: 10px 2px 0; }
.card .meta { font-size: 12.5px; color: var(--slate); margin: 2px 2px 0; }

.empty { background: var(--paper); border-radius: var(--r-sheet); padding: 24px 20px; margin: 18px 0 36px; color: var(--slate); }
.empty .btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* ── страница товара ── */
.gallery-wrap { position: relative; margin: 0 calc(var(--gutter) * -1); }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--sand); }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: none; width: 100%; aspect-ratio: 3/4; object-fit: cover; scroll-snap-align: start; }
.dots { position: absolute; left: 0; right: 0; bottom: 38px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.dots i { width: 7px; height: 7px; border-radius: var(--pebble); background: rgba(251,250,248,.55); transition: background .2s, transform .2s; }
.dots i.on { background: var(--paper); transform: scale(1.25); }
.back { position: absolute; left: 12px; top: 12px; z-index: 2; width: 40px; height: 40px; border-radius: var(--pebble); background: rgba(251,250,248,.9); display: grid; place-items: center; text-decoration: none; }
.back svg { width: 20px; height: 20px; }
.sheet { position: relative; background: var(--paper); border-radius: var(--r-sheet) var(--r-sheet) 0 0; margin: -26px calc(var(--gutter) * -1) 0; padding: 22px var(--gutter) 24px; }
.info .brandline { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--slate); margin: 0 0 6px; }
.info h1 { font: 400 clamp(23px, 6vw, 32px)/1.18 var(--font-brand); margin: 0 0 10px; }
.info .price { font-size: 21px; margin: 0; font-variant-numeric: tabular-nums; }
.note { font-size: 13px; color: var(--slate); margin: 6px 0 0; }
.quote { display: grid; grid-template-columns: 44px 1fr; gap: 12px; background: var(--limestone); border-radius: 20px; padding: 14px; margin: 18px 0 0; }
.quote .avatar { width: 44px; height: 44px; font-size: 18px; }
.quote p { margin: 0; font-size: 14px; }
.quote div > span { display: block; font-size: 12px; color: var(--slate); margin-bottom: 2px; }
dl.spec { display: grid; grid-template-columns: 96px 1fr; margin: 22px 0 0; font-size: 14px; }
dl.spec dt, dl.spec dd { padding: 11px 0; border-bottom: 1px solid var(--line); margin: 0; }
dl.spec dt { color: var(--slate); }
.check { color: var(--warn); }
@media (min-width: 900px) {
  .product { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, 1fr); gap: 48px; align-items: start; padding-top: 18px; }
  .gallery-wrap { margin: 0; }
  .gallery { flex-direction: column; overflow: visible; gap: 10px; background: none; }
  .gallery img { border-radius: var(--r-photo); }
  .dots, .back { display: none; }
  .sheet { margin: 0; border-radius: var(--r-sheet); position: sticky; top: 76px; padding: 28px; }
}

/* ── формы ── */
label { display: block; font-size: 13px; color: var(--slate); margin: 16px 0 6px; }
input, select, textarea { width: 100%; font: inherit; font-size: 16px; color: var(--graphite); padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--moss); }
textarea { min-height: 90px; }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick label { margin: 0; }
.pick input { position: absolute; opacity: 0; width: 1px; }
.pick span { display: inline-block; min-width: 48px; text-align: center; padding: 10px 15px; border-radius: 999px; background: var(--limestone); font-size: 14px; color: var(--graphite); cursor: pointer; border: 1px solid transparent; }
.pick input:checked + span { background: var(--graphite); color: var(--paper); }
.pick input:focus-visible + span { outline: 2px solid var(--moss); outline-offset: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  font: 500 15px/1 var(--font); padding: 16px 20px; border-radius: 999px; text-decoration: none; background: var(--graphite); color: var(--paper); }
.btn:active { transform: scale(.98); }
.btn.ghost, .btn.wa { background: var(--limestone); color: var(--graphite); }
.btn svg { width: 18px; height: 18px; }
.btn.small { padding: 10px 14px; font-size: 13px; }
.btn.danger { background: #f6e7e4; color: #8f1d22; }
.btn.full { width: 100%; }
.cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: 1fr auto; gap: 8px;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); background: rgba(251,250,248,.97); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.cta .btn.wa { width: 54px; padding: 0; border-radius: var(--pebble); }
body.has-cta { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { .cta { position: static; padding: 0; background: none; border: 0; margin-top: 20px; backdrop-filter: none; } body.has-cta { padding-bottom: 0; } }

.ok { background: #e6eee6; color: var(--ok); padding: 12px 14px; border-radius: 14px; font-size: 14px; }
.err { background: #f6e7e4; color: #8f1d22; padding: 12px 14px; border-radius: 14px; font-size: 14px; }
.warn { background: #f4ecdd; color: var(--warn); padding: 10px 12px; border-radius: 14px; font-size: 14px; }

.narrow { max-width: 560px; }
.page { background: var(--paper); border-radius: var(--r-sheet); padding: 22px var(--gutter) 26px; margin: 8px calc(var(--gutter) * -1) 28px; }
@media (min-width: 600px) { .page { margin: 18px 0 40px; padding: 30px; } }
.page-title { font: 400 clamp(25px, 7vw, 36px)/1.15 var(--font-brand); margin: 0 0 10px; }
.lead { color: var(--slate); margin: 0 0 20px; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 24px 0 0; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; align-items: start; padding: 12px 0; font-size: 14px; border-top: 1px solid var(--line); }
.steps li::before { content: counter(s); width: 24px; height: 24px; border-radius: var(--pebble); background: var(--limestone); display: grid; place-items: center; font-size: 12px; color: var(--slate); }
.estimate { margin-top: 16px; background: var(--limestone); border-radius: 18px; padding: 6px 14px; }
.estimate:empty { display: none; }
.estimate table { width: 100%; border-collapse: collapse; font-size: 14px; }
.estimate td { padding: 9px 0; border-bottom: 1px solid var(--line); }
.estimate tr:last-child td { border: 0; }
.estimate td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.preview { display: flex; gap: 14px; align-items: center; background: var(--limestone); border-radius: 18px; padding: 10px; }
.preview img { width: 60px; height: 80px; object-fit: cover; border-radius: 12px; background: var(--sand); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }

footer.site { padding: 8px 0 28px; color: var(--slate); font-size: 12.5px; }
footer.site .wrap { display: flex; align-items: center; gap: 10px; }
footer.site .mark { width: 22px; height: 22px; opacity: .8; }

/* ── панель Асель (работает на тех же токенах) ── */
.admin { background: var(--limestone); }
.admin .top { background: var(--graphite); color: var(--paper); }
.admin .logo { color: var(--paper); }
.admin .top .wrap { overflow-x: auto; }
.admin .top nav { display: flex; margin-left: auto; gap: 16px; }
.admin .top nav a { color: rgba(251,250,248,.7); }
.admin .top nav a[aria-current="true"] { color: var(--paper); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 16px 0 8px; }
.tabs a { flex: none; text-decoration: none; font-size: 13px; padding: 8px 13px; border-radius: 999px; background: var(--paper); }
.tabs a[aria-current="true"] { background: var(--graphite); color: var(--paper); }
.admin .search input { border-radius: 14px; }
.rows { display: flex; flex-direction: column; gap: 8px; padding: 10px 0 40px; }
.row { display: flex; gap: 12px; background: var(--paper); border-radius: 18px; padding: 10px; text-decoration: none; }
.row img, .row .noimg { width: 72px; height: 96px; object-fit: cover; flex: none; border-radius: 12px; background: var(--sand); }
.row h3 { margin: 0 0 4px; font-size: 15px; font-weight: 500; }
.row p { margin: 0; font-size: 13px; color: var(--slate); }
.badge { display: inline-block; font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--limestone); margin-top: 4px; }
.badge.warn { background: #f4ecdd; color: var(--warn); padding: 3px 9px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.actions form { margin: 0; }
.thumbs { display: flex; gap: 6px; overflow-x: auto; margin-top: 16px; }
.thumbs img { width: 96px; height: 128px; object-fit: cover; flex: none; border-radius: 12px; background: var(--sand); }
pre.wa { white-space: pre-wrap; background: var(--paper); border-radius: 18px; padding: 14px; font: 14px/1.5 var(--font); }
details summary { cursor: pointer; margin: 16px 0; font-size: 14px; }
.status-list { list-style: none; padding: 0; margin: 0; }
.status-list li { background: var(--paper); border-radius: 18px; padding: 12px 14px; margin-bottom: 8px; }
.status-list b { display: block; font-weight: 500; }
.admin .page-title { margin-top: 24px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.admin .mark path:first-child { fill: var(--paper); }
