:root {
  --bg: #f4f1ea;
  --card: #ffffff;
  --ink: #1d1b19;
  --muted: #6f6a62;
  --line: #e2ddd3;
  --accent: #e4572e;
  --accent-ink: #ffffff;
  --ok: #2e7d4f;
  --err: #c0392b;
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* Шапка */
.top { position: sticky; top: 0; z-index: 20; background: rgba(244, 241, 234, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-weight: 800; font-size: 22px; letter-spacing: -.5px; text-decoration: none; }
.logo span { color: var(--accent); }
.cart-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-weight: 600; }
.cart-btn b { background: var(--accent); border-radius: 999px; min-width: 22px; height: 22px; display: inline-grid; place-items: center; font-size: 13px; padding: 0 6px; }

/* Вступ */
.hero { padding: 28px 0 8px; }
.hero h1 { font-size: clamp(28px, 7vw, 48px); line-height: 1.05; margin: 0 0 10px; letter-spacing: -1px; }
.hero p { margin: 0; color: var(--muted); max-width: 560px; }

/* Пошук і категорії */
.tools { display: flex; flex-direction: column; gap: 10px; padding: 18px 0 6px; }
.search { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip { white-space: nowrap; border: 1px solid var(--line); background: var(--card); padding: 8px 14px; border-radius: 999px; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Товари */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 12px 0 40px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line); }
.card .ph { aspect-ratio: 1; background: #ece8df; display: grid; place-items: center; color: var(--muted); font-size: 34px; }
.card .ph img { width: 100%; height: 100%; object-fit: cover; font-size: 12px; color: var(--muted); }
.card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card .name { font-weight: 600; font-size: 15px; line-height: 1.25; }
.card .vol { color: var(--muted); font-size: 13px; }
.card .row { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.price { font-weight: 800; font-size: 17px; }
.price s { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 4px; }
.add { border: 0; background: var(--accent); color: var(--accent-ink); width: 40px; height: 40px; border-radius: 12px; font-size: 22px; line-height: 1; }
.add.done { background: var(--ok); }
.empty { padding: 40px 0; text-align: center; color: var(--muted); }

/* Інформація */
.info { display: grid; gap: 12px; padding: 0 0 40px; }
@media (min-width: 700px) { .info { grid-template-columns: repeat(3, 1fr); } }
.info div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.info h3 { margin: 0 0 6px; font-size: 16px; }
.info p { margin: 0; color: var(--muted); font-size: 14px; }
footer { border-top: 1px solid var(--line); padding: 20px 0 90px; color: var(--muted); font-size: 13px; }

/* Кошик (висувна панель) */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 40; display: none; }
.overlay.on { display: block; }
.drawer { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; max-height: 92dvh; background: var(--bg); border-radius: 20px 20px 0 0; transform: translateY(105%); transition: transform .25s; display: flex; flex-direction: column; }
@media (min-width: 700px) { .drawer { left: auto; top: 0; width: 440px; max-height: none; border-radius: 0; transform: translateX(105%); } }
.drawer.on { transform: none; }
.drawer header { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); }
.drawer header h2 { margin: 0; font-size: 20px; }
.x { border: 0; background: none; font-size: 28px; line-height: 1; padding: 0 4px; }
.drawer .scroll { overflow-y: auto; padding: 12px 16px 24px; }
.line { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.line .ph { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: #ece8df; display: grid; place-items: center; }
.line .ph img { width: 100%; height: 100%; object-fit: cover; font-size: 10px; color: var(--muted); }
.qty { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; }
.qty button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); }
.total { display: flex; justify-content: space-between; font-size: 18px; font-weight: 800; padding: 14px 0; }

/* Форми */
form { display: grid; gap: 12px; }
label { display: grid; gap: 5px; font-size: 14px; font-weight: 600; }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-weight: 400; }
textarea { min-height: 70px; resize: vertical; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg label { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--card); padding: 11px; border-radius: 10px; font-weight: 600; }
.seg input { width: auto; }
.err { color: var(--err); font-size: 13px; font-weight: 400; }
.hp { position: absolute; left: -9999px; }
.primary { border: 0; background: var(--accent); color: var(--accent-ink); padding: 14px; border-radius: 12px; font-weight: 700; font-size: 16px; }
.primary:disabled { opacity: .6; }
.note { color: var(--muted); font-size: 13px; margin: 0; }
.success { text-align: center; padding: 30px 10px; }
.success h3 { font-size: 22px; margin: 0 0 8px; }

/* Плаваюча кнопка кошика на телефоні */
.float-cart { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 30; display: none; }
.float-cart.on { display: flex; justify-content: center; }
.float-cart .cart-btn { width: 100%; justify-content: center; padding: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
@media (min-width: 700px) { .float-cart.on { display: none; } }
