/* ============================================================
   6Bags — стилі
   Шрифти: Cormorant Garamond (заголовки) + DM Sans (тіло)
   Палітра: темно-оливковий (#2C3A1E), кремовий (#F7F3EC), золотавий акцент (#C8A84B)
   ============================================================ */
:root {
  --bg:       #F7F3EC;
  --surface:  #FFFFFF;
  --dark:     #1A2210;
  --olive:    #2C3A1E;
  --olive2:   #4E6A2F;
  --gold:     #C8A84B;
  --red:      #8B2020;
  --text:     #2A2A2A;
  --muted:    #7A7A6A;
  --border:   #DDD8CC;
  --radius:   12px;
  --shadow:   0 2px 16px rgba(0,0,0,.08);
  --trans:    .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh; /* FB/IG in-app: динамічна висота вьюпорта (низ не ховається під тулбаром) */
  display: flex;
  flex-direction: column;
}

/* ---- HEADER ---- */
header {
  position: sticky;
  top: 0; z-index: 200;
  background: var(--dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: env(safe-area-inset-top) 16px 0;
  height: calc(56px + env(safe-area-inset-top));
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
  transition: background .28s ease, box-shadow .28s ease;
}
/* Scrolled state — glass effect */
header.scrolled {
  background: rgba(26,34,16,.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0,0,0,.35);
}

/* Mobile: non-sticky header + floating action buttons */
@media (max-width: 767px) {
  header {
    position: relative;
    top: auto;
  }
  /* Hide header nav buttons — FABs handle them */
  header #filter-toggle,
  header #cart-toggle { display: none; }
  /* Center logo */
  header { justify-content: center; }
}

/* ---- FLOATING ACTION BUTTONS (mobile only) ---- */
.fab {
  display: none;
}
@media (max-width: 767px) {
  .fab {
    display: flex;
    position: fixed;
    bottom: calc(22px + env(safe-area-inset-bottom));
    width: 54px; height: 54px;
    border-radius: 50%;
    border: none; cursor: pointer;
    align-items: center; justify-content: center;
    box-shadow: 0 4px 18px rgba(0,0,0,.35);
    z-index: 250;
    transition: transform .18s ease, box-shadow .18s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .fab:active { transform: scale(.91); box-shadow: 0 2px 8px rgba(0,0,0,.25); }

  .fab-filter {
    left: 20px;
    background: var(--olive);
    color: #fff;
  }
  .fab-cart {
    right: 20px;
    background: var(--gold);
    color: var(--dark);
  }
  .fab-cart-count {
    position: absolute;
    top: -3px; right: -3px;
    background: var(--red); color: #fff;
    font-size: 10px; font-weight: 700;
    min-width: 18px; height: 18px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
    pointer-events: none;
  }
  /* Extra bottom padding so last cards aren't hidden under FABs */
  .products-grid { padding-bottom: 90px; }
  footer { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}

.logo {
  display: flex; align-items: baseline; gap: 6px;
  color: #fff;
}
.logo-main {
  font-family: 'Tenor Sans', serif;
  font-size: 26px; font-weight: 400;
  letter-spacing: 2px;
  color: var(--gold);
  text-transform: uppercase;
}
.logo-sub {
  font-size: 13px; color: rgba(255,255,255,.6);
  display: none;
}
@media (min-width: 640px) { .logo-sub { display: inline; } }

.header-btn {
  background: none; border: none; cursor: pointer;
  color: #fff; padding: 8px; border-radius: 8px;
  transition: background var(--trans);
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
}
.header-btn:hover { background: rgba(255,255,255,.12); }

/* hamburger — SVG icon, no span rules needed */
#filter-toggle { width: 44px; height: 44px; }

.cart-count {
  position: absolute; top: 4px; right: 4px;
  background: var(--gold); color: var(--dark);
  font-size: 10px; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ---- CATEGORY BAR ---- */
.cat-bar {
  position: sticky;
  top: calc(56px + env(safe-area-inset-top));
  z-index: 190;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.cat-bar-inner {
  display: flex;
  gap: 6px;
  padding: 8px 16px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-bar-inner::-webkit-scrollbar { display: none; }

.cat-bar-chip {
  flex-shrink: 0;
  scroll-snap-align: start;
  padding: 5px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 400;
  cursor: pointer;
  transition: background var(--trans), color var(--trans), border-color var(--trans);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.cat-bar-chip:hover {
  border-color: var(--olive);
  color: var(--olive);
}
.cat-bar-chip.active {
  background: var(--olive);
  border-color: var(--olive);
  color: #fff;
  font-weight: 500;
}

/* On mobile — cat-bar sticks at top (header is not sticky) */
@media (max-width: 767px) {
  .cat-bar { top: 0; }
}

/* ---- FILTER PANEL ---- */
.filter-panel {
  position: fixed; top: 0; left: -320px;
  width: 300px; height: 100%;
  background: var(--surface);
  z-index: 300;
  transition: left .3s ease;
  box-shadow: 4px 0 24px rgba(0,0,0,.15);
  overflow-y: auto;
}
.filter-panel.open { left: 0; }

.filter-inner { padding: 20px; }

.filter-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 700;
  color: var(--olive);
}
.close-btn {
  background: none; border: none; font-size: 24px;
  cursor: pointer; color: var(--muted);
}

.filter-section { margin-bottom: 24px; }

.filter-label {
  font-size: 11px; font-weight: 500; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 10px;
}

.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  padding: 6px 14px; border-radius: 20px;
  border: 1.5px solid var(--border);
  background: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; color: var(--text);
  transition: var(--trans);
}
.chip:hover, .chip.active {
  background: var(--olive); color: #fff; border-color: var(--olive);
}
.chip.chip-disabled {
  opacity: .35; cursor: default; pointer-events: none;
}

.filter-select {
  width: 100%; padding: 8px 12px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-family: 'DM Sans', sans-serif; font-size: 14px;
  background: #fff; cursor: pointer;
}

.apply-btn {
  width: 100%; padding: 12px;
  background: var(--olive); color: #fff;
  border: none; border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 500;
  cursor: pointer; transition: var(--trans);
}
.apply-btn:hover { background: var(--olive2); }
#filter-count {
  display: inline-block;
  background: rgba(255,255,255,.25);
  border-radius: 20px;
  padding: 1px 9px;
  font-size: 13px;
  font-weight: 600;
  margin-left: 6px;
}

.overlay {
  display: none; position: fixed;
  inset: 0; background: rgba(0,0,0,.4);
  z-index: 290;
}
.overlay.show { display: block; }

/* ---- CATALOG ---- */
main { flex: 1; padding: 16px 16px 32px; }

/* Category sections */
.cat-section { margin-bottom: 36px; }
#main-catalog.cat-filtered .cat-section-title { display: none; }
.cat-section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px; font-weight: 700;
  color: var(--olive);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
  max-width: 1200px;
  margin-left: auto; margin-right: auto;
}
@media (min-width: 640px) { .cat-section-title { font-size: 28px; } }

.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ---- SIMPLIFIED CARD ---- */
.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow var(--trans), transform var(--trans);
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  box-shadow: 0 6px 28px rgba(0,0,0,.13);
  transform: translateY(-2px);
}

.card-img-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg);
}
.card-main-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}
.product-card:hover .card-main-img { transform: scale(1.04); }

