:root {
  --green: #2f6b3a;
  --green-dark: #224f2a;
  --green-light: #e8f2e6;
  --bg: #fbfaf6;
  --text: #1f2a1f;
  --muted: #5d6b5d;
  --card: #ffffff;
  --border: #dfe6dc;
  --accent: #d98b2b;
  --link: #2f6b3a;
  --input-bg: #ffffff;
  --danger: #b3261e;
  --danger-bg: #fbe9e7;
  --warn: #b25e00;
  --warn-bg: #fff3e0;
  --disabled: #b9c2b9;
  --shadow: 0 8px 24px rgba(0,0,0,.12);
  --hero-from: #2f6b3a;
  --hero-to: #4f8f4f;
  color-scheme: light;
}
/* Темна тема */
:root[data-theme="dark"] {
  --green: #4f9a5b;
  --green-dark: #43854e;
  --green-light: #1e3122;
  --bg: #111511;
  --text: #e2e9e0;
  --muted: #9ba99a;
  --card: #192019;
  --border: #2d392e;
  --accent: #c97d22;
  --link: #7cc487;
  --input-bg: #0f140f;
  --danger: #ff8a80;
  --danger-bg: #3a1f1d;
  --warn: #ffb74d;
  --warn-bg: #3a2c16;
  --disabled: #3a443b;
  --shadow: 0 8px 24px rgba(0,0,0,.5);
  --hero-from: #1d4524;
  --hero-to: #2f6b3a;
  color-scheme: dark;
}
/* Атрибут hidden завжди ховає елемент, навіть якщо для класу задано display */
[hidden] { display: none !important; }
body, header, .card, .panel, .drawer, input, textarea, select { transition: background-color .2s, border-color .2s, color .2s; }
dialog { background: var(--card); color: var(--text); }
.theme-btn {
  background: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px; cursor: pointer;
  font-size: 1.05rem; line-height: 1; color: var(--text);
}
.theme-btn:hover { background: var(--green-light); }
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--link); }
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* Header */
header {
  position: sticky; top: 0; z-index: 10;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 64px; gap: 16px; }
.nav > .logo { justify-self: start; }
.nav > .nav-links { grid-column: 2; }
.nav > .nav-actions { grid-column: 3; justify-self: end; }
.logo { font-weight: 700; font-size: 1.3rem; color: var(--green); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; letter-spacing: .2px; }
.logo-icon { width: 34px; height: 34px; flex: 0 0 34px; }
.nav-links { display: flex; gap: 20px; }
.nav-links a { text-decoration: none; color: var(--text); }
.nav-links a:hover, .nav-links a.active { color: var(--green); }
.nav-links a.active { font-weight: 600; }
.cart-btn {
  background: var(--green); color: #fff; border: 0; border-radius: 8px;
  padding: 8px 14px; font-size: 1rem; cursor: pointer;
}
.cart-btn:hover { background: var(--green-dark); }
.badge {
  display: inline-block; min-width: 22px; padding: 0 6px; margin-left: 6px;
  border-radius: 11px; background: #fff; color: var(--green); font-weight: 700; font-size: .85rem;
}
@media (max-width: 640px) { .nav-links { display: none; } }

/* Hero.
   Ілюстрація — окремий шар фіксованих пропорцій (1600×640), висота дорівнює висоті банера,
   а правий край прив'язаний до правого краю контенту. Тому на будь-якій ширині екрана
   плоди стоять у тих самих місцях відносно тексту й карток — змінюється лише порожнє тло з боків. */
.hero {
  --hero-ink: 29, 69, 36;
  position: relative; overflow: hidden; isolation: isolate;
  background: rgb(var(--hero-ink)); color: #fff;
  min-height: 460px; display: flex; align-items: center; padding: 48px 0;
}
:root[data-theme="dark"] .hero, :root[data-theme="dark"] .page-hero { --hero-ink: 19, 46, 24; }
.hero-art {
  position: absolute; z-index: -1; top: 0; height: 100%; aspect-ratio: 1600 / 640;
  right: calc(max(0px, (100% - 1100px) / 2) - 120px);
  background: url("/img/hero.svg") center / 100% 100% no-repeat;
  pointer-events: none;
  /* ліва частина плавно зникає під текстом */
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 30%, #000 50%, #000 93%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, transparent 30%, #000 50%, #000 93%, transparent 100%);
}
.hero-inner { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: center; }
.hero-text { max-width: 540px; }
.hero h1 { font-size: clamp(1.9rem, 4.2vw, 2.8rem); line-height: 1.15; margin: 0 0 16px; text-wrap: balance; }
.hero p { font-size: 1.1rem; line-height: 1.6; max-width: 520px; margin: 0 0 28px; opacity: .95; }
.hero-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.hero-features li {
  display: flex; gap: 14px; align-items: center; min-height: 76px; padding: 14px 16px; border-radius: 14px;
  background: rgba(16, 42, 22, .55); border: 1px solid rgba(255,255,255,.18);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.hero-features b { display: block; font-size: .98rem; line-height: 1.3; }
.hero-features small { display: block; opacity: .85; font-size: .85rem; line-height: 1.35; margin-top: 2px; }
.hf-icon { font-size: 1.35rem; width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.14); }
@media (max-width: 820px) {
  .hero { min-height: 0; padding: 40px 0; }
  .hero-art { right: -260px; opacity: .3; -webkit-mask-image: none; mask-image: none; }
  .hero-inner { grid-template-columns: 1fr; gap: 24px; }
}
.btn {
  display: inline-block; background: var(--accent); color: #fff; text-decoration: none;
  padding: 12px 22px; border-radius: 8px; font-weight: 600; border: 0; cursor: pointer; font-size: 1rem;
}
.btn:hover { filter: brightness(.95); }

