/* Bon Bon — вітрина. Кондитерська тема: темна слива, ягідний акцент,
   фісташковий для наявності, тепле вершкове тло. */

:root {
  --plum:        #2f1b33;
  --plum-soft:   #4a2c50;
  --berry:       #d6336c;
  --berry-dark:  #b32656;
  --pistachio:   #6ea351;
  --pistachio-l: #eaf3e2;
  --cream:       #fbf3e8;
  --cream-deep:  #f3e6d6;
  --card:        #ffffff;
  --ink:         #2b2028;
  --ink-soft:    #6f6069;
  --line:        #e6d7c6;
  --radius:      14px;
  --radius-sm:   10px;
  /* Тіні майже без розмиття — щоб було відчуття друкованої етикетки. */
  --shadow:      0 2px 0 rgba(47, 27, 51, .08);
  --shadow-lift: 0 4px 0 rgba(47, 27, 51, .12);
  --tap:         44px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.55 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -.01em;
}

img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

/* Фокус має бути видно з клавіатури — але не заважати мишею. */
:focus-visible {
  outline: 3px solid var(--berry);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* --- Верхня плашка --- */
.topbar {
  background: var(--plum);
  color: var(--cream);
  font-size: 13px;
  letter-spacing: .02em;
  text-align: center;
  padding: 9px 16px;
}

/* --- Шапка --- */
.header {
  position: sticky; top: 0; z-index: 30;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}
.header__in {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 0;
}
.logo {
  display: flex; align-items: baseline; gap: 8px;
  text-decoration: none; color: var(--plum); flex: none;
}
.logo__mark {
  font-family: 'Fraunces', serif; font-size: 26px; font-weight: 700;
  letter-spacing: -.02em;
}
.logo__slogan {
  font-size: 12px; color: var(--ink-soft); display: none;
}
@media (min-width: 900px) { .logo__slogan { display: block; } }

.search {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 6px 0 14px;
  min-height: var(--tap);
}
.search input {
  flex: 1; border: 0; background: none; padding: 10px 0; min-width: 0;
}
.search input:focus { outline: none; }
.search__btn {
  border: 0; background: var(--plum); color: var(--cream);
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; flex: none;
}

.cart-btn {
  position: relative; flex: none;
  min-width: var(--tap); min-height: var(--tap);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 14px; border: 0; border-radius: 999px;
  background: var(--berry); color: #fff; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow);
}
.cart-btn:hover { background: var(--berry-dark); }
.cart-btn__count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: #fff; color: var(--berry); font-size: 13px; font-weight: 700;
  display: grid; place-items: center;
}
.cart-btn__label { display: none; }
@media (min-width: 700px) { .cart-btn__label { display: inline; } }

/* --- Стрічка категорій --- */
.cats { border-bottom: 1px solid var(--line); background: var(--cream); }
.cats__row {
  display: flex; gap: 8px; overflow-x: auto; padding: 12px 0;
  scrollbar-width: none;
}
.cats__row::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: none; display: flex; align-items: center; gap: 8px;
  min-height: var(--tap); padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink);
  cursor: pointer; white-space: nowrap; font-size: 14px;
}
.cat-chip b { font-weight: 600; }
.cat-chip small { color: var(--ink-soft); font-size: 12px; }
.cat-chip.is-active {
  background: var(--plum); border-color: var(--plum); color: var(--cream);
}
.cat-chip.is-active small { color: #c9b4cd; }

/* --- Банер --- */
.banner {
  margin: 24px 0;
  background: linear-gradient(135deg, var(--plum) 0%, var(--plum-soft) 100%);
  color: var(--cream);
  border-radius: var(--radius);
  padding: 32px 24px;
  position: relative; overflow: hidden;
}
.banner__title { font-size: clamp(28px, 5vw, 44px); margin-bottom: 10px; }
.banner__text { max-width: 52ch; color: #e5d5e8; margin: 0 0 18px; }
.banner__note {
  display: inline-block; background: rgba(214, 51, 108, .22);
  border: 1px solid rgba(214, 51, 108, .5);
  color: #ffd9e5; border-radius: 999px; padding: 6px 14px; font-size: 13px;
}
.banner::after {
  content: ''; position: absolute; right: -60px; top: -60px;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(214,51,108,.35), transparent 70%);
}

/* --- Панель фільтрів --- */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 18px;
}
.toolbar__title { flex: 1; font-size: 22px; }
.chip {
  min-height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
  cursor: pointer; font-size: 14px;
}
.chip.is-active { background: var(--berry); border-color: var(--berry); color: #fff; }
select.chip { min-height: 38px; padding-inline: 12px; }

/* --- Сітка товарів --- */
.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(2, 1fr);
  padding-bottom: 40px;
}
@media (min-width: 700px)  { .grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }

