/* Дизайн v2 — shop. Стилі цієї фази живуть окремим файлом, щоб фази не конфліктували в serpen.css.
   Каталог /shop і сторінка товару /shop/<slug>: src/site/pages/Shop*.tsx. Кольори — лише змінні
   стіни (--bg, --card, --ink, --muted, --line, --accent), тож червона, графітова й нічна стіни
   перефарбовують магазин так само, як решту сайту. */

/* ── Каталог: заголовок і вступ в один ряд, під ними рядок «З чого почати» і сортування. */
.shop .wrap.shop-more{padding-top:0}
.shop-head{display:flex;justify-content:space-between;align-items:center;gap:24px 48px;flex-wrap:wrap}
.shop-head h1{flex:0 0 auto;margin:0}
/* Вступ: Body/Regular великими, початок — 700 кольором тексту, решта — mauve (макет 2513:1588). */
.shop-lead{flex:0 1 628px;color:var(--muted);font-size:var(--fs-body);line-height:var(--lh-body);text-transform:uppercase}
.shop-lead p{margin:0}
.shop-lead :is(strong,b){font-weight:700;color:var(--ink)}
.shop-bar{display:flex;justify-content:space-between;align-items:center;gap:12px 32px;flex-wrap:wrap;margin:32px 0 0}
.shop-start{margin:0;color:var(--muted);font-size:var(--fs-body);line-height:var(--lh-body)}
.shop-start a{color:var(--ink);text-decoration:underline 1px var(--line);text-underline-offset:5px;padding:6px 0;
  transition:color .2s ease,text-decoration-color .2s ease}
.shop-start a:hover{color:var(--accent);text-decoration-color:var(--accent)}
.shop-start a[aria-current]{color:var(--accent);text-decoration-color:var(--accent)}

.shop-sort{position:relative;flex:0 0 auto}
.shop-sort summary{list-style:none;display:flex;align-items:center;gap:6px;min-height:20px;cursor:pointer;
  font-size:var(--fs-caption);line-height:var(--lh-caption);color:var(--muted)}
.shop-sort summary::-webkit-details-marker{display:none}
.shop-sort summary:hover{color:var(--ink)}
.shop-sort summary svg{width:14px;height:14px;transition:transform .2s ease}
.shop-sort[open] summary svg{transform:rotate(180deg)}
.shop-sort ul{position:absolute;top:100%;right:0;z-index:15;list-style:none;margin:0;padding:6px 0;min-width:220px;
  background:var(--bg);border:1px solid var(--line);box-shadow:0 10px 24px rgba(30,26,27,.08)}
.shop-sort li a{display:flex;align-items:center;min-height:44px;padding:0 16px;color:var(--ink);font-size:var(--fs-small)}
.shop-sort li a:hover{color:var(--accent)}
.shop-sort li a[aria-current]{color:var(--accent)}

/* ── «Цегла»: три колонки, картка i — у колонці i % 3 (порядок читання — рядами).
   На ≤900 колонки розчиняються, і картки стають звичайною сіткою в порядку `order`. */
.shop-grid{display:grid;grid-template-columns:minmax(0,404fr) minmax(0,406fr) minmax(0,404fr);gap:53px;align-items:start;margin-top:29px}
.shop-col{display:flex;flex-direction:column;gap:60px}
.sc{display:flex;flex-direction:column;gap:25px;color:var(--ink)}
.sc-cap{display:flex;flex-direction:column;gap:19px;min-width:0}
.sc-at{display:flex;flex-direction:column;gap:6px;min-width:0}
.sc:hover{color:inherit}
/* Кадр на всю ширину картки, без поля й рамки; висота — за пропорцією кадру. */
.sc-shot{overflow:hidden}
.sc-shot img{display:block;width:100%;height:auto;transition:transform .4s ease}
.sc:hover .sc-shot img{transform:scale(1.02)}
.sc-shot .ph{min-height:300px}
.sc-t{font-size:var(--fs-title-l);line-height:var(--lh-title-l);font-weight:600;text-transform:uppercase;overflow-wrap:anywhere;hyphens:auto}
.sc:hover .sc-t{color:var(--accent)}
.sc-a,.sc-m{font-size:var(--fs-body);line-height:var(--lh-body);color:var(--muted)}
.sc-m{text-transform:uppercase}
.sc-p{font-size:var(--fs-title-l);line-height:var(--lh-title-l);font-weight:600;color:var(--accent)}
.sc-p .micro{font-size:var(--fs-caption);line-height:var(--lh-caption);font-weight:400;margin-left:4px;color:var(--muted)}
.sc-p.sold{color:var(--muted)}
@media(max-width:900px){
  .shop-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:48px var(--gap)}
  .shop-col{display:contents}
}
@media(max-width:560px){
  .shop-grid{grid-template-columns:minmax(0,1fr);gap:40px}
  .shop-head{align-items:flex-start}
}

