:root {
  --bg: #f7f3ee;
  --card: #fffdf9;
  --ink: #2b2622;
  --muted: #7a7066;
  --line: #e4dccf;
  --accent: #3f5b4a;
  --accent-ink: #ffffff;
  --warn: #a4452c;
  --sold: #8a6d3b;
  --shadow: 0 1px 2px rgba(60,45,30,.06), 0 8px 24px -12px rgba(60,45,30,.18);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 Inter, system-ui, sans-serif;
}
.wrap {
  max-width: 1080px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.top { background: rgba(255,253,249,.94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 12px; flex-wrap: wrap; }
.brand { font: 600 24px Lora, Georgia, serif; letter-spacing: .01em; color: var(--ink); text-decoration: none; }
.brand::after { content: ""; display: block; width: 28px; height: 2px; margin-top: 3px; background: var(--accent); border-radius: 2px; opacity: .6; }
nav { display: flex; gap: 8px; flex-wrap: wrap; }
main { padding-block: 24px 64px; }
h1, h2 { font-family: Lora, Georgia, serif; font-weight: 600; margin: 0 0 16px; }
h1 { font-size: 28px; letter-spacing: -.005em; } h2 { font-size: 20px; }
.muted { color: var(--muted); }
a { color: var(--accent); }

.btn {
  display: inline-block; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  padding: 10px 18px; border-radius: 99px; font: 500 15px Inter, sans-serif; cursor: pointer; text-decoration: none;
}
.btn.ghost { background: transparent; color: var(--accent); }
.btn.danger { background: var(--warn); border-color: var(--warn); }
.btn.small { padding: 6px 12px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; }
.card:hover { transform: translateY(-2px); }
.card a.cover { display: block; text-decoration: none; color: inherit; }
.card .ph { aspect-ratio: 3 / 4; background: #ece5d9; position: relative; overflow: hidden; }
.card.is-sold .ph img { filter: grayscale(.7) opacity(.72); }
.card .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .info { padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 4px; }
.card .t { font: 500 16px/1.35 Lora, Georgia, serif; overflow-wrap: anywhere; }
.price { font: 600 17px Lora, Georgia, serif; color: var(--accent); }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--line); color: var(--ink); }
.badge.sold { background: var(--sold); color: #fff; }
.badge.hidden { background: var(--muted); color: #fff; }
.ph .badge { position: absolute; top: 8px; left: 8px; }
.card .actions { padding: 0 16px 16px; }

.lot { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; }
.gallery { display: grid; gap: 10px; }
.gallery img { width: 100%; border-radius: 10px; display: block; background: #ece5d9; }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 720px) { .lot { grid-template-columns: minmax(0, 1fr); } }

form.box, .box { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; max-width: 560px; }
label { display: block; font-weight: 500; margin: 14px 0 6px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font: 16px Inter, sans-serif; background: #fff; color: var(--ink);
}
textarea { min-height: 120px; resize: vertical; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.thumb { position: relative; width: 84px; height: 104px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button { position: absolute; top: 2px; right: 2px; border: 0; background: rgba(0,0,0,.6); color: #fff; border-radius: 99px; width: 24px; height: 24px; cursor: pointer; }
.list { display: grid; gap: 8px; margin-top: 12px; }
.item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; flex-wrap: wrap; }
.item span { overflow-wrap: anywhere; min-width: 0; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 20; max-width: calc(100% - 32px); }
.toast.err { background: var(--warn); }
.empty { padding: 40px 0; text-align: center; }

.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.chip { display: inline-block; padding: 8px 16px; border: 1px solid var(--line); border-radius: 99px; background: var(--card); color: var(--ink); text-decoration: none; font-weight: 500; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.btns { display: flex; gap: 6px; flex-wrap: wrap; }
.panel { margin-top: -2px; max-width: none; }

/* характеристики */
.sub { font-size: 18px; margin: 22px 0 6px; }
.fld { margin-top: 4px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chk { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--card); font-weight: 400; margin: 0; cursor: pointer; }
.chk input { width: auto; margin: 0; }
.addopt { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.addopt input { flex: 1; min-width: 0; margin: 0; }
.optrow { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.optrow input { flex: 1 1 120px; min-width: 0; margin: 0; }
.optrow select { flex: 0 1 130px; min-width: 0; margin: 0; }
.chars { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 14px 0; }
.chars dt { color: var(--muted); }
.chars dd { margin: 0; overflow-wrap: anywhere; }

/* фільтри каталогу */
.filters { margin: 0 0 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.filters summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.filters summary::-webkit-details-marker { display: none; }
.filters summary::after { content: "▾"; color: var(--muted); transition: transform .15s; }
.filters[open] summary::after { transform: rotate(180deg); }
.filters-box { padding: 0 16px 16px; }
.filters-box label { margin: 10px 0 4px; font-size: 14px; }
.frow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fgrp { border: 0; border-top: 1px solid var(--line); margin: 14px 0 0; padding: 10px 0 0; min-width: 0; }
.fgrp legend { font-weight: 600; font-size: 14px; padding: 0 8px 0 0; }
.onlyav { margin-top: 12px; }
.chk input:checked { accent-color: var(--accent); }
.chk:has(input:checked) { border-color: var(--accent); background: #eef3ee; }
#rc { margin: 0 0 12px; font-size: 14px; }
@media (max-width: 400px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .card .info { padding: 10px 12px 12px; } .card .t { font-size: 15px; } }

/* кошик і замовлення */
.card .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.badge.reserved { background: #dfe8df; color: #2f4a3a; }
.buy { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.notice { background: #f6ecd6; border: 1px solid #e6d3a4; border-radius: 10px; padding: 10px 14px; }
.crow { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.cth { display: block; width: 64px; height: 80px; border-radius: 8px; overflow: hidden; background: #ece5d9; }
.cth img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cmid { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ct { color: var(--ink); text-decoration: none; font: 500 16px/1.3 Lora, Georgia, serif; overflow-wrap: anywhere; }
.sum { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 4px; font-size: 18px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.done { text-align: center; margin: 24px auto; }
button.chip { font: inherit; font-weight: 500; cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ord { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-top: 12px; box-shadow: var(--shadow); max-width: 720px; }
.ohead { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.st { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 99px; background: var(--line); }
.st-new { background: #f6e3c3; } .st-confirmed { background: #dfe8df; } .st-shipped { background: #d8e4ee; } .st-done { background: var(--accent); color: #fff; } .st-cancelled { background: #eadada; }
.osum { margin: 10px 0 6px; }
.ttn { display: flex; gap: 8px; align-items: center; }
.ttn input { flex: 1; min-width: 0; margin: 0; }

/* підвал, сторінки, меню керування */
.foot { border-top: 1px solid var(--line); background: var(--card); margin-top: 24px; }
.foot-in { padding-block: 22px calc(22px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 12px; }
.foot-brand { font: 600 18px Lora, Georgia, serif; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-links a { color: var(--ink); text-decoration: none; }
.foot-links a:hover { color: var(--accent); text-decoration: underline; }
.foot-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.small { font-size: 13px; margin: 0; }
.prose { max-width: 680px; }
.prose p { margin: 0 0 14px; overflow-wrap: anywhere; }
.prose ul { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin-bottom: 6px; overflow-wrap: anywhere; }
.adm { position: relative; }
.adm summary { list-style: none; cursor: pointer; }
.adm summary::-webkit-details-marker { display: none; }
.adm summary::after { content: " ▾"; }
.adm-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 12; min-width: 190px; display: grid; gap: 2px; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.adm-menu a { color: var(--ink); text-decoration: none; padding: 9px 12px; border-radius: 8px; }
.adm-menu a:hover { background: var(--bg); color: var(--accent); }

/* обране, кабінет */
.card { position: relative; }
.fav { position: absolute; top: 10px; right: 10px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,253,249,.92); color: var(--accent); font-size: 20px; line-height: 1; cursor: pointer; box-shadow: var(--shadow); display: grid; place-items: center; padding: 0; }
.fav.on { color: #b0463a; }
.fav:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.acct .adm-menu a { display: block; }

/* відгуки */
.rev { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0; max-width: 720px; }
.rev p { margin: 6px 0; }
.stars { color: #c9972b; letter-spacing: 1px; }
.stars .off { color: var(--line); }

/* ---- мінімальний декор: тонкі лінії та рамки ---- */
.top { position: relative; z-index: 40; background: var(--card); box-shadow: none; }
.adm { position: relative; }
.adm[open] { z-index: 50; }
.adm-menu { z-index: 60; }
.top-in { display: block; padding-block: 10px 8px; }
.brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 8px; padding: 8px 12px; border: 1px solid var(--accent); border-radius: 10px; outline: 1px solid var(--line); outline-offset: 3px; font: 600 24px/1.1 Lora, Georgia, serif; color: var(--accent); letter-spacing: 0; }
.brand::after { display: none; }
.brand i { display: block; flex: 1 1 0; max-width: 90px; height: 1px; background: var(--accent); opacity: .55; }
.brand b { display: block; width: 6px; height: 6px; background: var(--accent); transform: rotate(45deg); flex: none; }
.brand span { white-space: nowrap; }
nav { margin-top: 10px; }
h1 { position: relative; padding-bottom: 10px; }
h1::after { content: ""; position: absolute; left: 0; bottom: 0; width: 44px; height: 2px; background: var(--accent); opacity: .7; }
.card { outline: 1px solid transparent; outline-offset: 4px; transition: transform .18s ease, box-shadow .18s ease, outline-color .18s ease; }
.card:hover { outline-color: var(--line); }
.foot { border-top: 3px double var(--line); }
.filters-box { border-left: 3px solid var(--accent); }
.totop { position: fixed; left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--accent); background: rgba(63,91,74,.55); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 30; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.totop.show { opacity: 1; pointer-events: auto; }
.totop:hover { background: rgba(63,91,74,.8); }

/* етап B */
.badge.fresh { background: #f1e6c8; color: #6b5316; }
.chip .cn { color: var(--muted); font-size: .85em; }
.more { text-align: center; margin: 18px 0 0; }
#similar h2 { margin-top: 32px; }

/* етап C */
.bulk { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; background: var(--card); border-top: 1px solid var(--accent); box-shadow: 0 -4px 14px rgba(0,0,0,.08); padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px)); }
.bulk-in { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bulk select { width: auto; max-width: 100%; margin: 0; padding: 6px 8px; }
.selmode .totop { bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
.card.sm { cursor: pointer; }
.card.sm::after { content: ""; position: absolute; left: 8px; bottom: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--card); border: 2px solid var(--accent); z-index: 3; }
.card.sm.sel { outline: 3px solid var(--accent); outline-offset: -3px; }
.card.sm.sel::after { content: "✓"; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 15px; }
.pnote { margin: 22px 0; padding: 12px 14px; border: 1px dashed var(--accent); border-radius: 12px; background: var(--card); max-width: 720px; }
.pnote p { margin: 6px 0 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 14px 0 8px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; border-left: 3px solid var(--accent); }
.tile .tv { font: 600 24px Lora, Georgia, serif; color: var(--accent); }
.tile .tt { margin-top: 4px; }

.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