/* Features */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; padding: 40px 0 8px; }
.feature { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.feature b { display: block; margin-bottom: 4px; }
.feature span { color: var(--muted); font-size: .95rem; }

/* Catalog */
section { padding: 40px 0; }
h2 { font-size: 1.7rem; margin: 0 0 20px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filter {
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  padding: 8px 14px; border-radius: 20px; cursor: pointer; font-size: .95rem;
}
.filter.active { background: var(--green); color: #fff; border-color: var(--green); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; display: flex; flex-direction: column;
}
.card-img {
  height: 150px; display: flex; align-items: center; justify-content: center;
  font-size: 4.5rem; background: var(--green-light);
}
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { margin: 0; font-size: 1.1rem; }
.card p { margin: 0; color: var(--muted); font-size: .92rem; }
.card .card-summary { flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card h3 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-rating { min-height: 1.4em; }
.tag { font-size: .8rem; color: var(--green); font-weight: 600; }
.card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.price { font-weight: 700; font-size: 1.15rem; }
.add-btn {
  background: var(--green); color: #fff; border: 0; border-radius: 8px;
  padding: 8px 12px; cursor: pointer; font-size: .95rem;
}
.add-btn:hover { background: var(--green-dark); }

/* About / contacts */
.about { background: var(--green-light); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px; }
.contacts li { margin-bottom: 6px; }
footer { padding: 24px 0; text-align: center; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--border); }
.site-footer { text-align: left; background: var(--card); padding: 36px 0 0; margin-top: 24px; font-size: .95rem; color: var(--text); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1.3fr; gap: 28px; }
.footer-grid b { display: block; margin-bottom: 8px; }
.footer-grid .hint { margin-top: 8px; max-width: 320px; }
.footer-links { display: flex; flex-direction: column; gap: 6px; }
.footer-links a, .site-footer .contacts a { color: var(--text); text-decoration: none; }
.footer-links a:hover, .site-footer .contacts a:hover { color: var(--green); }
.site-footer .contacts { list-style: none; padding: 0; margin: 0; }
.footer-copy { text-align: center; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--border); margin-top: 28px; padding: 16px; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; gap: 20px; } }

/* Cart drawer */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: none; z-index: 20; }
.overlay.open { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(420px, 100%);
  background: var(--card); z-index: 30; transform: translateX(100%);
  transition: transform .25s ease; display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { margin: 0; }
.close { background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--muted); }
.drawer-body { padding: 16px; overflow-y: auto; flex: 1; }
.cart-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cart-item .emoji { font-size: 1.8rem; }
.cart-item .info { flex: 1; }
.cart-item .info small { color: var(--muted); }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 28px; height: 28px; border: 1px solid var(--border); background: var(--bg); border-radius: 6px; cursor: pointer; }
.total { font-size: 1.15rem; font-weight: 700; margin: 16px 0; }
.empty { color: var(--muted); text-align: center; padding: 32px 0; }
form { display: flex; flex-direction: column; gap: 10px; }
input, textarea {
  padding: 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; width: 100%;
  background: var(--input-bg); color: var(--text);
}
.success { background: var(--green-light); border-radius: 8px; padding: 16px; text-align: center; }

/* Header actions */
.nav-actions { display: flex; align-items: center; gap: 10px; }
.account-link {
  text-decoration: none; color: var(--green); border: 1px solid var(--border);
  padding: 8px 12px; border-radius: 8px; white-space: nowrap;
}
.account-link:hover { background: var(--green-light); }
.hint { color: var(--muted); font-size: .9rem; margin: 0 0 8px; }
.error { color: var(--danger); font-size: .92rem; min-height: 1.2em; margin: 0; }

