/* =========================================================
   Книжкова крамниця — стилі магазину (кольори й шрифти в :root)
   ========================================================= */
:root {
  --paper: #F7F1E6;
  --paper-2: #EFE5D3;
  --card: #FFFCF6;
  --ink: #1D2133;
  --ink-2: #3A3F55;
  --muted: #6E685C;
  --line: #E3D7C2;
  --red: #A3352A;
  --red-dark: #842A21;
  --gold: #B48A3E;
  --gold-light: #D9A85B;
  --green: #3F7A4A;
  --tg: #2AABEE;
  --vb: #7360F2;
  --wa: #25D366;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(29, 33, 51, .06), 0 14px 34px -14px rgba(29, 33, 51, .25);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --orn-band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='28'%3E%3Cpath fill='%23A3352A' d='M12 0h4v4h-4zM8 4h4v4H8zM16 4h4v4h-4zM4 8h4v4H4zM20 8h4v4h-4zM0 12h4v4H0zM24 12h4v4h-4zM4 16h4v4H4zM20 16h4v4h-4zM8 20h4v4H8zM16 20h4v4h-4zM12 24h4v4h-4z'/%3E%3Cpath fill='%231D2133' d='M12 8h4v4h-4zM8 12h4v4H8zM12 12h4v4h-4zM16 12h4v4h-4zM12 16h4v4h-4z'/%3E%3Cpath fill='%23B48A3E' d='M28 12h4v4h-4z'/%3E%3C/svg%3E");
  --orn-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='28'%3E%3Cpath d='M12 0h4v4h-4zM8 4h4v4H8zM16 4h4v4h-4zM4 8h4v4H4zM20 8h4v4h-4zM0 12h4v4H0zM24 12h4v4h-4zM4 16h4v4H4zM20 16h4v4h-4zM8 20h4v4H8zM16 20h4v4h-4zM12 24h4v4h-4zM12 12h4v4h-4zM28 12h4v4h-4z'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.container { width: min(1200px, 100% - 48px); margin-inline: auto; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.08; margin: 0; }
h2 { font-size: clamp(34px, 4vw, 52px); }
.eyebrow { margin: 0 0 12px; font-size: 12.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--red); }
.section-lead { color: var(--muted); max-width: 540px; margin: 14px 0 0; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 28px; border-radius: 999px; border: 1.5px solid var(--red);
  background: var(--red); color: #fff; font-family: var(--sans); font-weight: 700; font-size: 16px; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: 0 10px 22px -12px rgba(163, 53, 42, .7);
  transition: transform .2s, background .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-ghost { background: transparent; color: var(--ink); border-color: rgba(29, 33, 51, .3); box-shadow: none; }
.btn-ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-small { padding: 10px 18px; font-size: 14.5px; }
.btn-block { width: 100%; }
.link-btn { border: 0; background: none; padding: 0; color: var(--red); font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); background: var(--card);
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { border-color: var(--ink); }

/* ---------- Верхня смуга і шапка ---------- */
.topbar { background: var(--ink); color: #E9DFCC; font-size: 13.5px; }
.topbar-inner { display: flex; align-items: center; gap: 28px; min-height: 38px; }
.topbar span { display: inline-flex; align-items: center; gap: 8px; }
.topbar svg { width: 17px; height: 17px; fill: none; stroke: var(--gold-light); stroke-width: 1.7; stroke-linejoin: round; }
.topbar-phone { margin-left: auto; font-weight: 700; text-decoration: none; color: #fff; white-space: nowrap; }
.topbar b { font-weight: inherit; }
.topbar .short { display: none; }
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(247, 241, 230, .9); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid rgba(227, 215, 194, .8);
}
.header-inner { display: flex; align-items: center; gap: 28px; height: 74px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 44px; height: 44px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font-family: var(--serif); font-size: 27px; font-weight: 700; }
.brand-text small { font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.nav { display: flex; gap: 26px; margin-left: 24px; }
.nav a { text-decoration: none; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.nav a:hover { color: var(--red); }
.header-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.msg-mini { display: flex; gap: 8px; }
.msg-ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; transition: transform .2s; }
.msg-ico svg { width: 22px; height: 22px; }
a.msg-ico:hover { transform: translateY(-2px); }
.msg-tg .msg-ico, .msg-ico.msg-tg { background: var(--tg); }
.msg-vb .msg-ico, .msg-ico.msg-vb { background: var(--vb); }
.msg-wa .msg-ico, .msg-ico.msg-wa { background: var(--wa); }
.cart-btn {
  position: relative; display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 18px 10px 14px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--ink); color: var(--paper); font-weight: 700; font-size: 15px;
}
.cart-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.cart-count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  display: grid; place-items: center; background: var(--red); color: #fff; font-size: 12.5px;
}
.cart-btn.bump { animation: bump .35s ease; }
@keyframes bump { 50% { transform: scale(1.08); } }
.menu-toggle {
  display: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--card);
  flex-direction: column; align-items: center; justify-content: center; gap: 5px; cursor: pointer;
}
.menu-toggle span { width: 18px; height: 1.6px; background: var(--ink); transition: transform .25s; }
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.3px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.3px) rotate(-45deg); }