.card-foot {
  padding: 10px 12px 14px;
  display: flex; flex-direction: column; gap: 5px;
}
.card-title {
  font-family: 'Tenor Sans', serif;
  font-size: 14px; color: var(--olive);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-prices { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.price-old-card {
  font-size: 11px; color: var(--muted); text-decoration: line-through;
}
.price-disc-card {
  font-size: 10px; background: var(--gold); color: var(--dark);
  padding: 1px 5px; border-radius: 4px; font-weight: 700;
}
.price-new-card {
  font-family: 'Poppins', sans-serif;
  font-size: 14px; font-weight: 600; color: var(--olive);
}

.badge-discount {
  position: absolute; top: 10px; left: 10px;
  background: var(--gold); color: var(--dark);
  font-weight: 700; font-size: 13px;
  padding: 3px 8px; border-radius: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

/* Cart toggle button on catalog card */
.card-cart-btn {
  position: absolute; bottom: 8px; right: 8px;
  width: 34px; height: 34px;
  background: rgba(255,255,255,.88);
  border: 1.5px solid rgba(0,0,0,.1);
  border-radius: 50%; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0; transform: scale(.85);
  transition: opacity .2s, transform .2s, background .2s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  line-height: 1;
}
/* Миша: кнопка кошика з'являється при наведенні */
@media (hover: hover) {
  .product-card:hover .card-cart-btn { opacity: 1; transform: scale(1); }
  .card-cart-btn:hover { background: rgba(255,255,255,1); transform: scale(1.08); }
}
/* Тач (телефони/планшети): кнопка кошика завжди видима — щоб hover не блокував перший клік */
@media (hover: none) {
  .card-cart-btn { opacity: 1; transform: scale(1); }
}

/* In-cart state */
.product-card.in-cart .card-cart-btn {
  opacity: 1; transform: scale(1);
  background: var(--olive); border-color: var(--olive); color: #fff;
}
.product-card.in-cart .card-cart-btn:hover { background: #5a5e30; }

.slider-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.45); color: #fff;
  border: none; border-radius: 50%;
  width: 30px; height: 30px;
  font-size: 18px; line-height: 1;
  cursor: pointer; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--trans);
}
.slider-btn:hover { background: rgba(0,0,0,.7); }
.slider-btn.prev { left: 6px; }
.slider-btn.next { right: 6px; }

.colors-wrap { display: flex; flex-direction: column; gap: 6px; }
.colors-label { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.colors-list { display: flex; flex-wrap: wrap; gap: 5px; }

.color-btn {
  padding: 4px 10px; border-radius: 6px;
  border: 1.5px solid var(--border);
  background: #F0EDE6; cursor: pointer;
  font-size: 12px; font-family: 'DM Sans', sans-serif;
  transition: var(--trans);
}
.color-btn:hover { border-color: var(--olive); }
.color-btn.active {
  background: var(--olive); color: #fff; border-color: var(--olive);
}

.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

.btn-cart, .btn-buy {
  flex: 1; min-width: 120px;
  padding: 10px 6px; border-radius: 10px;
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: var(--trans);
}
/* Вторинна дія — В кошик (контурна) */
.btn-cart {
  background: #fff; color: var(--olive);
  border: 1.5px solid var(--olive);
}
.btn-cart:hover { background: var(--bg); }
/* Головний CTA — Купити зараз (яскравий, залитий, з легким пульсом) */
.btn-buy {
  background: linear-gradient(135deg, var(--olive2), var(--olive));
  color: #fff; border: none; font-weight: 700; letter-spacing: .2px;
  box-shadow: 0 4px 14px rgba(46,58,30,.32);
  animation: ctaPulse 2.4s ease-in-out infinite;
}
.btn-buy:hover { filter: brightness(1.08); }
.btn-buy:active { transform: translateY(1px) scale(.99); }
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(46,58,30,.30); }
  50%      { box-shadow: 0 4px 22px rgba(200,168,75,.60); }
}
@media (prefers-reduced-motion: reduce) { .btn-buy { animation: none; } }
/* ⚠️ Тут було друге правило `.btn-buy:hover { background: var(--olive) }` — воно
   ЗАМІНЯЛО градієнт суцільним кольором. Градієнт (background-image) і колір не
   інтерполюються, тож на переході кнопка на мить «блимала». Лишаємо лише brightness. */

