/* D'STUDIO SELECTION shop (shop.html / shop_en.html, logic in js/shop.js) */
:root {
  --bg: #F5F2EC; --surface: #fff; --ink: #34322F; --muted: #7B7670;
  --accent: #BDA171; --line: rgba(0, 0, 0, .08);
  --shadow-sm: 0 6px 16px rgba(0, 0, 0, .06); --shadow: 0 14px 36px rgba(0, 0, 0, .08);
  --space: clamp(40px, 7vw, 96px); --ease: cubic-bezier(.2, .6, .2, 1);
  --header-h: 72px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, system-ui, -apple-system, sans-serif; line-height: 1.6; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Header ─────────────────────────────────────────────────────────────────── */
.nav-header {
  position: sticky; top: 0; z-index: 1000; height: var(--header-h);
  background: rgba(245, 242, 236, .96); backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-content { height: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.back-link {
  justify-self: start; display: inline-flex; align-items: center; gap: .5rem; padding: .5rem 1rem;
  border: 1px solid var(--line); border-radius: 999px; font-weight: 500; transition: all .3s var(--ease);
}
.back-link:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-title { font-size: clamp(1.05rem, 2.6vw, 1.6rem); margin: 0; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.lang-switch {
  justify-self: end; display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, .7);
}
.lang-switch a { padding: .4rem .85rem; font-size: .8rem; font-weight: 600; color: var(--muted); }
.lang-switch a.active { background: var(--accent); color: #fff; }

/* ── Hero ───────────────────────────────────────────────────────────────────── */
.hero { padding: var(--space) 0 calc(var(--space) * .45); text-align: center; }
.eyebrow { letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-size: .8rem; font-weight: 500; }
.hero h1 { font-family: "Playfair Display", serif; font-size: clamp(1.9rem, 5vw, 3.4rem); margin: .6rem 0; line-height: 1.1; font-weight: 500; }
.hero .lead { color: var(--muted); font-size: clamp(.92rem, 2.4vw, 1.1rem); margin: 0 auto; max-width: 640px; }

/* ── Toolbar: search, sort, availability, categories ────────────────────────── */
.toolbar {
  position: sticky; top: var(--header-h); z-index: 900; background: rgba(245, 242, 236, .97);
  backdrop-filter: saturate(140%) blur(8px); padding: 12px 0 10px; border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.toolbar.stuck { border-bottom-color: var(--line); box-shadow: 0 8px 20px rgba(0, 0, 0, .04); }
.tb-row { display: flex; gap: 10px; align-items: center; }
.tb-row.sorts { flex: none; }
.search {
  flex: 1; min-width: 0; position: relative;
}
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  padding: 0 40px 0 40px; font-size: 16px; /* 16px: no zoom-on-focus on iOS */ outline: none; transition: border-color .2s, box-shadow .2s;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(189, 161, 113, .18); }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; display: none; align-items: center; justify-content: center;
}
.search-clear.show { display: inline-flex; }
.select {
  height: 44px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  padding: 0 34px 0 16px; font-size: .9rem; cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237B7670' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; max-width: 100%;
}
.select:focus { outline: none; border-color: var(--accent); }
/* Category picker („Категория ▾“ → photo tiles), active-category tag, phone „Филтри“ sheet */
.pick-btn {
  flex: none; height: 44px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink);
  padding: 0 16px 0 14px; display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; white-space: nowrap;
  transition: border-color .2s, box-shadow .2s;
}
.pick-btn[hidden] { display: none; }
#cat-btn { min-width: 212px; }   /* the label changes length: keep the search box from jumping */
#cat-btn .chev { margin-left: auto; }
.pick-btn > svg:first-child { color: var(--accent); flex: none; }
.pick-btn b { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pick-btn .chev { color: var(--muted); flex: none; transition: transform .25s var(--ease); }
.pick-btn:hover, .pick-btn[aria-expanded="true"] { border-color: var(--ink); }
.pick-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.pick-btn.has-cat { border-color: var(--accent); }
.pick-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(189, 161, 113, .25); }
.filt-btn { display: none; }
.filt-btn .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); visibility: hidden; flex: none; }
.filt-btn .dot.on { visibility: visible; }
.active-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.active-tags:empty { display: none; }
.tag {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 11px 0 14px; border: 0; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: .8rem; cursor: pointer; transition: background .2s;
}
.tag:hover { background: var(--accent); }
.tag svg { opacity: .75; }