.card__media {
  position: relative; aspect-ratio: 1 / 1; background: var(--cream-deep);
  border: 0; padding: 0; cursor: pointer; width: 100%; display: block;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__ph {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--plum) 0%, var(--plum-soft) 100%);
  color: var(--cream); font-family: 'Fraunces', serif; font-size: 40px;
}
.card__off {
  position: absolute; left: 8px; top: 8px;
  background: var(--berry); color: #fff; font-weight: 700; font-size: 13px;
  padding: 3px 9px; border-radius: 999px;
}
.card__badges { position: absolute; right: 8px; top: 8px; display: grid; gap: 4px; justifyItems: end; }
.badge {
  background: rgba(47, 27, 51, .85); color: var(--cream);
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
}

.card__body { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__brand { font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; }
.card__name {
  font-size: 15px; font-weight: 600; line-height: 1.3;
  background: none; border: 0; padding: 0; text-align: left; cursor: pointer;
}
.card__stock { font-size: 12px; display: flex; align-items: center; gap: 6px; }
.card__stock b { font-weight: 600; }
.in-stock  { color: var(--pistachio); }
.no-stock  { color: var(--ink-soft); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.card__foot { margin-top: auto; display: flex; align-items: center; gap: 10px; }
.price { font-family: 'Fraunces', serif; font-size: 20px; font-weight: 600; color: var(--berry); }
.price--old { font-family: 'Manrope', sans-serif; font-size: 14px; color: var(--ink-soft); text-decoration: line-through; font-weight: 400; }
.buy {
  margin-left: auto; min-height: var(--tap); min-width: var(--tap);
  padding: 0 16px; border: 0; border-radius: var(--radius-sm);
  background: var(--berry); color: #fff; font-weight: 600; cursor: pointer;
}
.buy:hover:not(:disabled) { background: var(--berry-dark); }
.buy:disabled { background: var(--cream-deep); color: var(--ink-soft); cursor: not-allowed; }

/* --- Стани --- */
.empty { text-align: center; padding: 60px 20px; color: var(--ink-soft); grid-column: 1 / -1; }
.skeleton { aspect-ratio: 3 / 4; border-radius: var(--radius); background: var(--cream-deep); }

/* --- Модалка товару --- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(47, 27, 51, .55); }
.modal__box {
  position: relative; background: var(--card); border-radius: var(--radius);
  width: min(880px, 100%); max-height: 90vh; overflow-y: auto;
  box-shadow: 0 8px 0 rgba(47, 27, 51, .2);
}
.modal__close {
  position: absolute; right: 10px; top: 10px; z-index: 2;
  width: var(--tap); height: var(--tap); border-radius: 50%;
  border: 0; background: var(--cream); cursor: pointer; font-size: 18px;
}
.pv { display: grid; grid-template-columns: 1fr; }
@media (min-width: 760px) { .pv { grid-template-columns: 1fr 1fr; } }
.pv__media { aspect-ratio: 1 / 1; background: var(--cream-deep); }
.pv__media img { width: 100%; height: 100%; object-fit: cover; }
.pv__body { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.pv__title { font-size: 26px; }
.pv__desc { color: var(--ink-soft); margin: 0; }
.specs { border-top: 1px solid var(--line); }
.specs div {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.specs dt { color: var(--ink-soft); }

/* --- Кошик --- */
.cart {
  position: fixed; inset: 0; z-index: 70;
  display: flex; justify-content: flex-end;
}
.cart__backdrop { position: absolute; inset: 0; background: rgba(47, 27, 51, .55); }
.cart__panel {
  position: relative; background: var(--cream);
  width: min(460px, 100%); display: flex; flex-direction: column;
  box-shadow: -4px 0 0 rgba(47, 27, 51, .12);
}
/* На вузькому екрані кошик виїжджає знизу — тягнутися вгору незручно. */
@media (max-width: 640px) {
  .cart { align-items: flex-end; }
  .cart__panel { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; }
}
.cart__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; border-bottom: 1px solid var(--line);
}
.cart__body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.cart__foot { border-top: 1px solid var(--line); padding: 16px; background: var(--card); }

.ci { display: flex; gap: 12px; align-items: center; }
.ci__img { width: 64px; height: 64px; border-radius: var(--radius-sm); object-fit: cover; background: var(--cream-deep); flex: none; }
.ci__main { flex: 1; min-width: 0; }
.ci__name { font-size: 14px; font-weight: 600; }
.ci__price { font-size: 13px; color: var(--ink-soft); }
.qty { display: flex; align-items: center; gap: 2px; }
.qty button {
  width: 34px; height: 34px; border: 1px solid var(--line); background: var(--card);
  cursor: pointer; border-radius: 8px; font-size: 17px;
}
.qty span { min-width: 34px; text-align: center; font-weight: 600; }
.ci__del { border: 0; background: none; color: var(--ink-soft); cursor: pointer; font-size: 18px; width: 34px; height: 34px; }

.sum { display: flex; justify-content: space-between; margin-bottom: 6px; }
.sum--total { font-size: 19px; font-weight: 700; }
.sum--total b { color: var(--berry); font-family: 'Fraunces', serif; }
.ship-note { font-size: 13px; color: var(--pistachio); margin-bottom: 12px; }

.btn {
  width: 100%; min-height: var(--tap); border: 0; border-radius: var(--radius-sm);
  background: var(--berry); color: #fff; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow);
}
.btn:hover:not(:disabled) { background: var(--berry-dark); }
.btn:disabled { background: var(--cream-deep); color: var(--ink-soft); cursor: not-allowed; box-shadow: none; }
.btn--ghost { background: none; color: var(--plum); border: 1px solid var(--line); box-shadow: none; }
.btn--ghost:hover { background: var(--cream-deep); }

/* --- Форма замовлення --- */
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 5px; }
.field > span { font-size: 13px; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  min-height: var(--tap); padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); width: 100%;
}
.field textarea { min-height: 76px; resize: vertical; }
.row2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 460px) { .row2 { grid-template-columns: 1fr 1fr; } }