/* ---- HERO BANNERS ---- */
.hero-banners {
  position: relative;
  margin: 12px 16px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
}
@media (min-width: 900px) {
  .hero-banners { margin: 16px 32px; border-radius: 20px; }
}
.hero-slide {
  display: none;
  position: relative;
}
.hero-slide.active { display: block; }
.hero-slide img {
  width: 100%; display: block;
  aspect-ratio: 16/9; object-fit: cover;
}
@media (min-width: 900px) {
  /* Зберігаємо пропорції 974:300 ≈ 3.25:1, але не більше 520px у висоту */
  .hero-slide img { aspect-ratio: 974/300; height: auto; max-height: 520px; object-fit: cover; }
}
.hero-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.6));
  color: #fff; padding: 30px 20px 16px;
  font-family: 'Tenor Sans', serif; font-size: 22px;
}
.hero-dots {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 7px; z-index: 3;
}
.hero-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,.5); border: none; cursor: pointer;
  transition: background var(--trans);
}
.hero-dot.active { background: #fff; }
.hero-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.4); color: #fff;
  border: none; border-radius: 50%;
  width: 40px; height: 40px; font-size: 22px;
  cursor: pointer; z-index: 3;
  display: flex; align-items: center; justify-content: center;
}
.hero-nav.hero-prev { left: 10px; }
.hero-nav.hero-next { right: 10px; }

/* ---- PRODUCT MODAL ---- */
/* ===== PRODUCT MODAL — DESKTOP ===== */
.modal-product { z-index: 401; padding: 20px; }

.modal-product-box {
  /* Reset .modal-box constraints */
  max-width: 1160px !important; width: 100%;
  padding: 0 !important;
  border-radius: 24px !important;
  max-height: 92vh !important;
  max-height: 92dvh !important;
  height: min(760px, 88vh);
  height: min(760px, 88dvh);
  overflow: hidden !important;
  display: flex; flex-direction: column;
  box-shadow: 0 32px 100px rgba(0,0,0,.28);
  position: relative;
  background: transparent;
}

