/* Страница магазина поверх дизайн-системы Organic (_ds/.../styles.css).
   Caprasimo не умеет кириллицу — заголовки берут Literata 800, как в макете. */
:root { --font-heading: "Caprasimo", "Literata", serif; --font-heading-weight: 800; --gutter: clamp(16px, 4vw, 56px); }
html { scroll-behavior: smooth; }
body { font-synthesis: none; min-height: 100vh; }
body:has(dialog[open]) { overflow: hidden; }
[hidden] { display: none !important; }
a { color: var(--color-accent-700); }
a:hover { color: var(--color-accent-800); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.pad { padding-inline: var(--gutter); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--color-neutral-700); font-size: 13px; }
.small { font-size: 13px; }
.btn.big { padding: 14px 26px; font-size: 16px; }
.mascot { display: block; height: auto; overflow: visible; flex: none; }
section[id], footer[id] { scroll-margin-top: 90px; }

/* — шапка — */
.topbar { position: sticky; top: 0; z-index: 5; background: var(--color-bg); display: flex; align-items: center; gap: 12px 24px; padding: 14px var(--gutter); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--color-text); margin-right: auto; }
.brand span { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 19px; line-height: .95; }
.brand:hover { color: var(--color-text); }
.links { display: flex; gap: 20px; font-size: 15px; flex-wrap: wrap; }
.links a { color: var(--color-text); text-decoration: none; }
.links a:hover { color: var(--color-accent-700); }
#cartBtn { gap: 8px; }
@media (max-width: 560px) { .links { order: 3; width: 100%; gap: 16px; } }

/* — первый экран — */
.hero { padding-top: 24px; padding-bottom: 64px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 40px; align-items: center; }
.hero-text { display: flex; flex-direction: column; gap: 20px; align-items: flex-start; max-width: 600px; }
.hero h1 { font-size: clamp(40px, 6vw, 72px); line-height: .98; }
.hero p { font-size: 18px; line-height: 1.5; color: var(--color-neutral-800); }
.hero-media { position: relative; aspect-ratio: 1; max-width: 560px; width: 100%; justify-self: end; }
.hero-circle { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; background: var(--color-surface); }
.hero-circle video { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-badge { position: absolute; left: -8px; bottom: 6%; transform: scale(1.3); transform-origin: left bottom; } /* сама плашка — js/mascot-badge.js (handoff из Claude Design); +30% по просьбе заказчика */
@media (max-width: 560px) { .hero-badge { left: 0; transform: scale(1.1); } } /* на телефоне 1.3 не влезает в ширину */

/* — преимущества — */
.usps { padding-bottom: 72px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.usp { background: var(--color-surface); border-radius: 32px; padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.usp-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--color-bg); display: grid; place-items: center; color: var(--color-accent-700); }
.usp h3 { font-size: 21px; }
.usp p { font-size: 15px; color: var(--color-neutral-800); }

/* — каталог — */
.catalog { padding-bottom: 80px; display: flex; flex-direction: column; gap: 22px; }
.catalog h2 { font-size: clamp(30px, 4vw, 44px); }
.filters { display: flex; gap: 14px 24px; flex-wrap: wrap; align-items: center; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pill { cursor: pointer; font: inherit; font-size: 15px; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--color-divider); background: transparent; color: var(--color-text); }
.pill:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.pill[aria-pressed="true"] { background: var(--color-text); color: var(--color-bg); }
.pill.sm { font-size: 14px; padding: 7px 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.card-p { background: var(--color-surface); border-radius: 32px; padding: 12px 12px 18px; display: flex; flex-direction: column; gap: 10px; }
.card-p .ph { position: relative; aspect-ratio: 4/3; border-radius: 24px; }
.card-p .info { padding: 0 6px; display: flex; flex-direction: column; gap: 4px; }
.card-p .kind { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--color-neutral-700); }
.card-p .name { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 20px; line-height: 1.15; color: var(--color-text); text-decoration: none; }
.card-p .name:hover { color: var(--color-accent-700); }
.card-p .buy { padding: 0 6px; margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 22px; white-space: nowrap; }
.empty-grid { grid-column: 1 / -1; color: var(--color-neutral-700); padding: 24px 0; }

/* фото товара: снимок или маскот-заглушка */
.ph { display: block; overflow: hidden; background: var(--color-neutral-200); }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph .nophoto { width: 100%; height: 100%; display: grid; place-items: center; background: var(--color-accent-100); }
.ph .nophoto .mascot { width: 38%; }
.flour { position: absolute; left: 10px; top: 10px; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 4px 10px; border-radius: 999px; pointer-events: none; }
.flour-classic { background: var(--color-accent-200); color: var(--color-accent-800); }
.flour-whole { background: var(--color-accent-2-200); color: var(--color-accent-2-800); }

/* — карточка товара — */
#detail { padding-top: 16px; padding-bottom: 80px; display: flex; flex-direction: column; gap: 22px; }
#detail > .btn-ghost { align-self: flex-start; }
.detail { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 40px; align-items: start; }
.detail .ph { aspect-ratio: 1; border-radius: 40px; }
.detail-info { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; max-width: 560px; }
.detail-info .flour { position: static; }
.detail h1 { font-size: clamp(34px, 4.5vw, 52px); line-height: 1.02; }
.detail-info > p { font-size: 17px; line-height: 1.5; color: var(--color-neutral-800); }
.detail .price { font-size: 38px; }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--color-surface); border-radius: 999px; padding: 4px; }
.stepper b { min-width: 28px; text-align: center; }
.stepper .btn { font-size: 20px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; align-self: stretch; }
.fact { background: var(--color-surface); border-radius: 28px; padding: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: var(--color-neutral-800); }
.fact b { font-size: 14px; color: var(--color-text); }
.fact.cook { background: var(--color-accent-2-100); color: var(--color-accent-2-900); }
.fact.cook b { color: var(--color-accent-2-800); }

