:root {
  --bg: #ffffff;
  --surface: #f3f4f6;
  --text: #1c1e22;
  --muted: #6a6f78;
  --line: #e2e4e8;
  --accent: #c8102e;
  --accent-dark: #a50d26;
  --dark: #1c1e22;
  --danger: #c8102e;
  --ok: #187a33;
  --radius: 12px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --shadow: 0 1px 2px rgba(20, 22, 26, .06), 0 4px 14px rgba(20, 22, 26, .06);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 500 16px/1.45 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a { touch-action: manipulation; }
/* Довге натискання на кнопку не виділяє її текст (текст сторінки лишається виділюваним) */
button, .btn, .chip, .cat, .catnav__btn, .icon-btn, .qty, .gallery__thumbs, .dots {
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
button { cursor: pointer; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1480px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  border-bottom: 3px solid var(--accent);
  padding-top: env(safe-area-inset-top, 0px);
}
.header__bar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 4px 8px;
  grid-template-areas: "menu logo actions" "search search search"; padding-block: 8px 10px;
}
#menuBtn { grid-area: menu; }
.logo { grid-area: logo; }
.header__actions { grid-area: actions; }
.search { grid-area: search; }
.header__contacts, .topbar, .catnav, .float-cart { display: none; }
.header__actions { justify-self: end; display: flex; gap: 2px; }
#menuBtn { justify-self: start; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 46px; height: 46px; border: 0; border-radius: 10px;
  background: transparent; position: relative;
}
.icon-btn:active { background: var(--surface); }
.logo { display: flex; flex-direction: column; align-items: center; min-width: 0; gap: 3px; }
.logo__mark { width: 150px; height: auto; display: block; }
/* Слоган як на лого: великі літери з розрядкою, риски по боках */
.logo__tag {
  display: flex; align-items: center; gap: 6px; font-size: 8.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .14em; color: var(--text); white-space: nowrap;
}
.logo__tag::before, .logo__tag::after { content: ''; flex: none; width: 10px; height: 1px; background: currentColor; }
@media (max-width: 389px) {   /* вузькі телефони: слоган у два рядки, щоб не заходив під кнопки */
  .logo__tag { white-space: normal; max-width: 150px; text-align: center; line-height: 1.3; }
  .logo__tag::before, .logo__tag::after { display: none; }
}
.cart-count {
  position: absolute; top: 4px; right: 2px;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
  display: grid; place-items: center;
}

.search { display: flex; }
.search input {
  flex: 1; min-width: 0; height: 46px; padding: 0 14px;
  border: 2px solid var(--text); border-right: 0; border-radius: 10px 0 0 10px;
  font-size: 16px; background: #fff; outline: none;
}
.search input:focus, .search input:focus + button { border-color: var(--accent); }
.search button {
  width: 54px; height: 46px; border: 2px solid var(--text); border-radius: 0 10px 10px 0;
  background: #fff; display: grid; place-items: center;
}