/* The panel is a <dialog>: under the toolbar on desktop (placed by shop.js), a bottom sheet on the phone */
.pop {
  position: fixed; inset: auto; margin: 0; z-index: 950; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .12); padding: 22px 26px 20px; max-height: calc(100vh - 210px); overflow-y: auto;
}
.pop[open] { animation: popIn .28s var(--ease); }
@keyframes popIn { from { opacity: 0; transform: translateY(-8px); } }
.pop::backdrop { background: rgba(52, 50, 47, .35); }
.pop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.pop-head .eyebrow { font-size: .72rem; }
.pop-close {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted);
}
.pop-close:hover { color: var(--ink); border-color: var(--ink); }
.pop-foot { display: flex; justify-content: center; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.pop-all {
  border: 0; border-bottom: 1px solid var(--accent); background: none; padding: 0 0 2px; cursor: pointer; font-size: .84rem;
  letter-spacing: .02em; color: var(--ink);
}
.pop-all .n { color: var(--muted); font-size: .76rem; margin-left: .25rem; }
.pop-all[aria-pressed="true"] { font-weight: 600; }
.cat-tiles { display: grid; grid-template-columns: repeat(var(--cols, 9), minmax(0, 1fr)); gap: 16px 12px; }
.cat-tile {
  border: 0; background: none; padding: 0; cursor: pointer; text-align: center; color: inherit;
  display: flex; flex-direction: column; align-items: center; min-width: 0;
}
.cat-tile:disabled { cursor: default; opacity: .38; }
.ct-img {
  display: block; width: 100%; aspect-ratio: 4 / 5; background: #EDE7DE; overflow: hidden;
  outline: 1px solid transparent; outline-offset: 5px; transition: outline-color .35s var(--ease);
}
.ct-img img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; transition: transform 1.1s var(--ease); }  /* white backgrounds take the warm tone */
.ct-name {
  font-family: "Playfair Display", serif; font-size: .92rem; line-height: 1.22; margin-top: 12px; padding-bottom: 3px;
  background: linear-gradient(var(--accent), var(--accent)) no-repeat center bottom / 0 1px; transition: background-size .35s var(--ease);
}
.ct-n { font-size: .68rem; color: var(--muted); letter-spacing: .14em; font-variant-numeric: tabular-nums; margin-top: 3px; }
@media (hover: hover) {
  .cat-tile:not(:disabled):hover .ct-img img { transform: scale(1.06); }
  .cat-tile:not(:disabled):hover .ct-name { background-size: 60% 1px; }
}
.cat-tile[aria-pressed="true"] .ct-img { outline-color: var(--accent); }
.cat-tile[aria-pressed="true"] .ct-name { background-size: 100% 1px; }
.cat-tile:focus-visible { outline: none; }
.cat-tile:focus-visible .ct-img { outline-color: var(--ink); }
.f-group { margin-bottom: 18px; }
.f-group .eyebrow { font-size: .7rem; margin-bottom: 4px; }
.f-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 13px 2px; border: 0;
  border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; color: inherit;
  font-family: "Playfair Display", serif; font-size: 1rem;
}
.f-row .tick { color: var(--accent); visibility: hidden; flex: none; }
.f-row[aria-pressed="true"] span { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 5px; }
.f-row[aria-pressed="true"] .tick { visibility: visible; }
.f-done { position: sticky; bottom: 0; margin-top: 6px; }
html.pop-open { overflow: hidden; }
.result-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 14px 0 16px; font-size: .85rem; color: var(--muted); min-height: 24px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-color: var(--accent); cursor: pointer; font-size: .85rem; }

