/*
 * 🎨 Кольори й тканини на сторінці товару + збільшене фото кольору (2026-11-14, PRODUCT_OPTIONS_SPEC §6.4, пакет B).
 * Розмітка — partials/product_options.html, поведінка — static/js/product_options.js. Кольори — змінні теми (--at-*),
 * жорстких нових кольорів немає (правило «вид тем = налаштування»). Мініатюри: 48 px телефон (ціль дотику ≥ 44 px),
 * 56 px від 768 px; без прокрутки вбік на 240–430 px (minmax(0,1fr) + min-width:0).
 */
.po { margin: 18px 0 22px; min-width: 0; }
.po--bare { margin: 0; }
.po__group { min-width: 0; margin: 0 0 14px; padding: 0; border: 0; }
.po__gname { display: block; margin: 0 0 8px; padding: 0; font-size: 12px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--at-muted, #6b6b6b); }
.po__gname--solo { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap; }
.po__gnote { font-weight: 400; letter-spacing: 0; text-transform: none; }
.po__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; min-width: 0; }
/* 2026-11-15 (власник): спершу компактно (≈ два ряди, як сітка розмірів), кнопка «Усі кольори (N)» розгортає усі групи */
.po.is-collapsed .po__body { max-height: 168px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent);
  mask-image: linear-gradient(#000 70%, transparent); }
.po-sw { position: relative; display: block; min-width: 0; aspect-ratio: 1 / 1; cursor: zoom-in;
  -webkit-tap-highlight-color: transparent; }
.po-sw input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.po-sw picture, .po-sw img, .po-sw video { display: block; width: 100%; height: 100%; object-fit: cover; }
.po-sw__m { display: block; width: 100%; height: 100%; overflow: hidden; border-radius: 6px;
  border: 1px solid var(--at-line, #e5e5e5); background: var(--at-surface, #f6f3f1);
  transition: box-shadow .2s var(--at-ease, ease), transform .2s var(--at-ease, ease); }
.po-sw:hover .po-sw__m { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0, 0, 0, .12); }
.po-sw input:checked + .po-sw__m { border-color: var(--at-color-text, #111); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--at-color-text, #111); }
.po-sw input:focus-visible + .po-sw__m { outline: 2px solid var(--at-color-text, #111); outline-offset: 3px; }
.po-sw input:disabled + .po-sw__m { opacity: .4; cursor: not-allowed; }
.po-sw__d { position: absolute; right: 2px; bottom: 2px; padding: 1px 4px; border-radius: 4px; font-size: 10px; line-height: 1.3;
  font-weight: 600; color: #fff; background: rgba(20, 14, 12, .72); pointer-events: none; }
.po-sw__v { position: absolute; left: 3px; top: 3px; display: flex; align-items: center; justify-content: center; width: 16px; height: 16px;
  border-radius: 50%; font-size: 8px; color: #fff; background: rgba(20, 14, 12, .6); pointer-events: none; }
.po__more { margin: 10px 0 0; }
.po__none { margin: 0; padding: 12px 14px; border: 1px dashed var(--at-line-strong, #bbb); font-size: 14px; color: var(--at-muted, #6b6b6b); }
.po-error { display: none; margin: 8px 0 0; font-size: 12px; font-weight: 600; color: var(--at-sale, #b3261e); }
.is-color-missing .po-error { display: block; }
.is-color-missing .po__grid { animation: at-shake .45s var(--at-ease, ease); }
.is-color-missing .po-sw__m { border-color: var(--at-sale, #b3261e); }
.po-fit { margin: 12px 0 0; padding: 10px 12px; font-size: 14px; font-weight: 600; background: var(--at-surface, #f6f3f1); border-radius: 6px; }
.po-fit[hidden] { display: none; }
@media (min-width: 768px) {
  .po__grid { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 10px; }
}

/* ── збільшене фото / відео кольору ── */
html.po-lb-open, html.po-lb-open body { overflow: hidden; }
.po-lb { position: fixed; inset: 0; z-index: calc(var(--at-z-toast, 1100) + 10);   /* вище за тост «Оберіть колір» */ display: flex; align-items: center; justify-content: center;
  animation: po-in .2s var(--at-ease, ease); }
.po-lb[hidden] { display: none; }
.po-lb.is-still { animation: none; }
.po-lb__back { position: absolute; inset: 0; background: rgba(12, 8, 6, .9); }
.po-lb__stage { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
  padding: 56px 12px 92px; overflow: hidden; pointer-events: none; }
.po-lb__img, .po-lb__video { max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: auto; border-radius: 4px; }
.po-lb__img { cursor: zoom-in; transition: transform .25s var(--at-ease, ease); }
.po-lb__img.is-zoomed { transform: scale(2); cursor: zoom-out; }
.po-lb.is-still .po-lb__img { transition: none; }
.po-lb__btn { position: absolute; z-index: 2; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  padding: 0; border: 0; border-radius: 50%; font-size: 28px; line-height: 1; color: #fff; background: rgba(255, 255, 255, .14);
  cursor: pointer; -webkit-tap-highlight-color: transparent; }
.po-lb__btn:hover { background: rgba(255, 255, 255, .26); }
.po-lb__btn:focus-visible, .po-lb__pick:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.po-lb__btn[hidden] { display: none; }
.po-lb__x { top: 10px; right: 10px; }
.po-lb__nav { top: 50%; margin-top: -22px; }
.po-lb__prev { left: 8px; }
.po-lb__next { right: 8px; }
.po-lb__bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: center; gap: 10px 18px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)); color: #fff; }
.po-lb__name { min-width: 0; max-width: 100%; font-size: 14px; overflow-wrap: anywhere; text-align: center; }
.po-lb__pick { min-height: 44px; padding: 10px 22px; border: 1px solid #fff; border-radius: 10px; font: inherit; font-size: 14px;
  font-weight: 600; color: #111; background: #fff; cursor: pointer; }
.po-lb__pick.is-chosen { color: #fff; background: transparent; }
@media (min-width: 768px) {
  .po-lb__stage { padding: 64px 80px 96px; }
  .po-lb__prev { left: 20px; }
  .po-lb__next { right: 20px; }
}
@keyframes po-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .po-lb, .po-lb__img, .po-sw__m { animation: none; transition: none; }
}