.radios { display: grid; gap: 8px; }
.radio {
  display: flex; align-items: center; gap: 10px; min-height: var(--tap);
  padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); cursor: pointer;
}
.radio input { width: 18px; height: 18px; accent-color: var(--berry); flex: none; }
.radio.is-on { border-color: var(--berry); background: #fff5f8; }

.note { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; }
.note--err { background: #fdecef; color: #97244d; border: 1px solid #f3c6d2; }
.note--ok  { background: var(--pistachio-l); color: #3f6b2a; border: 1px solid #cbe3ba; }

.done { text-align: center; padding: 30px 20px; }
.done__code {
  font-family: 'Fraunces', serif; font-size: 32px; color: var(--berry);
  margin: 12px 0; letter-spacing: .02em;
}

/* --- Підвал --- */
.footer {
  background: var(--plum); color: #d9c6dd; margin-top: 40px;
  padding: 34px 0; font-size: 14px;
}
.footer__in { display: grid; gap: 18px; }
@media (min-width: 700px) { .footer__in { grid-template-columns: repeat(3, 1fr); } }
.footer h3 { color: var(--cream); font-size: 17px; margin-bottom: 8px; }
.footer a { color: #d9c6dd; }

/* Спливаюче повідомлення */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: 90; background: var(--plum); color: var(--cream);
  padding: 12px 20px; border-radius: 999px; font-size: 14px;
  box-shadow: var(--shadow-lift); max-width: 90vw;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