/* ---------- Drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 40; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .4); animation: fadeIn 420ms ease-out; }
.drawer__panel {
  overscroll-behavior: contain;
  position: absolute; top: 0; bottom: 0; left: 0; width: min(320px, 86vw);
  background: #fff; overflow-y: auto;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 0 calc(16px + env(safe-area-inset-bottom, 0px));
  animation: slideIn 560ms var(--ease-drawer);
}
@keyframes slideIn { from { transform: translateX(-100%); } }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 8px 16px; }
.drawer__panel a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; font-size: 17px; font-weight: 600; border-bottom: 1px solid var(--line);
}
.drawer__panel a img { width: 40px; height: 40px; object-fit: contain; }
.drawer__panel a:active { background: var(--surface); }
.drawer__sep { height: 10px; background: var(--surface); }
.drawer__title { padding: 14px 16px 6px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.lang { display: inline-flex; border: 2px solid var(--text); border-radius: 10px; overflow: hidden; }
.lang button { border: 0; background: #fff; padding: 6px 14px; font-weight: 700; }
.lang button.is-on { background: var(--text); color: #fff; }

/* ---------- Common ---------- */
main { padding-bottom: 32px; min-height: 60vh; }
.section-title { display: flex; align-items: center; gap: 14px; margin: 28px 0 14px; font-size: 22px; font-weight: 700; }
.section-title::after { content: ''; flex: 1; height: 2px; background: var(--line); }
h1 { font-size: 24px; line-height: 1.2; margin: 18px 0 12px; font-weight: 800; }
.crumbs { font-size: 14px; color: var(--muted); margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.back {
  display: inline-flex; align-items: center; gap: 2px; height: 34px; padding: 0 12px 0 6px; margin-right: 6px;
  border: 0; border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 700; font-size: 14px;
  transition: transform 160ms var(--ease-out), background-color 120ms ease;
}
.back .ic { color: var(--text); width: 20px; height: 20px; }
.back:active { transform: scale(.95); }
.to-top {
  position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: #fff; color: var(--text); box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
  opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none;
  transition: opacity 420ms ease, transform 560ms var(--ease-out);
}
.to-top.is-on { opacity: 1; transform: none; pointer-events: auto; }
.to-top:active { transform: scale(.92); }
body.has-buybar .to-top { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
.crumbs a { text-decoration: underline; text-underline-offset: 2px; }
.empty { text-align: center; padding: 40px 0; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border: 0; border-radius: 12px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 17px;
  transition: background-color 150ms ease, transform 160ms var(--ease-out);
}
.btn:active { transform: scale(.97); background: var(--accent-dark); }
.btn--block { width: 100%; }
.btn--ghost { background: #fff; color: var(--text); border: 2px solid var(--line); }
.btn--ghost:active { background: var(--surface); }
.btn[disabled] { background: #b9bcc2; transform: none; cursor: default; }

/* ---------- Banner slider ---------- */
.slider { margin-top: 16px; position: relative; }
.slider__track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px;
  scrollbar-width: none; border-radius: var(--radius); overscroll-behavior-x: contain;
}
.slider__track::-webkit-scrollbar { display: none; }
.banner {
  flex: 0 0 100%; scroll-snap-align: start;
  aspect-ratio: 3 / 1; border-radius: var(--radius); overflow: hidden; background: #1a0306;
}
.banner img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.dots { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.dots button { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 0; background: #c9ccd2; transition: width 480ms var(--ease-out), background-color 400ms ease; }
.dots button.is-on { background: var(--accent); width: 24px; border-radius: 5px; }

/* ---------- Categories ---------- */
.cats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
/* Плитка: фото зверху, підпис під ним — підпис ніколи не перекриває товар */
.cat {
  position: relative; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column;
}
.cat img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; padding: 6px; }
.cat span {
  margin-top: auto; padding: 8px 10px 10px; display: flex; align-items: center; justify-content: space-between; gap: 6px;
  color: var(--text); font-weight: 700; font-size: 15px; line-height: 1.2; background: #f6f7f9;
}
.cat span::after { content: '›'; color: var(--accent); font-size: 22px; line-height: .8; }
.cat:active { transform: scale(.98); }
.cat img[src$=".svg"] { padding: 16%; }
.cat img.is-photo { padding: 0; object-fit: cover; }
.cat__soon {
  position: absolute; top: 8px; right: 8px; font-style: normal;
  background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 700;
  padding: 3px 8px; border-radius: 6px;
}

/* ---------- Product grid & cards ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.toolbar small { color: var(--muted); }
.toolbar select { height: 42px; border: 2px solid var(--line); border-radius: 10px; padding: 0 10px; background: #fff; max-width: 60%; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden; position: relative;
}
.card__img { aspect-ratio: 1; padding: 8px; display: block; overflow: hidden; }
.card__img img { width: 100%; height: 100%; object-fit: contain; }
.card__body { padding: 4px 10px 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__name { font-size: 14px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__price { font-size: 19px; font-weight: 800; margin-top: auto; }
.card__price small, .price small { font-size: .7em; font-weight: 700; }
.card .btn { min-height: 44px; font-size: 15px; padding: 0 10px; }
.card.is-out { opacity: .6; }
.stock { font-size: 13px; font-weight: 600; color: var(--ok); display: flex; align-items: center; gap: 4px; }
.stock.no { color: var(--muted); }
.stock::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tag {
  position: absolute; top: 8px; left: 8px; z-index: 1;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px;
}
.tag--new { background: #0b5ea8; }

/* ---------- Product page ---------- */
.product { display: grid; gap: 16px; }
.product__img { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 4 / 3; }
.gallery { position: relative; min-width: 0; }
.gallery__stage { position: relative; }
.gallery__slide img { cursor: zoom-in; }
.gallery__nav, .lightbox__nav {
  position: absolute; top: 50%; translate: 0 -50%; z-index: 2; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow); font-size: 28px; line-height: 1; padding-bottom: 3px; left: 10px;
  transition: transform 160ms var(--ease-out), background-color 120ms ease;
}
.gallery__nav--next, .lightbox__nav--next { left: auto; right: 10px; }
.gallery__nav:active, .lightbox__nav:active { transform: scale(.92); }

.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(14, 15, 17, .94); animation: fadeIn 180ms ease-out; }
.lightbox__track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.lightbox__track::-webkit-scrollbar { display: none; }
.lightbox__slide {
  flex: 0 0 100%; scroll-snap-align: start; display: grid; place-items: center;
  padding: calc(64px + env(safe-area-inset-top, 0px)) 16px calc(56px + env(safe-area-inset-bottom, 0px));
}
.lightbox__slide img { max-width: min(100%, 1200px); max-height: 100%; object-fit: contain; border-radius: 10px; background: #fff; }
.lightbox__close {
  position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; z-index: 2;
  width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .14); color: #fff;
}
.lightbox__nav { background: rgba(255, 255, 255, .16); border-color: transparent; color: #fff; box-shadow: none; width: 52px; height: 52px; left: 16px; }
.lightbox__nav--next { left: auto; right: 16px; }
.lightbox__count {
  position: absolute; left: 50%; translate: -50% 0; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  color: #fff; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums;
}
@media (max-width: 639px) {
  .lightbox__nav { display: none; }   /* на телефоні гортаємо пальцем */
  .gallery__nav { width: 38px; height: 38px; font-size: 24px; }
}
.gallery__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__slide { flex: 0 0 100%; scroll-snap-align: start; padding: 12px; }
.gallery__slide img { width: 100%; height: 100%; object-fit: contain; }
.gallery__slide { position: relative; }
.gallery__cap {
  position: absolute; left: 10px; bottom: 10px; background: rgba(255, 255, 255, .92); color: var(--text);
  font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}
.gallery__count {
  position: absolute; top: 10px; right: 10px; background: rgba(28, 30, 34, .72); color: #fff;
  font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.gallery__thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
.gallery__thumbs:empty { display: none; }
.gallery__thumbs button { flex: 0 0 64px; height: 64px; padding: 4px; border: 2px solid var(--line); border-radius: 10px; background: #fff; }
.gallery__thumbs button.is-on { border-color: var(--accent); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: contain; }
.product h1 { margin: 0 0 6px; }
.price { font-size: 30px; font-weight: 800; margin: 6px 0; }
.label { font-weight: 700; margin: 16px 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 2px solid var(--line); background: #fff; border-radius: 10px;
  padding: 9px 12px; font-size: 15px; font-weight: 600; min-height: 44px;
}
.chip.is-on { border-color: var(--accent); background: #fff1f3; color: var(--accent-dark); }
.chip.is-out { color: #a3a7ae; text-decoration: line-through; border-style: dashed; }
.buy-row { display: flex; gap: 10px; margin-top: 18px; }
.buy-row .btn { flex: 1; white-space: nowrap; }
.qty { display: inline-flex; align-items: center; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; height: 52px; }
.qty button { width: 46px; height: 100%; border: 0; background: #fff; font-size: 22px; font-weight: 700; }
.qty button:active { background: var(--surface); }
.qty span { min-width: 34px; text-align: center; font-weight: 700; font-size: 17px; }
.qty--sm { height: 40px; border-radius: 10px; }
.qty--sm button { width: 38px; font-size: 20px; }
.info { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; margin-top: 18px; }
.info p { margin: 0 0 6px; }
.info ul { margin: 0; padding-left: 20px; }
.info li { margin: 4px 0; }

/* ---------- Cart & checkout ---------- */
.cart-item { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-item img { width: 72px; height: 72px; object-fit: contain; background: #fff; border-radius: 10px; border: 1px solid var(--line); }
.cart-item__name { font-weight: 600; font-size: 15px; line-height: 1.3; }
.cart-item__var { color: var(--muted); font-size: 14px; }
.cart-item__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-top: 8px; gap: 8px; }
.cart-item > div { min-width: 0; }
.cart-item__sum { font-weight: 800; font-size: 17px; white-space: nowrap; }
.link-btn { border: 0; background: none; color: var(--muted); text-decoration: underline; padding: 6px 0; font-size: 14px; }
.total { display: flex; justify-content: space-between; align-items: baseline; font-size: 20px; font-weight: 800; padding: 16px 0; }

.form { display: grid; gap: 14px; margin-top: 8px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; min-height: 52px; padding: 12px 14px; font-size: 17px;
  border: 2px solid var(--line); border-radius: 12px; background: #fff; outline: none;
}
.field textarea { min-height: 84px; resize: vertical; }
/* Підказки Нової Пошти під полями "Місто" і "Відділення" */
.field { position: relative; }
.np-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; max-height: min(320px, 50vh); overflow-y: auto;
  overscroll-behavior: contain; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .16); animation: popIn 200ms var(--ease-out);
}
.np-list button {
  display: block; width: 100%; padding: 11px 14px; border: 0; border-bottom: 1px solid var(--line); background: none;
  text-align: left; font-size: 15px; line-height: 1.3; touch-action: manipulation;
}
.np-list button:last-child { border-bottom: 0; }
.np-list button.is-active, .np-list button:active { background: var(--surface); }
.np-list b { display: block; font-weight: 700; }
.np-list small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.field input:focus, .field textarea:focus { border-color: var(--text); }
.field.is-bad input { border-color: var(--danger); }
.field .err { color: var(--danger); font-size: 14px; margin-top: 4px; }
.note { font-size: 14px; color: var(--muted); }
.alert { background: #fff1f3; color: var(--danger); border-radius: 12px; padding: 12px 14px; font-weight: 600; }

.done { text-align: center; padding: 40px 0; }
.done__icon { width: 72px; height: 72px; border-radius: 50%; background: #e6f6ea; color: var(--ok); display: grid; place-items: center; margin: 0 auto 12px; }

/* ---------- Contacts ---------- */
.contacts { display: grid; gap: 10px; }
.contact-line { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 12px; padding: 14px 16px; font-weight: 700; font-size: 17px; }

/* ---------- Footer ---------- */
.footer { background: var(--dark); color: #d6d8dc; padding: 28px 0 calc(28px + env(safe-area-inset-bottom, 0px)); }
.footer .wrap { display: grid; gap: 18px; }
.footer h3 { color: #fff; margin: 0 0 8px; font-size: 16px; }
.footer a { display: block; padding: 5px 0; }
.footer__phone { font-size: 22px; font-weight: 800; color: #fff; }
.footer small { color: #8d929b; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 50;
  max-width: 480px; margin: 0 auto;
  background: #1c1e22; color: #fff; border-radius: 14px; padding: 12px 12px 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-weight: 600; box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
  /* Переходи, а не keyframes: часті "Купити" підхоплюють анімацію з поточного місця */
  opacity: 0; transform: translateY(calc(100% + 24px)); pointer-events: none;
  transition: transform 560ms var(--ease-out), opacity 420ms ease;
}
.toast.is-on { opacity: 1; transform: none; pointer-events: auto; }
.toast__msg { display: inline-flex; align-items: center; gap: 8px; }
.toast__msg svg { color: #5fd27a; flex: none; }
.toast a { background: var(--accent); color: #fff; padding: 10px 14px; border-radius: 10px; white-space: nowrap; }

/* Закриття — тим самим шляхом, що й відкриття, і швидше */
.drawer.is-closing .drawer__panel { animation: slideOut 380ms var(--ease-drawer) forwards; }
.drawer.is-closing .drawer__backdrop { animation: fadeOut 380ms ease forwards; }
@keyframes slideOut { to { transform: translateX(-100%); } }
@keyframes fadeOut { to { opacity: 0; } }
.lightbox__slide img { animation: lbIn 520ms var(--ease-out); }
@keyframes lbIn { from { opacity: 0; transform: scale(.96); } }
.lightbox.is-closing { animation: fadeOut 320ms ease forwards; }

/* "Зменшити рух": лишаємо м'які затухання, прибираємо зсуви й масштаб */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .drawer__panel, .mega, .catnav__list, .suggest, .lightbox__slide img { animation: fadeIn 150ms ease-out; }
  .drawer.is-closing .drawer__panel { animation: fadeOut 150ms ease forwards; }
  .cart-count.bump { animation: none; }
  .toast { transform: none; transition: opacity 150ms ease; }
  :active { transform: none !important; }
}

/* ---------- Хіти продаж: вкладка + карусель ---------- */
.tabs-title { margin: 36px 0 14px; border-bottom: 1px solid var(--line); display: flex; }
.tabs-title span {
  font-size: 18px; font-weight: 600; padding: 10px 18px; margin-bottom: -1px;
  border: 1px solid var(--line); border-bottom-color: var(--bg); border-radius: 8px 8px 0 0; background: var(--bg);
}
.carousel { position: relative; }
.carousel__track {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 4px 2px 14px; overscroll-behavior-x: contain;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track > .card { flex: 0 0 calc((100% - 12px) / 2); scroll-snap-align: start; }
.carousel__arrow {
  display: none; place-items: center; position: absolute; top: 42%; z-index: 2;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: #fff;
  box-shadow: var(--shadow); font-size: 26px; line-height: 1; left: -20px;
}
.carousel__arrow--next { left: auto; right: -20px; }

/* Кнопка "У кошик" + кількість */
.btn--buy { background: #1f7f30; }   /* білий текст 5:1 — читається й на сонці */
.btn--buy:active { background: #186826; }
.card__buy { display: flex; gap: 6px; align-items: center; }
.card__buy .btn { flex: 1; }
.qty--card { display: none; height: 44px; border-radius: 10px; }
.qty--card button { width: 30px; font-size: 18px; }
.qty--card span { min-width: 22px; font-size: 15px; }

.footer__cols { display: grid; gap: 18px; }
.footer__cols a::before { content: '› '; color: #8d929b; }
.footer__cols .footer__phone::before { content: ''; }
.footer p { margin: 4px 0; }
.footer__bottom { margin-top: 28px; color: #8d929b; font-size: 14px; }

/* ---------- Іконки, підказки пошуку, липка кнопка "Купити" ---------- */
.ic { width: 22px; height: 22px; flex: none; color: var(--accent); }
.contact-line .ic { width: 24px; height: 24px; }
.footer .ic { width: 16px; height: 16px; color: #8d929b; vertical-align: -3px; margin-right: 6px; }
.footer p { display: flex; align-items: center; }

.search { position: relative; }
.suggest {
  overscroll-behavior: contain;
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .16); overflow: hidden;
}
.suggest a { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; line-height: 1.25; }
.suggest a:last-child { border-bottom: 0; }
.suggest a.is-active { background: var(--surface); }
.suggest img { width: 48px; height: 48px; object-fit: contain; }
.suggest b { white-space: nowrap; }
.suggest span small { display: block; color: var(--muted); font-weight: 500; }
.suggest .suggest__all { display: block; text-align: center; color: var(--accent); font-weight: 700; }

@media (max-width: 899px) {
  .buy-row {
    position: sticky; bottom: 0; z-index: 6; background: #fff;
    margin-inline: -16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 16px -10px rgba(0, 0, 0, .25);
  }
  body.has-buybar .toast { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  .product { gap: 10px; }
  .product__img { aspect-ratio: 16 / 11; }
}
@media (max-width: 639px) {
  .footer__cats { display: none; }
}

/* ---------- Відчуття натискань і появи ---------- */
.card { transition: box-shadow 400ms ease; }
.chip, .cat, .gallery__thumbs button, .qty button, .icon-btn, .carousel__arrow, .banner, .card__img img {
  transition: transform 160ms var(--ease-out), border-color 120ms ease, background-color 120ms ease, box-shadow 200ms ease;
}
.chip:active, .cat:active, .gallery__thumbs button:active, .carousel__arrow:active, .icon-btn:active, .card__img:active img { transform: scale(.97); }
.banner:active { transform: scale(.985); }
.qty button:active { transform: scale(.92); }
.qty span, .price, .card__price, .cart-item__sum, .total, .btn, .cart-count { font-variant-numeric: tabular-nums; }

.mega, .catnav__list, .suggest { transform-origin: top center; animation: popIn 380ms var(--ease-out); }
@keyframes popIn { from { opacity: 0; transform: translateY(-8px); } }
@keyframes fadeIn { from { opacity: 0; } }

/* Товар додано: лічильник кошика коротко "штовхає" */
.cart-count.bump { animation: bump 520ms var(--ease-out); }
@keyframes bump { 40% { transform: scale(1.25); } }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.search input:focus-visible { outline: none; }
::selection { background: #f7d2d8; color: var(--text); }

/* Стійкість до "важких" даних з таблиці */
.suggest span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.gallery__cap { max-width: calc(100% - 20px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__name, .cart-item__name, h1 { overflow-wrap: anywhere; }
img.is-fallback { object-fit: contain; padding: 18%; background: var(--surface); }
@media (max-width: 380px) {
  .buy-row .btn { font-size: 15px; padding: 0 12px; }
  .buy-row .qty button { width: 38px; }
}

/* ---------- Larger screens ---------- */
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .cats { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .footer__cols { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .cats { grid-template-columns: repeat(4, 1fr); }
  .product { grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 8px; }
  .product__img { aspect-ratio: 1; }
  .checkout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: start; }
}

/* ---------- Ноутбук / ПК: як у референсі ---------- */
@media (min-width: 1000px) {
  .topbar { display: block; background: var(--dark); color: #d6d8dc; font-size: 14px; }
  .topbar__in { display: flex; align-items: center; justify-content: space-between; height: 38px; }
  .topbar__links { display: flex; gap: 24px; }
  .topbar__links a:hover { color: #fff; }
  .topbar .lang { border-color: #4a4e56; }
  .topbar .lang button { background: transparent; color: #d6d8dc; padding: 2px 10px; font-size: 13px; }
  .topbar .lang button.is-on { background: #fff; color: var(--text); }

  .header { position: static; border-bottom: 0; }
  .header__bar {
    grid-template-columns: auto 1fr auto auto; grid-template-areas: "logo search contacts actions";
    gap: 32px; padding-block: 22px;
  }
  #menuBtn, #phoneBtn { display: none; }
  .logo { align-items: flex-start; gap: 6px; }
  .logo__mark { width: 280px; }
  .logo__tag { font-size: 10px; letter-spacing: .2em; gap: 10px; }
  .logo__tag::before, .logo__tag::after { width: 18px; }
  .search input, .search button { border-width: 1px; border-color: #c9ccd2; height: 44px; }
  .search input { border-radius: 8px 0 0 8px; }
  .search button { border-radius: 0 8px 8px 0; color: var(--muted); }
  .header__contacts { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
  .header__phone { font-size: 20px; font-weight: 700; }
  .header__contacts span { display: flex; gap: 14px; font-size: 14px; color: var(--muted); }
  .header__contacts span a:hover { color: var(--accent); }
  .header__actions .icon-btn { width: 52px; height: 52px; }

  .catnav { display: block; position: sticky; top: 0; z-index: 25; background: #fff; padding-block: 0 6px; box-shadow: 0 6px 12px -10px rgba(0,0,0,.25); }
  .catnav__in { display: flex; gap: 12px; position: relative; }
  .catnav__catalog { position: relative; flex: 0 0 300px; }
  .catnav__btn {
    width: 100%; height: 48px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 18px; border: 0; border-radius: 6px; background: var(--accent); color: #fff;
    font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: .02em;
  }
  .catnav__btn:hover { background: var(--accent-dark); }
  .catnav__list {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 30; background: #fff;
    border: 1px solid var(--line); border-top: 0; box-shadow: 0 14px 30px rgba(0,0,0,.15);
  }
  .catnav__list a { display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-weight: 600; }
  .catnav__list a:hover { background: var(--surface); color: var(--accent); }
  .catnav__list img { width: 34px; height: 34px; object-fit: contain; }
  .catnav__menu { flex: 1; display: flex; margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 6px; background: #fafafa; }
  .catnav__item { flex: 1; }
  .catnav__item + .catnav__item > a { border-left: 1px solid var(--line); }
  .catnav__item > a { display: flex; align-items: center; justify-content: center; gap: 6px; height: 46px; font-weight: 600; }
  .catnav__item:hover > a, .catnav__item:focus-within > a { color: var(--accent); }
  .caret { font-size: 12px; }
  .mega {
    display: none; position: absolute; left: 16px; right: 16px; top: 100%; z-index: 30;
    background: #fff; box-shadow: 0 18px 40px rgba(0,0,0,.18); border: 1px solid var(--line);
    padding: 22px 24px; grid-template-columns: repeat(var(--mcols, 5), 1fr); gap: 22px 18px;
  }
  .catnav__item:hover .mega, .catnav__item:focus-within .mega { display: grid; }
  .catnav__item.is-closed .mega { display: none; }
  .mega__col { border-left: 1px solid var(--line); padding-left: 16px; display: flex; flex-direction: column; gap: 4px; }
  .mega__col > a:not(.mega__head) { font-size: 14px; color: var(--muted); }
  .mega__col a:hover { color: var(--accent); }
  .mega__head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
  .mega__head img { height: 110px; width: 100%; object-fit: contain; }
  .mega__head b { font-size: 16px; color: var(--text); }

  .float-cart {
    display: grid; place-items: center; position: fixed; right: 12px; top: 34vh; z-index: 35;
    width: 66px; height: 66px; background: #fff; border: 2px solid var(--accent); border-radius: 8px;
    box-shadow: var(--shadow);
  }
  body.has-buybar .to-top { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
  .float-cart .cart-count { top: auto; bottom: -8px; right: -8px; }

  .slider { margin-top: 20px; }
  .section-title { font-size: 26px; font-weight: 600; margin-top: 36px; }
  .section-title::after { display: none; }
  .cats { grid-template-columns: repeat(var(--cols, 5), 1fr); gap: 16px; }
  .cat { box-shadow: 0 2px 10px rgba(0,0,0,.08); border-radius: 6px; }
  .cat img { padding: 10px; }
  .cat span { font-size: 16px; padding: 10px 12px 12px; }
  .grid { grid-template-columns: repeat(5, 1fr); }
  .carousel__track > .card { flex-basis: calc((100% - 4 * 16px) / 5); }
  .carousel__arrow { display: grid; }
  .card__buy .qty--card { display: inline-flex; }
}
@media (min-width: 1000px) {
  .footer__cats { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; align-content: start; }
  .footer__cats h3 { grid-column: 1 / -1; }
}
/* Широкі монітори: більше товарів у ряд замість порожніх полів */
@media (min-width: 1400px) {
  .wrap { padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); }
  .grid { grid-template-columns: repeat(6, 1fr); }
  .carousel__track > .card { flex-basis: calc((100% - 5 * 16px) / 6); }
  .catnav__catalog { flex-basis: 320px; }
}
@media (hover: hover) and (pointer: fine) {
  .card:hover, .cat:hover { box-shadow: 0 2px 4px rgba(20, 22, 26, .08), 0 10px 26px rgba(20, 22, 26, .1); }
  .btn:hover { background: var(--accent-dark); }
  .btn--buy:hover { background: #186826; }
  .btn--ghost:hover { background: var(--surface); }
  .back:hover { background: #e8eaee; }
  .to-top:hover { background: var(--surface); }
  .suggest a:hover { background: var(--surface); }
  .cat:hover span { color: var(--accent); }
}