/* Close — floating above the box */
.modal-product-box > .modal-close {
  position: absolute; top: 16px; right: 16px; z-index: 10;
  width: 36px; height: 36px;
  background: rgba(255,255,255,.92);
  border-radius: 50%; border: none; font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  backdrop-filter: blur(6px);
  transition: background var(--trans), transform var(--trans);
  color: var(--dark);
}
.modal-product-box > .modal-close:hover { background: #fff; transform: scale(1.08); }

.pm-layout {
  display: grid;
  grid-template-columns: 54% 46%;
  flex: 1; min-height: 0; overflow: hidden;
}

/* ---- Gallery — left ---- */
.pm-gallery {
  background: #f7f6f2;
  display: flex; flex-direction: column;
  overflow: hidden; position: relative;
}
.pm-slider-wrap {
  position: relative; overflow: hidden;
  flex: 1; min-height: 0;
}
.pm-slider { position: relative; width: 100%; height: 100%; }
.pm-slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity .35s ease;
  background: #f7f6f2;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.pm-slide.active { opacity: 1; }
.pm-slide img {
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

/* Navigation arrows — subtle, centred vertically */
.pm-gallery .slider-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 3; width: 40px; height: 40px;
  background: rgba(255,255,255,.82); backdrop-filter: blur(4px);
  border: none; border-radius: 50%; cursor: pointer;
  font-size: 22px; color: var(--olive);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  transition: background var(--trans), transform var(--trans);
}
.pm-gallery .slider-btn:hover { background: #fff; transform: translateY(-50%) scale(1.1); }
.pm-gallery .slider-btn.prev { left: 14px; }
.pm-gallery .slider-btn.next { right: 14px; }

/* Dots — thumbnail-style, strip at bottom */
.pm-dots {
  display: flex; justify-content: center; align-items: center; gap: 8px;
  padding: 12px 16px; flex-shrink: 0;
  background: #f7f6f2;
  border-top: 1px solid rgba(0,0,0,.06);
}
.pm-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ccc; border: none; cursor: pointer;
  transition: background var(--trans), transform var(--trans);
}
.pm-dot.active { background: var(--olive); transform: scale(1.35); }
.pm-dot:hover { background: var(--olive2); }
.pm-dot-main  { background: #b8c5a8; }
.pm-dot-extra { background: #c9c5b8; }
.pm-dot-video { background: #7a5555; width: 10px; height: 10px; }
.pm-dot-video.active { background: #c04040; }
/* Video slide */
.pm-slide-video { padding: 0 !important; background: #111; }
.pm-slide-video iframe,
.pm-slide-video video { border-radius: 0; }

/* ---- Right column ---- */
.pm-right-col {
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--border);
}

/* ---- Breadcrumb у модалці ---- */
.pm-breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 2px;
  padding: 10px 32px 0;
  font-size: 12px; line-height: 1.4;
  color: var(--muted);
}
.pm-bc-link {
  color: var(--olive); text-decoration: none;
  transition: opacity .15s;
  white-space: nowrap;
}
.pm-bc-link:hover { opacity: .75; text-decoration: underline; }
.pm-bc-sep {
  color: var(--muted); padding: 0 3px; user-select: none;
  font-size: 13px;
}
.pm-bc-current {
  color: var(--muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 160px;
}

/* Scrollable content area */
.pm-info {
  padding: 20px 32px 24px;
  display: flex; flex-direction: column; gap: 16px;
  flex: 1;
}
.pm-header { padding-right: 40px; }

.pm-title {
  font-family: 'Tenor Sans', serif;
  font-size: 24px; line-height: 1.3;
  color: var(--dark); letter-spacing: .01em;
  margin: 0;
}

/* Price */
/* Ціна + «Поділитись» в одному рядку: кнопка стоїть НАВПРОТИ ціни — місце там було порожнє,
   і саме в цей момент людина зважує покупку («покажу комусь»). */
.pm-price-line { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.pm-price-line .pm-price-block { flex: 1; min-width: 0; }
.pm-share {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  background: none; border: 1px solid var(--border); border-radius: 20px;
  padding: 6px 12px; cursor: pointer; color: var(--muted);
  font-size: 12.5px; font-family: inherit; line-height: 1;
  transition: color .15s, border-color .15s, background .15s;
}
.pm-share:hover { color: var(--olive); border-color: var(--olive); background: #f6f9f0; }
.pm-share.done  { color: var(--olive); border-color: var(--olive); }
@media (max-width: 480px) {
  .pm-share-txt { display: none; }              /* на телефоні лишаємо саму іконку */
  .pm-share { padding: 7px 9px; border-radius: 50%; }
}
.pm-price-block { margin: -30px 0 0; }
.pm-price-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px;
}
.pm-price-old {
  font-size: 15px; color: var(--muted);
  text-decoration: line-through;
}
.pm-price-disc {
  font-size: 12px; background: #e8f5d0; color: var(--olive);
  padding: 2px 9px; border-radius: 20px; font-weight: 700;
  letter-spacing: .02em;
}
.pm-price-cur {
  font-family: 'Poppins', sans-serif;
  font-size: 26px; font-weight: 700; color: var(--olive);
  line-height: 1.2; white-space: nowrap;
}

/* Divider between price and colors */
.pm-divider {
  border: none; border-top: 1px solid var(--border);
  margin: 2px 0;
}

/* Color chips — pill style */
.colors-wrap { display: flex; flex-direction: column; gap: 8px; }
.colors-label {
  font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
}
.colors-list { display: flex; flex-wrap: wrap; gap: 7px; }
.colors-group { display: flex; flex-direction: column; gap: 5px; }
.colors-group-label {
  font-size: 11px; font-weight: 600; color: var(--olive);
  text-transform: uppercase; letter-spacing: .06em;
  padding-bottom: 1px; border-bottom: 1px solid var(--border);
}
.color-btn {
  padding: 5px 14px; border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface); cursor: pointer;
  font-size: 13px; color: var(--text);
  transition: var(--trans);
  font-family: 'DM Sans', sans-serif;
}
.color-btn:hover { border-color: var(--olive); color: var(--olive); }
.color-btn.active {
  background: var(--olive); color: #fff;
  border-color: var(--olive);
}
/* Sold-out variant — dimmed only, no strikethrough */
.color-btn.color-sold-out {
  opacity: .38;
  cursor: pointer;
}
.color-btn.color-sold-out.active {
  background: var(--muted);
  border-color: var(--muted);
}
.pm-soldout-notice {
  font-size: 13px; color: var(--red);
  padding: 6px 0 2px;
}

/* Qty row */
.pm-qty-row {
  display: flex; align-items: center; gap: 12px;
}
.pm-qty-row button {
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 10px; width: 36px; height: 36px;
  font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--olive); transition: var(--trans);
}
.pm-qty-row button:hover { background: var(--olive); color: #fff; border-color: var(--olive); }
.pm-qty-row span { min-width: 30px; text-align: center; font-weight: 600; font-size: 17px; }

/* Description & characteristics */
.pm-desc { font-size: 13.5px; line-height: 1.7; color: var(--text); }
.pm-desc p {
  margin: 0 0 5px;
  color: var(--muted);
}
.pm-desc p:first-child { color: var(--text); }
.pm-short-desc {
  font-size: 14px; line-height: 1.75; color: var(--text);
  padding-bottom: 12px; margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

/* Sticky action bar at bottom of right col */
.pm-actions {
  display: flex; gap: 10px;
  padding: 18px 32px 24px;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
  position: sticky; bottom: 0;
}
.pm-actions .btn-cart,
.pm-actions .btn-buy { border-radius: 12px; }
/* В кошик — компактна квадратна іконка (вторинна) */
.pm-actions .btn-cart {
  flex: 0 0 auto; width: 46px; padding: 0; min-height: 56px; align-self: stretch;
  font-size: 22px; line-height: 1;
  background: var(--bg); border: 1.5px solid var(--border); color: var(--olive);
}
.pm-actions .btn-cart:hover { background: #efe9dd; }
/* Купити — домінантна, на всю ширину: «Купити зараз» у рядок + ціна нижче */
.pm-actions .btn-buy {
  flex: 1; min-height: 64px; padding: 8px 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; line-height: 1.1;
}
.pm-actions .btn-buy .bb-label { font-weight: 700; font-size: 21px; white-space: nowrap; }
.pm-actions .btn-buy .bb-price { font-weight: 800; font-size: 14px; opacity: .95; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; }
.pm-actions .btn-buy .bb-old { text-decoration: line-through; font-weight: 600; font-size: .85em; opacity: .6; }
.pm-actions .btn-buy .bb-disc { font-weight: 800; font-size: .82em; background: var(--gold); color: var(--olive);
  padding: 1px 7px; border-radius: 8px; }
.pm-actions .btn-buy .bb-new { font-weight: 800; }

/* Бейджі довіри під ціною/описом у картці товару */
.pm-trust {
  display: flex; flex-direction: column; gap: 7px;
  margin-top: 4px; padding: 12px 14px;
  background: #f3f6ee; border: 1px solid #e2e8d5; border-radius: 12px;
}
.pm-trust-item {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; line-height: 1.35; color: var(--text);
}
.pm-trust-item b { font-weight: 600; }
.pm-trust-ic {
  flex: 0 0 18px; width: 18px; height: 18px; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  background: var(--olive2); color: #fff; border-radius: 50%;
  font-size: 11px; font-weight: 700;
}

/* Reviews & similar */
.pm-reviews-wrap, .pm-similar-wrap {
  border-top: 1px solid var(--border);
  padding: 22px 32px;
  flex-shrink: 0;
}
.pm-section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 19px; color: var(--olive);
  margin-bottom: 14px; font-weight: 600;
}
.review-card {
  background: var(--bg); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 10px;
}
.review-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px; flex-wrap: wrap;
}
.review-name { font-weight: 600; font-size: 14px; }
.review-stars { color: var(--gold); font-size: 14px; letter-spacing: 1px; }
.review-date { font-size: 11px; color: var(--muted); margin-left: auto; }
.review-text { font-size: 13px; color: var(--text); line-height: 1.5; }

/* Similar products — 3-column grid on desktop */
.pm-similar-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.similar-card {
  cursor: pointer; border-radius: 10px;
  overflow: hidden; background: var(--bg);
  border: 1px solid var(--border);
  transition: transform var(--trans), box-shadow var(--trans);
}
.similar-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.similar-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.similar-title {
  font-size: 12px; padding: 6px 8px 2px;
  color: var(--olive); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.similar-price {
  font-size: 12px; padding: 0 8px 8px;
  font-weight: 600; color: var(--olive);
}

/* ===== MOBILE: bottom sheet ===== */
@media (max-width: 640px) {
  .modal-product { align-items: flex-end; padding: 0; }
  .modal-product-box {
    border-radius: 20px 20px 0 0 !important;
    max-height: 96vh !important; max-height: 96dvh !important; height: auto !important;
    overflow-y: auto !important; overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
  }
  .pm-layout { grid-template-columns: 1fr; flex: none; }
  .pm-right-col { border-left: none; border-top: 1px solid var(--border); }
  .pm-gallery { flex-shrink: 0; }
  .pm-slider-wrap { aspect-ratio: 1; flex: none; min-height: unset; }
  .pm-slide { padding: 12px; }
  .pm-breadcrumb { padding: 8px 18px 0; }
  .pm-info { padding: 12px 18px 16px; gap: 13px; }
  .pm-header { padding-right: 36px; }
  .pm-title { font-size: 20px; }
  .pm-price-cur { font-size: 22px; white-space: nowrap; }
  /* Кнопки «В кошик / Купити» — закріплені до низу екрана, завжди видимі при гортанні фото/опису */
  .pm-actions {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 402;
    padding: 30px 22px calc(20px + env(safe-area-inset-bottom, 0px));
    /* плавне зникнення донизу (без різкого блюру й білої плити) */
    background: linear-gradient(to top, var(--surface) 60%, rgba(255,255,255,.72) 82%, rgba(255,255,255,0) 100%);
    border-top: none; box-shadow: none;
  }
  /* Місце під фіксовану панель, щоб контент (відгуки/схожі) не ховався за нею */
  .modal-product-box { padding-bottom: 96px !important; }
  .pm-reviews-wrap, .pm-similar-wrap { padding: 16px 18px; }
  .pm-similar-list { grid-template-columns: repeat(2, 1fr); }
}

/* ---- MODALS ---- */
.modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 400;
  align-items: center; justify-content: center;
  padding: 16px;
}
.modal.open { display: flex; }

.modal-box {
  background: var(--surface);
  border-radius: 16px;
  padding: 28px;
  width: 100%; max-width: 460px;
  max-height: 90vh; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
@media (max-width: 480px) {
  .modal-box { padding: 20px 16px; }
  .modal-box h2 { font-size: 22px; margin-bottom: 14px; }
}
.modal-box h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px; color: var(--olive);
  margin-bottom: 20px;
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: #f0ede6; border: none; border-radius: 50%;
  width: 30px; height: 30px; font-size: 18px;
  cursor: pointer; color: var(--text);
  display: flex; align-items: center; justify-content: center;
}

/* Cart items */
.cart-item {
  display: grid;
  grid-template-columns: 60px 1fr auto auto auto;
  grid-template-rows: auto auto;
  column-gap: 12px; row-gap: 4px;
  align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.cart-item img {
  width: 60px; height: 60px; object-fit: cover; border-radius: 8px;
  grid-row: 1 / 3; grid-column: 1;
}
.cart-item-info { grid-column: 2; grid-row: 1; min-width: 0; }
.cart-item-qty  { grid-column: 3; grid-row: 1; }
.cart-item-price { grid-column: 4; grid-row: 1; font-weight: 700; font-size: 15px; color: var(--olive); white-space: nowrap; }
.cart-item-remove { grid-column: 5; grid-row: 1; background: none; border: none; color: var(--red); cursor: pointer; font-size: 18px; padding: 4px; }
.cart-item-name { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-color { font-size: 12px; color: var(--muted); }

/* Mobile: stack qty + price under name */
@media (max-width: 480px) {
  .cart-item {
    grid-template-columns: 56px 1fr auto;
    grid-template-rows: auto auto;
  }
  .cart-item img { width: 56px; height: 56px; grid-row: 1 / 3; }
  .cart-item-info { grid-column: 2 / 4; grid-row: 1; }
  .cart-item-qty  { grid-column: 2; grid-row: 2; justify-self: start; }
  .cart-item-price { grid-column: 3; grid-row: 2; font-size: 14px; justify-self: end; }
  .cart-item-remove { grid-column: 3; grid-row: 1; justify-self: end; }
}

/* Кількість у кошику */
.cart-item-qty {
  display: flex; align-items: center; gap: 4px;
  background: var(--bg); border-radius: 8px;
  padding: 2px 4px;
}
.cart-item-qty button {
  background: none; border: 1.5px solid var(--border);
  border-radius: 6px; width: 26px; height: 26px;
  font-size: 16px; line-height: 1; cursor: pointer;
  color: var(--olive); transition: var(--trans);
  display: flex; align-items: center; justify-content: center;
}
.cart-item-qty button:hover { background: var(--olive); color: #fff; border-color: var(--olive); }
.cart-item-qty span { min-width: 20px; text-align: center; font-weight: 600; font-size: 14px; }

/* Вибір варіанту в кошику */
.cart-color-sel {
  font-family: 'DM Sans', sans-serif; font-size: 12px;
  border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 6px; background: #fff; color: var(--text);
  cursor: pointer; max-width: 140px;
}

/* ---- CONFIRM MODAL ---- */
.confirm-check {
  font-size: 48px; text-align: center; margin-bottom: 8px;
}
.confirm-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px; color: var(--olive); text-align: center;
  margin-bottom: 4px;
}
.confirm-sub {
  text-align: center; color: var(--muted); font-size: 14px;
  margin-bottom: 18px;
}
#confirm-items { margin-bottom: 18px; }
.confirm-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.confirm-price { font-weight: 700; color: var(--olive); white-space: nowrap; margin-left: 10px; }

.cart-total {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 700;
  text-align: right; padding: 12px 0;
  color: var(--olive);
}
.cart-empty { text-align: center; color: var(--muted); padding: 20px 0; }

.buy-product-info {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg); border-radius: 10px; padding: 12px;
  margin-bottom: 18px;
}
.buy-product-info img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; }
.buy-product-title { font-weight: 600; font-size: 16px; }
.buy-product-color { font-size: 13px; color: var(--muted); }
.buy-product-price { font-family: 'Cormorant Garamond', serif; font-size: 20px; font-weight: 700; color: var(--olive); }
.buy-color-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.buy-color-row .color-btn { min-width: 32px; height: 32px; padding: 0 8px; font-size: 12px; border-radius: 6px; cursor: pointer; }
.buy-color-swatch { display: inline-block; width: 16px; height: 16px; border-radius: 50%; vertical-align: middle; border: 1px solid rgba(0,0,0,0.15); }

/* Checkout summary */
#checkout-summary {
  background: var(--bg); border-radius: 10px;
  padding: 12px; margin-bottom: 16px;
  font-size: 13px; line-height: 1.8;
}

/* Form */
.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.form-group label { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.form-group input, .form-group textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-family: 'DM Sans', sans-serif; font-size: 14px;
  transition: border-color var(--trans);
}
.form-group input:focus, .form-group textarea:focus {
  outline: none; border-color: var(--olive);
}
.form-group textarea { resize: vertical; }
.form-note { font-size: 11px; color: var(--muted); margin-top: 8px; }

.btn-primary {
  width: 100%; padding: 13px;
  background: var(--olive); color: #fff;
  border: none; border-radius: 10px;
  font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 500;
  cursor: pointer; transition: var(--trans);
}
.btn-primary:hover { background: var(--olive2); }

/* ---- LIGHTBOX ---- */
.lightbox {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 500;
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lb-img {
  max-width: 90vw; max-height: 85vh;
  object-fit: contain; border-radius: 8px;
}
.lb-close {
  position: fixed; top: 16px; right: 20px;
  background: none; border: none; color: #fff;
  font-size: 32px; cursor: pointer; z-index: 2;
}
.lb-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.15); border: none; color: #fff;
  font-size: 40px; cursor: pointer; padding: 12px 18px; border-radius: 8px;
  transition: background var(--trans);
}
.lb-nav:hover { background: rgba(255,255,255,.3); }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }

/* ---- TOAST ---- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--dark); color: #fff;
  padding: 12px 24px; border-radius: 24px;
  font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: opacity .3s;
  z-index: 600; white-space: nowrap;
}
.toast.show { opacity: 1; }

/* No results */
.no-results {
  text-align: center; padding: 60px 20px;
  font-size: 18px; color: var(--muted);
}

footer {
  background: var(--dark); color: rgba(255,255,255,.6);
  text-align: center; padding: 16px;
  font-size: 13px; margin-top: 40px;
}

/* ── Push prompt banner ── */
#push-prompt {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 700;
  background: #fff; color: var(--dark);
  border-radius: 16px; box-shadow: 0 4px 24px rgba(0,0,0,.18);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
  width: min(360px, calc(100vw - 32px));
  font-size: 14px; animation: pushSlideUp .35s ease;
}
@keyframes pushSlideUp {
  from { opacity:0; transform: translateX(-50%) translateY(20px); }
  to   { opacity:1; transform: translateX(-50%) translateY(0); }
}
#push-prompt-row1 {
  display: flex; align-items: flex-start; gap: 8px;
}
#push-prompt-text {
  flex: 1; font-weight: 600; line-height: 1.4;
  color: var(--dark);
  font-size: 14px;
}
#push-prompt-yes {
  background: var(--olive, #6b7a3a); color: #fff; border: none; cursor: pointer;
  padding: 9px 0; border-radius: 10px; font-size: 13px; font-weight: 600;
  white-space: nowrap; width: 100%;
}
#push-prompt-yes:hover { filter: brightness(1.1); }
#push-prompt-no {
  background: #fee2e2; border: none; cursor: pointer; color: #ef4444;
  font-size: 15px; font-weight: 700;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; line-height: 1;
  transition: background .15s, color .15s;
}
#push-prompt-no:hover { background: #fecaca; color: #dc2626; }