/* ── Смуга переваг: на всю ширину, тло — акцент стіни (темно-червоний на білій;
   на темних стінах акцент світлий, і текст стає кольором стіни). */
.shop-trust{margin:0;background:var(--accent);color:var(--on-accent)}
/* Як смуга довіри робіт: пункти по 238 px space-between, лінія посередині проміжку (через cqw),
   смуга 268 px заввишки (pad 68/60/67 + рядок 133, пункти 111 по центру). */
.shop-trust-in{display:flex;justify-content:space-between;align-items:center;gap:10px;min-height:268px;container-type:inline-size;
  padding:68px var(--pad) 67px;max-width:calc(var(--maxw) + var(--pad) * 2);margin:0 auto}
.shop-trust-in>div{position:relative;display:flex;flex-direction:column;gap:20px;flex:0 1 238px;min-width:0}
.shop-trust-in>div+div::before{content:"";position:absolute;top:-11px;bottom:-11px;
  left:calc((238px * var(--n,3) - 100cqw) / (2 * (var(--n,3) - 1)));border-left:1px solid color-mix(in srgb,var(--on-accent) 22%,transparent)}
.shop-trust b{display:block;margin:0;font-size:var(--fs-body);line-height:var(--lh-body);font-weight:600;text-transform:uppercase}
.shop-trust p{margin:0;font-size:var(--fs-body);line-height:var(--lh-body);color:rgba(255,255,255,.7)}
html:is([data-wall="red"],[data-wall="gray"],[data-wall="night"]) .shop-trust p{color:color-mix(in srgb,var(--on-accent) 70%,transparent)}
@media(max-width:900px){
  .shop-trust-in{flex-direction:column;justify-content:flex-start;align-items:stretch;gap:28px;min-height:0;padding-top:48px;padding-bottom:48px}
  .shop-trust-in>div{gap:8px}
  .shop-trust-in>div{flex:none}
  .shop-trust-in>div+div::before{display:none}
  .shop-trust-in>div+div{padding-top:28px;border-top:1px solid color-mix(in srgb,var(--on-accent) 18%,transparent)}
}

/* ── Заклик на всю ширину («Подарунок», «Обмежений тираж»). Без фото — тло картки стіни;
   з фото — затемнення ≥ 55 % під текстом, щоб білий читався на будь-якому кадрі. */