/* Pages: account & admin */
.page { padding-top: 32px; padding-bottom: 64px; }
.panel {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; margin-bottom: 20px;
}
.panel h2 { font-size: 1.3rem; margin: 0 0 14px; }
.auth-wrap { max-width: 420px; margin: 0 auto; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs .filter { flex: 1; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1 1 160px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
label.check input { width: auto; }
select { padding: 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; width: 100%; background: var(--input-bg); color: var(--text); }
.btn-sm {
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: .9rem; white-space: nowrap;
}
.btn-sm:hover { background: var(--green-light); }
.btn-sm.danger { color: var(--danger); }
.btn-sm.danger:hover { background: var(--danger-bg); }
.btn-green { background: var(--green); color: #fff; border: 0; border-radius: 8px; padding: 10px 16px; cursor: pointer; font-size: 1rem; }
.btn-green:hover { background: var(--green-dark); }
.profile-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Orders history */
.order { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.order-head small { color: var(--muted); }
.order-line { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; font-size: .95rem; }
.order-line span:last-child { white-space: nowrap; }
.status { display: inline-flex; align-items: center; align-self: flex-start; flex: 0 0 auto; white-space: nowrap; line-height: 1.2; font-size: .8rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: var(--green-light); color: var(--green); }
.order-foot { display: flex; justify-content: space-between; border-top: 1px dashed var(--border); margin-top: 8px; padding-top: 8px; font-weight: 700; }

/* Admin */
.admin-grid { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
@media (max-width: 820px) { .admin-grid { grid-template-columns: 1fr; } }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-item {
  display: flex; align-items: center; gap: 6px; padding: 8px; border-radius: 8px;
  cursor: pointer; border: 1px solid transparent;
}
.cat-item:hover { background: var(--bg); }
.cat-item.active { background: var(--green-light); border-color: var(--border); }
.cat-item .cat-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cat-item small { color: var(--muted); }
.lot { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.lot:last-child { border-bottom: 0; }
.lot .emoji { font-size: 2rem; width: 44px; text-align: center; }
.lot .info { flex: 1; min-width: 0; }
.lot .info small { color: var(--muted); display: block; overflow-wrap: anywhere; }
.lot.inactive { opacity: .55; }
.lot-actions { display: flex; gap: 6px; flex-wrap: wrap; }
dialog { border: 0; border-radius: 12px; padding: 20px; width: min(480px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(10, 20, 12, .35); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
dialog h3 { margin: 0 0 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* Photos */
.no-photo { display: flex; align-items: center; justify-content: center; background: var(--green-light); font-size: 2rem; }
.card-img { position: relative; overflow: hidden; height: auto; aspect-ratio: 4 / 3; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-img .no-photo { width: 100%; height: 100%; font-size: 4.5rem; }
.gal-btn {
  position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer; display: grid; place-items: center;
  background: rgba(20, 30, 20, .55); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .2s, background-color .15s;
}
.gal-btn svg { width: 16px; height: 16px; }
.gal-btn:hover { background: rgba(20, 30, 20, .8); }
.gal-btn.prev { left: 10px; } .gal-btn.next { right: 10px; }
.card-img:hover .gal-btn, .pg-main:hover .gal-btn, .gal-btn:focus-visible { opacity: 1; }
@media (hover: none) { .gal-btn { opacity: 1; } }
.gal-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.gal-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.55); box-shadow: 0 0 2px rgba(0,0,0,.4); }
.gal-dots i.on { background: #fff; }
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: 0 0 44px; font-size: 1.4rem; }
.lot .thumb { width: 64px; height: 64px; flex-basis: 64px; }

/* Photo manager in admin */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .cover { position: absolute; top: 4px; left: 4px; background: var(--green); color: #fff; font-size: .7rem; padding: 1px 6px; border-radius: 6px; }
.photo-tools { position: absolute; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-between; background: rgba(0,0,0,.45); }
.photo-tools button { background: none; border: 0; color: #fff; cursor: pointer; padding: 3px 6px; font-size: .9rem; }
.photo-tools button:disabled { opacity: .3; cursor: default; }
.photo-add {
  aspect-ratio: 1; border: 2px dashed var(--border); border-radius: 8px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; cursor: pointer; color: var(--muted); font-size: .8rem; text-align: center;
}
.photo-add:hover { border-color: var(--green); color: var(--green); }
.photo-add b { font-size: 1.6rem; line-height: 1; }

/* Auth pages */
.auth-switch { text-align: center; margin: 14px 0 0; color: var(--muted); }
@media (max-width: 480px) { .hide-sm { display: none; } }

/* Autocomplete */
.ac { position: relative; }
.ac-list {
  position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: 4px 0; list-style: none;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow);
  max-height: 280px; overflow-y: auto;
}
.ac-list li { padding: 8px 12px; cursor: pointer; font-size: .93rem; line-height: 1.35; }
.ac-list li small { display: block; color: var(--muted); font-size: .8rem; }
.ac-list li.on, .ac-list li[data-i]:hover { background: var(--green-light); }
.ac-list li.ac-msg { color: var(--muted); cursor: default; }
.ac-list li.ac-msg.error { color: var(--danger); }

/* Delivery */
.carrier { display: flex; gap: 8px; }
.carrier-opt { flex: 1; flex-direction: row; cursor: pointer; position: relative; }
.carrier-opt input { position: absolute; opacity: 0; width: 0; }
.carrier-opt span { flex: 1; text-align: center; padding: 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); }
.carrier-opt input:checked + span { border-color: var(--green); background: var(--green-light); font-weight: 600; }
.carrier-opt input:focus-visible + span { outline: 2px solid var(--green); }
.delivery-box { display: flex; flex-direction: column; gap: 10px; }
.dlv-manual { display: flex; flex-direction: column; gap: 10px; }
.field-title { font-weight: 600; font-size: .95rem; margin: 6px 0 -2px; }

/* Stock */
.stock { font-size: .82rem; font-weight: 600; }
.stock.in { color: var(--green); }
.stock.out { color: var(--danger); }
.card.out .card-img { filter: grayscale(.7); opacity: .8; }
.add-btn:disabled { background: var(--disabled); cursor: not-allowed; }
.card a.card-link { color: inherit; text-decoration: none; }
.card a.card-link:hover h3 { color: var(--green); }
.cart-item.out .info { color: var(--danger); }

/* Product page */
.product { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 760px) { .product { grid-template-columns: 1fr; gap: 20px; } }
.pg-main { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--card); border: 1px solid var(--border); }
.pg-main img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pg-main .no-photo { width: 100%; height: 100%; font-size: 6rem; }
.pg-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pg-thumbs button { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; width: 72px; height: 72px; cursor: pointer; background: none; }
.pg-thumbs button.on { border-color: var(--green); }
.pg-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product h1 { margin: 4px 0 8px; font-size: clamp(1.5rem, 4vw, 2rem); line-height: 1.2; }
.product .price { font-size: 1.6rem; display: block; margin: 12px 0; }
.product .desc { white-space: pre-line; margin: 16px 0 0; }
.buy-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.qty-input { width: 90px; text-align: center; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 16px; overflow-wrap: anywhere; }
.crumbs a { text-decoration: none; }

/* Admin tabs & tables */
.admin-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-tabs a { text-decoration: none; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.toolbar input, .toolbar select { flex: 1 1 200px; width: auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--green-light); border-radius: 16px; padding: 4px 6px 4px 12px; font-size: .9rem; }
.chip button { border: 0; background: none; cursor: pointer; font-size: 1rem; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.data th, table.data td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data th { color: var(--muted); font-weight: 600; font-size: .85rem; white-space: nowrap; }
table.data td.num { text-align: right; white-space: nowrap; }
table.data td small { color: var(--muted); display: block; }
.order-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px 16px; font-size: .92rem; margin-bottom: 10px; }
.order-meta small { color: var(--muted); display: block; }
.order-meta div { overflow-wrap: anywhere; }
.order-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; border-top: 1px dashed var(--border); margin-top: 10px; padding-top: 10px; }
.order-controls label { flex: 1 1 180px; }
.item-status { width: auto; padding: 4px 8px; font-size: .85rem; }
.order[data-status="cancelled"] { opacity: .65; }
.status[data-s="new"] { background: var(--warn-bg); color: var(--warn); }
.status[data-s="cancelled"] { background: var(--border); color: var(--muted); }
.status[data-s="done"] { background: var(--green-light); color: var(--green); }
.item-st { font-size: .78rem; color: var(--muted); }
.item-st[data-s="unavailable"] { color: var(--danger); }
.saved { color: var(--green); font-size: .85rem; }

/* Код лота */
.sku { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; color: var(--muted); }
.catalog-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.catalog-tools input { flex: 1 1 260px; width: auto; }

/* Оцінки й відгуки */
.stars { color: #e0a526; letter-spacing: 1px; font-size: 1.05rem; white-space: nowrap; }
.stars.sm { font-size: .85rem; }
.rating-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.rating-input input { position: absolute; opacity: 0; width: 0; }
.rating-input label { font-size: 1.9rem; color: var(--disabled); cursor: pointer; line-height: 1; flex-direction: row; }
.rating-input input:checked ~ label,
.rating-input label:hover, .rating-input label:hover ~ label { color: #e0a526; }
.rating-input input:focus-visible + label { outline: 2px solid var(--green); border-radius: 4px; }
.review { border-top: 1px solid var(--border); padding: 14px 0; }
.review-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.review p { margin: 6px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.verified { font-size: .78rem; color: var(--green); font-weight: 600; }
.rating-summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.rating-big { font-size: 2.4rem; font-weight: 700; line-height: 1; }

/* Рекомендації */
.recs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.mini-card {
  display: flex; flex-direction: column; text-decoration: none; color: var(--text);
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.mini-card:hover { border-color: var(--green); }
.mini-img { position: relative; aspect-ratio: 4 / 3; background: var(--green-light); overflow: hidden; }
.mini-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini-img .no-photo { width: 100%; height: 100%; font-size: 2.6rem; }
.mini-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; font-size: .92rem; }
.mini-body .price { font-size: 1rem; }
.section-title { font-size: 1.35rem; margin: 40px 0 14px; }

/* Код з пошти */
.code-input { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-family: ui-monospace, Consolas, monospace; }
.code-note { background: var(--green-light); border-radius: 8px; padding: 10px 12px; font-size: .92rem; margin: 0; }
.link-btn { background: none; border: 0; color: var(--link); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
.link-btn:disabled { color: var(--muted); cursor: default; text-decoration: none; }

/* Мінімальна сума */
.min-note { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 10px 12px; font-size: .92rem; margin: 0 0 12px; }
.settings-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.settings-row label { flex: 1 1 160px; }

/* Поля пошуку: невелика сіра лупа зліва */
input[type="search"] {
  padding-left: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a958a' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 11px center;
  background-size: 15px 15px;
}

/* ---------- Кошик у вікні по центру ---------- */
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
dialog.cart-modal {
  padding: 0; width: min(920px, calc(100% - 24px)); max-height: calc(100vh - 48px);
  border-radius: 14px; border: 1px solid var(--border); overflow: hidden;
}
dialog.cart-modal[open] { display: flex; flex-direction: column; }
.cm-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.cm-head h2 { margin: 0; font-size: 1.5rem; }
.cm-body { overflow-y: auto; }
.cm-list { padding: 0 20px; }
.cm-item {
  display: grid; grid-template-columns: 96px 1fr auto auto; grid-template-areas: "img info info del" "img qty . sum";
  gap: 8px 16px; padding: 16px 0; border-bottom: 1px solid var(--border); align-items: center;
}
.cm-item:last-child { border-bottom: 0; }
.cm-img { grid-area: img; width: 96px; height: 96px; border-radius: 10px; overflow: hidden; background: var(--green-light); display: block; }
.cm-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cm-img .no-photo { width: 100%; height: 100%; font-size: 2.4rem; }
.cm-info { grid-area: info; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cm-name { color: var(--text); text-decoration: none; font-weight: 500; overflow-wrap: anywhere; }
.cm-name:hover { color: var(--link); }
.cm-del { grid-area: del; align-self: start; background: none; border: 0; cursor: pointer; font-size: 1.1rem; opacity: .6; padding: 4px; }
.cm-del:hover { opacity: 1; }
.cm-qty { grid-area: qty; display: flex; align-items: center; gap: 6px; }
.cm-qty button { width: 34px; height: 34px; border: 1px solid var(--border); background: var(--card); color: var(--link); border-radius: 8px; font-size: 1.2rem; cursor: pointer; }
.cm-qty button:disabled { color: var(--disabled); cursor: not-allowed; }
.cm-qty input { width: 56px; text-align: center; padding: 6px; -moz-appearance: textfield; }
.cm-qty input::-webkit-outer-spin-button, .cm-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cm-sum { grid-area: sum; text-align: right; font-weight: 700; font-size: 1.15rem; white-space: nowrap; }
.cm-sum small { display: block; font-weight: 400; font-size: .8rem; color: var(--muted); }
.cm-item.out .cm-img { filter: grayscale(.8); opacity: .7; }
.cm-foot {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  padding: 16px 20px 20px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--card);
}
.cm-total { margin-left: auto; max-width: 100%; }
.cm-total-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  border: 1px solid var(--green); background: var(--green-light); border-radius: 10px; padding: 12px 16px;
}
.cm-total-sum { font-size: 1.6rem; font-weight: 700; white-space: nowrap; }
.cm-empty { text-align: center; padding: 40px 20px 48px; }
.cm-empty h3 { margin: 8px 0 4px; font-size: 1.3rem; }
@media (max-width: 560px) {
  .cm-item { grid-template-columns: 72px 1fr auto; grid-template-areas: "img info del" "img qty qty" "img sum sum"; }
  .cm-img { width: 72px; height: 72px; }
  .cm-sum { text-align: left; }
  .cm-total, .cm-total-row { width: 100%; }
  .cm-total-row .btn { flex: 1; text-align: center; }
}

/* ---------- Оформлення замовлення ---------- */
.checkout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
@media (max-width: 860px) { .checkout { grid-template-columns: 1fr; } }
.checkout h1 { margin: 0 0 16px; font-size: 1.8rem; }
.step { margin-bottom: 16px; }
.step h2 { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; }
.step h2 .num { width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; }
.co-items { display: flex; flex-direction: column; gap: 10px; }
.co-item { display: flex; gap: 12px; align-items: center; }
.co-item .thumb { width: 56px; height: 56px; flex-basis: 56px; }
.co-item .co-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: .95rem; }
.co-item .co-name small { display: block; color: var(--muted); }
.co-item b { white-space: nowrap; }
.summary { position: sticky; top: 84px; }
.summary-row { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; }
.summary-total { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; font-size: 1.1rem; }
.summary-total b { font-size: 1.5rem; }
.summary .btn { width: 100%; margin-top: 14px; text-align: center; }
.pay-opts { display: flex; flex-direction: column; gap: 10px; }
.pay-opt { flex-direction: row; align-items: flex-start; gap: 12px; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; cursor: pointer; color: var(--text); }
.pay-opt input { width: auto; margin-top: 3px; accent-color: var(--green); }
.pay-opt b { display: block; }
.pay-opt small { color: var(--muted); }
.pay-opt:has(input:checked) { border-color: var(--green); background: var(--green-light); }
.pay-badge { font-size: .8rem; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: var(--border); color: var(--muted); white-space: nowrap; }
.pay-badge[data-s="paid"] { background: var(--green-light); color: var(--green); }
.pay-badge[data-s="awaiting"], .pay-badge[data-s="processing"] { background: var(--warn-bg); color: var(--warn); }
.pay-badge[data-s="failed"] { background: var(--danger-bg); color: var(--danger); }
.result-box { max-width: 560px; margin: 0 auto; text-align: center; }
.result-box .big { font-size: 3.5rem; }

/* Реквізити для оплати */
.req-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.req-row:last-of-type { border-bottom: 0; }
.req-val { font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.iban-fields { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 4px 26px; }

/* ---------- Кнопки ---------- */
.btn-outline {
  display: inline-block; border: 1px solid var(--green); color: var(--green); background: transparent; text-decoration: none;
  padding: 10px 20px; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: .98rem;
}
.btn-outline:hover { background: var(--green-light); }
.btn-outline:disabled { opacity: .5; cursor: default; }
.card .add-btn { padding: 8px 14px; line-height: 0; }
.card .add-btn svg { width: 20px; height: 20px; }

/* ---------- Каталог (бокова панель + сітка) ---------- */
.catalog-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.catalog-side {
  position: sticky; top: 80px; background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - 100px); overflow-y: auto;
}
.side-block { padding: 10px 0; border-bottom: 1px solid var(--border); }
.side-block:first-child { padding-top: 0; }
.side-block:last-of-type { border-bottom: 0; }
.side-title { font-weight: 600; margin: 0 0 8px; font-size: .95rem; }
.side-cats { list-style: none; margin: 0; padding: 0; }
.side-cat {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left;
  background: none; border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; font: inherit; color: var(--text);
}
.side-cat:hover { background: var(--green-light); }
.side-cat.active { background: var(--green-light); color: var(--green); font-weight: 600; }
.side-cat small { color: var(--muted); font-weight: 400; }
.price-range { display: flex; align-items: center; gap: 6px; }
.price-range input { min-width: 0; }
.catalog-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.catalog-head h1 { margin: 0; font-size: clamp(1.4rem, 3vw, 1.9rem); }
.catalog-controls { display: flex; gap: 8px; align-items: center; }
.catalog-controls select { width: auto; }
.catalog-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.side-toggle { display: none; }
@media (max-width: 860px) {
  .catalog-layout { grid-template-columns: 1fr; }
  .catalog-side { position: static; max-height: none; display: none; }
  .catalog-side.open { display: flex; }
  .side-toggle { display: inline-block; }
}

/* ---------- Головна: стрічка лотів ---------- */
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.section-head h2 { margin: 0; }
.strip-nav { display: flex; gap: 8px; }
.round-btn {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--card); color: var(--text); cursor: pointer; padding: 0;
  display: inline-grid; place-items: center; transition: border-color .15s, color .15s, background-color .15s;
}
.round-btn svg { width: 18px; height: 18px; }
.round-btn:hover { border-color: var(--green); color: var(--green); }
.round-btn:active { transform: scale(.95); }
/* Стрічка: доріжка рухається плавно (transform), картки однакової ширини */
.strip { overflow: hidden; padding: 4px 0 8px; touch-action: pan-y; cursor: grab; user-select: none; transition: opacity .35s; }
.strip.dragging { cursor: grabbing; }
.strip.fade { opacity: 0; }
.strip-track { display: flex; gap: 16px; will-change: transform; }
.strip-track > .card { flex: 0 0 var(--cw, 250px); min-width: 0; }
.strip-track > .empty, .strip-track > .hint { flex: 1; }
.strip img { -webkit-user-drag: none; pointer-events: none; }
.strip-more { text-align: center; margin: 20px 0 0; }

/* ---------- Головна: відгуки ---------- */
.reviews-section { background: var(--green-light); }
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.review-grid > .empty { grid-column: 1 / -1; }
.review-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.rc-product { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
.rc-product:hover { color: var(--green); }
.rc-img { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 8px; overflow: hidden; background: var(--green-light); }
.rc-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rc-img .no-photo { width: 100%; height: 100%; font-size: 1.4rem; }
.rc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rc-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.rc-author { color: var(--muted); }

/* ---------- Сторінка «Про нас» ---------- */
.page-hero {
  --hero-ink: 29, 69, 36;
  position: relative; overflow: hidden; isolation: isolate;
  color: #fff; background: rgb(var(--hero-ink)); min-height: 240px; display: flex; align-items: center; padding: 32px 0;
}
.page-hero > .container { width: 100%; }
.page-hero h1 { margin: 0 0 6px; font-size: clamp(1.6rem, 4vw, 2.3rem); }
.page-hero p { margin: 0; opacity: .9; }
.page-hero .crumbs, .page-hero .crumbs a { color: rgba(255,255,255,.8); }
.about-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } }
.about-text p { line-height: 1.65; }
.about-points { list-style: none; padding: 0; margin: 18px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.about-points li { display: flex; gap: 10px; align-items: flex-start; background: var(--green-light); border-radius: 10px; padding: 12px; }
.about-points span { font-size: 1.4rem; }
.about-points b, .about-points small { display: block; }
.about-points small { color: var(--muted); }
.contacts-lg { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; font-size: 1.02rem; }

/* ---------- Симетрія: однакова висота й вирівнювання кнопок ---------- */
h1, h2, h3 { text-wrap: balance; }
.btn, .btn-green, .btn-sm, .btn-outline, .account-link, .cart-btn, .theme-btn, .add-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  line-height: 1.2; text-align: center; vertical-align: middle; box-sizing: border-box;
}
.nav-actions .account-link, .nav-actions .cart-btn, .nav-actions .btn-sm { height: 40px; padding: 0 14px; }
.nav-actions .theme-btn { width: 40px; height: 40px; padding: 0; }
.cart-btn .badge { margin-left: 2px; }
.btn, .btn-outline { min-height: 44px; padding: 0 22px; }
.btn-green { min-height: 40px; }
.btn-sm { min-height: 34px; }
.card .add-btn { width: 48px; height: 38px; padding: 0; }
.card-footer { align-items: center; margin-top: 10px; }
.section-head { align-items: center; }
.catalog-head { align-items: center; }
.side-cats { display: flex; flex-direction: column; gap: 4px; }
.side-cat { min-height: 38px; }
.guest-note {
  background: var(--green-light); border-radius: 10px; padding: 12px 14px; margin: 0 0 12px; line-height: 1.5;
}
.guest-note small { color: var(--muted); }
.table-title { margin: 0 0 10px; font-size: 1.1rem; display: flex; align-items: baseline; gap: 6px; }

/* Каталог: секція без зовнішнього відступу, кнопка «Фільтри» — лише на вузьких екранах */
.catalog-main { padding: 0; }
@media (min-width: 861px) { .side-toggle { display: none; } }

/* ---------- Векторні іконки ---------- */
.ic { width: 1.15em; height: 1.15em; flex: 0 0 auto; vertical-align: -0.2em; }
.with-ic { display: inline-flex; align-items: center; gap: 8px; }
h2.with-ic { display: flex; }
.no-photo .ic { width: 1em; height: 1em; color: var(--green); opacity: .45; stroke-width: 1.5; }
.cart-btn .ic, .account-link .ic { width: 18px; height: 18px; }
.theme-btn .ic { width: 18px; height: 18px; }
.hf-icon .ic { width: 22px; height: 22px; }
.pt-ic { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 10px; background: var(--card); color: var(--green); }
.pt-ic .ic { width: 22px; height: 22px; }
.about-points li { align-items: center; }
.round-btn .ic { width: 18px; height: 18px; }
.btn-outline .ic { width: 16px; height: 16px; }
.close { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 10px; }
.close:hover { background: var(--green-light); color: var(--text); }
.close .ic { width: 22px; height: 22px; }
.cm-del { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 8px; color: var(--muted); opacity: 1; }
.cm-del:hover { background: var(--danger-bg); color: var(--danger); }
.cm-del .ic { width: 19px; height: 19px; }
.empty-ic { width: 84px; height: 84px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; background: var(--green-light); color: var(--green); }
.empty-ic .ic { width: 40px; height: 40px; stroke-width: 1.6; }
.cm-empty .btn { margin-top: 10px; text-decoration: none; }
.status-ic { width: 76px; height: 76px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; }
.status-ic .ic { width: 40px; height: 40px; stroke-width: 1.8; }
.status-ic.ok { background: var(--green-light); color: var(--green); }
.status-ic.wait { background: var(--warn-bg); color: var(--warn); }
.status-ic.bad, .status-ic.warn { background: var(--danger-bg); color: var(--danger); }
.ic-ok { color: var(--green); } .ic-warn { color: var(--warn); }
.ac-ic { display: inline-flex; color: var(--muted); margin-right: 6px; vertical-align: -0.15em; }
.carrier-opt span { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.admin-tabs .filter { display: inline-flex; align-items: center; gap: 8px; }
label.check .ic { color: var(--green); }
.contacts li, .contacts-lg li { display: flex; align-items: flex-start; gap: 10px; }
.contacts li > .ic, .contacts-lg li > .ic { color: var(--green); margin-top: .2em; }
.contacts-lg li.hint { display: block; }

/* Зірки рейтингу */
.stars { display: inline-flex; gap: 1px; vertical-align: -0.15em; letter-spacing: 0; }
.stars svg { width: 1em; height: 1em; fill: var(--border); }
.stars svg.on { fill: #e0a526; }
.rev-stats { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--muted); margin-top: 6px; }
.rev-stats b { color: var(--text); }

/* ---------- Прокрутка: під вікном сторінка стоїть, гортається лише вікно ---------- */
html.scroll-locked { overflow: hidden; }
html.scroll-locked body { padding-right: var(--sbw, 0px); }
dialog { overscroll-behavior: contain; }
.cm-body { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

/* ---------- Стрічка відгуків ---------- */
.review-strip .strip-track { align-items: stretch; }
.strip-track > .review-card { flex: 0 0 var(--cw, 320px); min-width: 0; }
.rc-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rc-author { margin-top: auto; }

/* ---------- Телефони ---------- */
@media (max-width: 640px) {
  /* Шапка у два ряди: логотип і кнопки, під ними меню */
  .nav { grid-template-columns: auto 1fr; height: auto; padding-top: 10px; padding-bottom: 6px; gap: 6px 10px; }
  .nav > .logo { grid-column: 1; grid-row: 1; }
  .nav > .nav-actions { grid-column: 2; grid-row: 1; justify-self: end; }
  .nav > .nav-links { grid-column: 1 / -1; grid-row: 2; display: flex; justify-content: center; gap: 8px; border-top: 1px solid var(--border); padding-top: 6px; }
  .nav-links a { white-space: nowrap; }
  .nav-links a { padding: 6px 14px; border-radius: 8px; }
  .nav-links a.active { background: var(--green-light); }
  .logo { font-size: 1.15rem; }
  .logo-icon { width: 30px; height: 30px; flex-basis: 30px; }
  .nav-actions { gap: 6px; }
  .catalog-side { top: 0; }
  section { padding: 28px 0; }
  h2 { font-size: 1.4rem; }
  .page { padding-top: 20px; padding-bottom: 40px; }
  /* Поля вводу 16px — iPhone не збільшує сторінку при фокусі */
  input, select, textarea { font-size: 16px; }
}
@media (max-width: 520px) {
  /* Лише іконки в кнопках шапки */
  .cart-label, .auth-label { display: none; }
  .nav-actions .account-link, .nav-actions .cart-btn { padding: 0 11px; }
  .cart-btn .badge { margin-left: 4px; }
  /* Каталог — дві картки в ряд, як у великих магазинах */
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-img { aspect-ratio: 1 / 1; }
  .card-body { padding: 12px; gap: 4px; }
  .card h3 { font-size: .98rem; }
  .card .card-summary { -webkit-line-clamp: 2; font-size: .85rem; }
  .card .price { font-size: 1.05rem; }
  .card .add-btn { width: 42px; height: 36px; }
  .card-rating .hint { font-size: .78rem; }
  .catalog-head { flex-direction: column; align-items: stretch; }
  .catalog-controls { width: 100%; }
  .catalog-controls select { flex: 1; }
  /* Кошик — панель знизу на всю ширину */
  dialog.cart-modal {
    width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; border-radius: 16px 16px 0 0; border-bottom: 0;
  }
  .cm-head { padding: 12px 16px; }
  .cm-list { padding: 0 16px; }
  .cm-foot { padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); }
  .hero h1 { font-size: 1.85rem; }
  .hero p { font-size: 1rem; }
  .hero .btn { width: 100%; }
  .hero-features li { min-height: 64px; padding: 10px 12px; }
  .section-head .strip-nav { display: none; } /* на телефоні гортаємо пальцем */
  .review-card { padding: 14px; }
  .page-hero { min-height: 170px; }
}

@media (max-width: 480px) { .nav-actions .hide-sm { display: none; } }
.close:focus:not(:focus-visible) { outline: none; }
@media (max-width: 640px) {
  .product-page section { padding: 0; }
  .product-page .section-title { margin-top: 28px; }
}

/* ---------- Фото в рамці однакового розміру ---------- */
.ph { position: absolute; inset: 0; display: block; overflow: hidden; background: var(--green-light); }
.ph .ph-bg {
  position: absolute; inset: -12%; width: 124%; height: 124%; object-fit: cover;
  filter: blur(22px) saturate(1.15); opacity: .6; pointer-events: none;
}
.ph .ph-img { position: relative; width: 100%; height: 100%; object-fit: contain; display: block; }
.card-img .no-photo, .mini-img .no-photo { position: absolute; inset: 0; }
.card-img:hover .ph-img { transform: scale(1.03); }
.ph-img { transition: transform .35s ease; }
.pg-main { background: var(--green-light); }

/* ---------- Розмиті краї стрічок ---------- */
.strip {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 48px, #000 calc(100% - 48px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 48px, #000 calc(100% - 48px), transparent 100%);
}
@media (max-width: 520px) {
  .strip {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 28px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 28px), transparent 100%);
  }
}

/* ---------- Дерево категорій у каталозі ---------- */
.side-cat.has-sub span::after {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; vertical-align: .2em;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg);
  opacity: .5; transition: transform .2s;
}
.side-cat.has-sub.open span::after { transform: rotate(45deg); vertical-align: .35em; }
.side-sub { list-style: none; margin: 4px 0 4px 12px; padding: 0 0 0 10px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.side-sub .side-cat { min-height: 34px; font-size: .94rem; }
.sub-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 16px; }
.sub-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--card); color: var(--text); font: inherit; font-size: .92rem;
}
.sub-chip small { color: var(--muted); }
.sub-chip:hover { border-color: var(--green); }
.sub-chip.active { background: var(--green); border-color: var(--green); color: #fff; }
.sub-chip.active small { color: rgba(255,255,255,.8); }

/* ---------- Адмінка: дерево категорій ---------- */
.cat-item.sub { margin-left: 18px; position: relative; }
.cat-item.sub::before { content: ""; position: absolute; left: -10px; top: 50%; width: 8px; border-top: 2px solid var(--border); }
.cat-item.top .cat-name { font-weight: 600; }
.cat-item .btn-sm { min-width: 34px; padding: 0 8px; }
#catForm select { margin: 0; }

/* ---------- Адмінка: налаштування магазину горизонтально ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; align-items: start; }
.settings-col { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; height: 100%; }
.settings-col legend { font-weight: 600; padding: 0 6px; color: var(--text); }
.settings-col .field-title { margin: 4px 0 -4px; }
.settings-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: center; gap: 16px; }
.settings-actions .error { margin: 0; flex: 1; text-align: right; }
@media (max-width: 980px) { .settings-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .settings-grid { grid-template-columns: 1fr; } .settings-actions { flex-direction: column-reverse; align-items: stretch; } }
.up-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.up-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 24px; }