/* ---------- Головний екран ---------- */
.hero { position: relative; padding: 64px 0 92px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; top: -260px; right: -220px; width: 820px; height: 820px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(180, 138, 62, .16), transparent 72%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 64px; align-items: center; }
.hero h1 { font-size: clamp(50px, 6.2vw, 86px); line-height: 1; margin-bottom: 24px; letter-spacing: -.01em; }
.hero h1 em { font-style: italic; font-weight: 500; color: var(--red); }
.lead { font-size: 19px; color: var(--ink-2); max-width: 540px; margin: 0 0 32px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.perks { list-style: none; margin: 44px 0 0; padding: 26px 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 14px 28px; max-width: 600px; }
.perks li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.perk-ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); }
.perk-ico svg, .step-ico svg { width: 19px; height: 19px; fill: none; stroke: var(--red); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.hero-visual { position: relative; justify-self: end; width: min(420px, 100%); }
.portrait {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 240px 240px 26px 26px;
  background: linear-gradient(165deg, #F2E6D0 0%, #E6D3B5 100%); box-shadow: var(--shadow);
}
.hero-visual::before {
  content: ""; position: absolute; inset: -12px; z-index: -1;
  border: 1px solid rgba(180, 138, 62, .55); border-radius: 252px 252px 34px 34px;
}
.portrait svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-new {
  position: absolute; left: -54px; top: 64px; width: 230px;
  padding: 16px 18px 18px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.hero-new b { display: block; margin: 10px 0 4px; font-family: var(--serif); font-size: 21px; line-height: 1.1; }
.hero-new .hero-new-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.hero-new .price { font-size: 24px; }
.hero-books { position: absolute; left: -70px; bottom: -42px; display: flex; width: 360px; }
.hero-books .cover { width: 118px; flex: none; padding: 18px 13px 12px 20px; } /* % тут рахувались би від ширини всього блоку */
.hero-books .cover:nth-child(1) { transform: rotate(-10deg); }
.hero-books .cover:nth-child(2) { transform: rotate(-1deg) translate(-34px, 10px); }
.hero-books .cover:nth-child(3) { transform: rotate(7deg) translate(-68px, 22px); }
.ornament-band { height: 22px; opacity: .9; background: var(--orn-band) repeat-x center / auto 22px; }

/* ---------- Секції ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--paper-2); }
section[id] { scroll-margin-top: 80px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; flex-wrap: wrap; margin-bottom: 40px; }

/* ---------- Фільтри ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 11px 20px; border-radius: 999px; cursor: pointer; border: 1px solid var(--line); background: var(--card);
  color: var(--ink-2); font-weight: 700; font-size: 14.5px; line-height: 1; transition: background .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: var(--ink); }
.chip.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- Картки книжок ---------- */
.book-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.book {
  display: flex; flex-direction: column; padding: 16px 16px 18px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); transition: transform .25s, box-shadow .25s;
}
.book:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.book.skeleton { min-height: 460px; background: linear-gradient(100deg, var(--card) 30%, var(--paper-2) 50%, var(--card) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -150% 0; } }
.book-cover-wrap {
  position: relative; display: grid; place-items: center; margin-bottom: 18px; padding: 30px 32px 28px; border-radius: 12px;
  background: linear-gradient(180deg, var(--paper-2), #E9DDC8); cursor: pointer;
}
.book-cover-wrap .cover { width: 100%; max-width: 168px; }
.badge {
  position: absolute; left: 10px; top: 10px; z-index: 2; max-width: calc(100% - 20px);
  padding: 5px 10px; border-radius: 999px; background: var(--ink); color: #F3E7CF;
  font-size: 10.5px; font-weight: 700; letter-spacing: .03em; line-height: 1.3;
}
.book-body { display: flex; flex-direction: column; flex: 1; padding: 0 4px; }
.book-genre { margin: 0 0 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--red); }
.book-title { font-size: 24px; line-height: 1.08; margin: 0 0 8px; }
.book-text {
  margin: 0 0 14px; font-size: 14.5px; line-height: 1.5; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.book-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--line); }
.price { font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1; white-space: nowrap; font-variant-numeric: lining-nums; }
.add-btn.is-in { background: var(--ink); border-color: var(--ink); box-shadow: none; }
.book.is-out .cover { filter: grayscale(.6); opacity: .7; }
.soldout { font-size: 13px; font-weight: 700; color: var(--muted); }
.catalog-error { margin: 24px 0 0; padding: 18px 22px; border-radius: 14px; background: #FBE9E5; color: var(--red-dark); font-weight: 600; }

/* ---------- Обкладинка, що малюється автоматично ---------- */
.cover {
  position: relative; aspect-ratio: 2 / 3; width: 100%; overflow: hidden; display: flex; flex-direction: column;
  padding: 15% 11% 10% 17%; border-radius: 3px 7px 7px 3px;
  background: var(--c, #1D2133); color: #F8EEDC;
  box-shadow: 0 2px 3px rgba(0, 0, 0, .14), 0 20px 30px -14px rgba(29, 33, 51, .6);
  container-type: inline-size;
}
.cover::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,.30) 0, rgba(0,0,0,.06) 4%, rgba(255,255,255,.14) 5.5%, transparent 9%),
              linear-gradient(170deg, rgba(255,255,255,.12), transparent 45%, rgba(0,0,0,.14));
}
.cover::after { content: ""; position: absolute; inset: 5.5% 6% 5.5% 11%; pointer-events: none; border: 1px solid currentColor; opacity: .32; border-radius: 2px; }
.cover.ink-dark { color: #23202A; }
.cover-top { font-size: 7.8cqi; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; line-height: 1.4; opacity: .85; }
.cover-title { margin: auto 0; font-family: var(--serif); font-size: 21cqi; font-weight: 600; line-height: 1.02; overflow-wrap: break-word; }
.cover-orn {
  display: block; height: 8cqi; width: 62%; margin-bottom: 6cqi; opacity: .6; background: currentColor;
  -webkit-mask: var(--orn-mask) repeat-x left center / auto 100%; mask: var(--orn-mask) repeat-x left center / auto 100%;
}
.cover-year { font-size: 7.6cqi; font-weight: 600; letter-spacing: .22em; opacity: .8; }
.cover-photo { padding: 0; background: var(--paper-2); }
.cover-photo::before { background: linear-gradient(90deg, rgba(0,0,0,.22) 0, rgba(0,0,0,.04) 3%, transparent 6%); z-index: 1; }
.cover-photo::after { display: none; }
.cover-photo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Доставка ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { padding: 32px 30px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.step-ico { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: #F6E3DE; }
.step-ico svg { width: 24px; height: 24px; }
.step h3 { margin: 18px 0 8px; font-size: 27px; }
.step p { margin: 0; font-size: 15.5px; color: var(--muted); }

/* ---------- Месенджери ---------- */
.messenger-card {
  position: relative; overflow: hidden; display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center;
  padding: 56px; border-radius: 28px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.messenger-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: var(--orn-band) repeat-x center / auto 8px; opacity: .8; }
.phone-big { display: inline-block; margin-top: 22px; font-family: var(--serif); font-size: 34px; font-weight: 700; text-decoration: none; font-variant-numeric: lining-nums; }
.msg-buttons { display: grid; gap: 12px; }
.msg-btn {
  display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: 16px; text-decoration: none;
  background: var(--paper); border: 1px solid var(--line); transition: transform .2s, border-color .2s;
}
.msg-btn:hover { transform: translateX(3px); }
.msg-btn.msg-tg:hover { border-color: var(--tg); }
.msg-btn.msg-vb:hover { border-color: var(--vb); }
.msg-btn.msg-wa:hover { border-color: var(--wa); }
.msg-btn .msg-ico { width: 48px; height: 48px; }
.msg-btn .msg-ico svg { width: 27px; height: 27px; }
.msg-btn b { display: block; font-size: 17px; }
.msg-btn small { display: block; font-size: 13.5px; color: var(--muted); }
.msg-buttons-compact .msg-btn { padding: 10px 14px; }
.msg-buttons-compact .msg-ico { width: 40px; height: 40px; }

/* ---------- Підвал ---------- */
.site-footer { padding: 0 0 40px; font-size: 14.5px; color: var(--muted); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px 32px; flex-wrap: wrap; padding-top: 28px; border-top: 1px solid var(--line); }
.footer-brand b { font-family: var(--serif); font-size: 24px; color: var(--ink); margin-right: 10px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { text-decoration: none; font-weight: 600; color: var(--ink-2); }
.footer-links a:hover { color: var(--red); }

/* ---------- Кошик (бокова панель) ---------- */
.drawer {
  margin: 0 0 0 auto; padding: 0; border: 0; width: min(470px, 100%); height: 100%; max-height: none; max-width: 100%;
  background: var(--card); color: var(--ink); box-shadow: -20px 0 60px -20px rgba(29, 33, 51, .45);
}
.drawer[open] { animation: slide-in .28s ease; }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
.drawer::backdrop { background: rgba(29, 33, 51, .5); }
.drawer-panel { display: flex; flex-direction: column; height: 100%; }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 30px; margin-right: auto; }
.drawer-steps { display: flex; gap: 6px; list-style: none; margin: 0; padding: 12px 22px; border-bottom: 1px solid var(--line); font-size: 12.5px; font-weight: 700; color: var(--muted); }
.drawer-steps li { flex: 1; padding-top: 8px; border-top: 3px solid var(--line); }
.drawer-steps li.is-done, .drawer-steps li.is-now { border-color: var(--red); color: var(--ink); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px; }
.drawer-foot { padding: 16px 22px 20px; border-top: 1px solid var(--line); background: var(--card); }
.foot-total { display: flex; align-items: baseline; justify-content: space-between; font-weight: 700; }
.foot-total b { font-family: var(--serif); font-size: 32px; font-variant-numeric: lining-nums; }
.foot-note { margin: 2px 0 12px; font-size: 13px; color: var(--muted); }

.cart-list { list-style: none; margin: 0; padding: 0; }
.cart-item { display: grid; grid-template-columns: 62px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-item:first-child { padding-top: 0; }
.cart-item b { display: block; font-family: var(--serif); font-size: 19px; line-height: 1.15; }
.cart-item .unit { font-size: 13.5px; color: var(--muted); }
.qty { display: inline-flex; align-items: center; margin-top: 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.qty button { width: 34px; height: 34px; border: 0; background: none; cursor: pointer; font-size: 18px; font-weight: 700; border-radius: 50%; }
.qty button:hover { background: var(--paper-2); }
.qty span { min-width: 26px; text-align: center; font-weight: 700; }
.cart-line { text-align: right; }
.cart-line strong { display: block; font-size: 16px; white-space: nowrap; }
.cart-remove { margin-top: 10px; border: 0; background: none; color: var(--muted); font-size: 13px; cursor: pointer; text-decoration: underline; }
.cart-empty { text-align: center; padding: 56px 0; color: var(--muted); }
.cart-empty svg { width: 54px; height: 54px; fill: none; stroke: var(--line); stroke-width: 1.5; margin: 0 auto 10px; }

/* ---------- Оформлення ---------- */
.checkout fieldset { border: 0; margin: 0 0 18px; padding: 0; }
.checkout legend { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-weight: 800; font-size: 16px; }
.checkout legend span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-size: 13px; }
.summary-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; padding: 12px 16px; border-radius: 12px; background: var(--paper-2); font-size: 14.5px; font-weight: 600; }
.field { position: relative; display: block; margin-bottom: 12px; }
.field > span, .field > label { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.field input, .field textarea, .field select, .comment textarea {
  width: 100%; padding: 13px 15px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink);
  font: inherit; font-size: 16px; line-height: 1.35;
}
.field input:focus, .field textarea:focus, .comment textarea:focus { outline: none; border-color: var(--ink); background: #fff; }
.field input:disabled { opacity: .6; cursor: not-allowed; }
.field.is-invalid input { border-color: var(--red); background: #FDF3F1; }
.field .err { display: block; margin-top: 5px; font-size: 13px; font-weight: 600; color: var(--red); }
.hint { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% - 2px); z-index: 5; max-height: 290px; overflow-y: auto;
  margin: 0; padding: 6px; list-style: none; background: #fff; border: 1.5px solid var(--ink); border-radius: 0 0 12px 12px;
  box-shadow: 0 18px 30px -14px rgba(29, 33, 51, .35);
}
.combo-list li { padding: 10px 12px; border-radius: 9px; cursor: pointer; line-height: 1.35; }
.combo-list li b { display: block; font-size: 15px; }
.combo-list li small { display: block; font-size: 13px; color: var(--muted); }
.combo-list li[aria-selected="true"], .combo-list li:hover { background: var(--paper-2); }
.combo-list li.combo-msg { cursor: default; color: var(--muted); font-size: 14px; background: none; }
.combo-list .tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #E8EEF9; color: #33558A; font-size: 11px; font-weight: 700; vertical-align: 2px; }
.radio-card { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); cursor: pointer; background: var(--paper); }
.radio-card input { margin: 3px 0 0; width: 20px; height: 20px; accent-color: var(--red); }
.radio-card b { display: block; font-size: 15.5px; }
.radio-card small { display: block; font-size: 13.5px; color: var(--muted); }
.radio-card:has(input:checked) { border-color: var(--red); background: #FDF5F2; }
.comment summary { cursor: pointer; font-weight: 700; font-size: 14.5px; color: var(--red); margin-bottom: 10px; }
.form-error { margin: 6px 0 0; padding: 12px 14px; border-radius: 12px; background: #FBE9E5; color: var(--red-dark); font-weight: 600; font-size: 14.5px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- Готово ---------- */
.done { text-align: center; padding: 20px 4px; }
.done-mark { width: 74px; height: 74px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: var(--green); }
.done-mark-alt { background: var(--vb); }
.done-mark svg { width: 36px; height: 36px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.done h3 { font-size: 32px; margin-bottom: 10px; }
.done p { color: var(--muted); margin: 0 0 20px; }
.done-recap { text-align: left; padding: 16px 18px; border-radius: 14px; background: var(--paper-2); font-size: 14.5px; line-height: 1.6; white-space: pre-line; }
.manual-text { width: 100%; margin: 14px 0 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); font: inherit; font-size: 13.5px; resize: none; }

/* ---------- Мобільна смуга кошика і сповіщення ---------- */
.cartbar {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30;
  display: none; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 10px 10px 20px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700;
  box-shadow: 0 16px 34px -12px rgba(29, 33, 51, .6);
}
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 20px; border-radius: 999px;
  background: var(--ink); color: #fff; font-weight: 600; font-size: 15px; box-shadow: 0 16px 34px -12px rgba(29, 33, 51, .6);
  animation: toast-in .25s ease;
}
@keyframes toast-in { from { transform: translate(-50%, 12px); opacity: 0; } }

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
  .book-grid { grid-template-columns: repeat(3, 1fr); }
  .msg-mini { display: none; }
}
@media (max-width: 920px) {
  .nav { display: none; }
  .menu-toggle { display: flex; }
  .nav.is-open {
    display: flex; flex-direction: column; gap: 0; margin: 0; position: absolute; top: 74px; left: 0; right: 0;
    padding: 6px 24px 16px; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: 0 20px 30px -20px rgba(29,33,51,.3);
  }
  .nav.is-open a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
  .nav.is-open a:last-child { border-bottom: 0; }
  .hero { padding: 40px 0 92px; }
  .hero-grid { grid-template-columns: 1fr; gap: 60px; }
  .hero-visual { justify-self: center; width: min(360px, 78%); }
  .steps { grid-template-columns: 1fr; }
  .messenger-card { grid-template-columns: 1fr; gap: 28px; padding: 44px 32px 32px; }
}
@media (max-width: 760px) {
  .cartbar { display: flex; }
  .toast { bottom: 84px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .container { width: calc(100% - 32px); }
  .topbar { font-size: 12.5px; }
  .topbar .hide-sm, .topbar .long { display: none; }
  .topbar .short { display: inline; }
  .topbar-inner { gap: 12px; }
  .header-inner { height: 64px; gap: 10px; }
  .nav.is-open { top: 64px; padding-inline: 16px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-text b { font-size: 23px; }
  .brand-text small { font-size: 10px; }
  .cart-btn { padding: 9px 12px; }
  .cart-btn-label { display: none; }
  .header-actions { gap: 8px; }
  .section { padding: 68px 0; }
  .section-head { margin-bottom: 24px; gap: 18px; }
  .hero { padding: 30px 0 84px; }
  .lead { font-size: 17px; }
  .hero-actions .btn { flex: 1; padding-inline: 16px; }
  .perks { margin-top: 32px; gap: 12px; flex-direction: column; }
  .hero-visual { width: 74%; }
  .hero-new { left: -30px; top: 34px; width: 188px; padding: 12px 14px 14px; }
  .hero-new b { font-size: 18px; }
  .hero-new .price { font-size: 21px; }
  .hero-new .btn { padding: 8px 12px; font-size: 13px; }
  .hero-books { left: -18px; bottom: -46px; width: 260px; }
  .hero-books .cover { width: 84px; padding: 13px 9px 8px 14px; }
  .hero-books .cover:nth-child(2) { transform: rotate(-1deg) translate(-26px, 8px); }
  .hero-books .cover:nth-child(3) { transform: rotate(7deg) translate(-52px, 18px); }
  .filters { width: 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; width: calc(100% + 32px); }
  .chip { flex: none; }

  .book-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .book { padding: 10px 10px 12px; border-radius: 14px; }
  .book-cover-wrap { padding: 16px 18px 14px; margin-bottom: 12px; border-radius: 10px; }
  .badge { left: 6px; top: 6px; font-size: 9px; padding: 3px 7px; }
  .book-body { padding: 0 2px; }
  .book-genre { font-size: 10px; letter-spacing: .1em; margin-bottom: 4px; }
  .book-title { font-size: 19px; }
  .book-text { display: none; }
  .book-foot { flex-direction: column; align-items: stretch; gap: 10px; padding-top: 10px; }
  .price { font-size: 24px; }
  .add-btn { padding: 10px 12px; font-size: 14px; }

  .step { padding: 24px 22px; }
  .messenger-card { padding: 36px 18px 18px; border-radius: 22px; }
  .phone-big { font-size: 28px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .site-footer { padding-bottom: 96px; }
  .drawer { width: 100%; }
  .drawer-head, .drawer-body, .drawer-foot, .drawer-steps { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