/* — подвал — */
.promo { margin: 0 var(--gutter) 40px; background: var(--color-accent); color: var(--color-bg); border-radius: 40px; padding: clamp(28px, 4vw, 48px); display: flex; flex-wrap: wrap; gap: 28px; align-items: center; overflow: hidden; }
.promo > div { display: flex; flex-direction: column; gap: 10px; max-width: 560px; }
.promo h2 { font-size: clamp(28px, 4vw, 44px); line-height: 1; }
.promo p { font-size: 17px; color: var(--color-accent-100); }
.promo-mascot { margin-left: auto; --ink: #402310; }

/* — контакты — */
.contacts { padding-bottom: 48px; display: flex; flex-direction: column; gap: 12px; }
.contacts h2 { font-size: clamp(30px, 4vw, 44px); }
.contacts p { font-size: 16px; color: var(--color-neutral-800); max-width: 560px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.contact-links .btn { gap: 10px; color: var(--color-text); }
.contact-links .btn svg { color: var(--color-accent-700); }

/* — статьи — */
#article, #blog { padding-top: 16px; padding-bottom: 80px; display: flex; flex-direction: column; gap: 22px; }
#article > .btn-ghost { align-self: flex-start; }
.post { max-width: 720px; display: flex; flex-direction: column; gap: 16px; }
.kicker { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--color-accent-700); }
.post h1, #blog h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.05; }
.lead { font-size: 19px; line-height: 1.55; color: var(--color-neutral-800); max-width: 720px; }
.cta-inline { background: var(--color-accent-2-100); color: var(--color-accent-2-900); border-radius: 22px; padding: 14px 18px; font-size: 16px; }
.cta-inline a { color: var(--color-accent-2-800); font-weight: 700; }
.prose { font-size: 17px; line-height: 1.7; }
.prose h2 { font-size: 28px; margin: 22px 0 10px; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 24px; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--color-accent); }
.prose .tip { background: var(--color-accent-100); color: var(--color-accent-900); border-radius: 22px; padding: 14px 18px; }
.prose .tip::before { content: "💡 "; }
.cta { background: var(--color-surface); border-radius: 40px; padding: clamp(22px, 4vw, 40px); display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 90px; }
.cta h2 { font-size: clamp(26px, 3.5vw, 38px); }
.cta > p { font-size: 17px; color: var(--color-neutral-800); max-width: 640px; }
.cta .grid { margin-top: 8px; }
.cta .card-p { background: var(--color-bg); }
.cta > .btn, .home-posts > .btn { align-self: flex-start; }
.more h2, .home-posts h2 { font-size: clamp(26px, 3.5vw, 38px); margin-bottom: 14px; }
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.post-card { background: var(--color-surface); border-radius: 32px; padding: 24px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--color-text); transition: transform .2s ease; }
.post-card:hover { transform: translateY(-2px); color: var(--color-text); }
.post-card h3 { font-size: 21px; line-height: 1.15; }
.post-card p { font-size: 15px; color: var(--color-neutral-800); }
.post-card .read { margin-top: auto; padding-top: 6px; font-weight: 700; color: var(--color-accent-700); }
.home-posts { padding-bottom: 80px; display: flex; flex-direction: column; gap: 8px; }
.home-posts > .btn { margin-top: 14px; }

