/* Public catalog pages (/c, /p): plain server-rendered HTML for search engines and visitors
   arriving from them. Hand-written, no Tailwind: these pages must stay light and stable.
   Palette and shapes follow DESIGN.md (brand green, slate neutrals, rounded cards). */
:root {
  --red: #007e42; --red-dark: #006837; --red-soft: #effbf3;
  --ink: #0f172a; --text: #334155; --muted: #64748b; --line: #e2e8f0; --bg: #f8fafc; --card: #fff;
  --radius: 14px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.55 'Onest', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--red); }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 6px; }
img { max-width: 100%; height: auto; display: block; }
h1, h2 { color: var(--ink); line-height: 1.25; margin: 0; }
h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; font-weight: 700; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); font-size: 0.875rem; margin: 4px 0 0; }

/* Header */
.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); font-size: 1.05rem; }
.brand .wm { display: flex; flex-direction: column; line-height: 1; white-space: nowrap; }
.brand .wm b { font-weight: 800; letter-spacing: -0.01em; }
.brand .wm small { margin-top: 3px; font-size: 0.7rem; font-weight: 600; color: var(--muted); }
.wm-r { color: var(--red); } .wm-b { color: #9a7300; }
.top-nav { display: flex; align-items: center; gap: 6px; }
.top-nav > a:not(.btn) { padding: 8px 12px; font-weight: 600; color: var(--text); font-size: 0.9rem; }

/* Buttons */
.btn {
  white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px;
  padding: 9px 16px; border-radius: 12px; font-weight: 600; font-size: 0.9rem;
  border: 1px solid var(--line); background: #fff; color: var(--ink); transition: background .15s, color .15s;
}
.btn:hover { background: #f1f5f9; color: var(--ink); }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 6px 16px -8px rgba(0, 126, 66, .7); }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn-wide { width: 100%; min-height: 48px; font-size: 1rem; }

/* Breadcrumbs */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 0; padding: 0; margin: 16px 0 12px; font-size: 0.8rem; color: var(--muted); }
.crumbs li + li::before { content: '/'; margin: 0 8px; color: #cbd5e1; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--red); }
@media (max-width: 640px) {
  .crumbs ol { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .crumbs ol::-webkit-scrollbar { display: none; }
}
.crumbs [aria-current] { color: var(--text); max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Page head */
.head { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.head .lead { margin: 8px 0 16px; max-width: 70ch; color: var(--text); }
.head-center { text-align: center; padding: 48px 20px; }
.head-center .lead { margin-left: auto; margin-right: auto; }
.actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 0; }
.section-title { margin: 24px 0 12px; }

/* Chips */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 0.85rem; font-weight: 500; }
.chip span { color: var(--muted); font-size: 0.75rem; }
.chip-active { background: var(--red-soft); border-color: #aeeac6; color: var(--red-dark); }

/* Product grid */
.grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.card a { display: flex; flex-direction: column; height: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; transition: box-shadow .15s, border-color .15s; }
.card a:hover { border-color: #cbd5e1; box-shadow: 0 8px 24px -16px rgba(15, 23, 42, .35); color: inherit; }
.card-img { position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: var(--bg); border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.card-img img { width: 100%; height: 100%; object-fit: contain; }
.card-name { font-size: 0.85rem; line-height: 1.35; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.card-price { margin-top: 6px; font-weight: 700; color: var(--red); }
.card-rub { font-size: 0.75rem; color: var(--muted); }
.badge { position: absolute; top: 6px; left: 6px; background: var(--red); color: #fff; font-size: 0.7rem; font-weight: 700; padding: 2px 6px; border-radius: 6px; }
.badge-inline { position: static; display: inline-block; }

/* Catalog departments */
.depts { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .depts { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .depts { grid-template-columns: repeat(3, 1fr); } }
.dept { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.dept h2 a { display: inline-flex; align-items: center; gap: 8px; }
.dept-icon { font-size: 1.3rem; }
.dept-subs { list-style: none; padding: 0; margin: 10px 0 0; font-size: 0.875rem; }
.dept-subs li { padding: 8px 0; border-top: 1px solid #f1f5f9; display: flex; justify-content: space-between; gap: 8px; }
.dept-subs span { color: var(--muted); font-size: 0.8rem; }

/* Pager */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 24px 0 8px; }
.pager ol { list-style: none; display: flex; gap: 4px; padding: 0; margin: 0; }
.page { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; padding: 0 10px; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: 0.875rem; }
.page-current { background: var(--ink); border-color: var(--ink); color: #fff; }
.gap { display: inline-flex; align-items: center; padding: 0 4px; color: var(--muted); }

/* Product page */
.product { display: grid; gap: 16px; align-items: start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
@media (min-width: 768px) { .product { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; padding: 24px; } }
.product-media { max-height: 520px; background: var(--bg); border-radius: 12px; display: flex; align-items: center; justify-content: center; aspect-ratio: 1; overflow: hidden; }
.product-media img { width: 100%; height: 100%; object-fit: contain; }
.product-info { display: flex; flex-direction: column; gap: 10px; align-self: center; }
.eyebrow { margin: 0; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.vi { margin: 0; color: var(--muted); font-style: italic; font-size: 0.9rem; }
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 6px; }
.price-now { font-size: 1.75rem; font-weight: 800; color: var(--red); }
.price-rub { color: var(--muted); font-weight: 600; }
.soldout { margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: #f1f5f9; color: var(--text); font-weight: 600; }
.hint { margin: 0; font-size: 0.8rem; color: var(--muted); }
.block { margin-top: 24px; }
.block > h2 { margin-bottom: 8px; }
.block > .muted { margin-bottom: 12px; }
.more { display: inline-block; margin-top: 12px; font-weight: 600; color: var(--red); }
.branches { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 0.9rem; }
.branches th, .branches td { text-align: left; padding: 10px 14px; border-top: 1px solid #f1f5f9; }
.branches th { background: var(--bg); color: var(--muted); font-weight: 600; font-size: 0.8rem; border-top: 0; }
.branches .num { text-align: right; white-space: nowrap; }
.branches s { color: var(--muted); font-size: 0.8rem; margin-right: 4px; }

/* Footer */
.foot { margin-top: 40px; background: #fff; border-top: 1px solid var(--line); padding: 24px 0 32px; font-size: 0.8rem; color: var(--muted); }
.foot p { max-width: 80ch; margin: 8px 0 0; line-height: 1.6; }
.foot-note { font-size: 0.75rem; color: #94a3b8; }
.foot-links { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0; margin: 0 0 12px; }
.foot-links a { display: inline-block; padding: 6px 0; color: var(--text); font-weight: 500; }

@media (max-width: 480px) {
  h1 { font-size: 1.3rem; }
  .top-nav > a:not(.btn) { display: none; }
  .top-nav .btn { min-height: 36px; padding: 7px 12px; font-size: 0.85rem; }
  .brand { font-size: 0.95rem; gap: 8px; }
  .price-now { font-size: 1.5rem; }
}

/* Notices: «how it works» (no commission) and the loyalty-card callout */
.notice {
  position: relative; overflow: hidden; margin: 0 0 16px; padding: 18px 20px 20px;
  border-radius: 18px; border: 1px solid #d4f1ec;
  background: radial-gradient(120% 140% at 100% 0%, #effaf8 0%, rgb(239 250 248 / 0) 55%), #fff;
  box-shadow: 0 1px 2px rgb(15 23 42 / .04), 0 10px 30px -18px rgb(26 121 114 / .35);
}
.notice::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(#1a7972, #40b2a5); }
.notice-head { margin: 0 0 14px; font-size: 0.75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #1a7972; }
.notice-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .notice-points { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.notice-points li { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.notice-points li > span:last-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.notice-points b { color: var(--ink); font-size: 1rem; }
.notice-points li > span:last-child > span { color: var(--text); font-size: 0.875rem; line-height: 1.5; }
.notice-ico, .callout-ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; }
.notice-ico { background: #effaf8; color: #1a7972; box-shadow: inset 0 0 0 1px #d4f1ec; }
.notice-ico svg, .callout-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.callout {
  display: grid; gap: 14px 16px; grid-template-columns: auto 1fr; align-items: start;
  margin: 16px 0; padding: 20px; border-radius: 18px; border: 1px solid #aeeac6;
  background: radial-gradient(120% 160% at 0% 0%, #effbf3 0%, rgb(239 251 243 / 0) 60%), #fff;
  box-shadow: 0 1px 2px rgb(15 23 42 / .04), 0 10px 30px -18px rgb(0 126 66 / .35);
}
.callout-ico { width: 48px; height: 48px; border-radius: 14px; background: var(--red); color: #fff; box-shadow: 0 8px 18px -8px rgb(0 126 66 / .7); }
.callout-ico svg { width: 24px; height: 24px; }
.callout-body { min-width: 0; }
.callout-body p { margin: 0; max-width: 70ch; font-size: 0.9rem; }
.callout-tag { font-size: 0.75rem !important; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--red); }
.callout-title { margin: 2px 0 6px !important; font-size: 1.15rem !important; font-weight: 800; color: var(--ink); letter-spacing: -0.01em; }
.callout-link { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; margin-top: 6px; font-weight: 700; color: var(--red); }
.callout-link span { transition: transform .15s; }
.callout-link:hover { color: var(--red-dark); }
.callout-link:hover span { transform: translateX(3px); }
.callout .store-badges { grid-column: 1 / -1; margin: 0; }
.callout .store-badge { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: 0 1px 2px rgb(15 23 42 / .05); }
.callout .store-badge:hover { border-color: #cbd5e1; background: #f8fafc; color: var(--ink); }
.callout .store-badge small { color: var(--muted); opacity: 1; }
@media (min-width: 860px) {
  .callout { grid-template-columns: auto 1fr auto; align-items: center; padding: 22px 24px; }
  .callout .store-badges { grid-column: 3; flex-direction: column; }
}
@media (max-width: 520px) {
  .callout .store-badges { display: grid; grid-template-columns: 1fr 1fr; }
  .callout .store-badge { padding: 6px 10px; font-size: 0.9rem; }
}

/* Official app store buttons */
.store-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.store-badge { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 16px 6px 12px; border-radius: 12px; background: #0f172a; color: #fff; font-weight: 700; font-size: 1rem; line-height: 1.1; }
.store-badge:hover { background: #1e293b; color: #fff; }
.store-badge svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
.store-badge span { display: flex; flex-direction: column; }
.store-badge small { font-size: 0.65rem; font-weight: 500; opacity: .75; letter-spacing: .02em; }

/* Steps */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps > li { counter-increment: step; position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 16px 60px; }
.steps > li::before { content: counter(step); position: absolute; left: 16px; top: 14px; width: 30px; height: 30px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; }
.steps h2 { font-size: 1.05rem; margin: 3px 0 6px; }
.steps p, .steps ul { margin: 6px 0 0; max-width: 75ch; }
.steps ul { padding-left: 18px; }
.steps li li { margin: 4px 0; }
.steps a:not(.store-badge), .prose a, .tips a, .faq a, .block > .muted a, .hint a { color: var(--red); font-weight: 600; }
.steps-short > li { padding: 12px 14px 12px 56px; }
.steps-short > li::before { top: 11px; }
.ui { display: inline-block; padding: 0 6px; border-radius: 6px; background: #f1f5f9; border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: 0.9em; line-height: 1.5; white-space: nowrap; }
.tips { padding-left: 18px; margin: 0; }
.tips li { margin: 6px 0; max-width: 80ch; }
.prose { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 20px 16px; }
.prose h2 { margin: 18px 0 6px; font-size: 1.05rem; }
.prose p { margin: 0; max-width: 75ch; }

/* FAQ */
.faq-list { display: grid; gap: 8px; }
.faq { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 16px; }
.faq summary { cursor: pointer; list-style: none; font-weight: 700; color: var(--ink); padding: 14px 24px 14px 0; position: relative; min-height: 48px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 0; top: 12px; font-size: 1.2rem; color: var(--muted); }
.faq[open] summary::after { content: '−'; }
.faq p { margin: 0 0 14px; max-width: 80ch; }

/* Help index */
.help-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .help-cards { grid-template-columns: repeat(2, 1fr); } }
.help-card { display: flex; align-items: flex-start; gap: 14px; height: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; transition: border-color .15s, box-shadow .15s; }
.help-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--red-soft); color: var(--red); transition: background .15s, color .15s; }
.help-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.help-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.help-card b { color: var(--ink); font-size: 1.05rem; }
.help-txt span { color: var(--muted); font-size: 0.875rem; }
.help-card:hover { border-color: #aeeac6; box-shadow: 0 4px 14px rgb(0 126 66 / .08); }
.help-card:hover b { color: var(--red); }
.help-card:hover .help-ico { background: var(--red); color: #fff; }

/* Delivery cities */
.cities { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cities { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cities { grid-template-columns: repeat(3, 1fr); } }
.city { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.city > a { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-height: 36px; }
.city > a b { font-size: 1.1rem; color: var(--ink); }
.city > a:hover b { color: var(--red); }
.city > a span { color: var(--muted); font-size: 0.8rem; }
.city-branches { list-style: none; padding: 0; margin: 4px 0 0; font-size: 0.85rem; color: var(--muted); }
.branches-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.branch { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; display: grid; gap: 4px 12px; grid-template-columns: 1fr auto; align-items: center; }
.branch b { color: var(--ink); }
.branch .vi { grid-column: 1; font-size: 0.8rem; }
.branch .btn { grid-column: 2; grid-row: 1 / span 2; }
@media (max-width: 520px) { .branch { grid-template-columns: 1fr; } .branch .btn { grid-column: 1; grid-row: auto; margin-top: 6px; } }
.foot-help { margin-top: -4px; }