/* iOS home screen prompt — inherits push-prompt layout */
#ios-prompt {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 700;
  background: #fff; color: var(--dark);
  border-radius: 16px; box-shadow: 0 4px 24px rgba(0,0,0,.18);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
  width: min(360px, calc(100vw - 32px));
  font-size: 14px; animation: pushSlideUp .35s ease;
}
/* стрілка вниз до кнопки Share на iOS */
#ios-prompt::after {
  content: '';
  position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%);
  border: 10px solid transparent; border-top-color: #fff;
  border-bottom: none;
}

/* ── «Додано в кошик»: що робити далі ──────────────────────────────────────
   Раніше після додавання показувався лише тост, і людина лишалась на місці —
   шляху до оформлення не було видно. Це головна причина, чому кошиком майже
   не користувались. На телефоні — панель знизу, на десктопі — картка по центру. */
.cart-added {
  display: none; position: fixed; inset: 0; z-index: 1200;
  background: rgba(20, 26, 14, .45);
  align-items: flex-end; justify-content: center;
}
.cart-added.show { display: flex; }
.cart-added-box {
  width: 100%; max-width: 460px; background: #fff;
  border-radius: 18px 18px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 40px rgba(0,0,0,.18);
  animation: caUp .22s ease-out;
}
@keyframes caUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.ca-head { display: flex; align-items: center; gap: 12px; }
.ca-ic {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: #e8f5d0; color: var(--olive);
  display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700;
}
.ca-title { font-weight: 700; font-size: 15px; }
.ca-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.ca-total { font-size: 13px; color: var(--muted); margin: 12px 0 14px; }
.ca-total b { color: var(--text); font-size: 15px; }
.ca-acts { display: flex; gap: 10px; }
.ca-btn-ghost, .ca-btn-main {
  flex: 1; padding: 13px 12px; border-radius: 12px; font-size: 14px;
  font-family: inherit; cursor: pointer; font-weight: 600; line-height: 1.2;
}
.ca-btn-ghost { background: #fff; border: 1.5px solid var(--border); color: var(--text); }
.ca-btn-main  { background: var(--olive); border: 1.5px solid var(--olive); color: #fff; }
.ca-btn-ghost:hover { border-color: var(--olive); color: var(--olive); }
@media (min-width: 640px) {
  .cart-added { align-items: center; }
  .cart-added-box { border-radius: 16px; padding: 22px; animation: none; }
}

/* Смужка кошика — ВСЕРЕДИНІ ряду з кнопками покупки (лише коли в кошику щось є).
   Займає весь рядок над кнопками, тож іде разом з ними: і на десктопі (sticky),
   і на мобільному (fixed до низу екрана). Шукати її не треба. */
.pm-actions { flex-wrap: wrap; }
.pm-cart-bar {
  flex: 1 0 100%;
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 10px 13px; margin-bottom: 2px;
  border: 1.5px solid var(--olive); border-radius: 12px;
  background: #f6f9f0; font-size: 13.5px; color: var(--text);
}
.pm-cart-bar:hover { background: #eef4e3; }
.pmcb-ic  { font-size: 15px; }
.pmcb-txt { flex: 1; min-width: 0; }
.pmcb-go  { font-weight: 700; color: var(--olive); white-space: nowrap; }

/* Хрестик закриття на мобільному — ЛИПКИЙ УСЕРЕДИНІ картки.
   Був `absolute` (прокручувався разом з описом — щоб закрити товар, доводилось
   вертатись угору) і потім `fixed` (висів над модалкою, поза нею). `sticky` у
   скролері картки лишає його в її межах і завжди на видноті. */
@media (max-width: 767px) {
  .modal-product-box > .modal-close {
    /* `float` тут НЕ працює: .modal-product-box — flex-колонка, тому хрестик злітав
       ліворуч. Праворуч його тримає align-self. Відступи зверху і справа однакові (12px). */
    position: -webkit-sticky; position: sticky;
    top: 12px; right: auto; float: none; align-self: flex-end;
    flex: 0 0 auto;                     /* у flex-колонці висота стискалась → овал */
    margin: 12px 12px -48px 0;          /* відʼємний низ — щоб не зсувати вміст */
    z-index: 403;
    background: rgba(255,255,255,.96);
    box-shadow: 0 2px 10px rgba(0,0,0,.22);
  }
}