.shop-band{position:relative;margin:0;background:var(--card);color:var(--ink);overflow:hidden}
/* Смуги на всю ширину стоять впритул одна до одної; від змісту над ними — 96 px повітря. */
.shop .wrap+.shop-trust,.shop .wrap+.shop-band{margin-top:96px}
@media(max-width:560px){.shop .wrap+.shop-trust,.shop .wrap+.shop-band{margin-top:64px}}
.shop-band-bg{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
/* Фото або темне тло: білий текст; кнопка лишається primary стіни (у макеті — акцент). */
.shop-band.photo{color:#fff;--ink:#fff;--muted:#fff;background:var(--c-ink)}
.shop-band.photo::before{content:"";position:absolute;inset:0;z-index:1;
  background:linear-gradient(180deg,rgba(0,0,0,.55) 0%,rgba(0,0,0,.72) 100%)}
/* Смуга: 150 зверху й знизу, зміст 704 по центру (макет 2513:1775); тексти на всю ширину змісту. */
.shop-band{padding:150px 0}
.shop-band-in{position:relative;z-index:2;display:flex;flex-direction:column;align-items:stretch;gap:15px;text-align:center;
  width:min(704px,100% - var(--pad) * 2);margin:0 auto}
.shop-band-in .btn{align-self:center}
.shop-band-k{font-size:var(--fs-body);line-height:var(--lh-body);text-transform:uppercase;color:var(--muted);margin-bottom:15px}
.shop-band-in p{margin:0;font-size:var(--fs-body);line-height:var(--lh-body)}
.shop-band-in .btn{margin-top:25px}
@media(max-width:560px){
  .shop-band{padding:72px 0}
  .shop-band-in .btn{width:100%;min-height:48px}
}
/* Підвал після смуги на всю ширину — без зайвого повітря. */
main.shop:has(> .shop-band:last-child)+footer.site,main.shop:has(> .shop-trust:last-child)+footer.site{margin-top:0}

/* ── Сторінка товару: фото ліворуч у рамці, інформація праворуч (648 / 572 у кадрі 1440). */
.si{display:grid;grid-template-columns:minmax(0,648fr) minmax(0,572fr);gap:100px;align-items:start}
.si-frame{display:flex;align-items:center;justify-content:center;aspect-ratio:1;background:var(--card);cursor:zoom-in}
.si-frame{overflow:hidden}
.si-frame img{display:block;width:100%;height:100%;object-fit:contain}
.si-more{margin-top:28px}
/* Мініатюри 109 × 80 (поле 4 px) з підписом Body/Caption під кадром. */
.si-thumbs{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:16px 26px}
.si-thumbs a{display:flex;flex-direction:column;align-items:center;gap:8px;cursor:zoom-in;color:var(--muted)}
.si-thumb{display:flex;align-items:center;justify-content:center;width:109px;height:80px;padding:4px;
  border:1px solid transparent;transition:border-color .2s ease}
.si-thumbs a:hover .si-thumb{border-color:var(--stroke)}
.si-thumbs a:hover{color:var(--ink)}
.si-thumb img{width:100%;height:100%;object-fit:cover}
.si-cap{max-width:109px;font-size:var(--fs-caption);line-height:var(--lh-caption);text-align:center;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.si-info{display:flex;flex-direction:column;align-items:flex-start}
.si-back{display:flex;width:fit-content;align-items:center;gap:19px;min-height:20px;margin:0;
  font-size:var(--fs-caption);line-height:var(--lh-caption);color:var(--ink)}
.si-back:hover{color:var(--accent)}
/* Рядок «тираж · лишилось», назва H2 Bold 38 великими, автор акцентом (gap 30 / 8 / 10). */
.si-meta{margin:30px 0 0;font-size:var(--fs-body);line-height:var(--lh-body);color:var(--muted);text-transform:uppercase}
.si-title{margin:8px 0 0;font-size:var(--fs-h2);line-height:var(--lh-h2);font-weight:700;text-transform:uppercase;overflow-wrap:anywhere;hyphens:auto}
.si-back+.si-title{margin-top:30px}
@media(max-width:900px){.si-back{min-height:44px;margin-top:-12px}.si-meta,.si-back+.si-title{margin-top:18px}}
.si-artist{margin:10px 0 0;font-size:var(--fs-body);line-height:var(--lh-body);color:var(--accent)}
.si-artist a{display:inline-flex;align-items:center;min-height:44px;margin:-11px 0;color:inherit}
.si-artist a:hover{color:var(--accent-deep)}

.si-buy{margin-top:24px;width:100%}
.si-price{margin:0;font-size:var(--fs-title-l);line-height:var(--lh-title-l);font-weight:600;color:var(--accent)}
.si-price.sold{color:var(--ink)}
.si-vat{margin:6px 0 0}
.si-vat a,.si-withdraw a{color:var(--ink);text-decoration:underline 1px var(--stroke);text-underline-offset:3px}
.si-vat a:hover,.si-withdraw a:hover{color:var(--accent)}
.si-actions{display:flex;flex-wrap:wrap;gap:15px;margin-top:32px}
.si-actions .btn{flex:1 1 0;min-width:0}
.si-withdraw{margin:16px 0 0;max-width:52ch}
.si-desc{margin-top:32px}
.si-desc p:last-child{margin-bottom:0}

/* Оригінал: мітка Body/Regular великими, ціна Title/Large, рядок матеріалу Body/Small зі стрілкою праворуч. */
.si-orig{display:flex;flex-direction:column;gap:8px;width:100%;margin-top:32px;padding:24px;
  background:var(--card);color:var(--ink)}
.si-orig:hover{color:var(--ink)}
.si-orig-l{font-size:var(--fs-body);line-height:var(--lh-body);text-transform:uppercase;color:var(--muted)}
.si-orig-p{font-size:var(--fs-title-l);line-height:var(--lh-title-l);font-weight:600}
.si-orig-p .micro{font-size:var(--fs-caption);font-weight:400;color:var(--muted)}
.si-orig-row{display:flex;justify-content:space-between;align-items:center;gap:16px}
.si-orig-m{font-size:var(--fs-small);line-height:var(--lh-small);color:var(--muted)}
.si-orig-arrow{flex:0 0 auto;color:var(--muted);transition:transform .2s ease,color .2s ease}
.si-orig:hover .si-orig-arrow{transform:translateX(4px);color:var(--accent)}

/* «Поділитися» — квадрат 52 на тлі картки в ряду кнопок (робота й товар). */
.share-sq{position:relative;flex:0 0 auto}
.share-sq summary{list-style:none;display:flex;align-items:center;justify-content:center;width:52px;height:52px;
  background:var(--card);color:var(--ink);cursor:pointer;transition:color .2s ease}
.share-sq summary::-webkit-details-marker{display:none}
.share-sq summary:hover,.share-sq[open] summary{color:var(--accent)}
.share-sq summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.share-sq ul{position:absolute;top:calc(100% + 6px);right:0;z-index:15;list-style:none;margin:0;padding:6px 0;min-width:160px;
  background:var(--bg);border:1px solid var(--line);box-shadow:0 10px 24px rgba(30,26,27,.08)}
.share-sq li a{display:flex;align-items:center;min-height:44px;padding:0 16px;color:var(--ink);font-size:var(--fs-small)}
.share-sq li a:hover{color:var(--accent)}
@media(max-width:560px){.share-sq ul{right:auto;left:0}}

@media(max-width:1100px){.si{gap:56px}}
@media(max-width:900px){
  .si{grid-template-columns:minmax(0,1fr);gap:40px}
}
@media(max-width:560px){
  .si-actions .btn{flex:1 1 calc(100% - 67px);min-height:52px}
  .si-thumbs{gap:12px}
  .si-thumb{width:88px;height:66px}
  .si-cap{max-width:88px}
}
/* На телефоні сортування переноситься під рядок «З чого почати» і стоїть ліворуч — список відкривається вправо. */
@media(max-width:560px){.shop-sort ul{right:auto;left:0}}

/* Хлібні крихти магазину й товару — рядок 44 px під шапкою; до заголовка магазину 56, до товару 30 (макет). */
/* (сам рядок — у v2-works.css разом із каталогом і роботою; поля сусідів згортаються, тож 56 = відступ до заголовка) */
.shop>.wrap>.v2-crumbs+.shop-head{margin-top:56px}
@media(max-width:900px){.shop>.wrap>.v2-crumbs+.shop-head{margin-top:16px}.shop-sort summary{min-height:44px}}

/* Вторинний текст за макетом — gray #737373 (text/secondary): крихти й вступ магазину. */
.shop .v2-crumbs, .shop .v2-crumbs a, .shop-lead { color: var(--c-gray); }

/* Довге слово в описі товару і ряд кнопок «поділитись» на вузькому екрані не розтягують сторінку вбік (перевірка 24.10). */
.si-desc{overflow-wrap:anywhere}
.share-sq ul{flex-wrap:wrap}