/* ── Grid & cards ───────────────────────────────────────────────────────────── */
.shop-section { padding-bottom: var(--space); min-height: 60vh; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.product-card {
  position: relative; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column;
  transition: box-shadow .35s var(--ease), transform .35s var(--ease);
  content-visibility: auto; contain-intrinsic-size: auto 470px;   /* the browser skips off-screen cards */
  animation: cardIn .45s var(--ease) both; animation-delay: var(--d, 0ms);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } }
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.card-open {   /* fills the card, so the price and the button line up even when a card has no size line */
  display: flex; flex-direction: column; flex: 1; border: 0; padding: 0; margin: 0; background: none; text-align: left; cursor: pointer; width: 100%; color: inherit;
}
.card-open:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.product-thumb { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: linear-gradient(135deg, #f8f6f2, #ede9e3); }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease), opacity .5s var(--ease); }
.product-thumb img.alt { position: absolute; inset: 0; opacity: 0; }
@media (hover: hover) {
  .product-card:hover .product-thumb img { transform: scale(1.04); }
  .product-card:hover .product-thumb.has-alt img.alt { opacity: 1; }
}
.badges { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: space-between; align-items: flex-start; }
.badge-cat { background: var(--accent); color: #fff; font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: .22rem .6rem; border-radius: 999px; }
.badge-stock {
  background: rgba(255, 255, 255, .94); color: var(--ink); font-size: .63rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  padding: .22rem .55rem; border-radius: 999px; border: 1px solid var(--line); display: inline-flex; align-items: center; gap: .3rem;
}
.badge-stock::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #2f9e6e; }
.badge-stock.low::before { background: #d97706; }
.badge-stock.on_order::before { background: #2563eb; }
.badge-stock.made::before { background: #9333ea; }
.badge-stock.sold_out { color: var(--muted); }
.product-card .badge-stock .more { display: none; }
.badge-stock.sold_out::before { background: #b9b4ad; }
.product-info { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; gap: 4px; }
.product-title {
  font-size: .98rem; font-weight: 600; margin: 0; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-dims { color: var(--muted); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-price { font-size: 1.05rem; font-weight: 600; margin-top: auto; padding-top: 6px; }
.product-price.request { font-size: .85rem; font-weight: 500; color: var(--muted); }
.old-price { color: var(--muted); font-weight: 400; font-size: .85rem; text-decoration: line-through; margin-left: .35rem; }
.card-cta { padding: 0 16px 16px; }
.cta {
  display: flex; align-items: center; justify-content: center; gap: .45rem; width: 100%; min-height: 44px; padding: .6rem 1rem;
  background: var(--ink); color: #fff; font-size: .86rem; font-weight: 500; border: 0; cursor: pointer; text-align: center;
  transition: background .25s var(--ease);
}
.cta:hover { background: var(--accent); }
.cta.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.cta.ghost:hover { background: var(--ink); color: #fff; }
.cta:disabled { opacity: .7; cursor: progress; }
.cta .short { display: none; }
.product-card-shopify { background: transparent; border: 0; align-items: center; justify-content: center; }
.product-card-shopify:hover { box-shadow: none; transform: none; }
.shopify-embed { width: 100%; display: flex; justify-content: center; }

.state { grid-column: 1 / -1; text-align: center; padding: 4rem 1rem; color: var(--muted); }
.state h2 { font-family: "Playfair Display", serif; font-weight: 500; color: var(--ink); font-size: 1.5rem; margin: 0 0 .5rem; }
.sentinel { height: 1px; }
.more-wrap { display: flex; justify-content: center; margin-top: 28px; }
.more-wrap .cta { width: auto; padding: .7rem 2rem; }
.skeleton .product-thumb { animation: shimmer 1.4s infinite linear; background: linear-gradient(90deg, #efebe5 25%, #f6f3ee 50%, #efebe5 75%); background-size: 200% 100%; }
.skeleton .sk-line { height: 12px; background: #efebe5; border-radius: 6px; margin: 4px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Product sheet (detail) ─────────────────────────────────────────────────── */
.sheet {
  border: 0; padding: 0; margin: auto; width: min(1040px, calc(100vw - 48px)); max-height: calc(100vh - 48px);
  background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .25); overflow: hidden;
}
.sheet[open] { display: grid; grid-template-columns: 1.1fr 1fr; animation: sheetIn .35s var(--ease); }
.sheet::backdrop { background: rgba(52, 50, 47, .45); backdrop-filter: blur(2px); }
@keyframes sheetIn { from { opacity: 0; transform: translateY(16px) scale(.99); } }
.sheet-close {
  position: absolute; top: 12px; right: 12px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .94); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.gallery { position: relative; background: #f1ede7; min-height: 0; display: flex; align-items: center; }
.gallery-track { width: 100%; }
.gallery-track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track img { flex: 0 0 100%; width: 100%; height: 100%; max-height: calc(100vh - 48px); object-fit: contain; scroll-snap-align: center; aspect-ratio: 4 / 5; }  /* whole photo, also landscape catalogue shots */
.gallery-dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.gallery-dots button { width: 8px; height: 8px; padding: 0; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .6); cursor: pointer; }
.gallery-dots button[aria-current="true"] { background: #fff; width: 20px; border-radius: 4px; }
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .9); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.gallery-nav.prev { left: 12px; } .gallery-nav.next { right: 12px; }
.sheet-body { padding: 36px 36px 28px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.sheet-body > * { flex-shrink: 0; }   /* the column scrolls instead of squashing a block (the delivery box was cut off on laptop screens) */
.sheet-body h2 { font-family: "Playfair Display", serif; font-weight: 500; font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.15; margin: 0; }
.sheet-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sheet-price { font-size: 1.5rem; font-weight: 600; }
.sheet-price.request { font-size: 1rem; color: var(--muted); font-weight: 500; }
.sheet-dims { font-size: .9rem; color: var(--muted); }
.sheet-desc { color: #4d4a46; font-size: .95rem; line-height: 1.7; white-space: pre-line; }
.sheet-actions {   /* stays in view at the bottom of the column when the text is longer than the window */
  margin-top: auto; padding-top: 12px; display: grid; gap: 10px; position: sticky; bottom: -28px; z-index: 1;
  margin-bottom: -28px; padding-bottom: 28px; background: var(--surface); box-shadow: 0 -10px 12px -12px rgba(0, 0, 0, .14);
}
.sheet-note { font-size: .8rem; color: var(--muted); text-align: center; }

/* Delivery estimate (Поръчка → Обработка → Доставка) and the promises under it */
.delivery { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; margin-top: 6px; }
.delivery-lead { margin: 0; padding: 12px 14px; font-size: .88rem; line-height: 1.5; color: #4d4a46; border-bottom: 1px solid var(--line); }
.delivery-lead strong { color: var(--ink); font-weight: 600; }
.delivery-lead b { color: var(--ink); font-weight: 600; white-space: nowrap; }
.delivery-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.delivery-steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 12px 8px 11px; text-align: center; }
.delivery-steps li + li { border-left: 1px solid var(--line); }
.delivery-steps li + li::before {
  content: ""; position: absolute; left: -5px; top: 50%; width: 8px; height: 8px; background: var(--surface);
  border-top: 1px solid var(--line); border-right: 1px solid var(--line); transform: translateY(-50%) rotate(45deg);
}
.ds-icon { color: var(--accent); line-height: 0; margin-bottom: 5px; }
.ds-label { font-size: .8rem; font-weight: 600; color: var(--ink); }
.ds-date { font-size: .78rem; color: var(--muted); }
.ds-date span { white-space: nowrap; }   /* break only between the two dates of a range */
.delivery-note { margin: 0; padding: 8px 14px 10px; font-size: .74rem; color: var(--muted); background: #faf8f4; border-top: 1px solid var(--line); }
.promises { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 7px; }
.promises li { display: flex; align-items: center; gap: 10px; font-size: .86rem; color: #4d4a46; }
.promises svg { color: var(--accent); flex: none; }

/* ── Products with variants (material / colour / size) ─────────────────────────── */
/* Card: material dots + „3 материала“, „от 419 €“ */
.card-vars { display: flex; align-items: center; gap: 7px; min-width: 0; margin-top: 3px; font-size: .72rem; color: var(--muted); letter-spacing: .01em; }
.card-vars .dots { display: inline-flex; align-items: center; gap: 5px; flex: none; }
.card-vars i {
  width: 13px; height: 13px; border-radius: 50%; flex: none; background: #e7e1d8 center / cover;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14);
}
.card-vars .more { margin-left: 1px; }
.card-vars .n { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-price .from { font-weight: 500; color: var(--muted); font-size: .82em; }

/* Picker („мостри“): option name + chosen value, round swatches / name buttons / a list for many values */
.vpick { display: grid; gap: 16px; padding: 14px 0 15px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.vopt-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 9px; margin: 0; font-size: .86rem; line-height: 1.4; }
.vopt-name { font-size: .7rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.vopt-head b { font-weight: 600; color: var(--ink); }
.sw-row { display: flex; flex-wrap: wrap; gap: 10px 8px; margin-top: 10px; }
.sw {
  width: 66px; padding: 5px 0 0; border: 0; background: none; color: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
}
.sw-img {
  position: relative; width: 54px; height: 54px; border-radius: 50%; background: #e9e4dc center / cover;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); outline: 1px solid transparent; outline-offset: 4px;
  transition: outline-color .25s var(--ease), opacity .25s;
}
.sw-blank { display: flex; align-items: center; justify-content: center; font: 500 1.15rem/1 "Playfair Display", serif; color: #6d665d; }
.sw:hover .sw-img { outline-color: rgba(189, 161, 113, .6); }
.sw[aria-checked="true"] .sw-img { outline: 1.5px solid var(--ink); }
.sw:focus-visible { outline: none; }
.sw:focus-visible .sw-img { outline: 2px solid var(--accent); outline-offset: 4px; }
.sw .ok, .pill .ok { flex: none; border-radius: 50%; background: #2f9e6e; }
.sw .ok { position: absolute; right: -1px; bottom: 1px; width: 12px; height: 12px; border: 2px solid #fff; }
.sw .ok.low, .pill .ok.low { background: #d97706; }
.sw-price { font-size: .74rem; line-height: 1.2; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; min-height: 1.2em; }
.sw[aria-checked="true"] .sw-price { color: var(--ink); font-weight: 600; }
.sw.is-sold .sw-img { opacity: .55; }
.sw.is-off { cursor: not-allowed; }
.sw.is-off .sw-img { opacity: .3; }
.sw.is-off .sw-img::after {   /* not offered with the choice above: struck through */
  content: ""; position: absolute; left: 50%; top: 4px; bottom: 4px; width: 1.5px; background: var(--ink); transform: rotate(45deg);
}
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pill {
  min-height: 40px; padding: 0 16px; border: 1px solid rgba(0, 0, 0, .14); border-radius: 999px; background: #fff; color: var(--ink);
  font-size: .86rem; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: border-color .2s, background .2s, color .2s;
}
.pill:hover { border-color: var(--ink); }
.pill[aria-checked="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pill .ok { width: 7px; height: 7px; }
.pill-price { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill[aria-checked="true"] .pill-price { color: rgba(255, 255, 255, .78); }
.pill.is-sold { color: var(--muted); }
.pill.is-off { cursor: not-allowed; color: #b3ada5; border-style: dashed; text-decoration: line-through; }
.pill.is-off:hover { border-color: rgba(0, 0, 0, .14); }
.vsel { width: 100%; margin-top: 8px; height: 46px; border-radius: 12px; font-size: .9rem; }
.vp-stock { margin: 0; display: flex; align-items: center; gap: 8px; font-size: .8rem; color: #4d4a46; }
.vp-stock::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #2f9e6e; flex: none; }
.vp-stock.low::before { background: #d97706; }
.vp-stock.on_order::before { background: #2563eb; }
.vp-stock.made::before { background: #9333ea; }
.vp-stock.sold_out::before { background: #b9b4ad; }
.sheet-price.flash { animation: priceFlash .7s var(--ease); }
@keyframes priceFlash { from { color: var(--accent); } }
.sheet-delivery { display: contents; }
.sheet-delivery > * { flex-shrink: 0; }   /* same as .sheet-body > *: the delivery box must not be squeezed */
.sheet-dims[hidden] { display: none; }
/* What the photo shows, on the photo */
.gallery-cap {
  position: absolute; left: 12px; bottom: 34px; z-index: 2; max-width: calc(100% - 24px); margin: 0; padding: 5px 11px;
  border-radius: 999px; background: rgba(255, 255, 255, .92); border: 1px solid var(--line); font-size: .74rem; line-height: 1.4;
  color: #4d4a46; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gallery-cap.solo { bottom: 12px; }
.gallery-cap[hidden] { display: none; }
.gallery-cap b { font-weight: 600; color: var(--ink); }
/* The choice right above the button (stays in the phone's sticky bar) */
.sheet-choice { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: .82rem; color: #4d4a46; }
.sheet-choice b { font-weight: 600; color: var(--ink); }
.sheet-choice .pr { font-weight: 600; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ── Footer bits ────────────────────────────────────────────────────────────── */
.catalog-cta { padding: var(--space) 0; border-top: 1px solid var(--line); text-align: center; }
.catalog-cta .inner { max-width: 520px; margin: 0 auto; }
.catalog-cta .kicker { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .18em; color: var(--accent); margin-bottom: 1.1rem; }
.catalog-cta h2 { font-family: "Playfair Display", serif; font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin: 0 0 1rem; line-height: 1.2; font-weight: 500; }
.catalog-cta p { color: var(--muted); font-size: .95rem; margin: 0 0 2rem; line-height: 1.75; }
.catalog-cta a {
  display: inline-flex; align-items: center; gap: .6rem; padding: .85rem 2.25rem; background: var(--accent); color: #fff;
  font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; transition: opacity .3s;
}
.catalog-cta a:hover { opacity: .85; }
.site-footer { padding: 1.5rem 0; text-align: center; border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .85rem; }
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-bottom: 8px; }
.legal-links a { color: var(--ink); }
.legal-links a:hover { color: var(--accent); }
.sheet-legal { font-size: .76rem; color: var(--muted); margin-top: 6px; line-height: 1.5; text-align: center; }
.sheet-legal a { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 2px; }

/* ── Tablet ─────────────────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .cat-tiles { --cols: 5; }
  .tb-main { flex-wrap: wrap; }   /* search on its own row, the pickers under it */
  .tb-row.sorts { flex: 1 1 100%; min-width: 0; }
  .tb-row.sorts > * { flex: 1 1 0; min-width: 0; }
  .sheet[open] { grid-template-columns: 1fr 1fr; }
}

/* ── Phone ──────────────────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
  :root { --header-h: 60px; }
  .container { padding: 0 14px; }
  .back-link { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 50%; }
  .back-link .back-text { display: none; }
  .hero { padding: 28px 0 14px; }
  .hero .lead { display: none; }
  .tb-main { flex-wrap: wrap; }
  .tb-row.sorts { flex: 1 1 100%; min-width: 0; }
  .tb-row.sorts .select { display: none; }   /* availability + sort move into the „Филтри“ sheet */
  .pick-btn { flex: 1 1 0; min-width: 0; height: 42px; font-size: .88rem; padding: 0 14px; }
  .pick-btn .chev, .filt-btn .dot { margin-left: auto; }
  .filt-btn { display: inline-flex; }
  .pop {
    inset: auto 0 0 0; width: 100%; max-width: 100%; max-height: 86vh; border: 0; border-radius: 20px 20px 0 0;
    padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
  }
  .pop[open] { animation: popUp .38s var(--ease); }
  @keyframes popUp { from { transform: translateY(40px); opacity: .4; } }
  .pop::before { content: ""; display: block; width: 38px; height: 4px; border-radius: 4px; background: #d8d2c8; margin: 0 auto 12px; }
  .cat-tiles { --cols: 3; gap: 16px 10px; }
  .ct-name { font-size: .88rem; margin-top: 8px; }
  .page-title { font-size: .95rem; letter-spacing: .01em; }
  .lang-switch a { padding: .35rem .6rem; font-size: .72rem; }
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .product-card { contain-intrinsic-size: auto 340px; }
  .product-card:hover { transform: none; box-shadow: none; }
  .badges { top: 7px; left: 7px; right: 7px; }
  .badge-cat { display: none; }  /* little room on phone cards; the category filter says it */
  .badge-stock { font-size: .58rem; padding: .18rem .45rem; }
  .product-info { padding: 10px 10px 8px; gap: 2px; }
  .product-title { font-size: .86rem; }
  .product-dims { font-size: .7rem; }
  .product-price { font-size: .95rem; }
  .product-price.request { font-size: .78rem; }
  .card-cta { padding: 0 10px 10px; }
  .cta { min-height: 38px; font-size: .8rem; padding: .45rem .5rem; }
  .card-cta .cta .long { display: none; }
  .card-cta .cta .short { display: inline; }

  .sheet {
    width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 18px 18px 0 0;
  }
  .sheet[open] { display: flex; flex-direction: column; overflow-y: auto; animation: sheetUp .35s var(--ease); }
  @keyframes sheetUp { from { transform: translateY(40px); opacity: .4; } }
  .gallery { flex: none; }
  .gallery-track { align-items: center; }
  .gallery-track img { height: auto; max-height: 62vh; aspect-ratio: auto; }  /* the photo's own shape: no empty bands */
  .gallery-nav { display: none; }
  .sheet-body { padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); overflow: visible; }
  .sheet-actions { position: sticky; bottom: 0; margin-bottom: 0; background: var(--surface); padding: 10px 0 calc(4px + env(safe-area-inset-bottom)); }
  .card-vars { gap: 5px; margin-top: 2px; font-size: .66rem; }
  .card-vars .dots { gap: 4px; }
  .card-vars i { width: 11px; height: 11px; }
  .sw { width: 60px; }
  .sw-img { width: 50px; height: 50px; }
  .gallery-cap { bottom: 28px; font-size: .7rem; }
  .gallery-cap.solo { bottom: 10px; }
}
@media (max-width: 360px) {
  .page-title { font-size: .95rem; }
}
@media (prefers-reduced-motion: reduce) {
  .product-card, .sheet[open], .pop[open], .sheet-price.flash { animation: none; }
  .product-thumb img, .ct-img img, .sw-img { transition: none; }
}
