:root {
    --ink: #1b1f24;
    --muted: #6b7280;
    --line: #e5e7eb;
    --bg: #fff;
    --soft: #f6f7f9;
    --accent: #0b6e8f;
    --accent-ink: #fff;
    --promo: #0a7a4b;
    --tg: #2aabee;
    --radius: 10px;
    --max: 1120px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
main { max-width: var(--max); margin: 0 auto; padding: 0 16px 48px; }

.top { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 16px; }
.brand { display: flex; align-items: baseline; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-word { font-weight: 700; font-size: 22px; letter-spacing: .02em; color: var(--accent); }
.brand-sub { font-size: 13px; color: var(--muted); }
.top-nav { display: flex; align-items: center; gap: 18px; font-size: 15px; }
.cart-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); }
.badge { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; line-height: 20px; text-align: center; }
.badge:empty, .badge[data-zero] { display: none; }

.hero { padding: 56px 0 32px; max-width: 760px; }
.hero h1 { font-size: 34px; }
.hero p { font-size: 17px; color: #374151; }
.promo { display: inline-block; padding: 10px 14px; border-radius: var(--radius); background: #e8f6ee; color: var(--promo); font-weight: 600; }
.btn { display: inline-block; padding: 9px 16px; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-lg { padding: 13px 22px; font-size: 17px; }
.btn-tg { background: var(--tg); }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }

.why { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 24px 0 40px; }
.why > div { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); }
.why h3 { font-size: 16px; }
.why p { margin: 0; font-size: 14px; color: #374151; }

.sections { display: flex; flex-wrap: wrap; gap: 8px; position: sticky; top: 57px; z-index: 5; background: var(--bg); padding: 10px 0; border-bottom: 1px solid var(--line); }
.sections a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); font-size: 14px; }
.sections a:hover { border-color: var(--accent); text-decoration: none; }
.section { padding-top: 28px; scroll-margin-top: 120px; }
.section h2 { font-size: 24px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }

.card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--bg); }
.card-img { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: var(--soft); border-radius: 8px; overflow: hidden; margin-bottom: 10px; }
.card-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.no-img { color: var(--muted); font-size: 13px; }
.card h3 { font-size: 16px; }
.desc { margin: 0 0 4px; font-size: 14px; color: #374151; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.desc.open { display: block; }
.card .link { font-size: 13px; align-self: flex-start; margin-bottom: 8px; }
.variants { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.chip { position: relative; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); font: inherit; font-size: 13px; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.chip-qty:not(:empty) { margin-left: 6px; padding: 0 5px; border-radius: 999px; background: var(--promo); color: #fff; font-size: 11px; }
.buy { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.price { font-weight: 700; font-size: 17px; white-space: nowrap; }
.stepper { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stepper button { width: 32px; border: 0; background: var(--soft); font-size: 18px; cursor: pointer; }
.stepper input { width: 48px; border: 0; text-align: center; font: inherit; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.card.added { box-shadow: 0 0 0 2px var(--promo); transition: box-shadow .2s; }
.empty { padding: 40px 0; color: var(--muted); }
.card h3 a { color: inherit; }
.card .more { font-size: 13px; align-self: flex-start; margin-bottom: 8px; }

/* Сторінка товару */
.crumbs { padding: 18px 0 10px; font-size: 14px; color: var(--muted); }
.card.product { display: grid; grid-template-columns: minmax(220px, 380px) 1fr; gap: 28px; padding: 20px; margin-bottom: 20px; }
.card.product h1 { font-size: 26px; }
.card.product .lead { color: #374151; white-space: pre-line; margin: 0 0 12px; }
.card.product .buy { margin-top: 12px; justify-content: flex-start; gap: 16px; }
.card.product .promo.small { font-size: 13px; margin: 14px 0 0; }
.details details { border-top: 1px solid var(--line); padding: 6px 0; }
.details summary { cursor: pointer; font-weight: 600; font-size: 17px; padding: 10px 0; list-style: none; display: flex; justify-content: space-between; }
.details summary::-webkit-details-marker { display: none; }
.details summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.details details[open] summary::after { content: "–"; }
.rich { padding: 0 0 14px; color: #374151; line-height: 1.55; }
.rich p { margin: 0 0 10px; }
.rich ul, .rich ol { margin: 0 0 10px; padding-left: 22px; }
.rich.pre { white-space: pre-line; }
.back { padding: 20px 0 40px; }

.cart-page { max-width: 720px; padding-top: 28px; }
.cart-page table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.cart-page td, .cart-page th { padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: left; }
.num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cart-page tr.total td { font-weight: 700; border-bottom: 0; }
.cart-page .sub { display: block; font-size: 13px; color: var(--muted); }
.cart-page .stepper input { width: 44px; }
.cart-page .remove { color: var(--muted); font-size: 18px; line-height: 1; }
.cart-empty { padding: 24px 0; color: var(--muted); }
.checkout label { display: block; margin-bottom: 12px; font-size: 14px; color: #374151; }
.checkout input, .checkout textarea { display: block; width: 100%; margin-top: 4px; padding: 9px 11px; border: 1px solid #cfd4db; border-radius: 8px; font: inherit; font-size: 16px; }
.checkout .hp { position: absolute; left: -9999px; }
.muted { color: var(--muted); font-size: 14px; }
.alert { padding: 12px 14px; border-radius: 8px; background: #fdecec; color: #8a1c1c; margin-bottom: 16px; }
.alert ul { margin: 0; padding-left: 18px; }

.thanks { max-width: 640px; padding-top: 40px; }
.thanks .btn-tg { margin: 8px 0; }
.lines { width: 100%; border-collapse: collapse; margin: 20px 0; }
.lines td { padding: 8px 6px; border-bottom: 1px solid var(--line); }
.lines tr.total td { font-weight: 700; border-bottom: 0; }

.bottom { max-width: var(--max); margin: 0 auto; padding: 24px 16px 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; display: grid; gap: 6px; }

@media (max-width: 640px) {
    .hero { padding-top: 28px; }
    .hero h1 { font-size: 26px; }
    .brand-sub { display: none; }
    .top-nav { gap: 12px; font-size: 14px; }
    .sections { top: 53px; overflow-x: auto; flex-wrap: nowrap; }
    .sections a { white-space: nowrap; }
    .card.product { grid-template-columns: 1fr; gap: 14px; }
    .card.product h1 { font-size: 22px; }
}