/* — про нас — */
#about { padding-top: 16px; padding-bottom: 80px; display: flex; flex-direction: column; gap: 18px; max-width: 980px; }
#about h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.05; }
#about h2 { font-size: clamp(26px, 3.5vw, 36px); margin-top: 14px; }
#about > .btn { align-self: flex-start; }
.table-wrap { overflow-x: auto; background: var(--color-surface); border-radius: 28px; padding: 8px 14px; }
.prices { font-size: 15px; min-width: 620px; }
.prices td { vertical-align: top; }
.faq { display: flex; flex-direction: column; gap: 12px; }
.faq section { background: var(--color-surface); border-radius: 24px; padding: 18px 22px; }
.faq h3 { font-family: var(--font-body); font-weight: 700; font-size: 17px; margin-bottom: 6px; }
.faq p { font-size: 16px; line-height: 1.6; color: var(--color-neutral-800); }
.tg #about > .btn { display: none; }

/* — промокод — */
.promo-row { display: flex; gap: 8px; }
.promo-row .input { text-transform: uppercase; }
.promo-msg { font-size: 14px; margin-top: 6px; color: var(--color-accent-800); }
.promo-msg.ok { color: var(--color-accent-2-800); }
.total.sub b { font-family: var(--font-body); font-weight: 700; font-size: 17px; color: var(--color-accent-2-800); }
.promo-banner { margin: 0 var(--gutter) 12px; background: var(--color-accent-2-100); color: var(--color-accent-2-900); border-radius: 22px; padding: 12px 18px; font-size: 15px; }

/* — кошик: нативный <dialog> справа — */
.drawer { position: fixed; inset: 12px 12px 12px auto; margin: 0; width: min(440px, calc(100% - 24px)); height: auto; max-width: none; max-height: none; border: 0; border-radius: 36px; padding: 26px; background: var(--color-bg); color: var(--color-text); box-shadow: var(--shadow-lg); }
.drawer[open] { display: flex; flex-direction: column; gap: 16px; }
.drawer::backdrop { background: color-mix(in srgb, var(--color-neutral-900) 45%, transparent); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.drawer-head h2 { font-size: 28px; }
.step { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; scrollbar-gutter: stable; margin: 0 -6px; padding: 0 6px 2px; } /* gutter — сумма не уходит под полосу прокрутки */
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; font-size: 16px; color: var(--color-neutral-800); }
.lines { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.line { background: var(--color-surface); border-radius: 24px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.line > div:first-child { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.line b { font-size: 15px; }
.line .muted { font-size: 13px; }
.line .stepper { background: none; padding: 0; gap: 2px; }
.line .stepper b { min-width: 20px; }
.total { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; margin-top: auto; }
.total b { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 28px; white-space: nowrap; }
.step .btn.big { padding: 15px; flex: none; }
#stepCheckout .total { margin-top: 4px; }
fieldset.field { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.field > label.radio { display: inline-flex; margin: 0; font-size: 15px; color: var(--color-text); } /* перебить .field > label из DS */
fieldset.field legend { font-size: 12px; margin-bottom: 5px; color: color-mix(in srgb, var(--color-text) 70%, transparent); padding: 0; }
.input { font-size: 16px; min-height: 44px; } /* 16px — чтобы iOS не зумил поле */
textarea.input { border-radius: 22px; min-height: 80px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-error { background: var(--color-accent-100); color: var(--color-accent-800); border-radius: 18px; padding: 10px 14px; font-size: 14px; }
.done { align-items: center; justify-content: center; text-align: center; gap: 16px; }
.done h3 { font-size: 26px; }
.done p { font-size: 16px; color: var(--color-neutral-800); }
@media (max-width: 480px) { .drawer { inset: 8px; width: auto; padding: 20px; border-radius: 28px; } }
.done b { white-space: nowrap; }
.card-p h3 { font-size: 20px; line-height: 1.15; }
.buyrow { align-items: center; gap: 18px; }

/* — Telegram Mini App (html.tg): свои кнопки заменяют нативные MainButton/BackButton, сразу к каталогу — */
.tg #article > .btn-ghost, .tg #cartBtn, .tg .links, .tg #toCheckout, .tg #stepCheckout [type=submit], .tg #backToCart, .tg #stepDone .btn, .tg #detail > .btn-ghost { display: none !important; }
.tg .topbar { padding-block: 10px; }
.tg #home { display: flex; flex-direction: column; }
.tg .usps { order: 1; }
.tg .hero { padding-bottom: 28px; gap: 0; }
.tg .hero-media, .tg .hero .row { display: none; }
.tg .hero h1 { font-size: 34px; }
.tg .hero p { font-size: 16px; }
