/* SezonHit theme: category page only (product/category.twig); loaded by common/header.twig on this route.
   The page's shared parts (cards, chips, sort, pagination) are in stylesheet.css: search and home use them too. */

/* the category's own text from the admin (SEO description), under the products */
.cat-desc { max-width: 72ch; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 15.5px; line-height: 1.65; }
.cat-desc > * + * { margin-top: .8em; }
.cat-desc h2, .cat-desc h3 { color: var(--ink); font-size: 20px; }
.cat-desc a { color: var(--green); }
.cat-desc ul, .cat-desc ol { padding-left: 1.3em; list-style: disc; }
@media (max-width: 760px) { .cat-desc { margin-top: 40px; } }

/* the head's last line on a page of boxes: what the shop says of itself (controller trust()) */
.trust { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 2px; font-size: 14.5px; color: var(--ink-2); }
.trust li { display: inline-flex; align-items: center; gap: 6px; }
.trust svg { width: 16px; height: 16px; flex: none; color: var(--green); }
@media (max-width: 560px) { .trust { gap: 2px 14px; font-size: 14px; } }

/* ── strips: a family with many designs as a row of them (controller extension/sezonhit/category::strips).
      The head says what it is, how many designs and from what price; a design opens a quick look (.qv); «Усі 220
      дизайнів» (by the name and at the row's end) opens all of them in place as a grid (.is-open), one strip at a time.
      The row swipes on phones; with a mouse, arrows (product-category.js) and a fade. ── */
.strips { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; margin-top: 28px; }
.strip { min-width: 0; scroll-margin-top: calc(var(--hdr-stick) + 12px); }
.strip__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 14px; }
.strip__name { font: 600 22px/1.25 var(--serif); text-wrap: balance; text-wrap: pretty; } /* as .pdp__title */
.strip__name a { display: inline-block; padding: 10px 0; margin: -10px 0; color: var(--ink); text-decoration: none; } /* a 44 px target, outside the layout */
.strip__name a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.strip__name .promo-badge, .strip__name .flare { margin-left: 6px; vertical-align: 3px; }
/* «Усі 220 дизайнів ›», «Згорнути ⌃» while open: a 44 px target that takes no more room than the line */
.strip__open { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin: -12px 0; color: var(--green); font: 600 15px/1 var(--ui);
  text-decoration: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.strip__open svg { width: 18px; height: 18px; flex: none; transition: transform var(--t-fast) var(--ease); }
.strip__open:hover { text-decoration: underline; text-underline-offset: 4px; }
.strip__open-less { display: none; }
.strip.is-open .strip__open-all { display: none; }
.strip.is-open .strip__open-less { display: inline; }
.strip.is-open .strip__open svg { transform: rotate(-90deg); }
.strip__meta { font-size: 14.5px; color: var(--ink-3); }
.strip__meta em { font-style: normal; font-weight: 600; color: var(--brown); }
.strip__price { display: flex; align-items: baseline; gap: 10px; margin-left: auto; font: 700 18px/1.2 var(--ui); white-space: nowrap; }
.strip__price small { font: 500 13px/1 var(--ui); color: var(--ink-2); }
.strip__frame { position: relative; }
.strip__row { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding-right: 40px; }
.strip__row::-webkit-scrollbar { display: none; }
.strip__row.is-more { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent); }
.strip__row li { flex: none; width: 148px; scroll-snap-align: start; }
.strip__tile { position: relative; display: block; aspect-ratio: 1 / 1; border-radius: var(--r); overflow: hidden; background: var(--paper-2); }
.strip__tile img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-zoom) var(--ease); }
.strip__tile:hover img { transform: scale(1.06); }
/* as on the home's design wall: two lines rather than an ellipsis, the radius keeps one line a pill */
.strip__tile span {
  position: absolute; left: 6px; bottom: 6px; max-width: calc(100% - 12px); padding: 4px 8px; border-radius: 11px;
  background: rgb(255 252 246 / .94); color: var(--ink); font: 600 12px/1.2 var(--ui); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; box-shadow: 0 2px 8px -2px rgb(0 0 0 / .35);
}
/* the row's last tile: all the designs (the grid in place; the product's picker without the script) */
.strip__tile--all { display: grid; place-content: center; justify-items: center; gap: 2px; padding: 10px; border: 1.5px dashed var(--line-2); background: var(--card);
  text-align: center; text-decoration: none; }
.strip__tile--all b { font: 700 18px/1.2 var(--ui); color: var(--green); font-variant-numeric: tabular-nums; }
.strip__tile--all span { position: static; display: block; max-width: none; padding: 0; background: none; box-shadow: none; font: 500 13px/1.3 var(--ui); color: var(--ink-2); white-space: normal; overflow: visible; }
.strip__tile--all svg { width: 20px; height: 20px; margin-top: 4px; color: var(--green); }
.strip__tile--all:hover { border-color: var(--green); }
/* the row's first tile where a size takes the buyer's own photo: light like the strip's «Усі 220», with one strong accent:
   a green dashed edge (a place for a photo) and the camera in a solid green circle; its name and price under it */
.strip__tile--own { display: grid; place-content: center; justify-items: center; gap: 6px; padding: 10px; border: 2px dashed var(--green); background: var(--green-tint);
  color: var(--green); text-align: center; text-decoration: none; transition: background-color var(--t) var(--ease); }
.strip__own-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--green); color: var(--card);
  box-shadow: 0 4px 12px -4px rgb(30 58 43 / .55); transition: transform var(--t) var(--ease); }
.strip__own-icon svg { width: 26px; height: 26px; }
.strip__tile--own b { font: 700 15px/1.2 var(--ui); }
.strip__tile--own span { position: static; display: block; max-width: none; margin-top: -3px; padding: 0; background: none; box-shadow: none; color: var(--green);
  font: 600 13px/1.3 var(--ui); font-variant-numeric: tabular-nums; white-space: normal; overflow: visible; opacity: .8; }
.strip__tile--own:hover { background: #d6e3d2; }
.strip__tile--own:hover .strip__own-icon { transform: scale(1.06); }
@media (max-width: 560px) {
  .strip__own-icon { width: 44px; height: 44px; }
  .strip__own-icon svg { width: 22px; height: 22px; }
  .strip__tile--own b { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .strip__own-icon { transition: none; } }
/* a mouse gets told what a click on a design does: it opens bigger, with its price, over the page */
@media (hover: hover) and (pointer: fine) {
  .strip[data-look] .strip__tile:not(.strip__tile--all):not([data-on-photo])::after { content: "Переглянути"; position: absolute; left: 50%; bottom: 10px; padding: 7px 12px;
    border-radius: 999px; background: rgb(29 26 22 / .82); color: #fffcf6; font: 600 13px/1 var(--ui); white-space: nowrap; transform: translate(-50%, 6px);
    opacity: 0; transition: opacity var(--t-fast), transform var(--t-fast) var(--ease); pointer-events: none; }
  .strip[data-look] .strip__tile:hover::after, .strip[data-look] .strip__tile:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
}
.strip__nav { position: absolute; top: 50%; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; margin-top: -22px; border: 1px solid var(--line-2); border-radius: 50%;
  background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.strip__nav svg { width: 20px; height: 20px; }
.strip__nav:hover { border-color: var(--green); color: var(--green); }
.strip__nav--prev { left: -16px; }
.strip__nav--next { right: -16px; }
@media (hover: none) { .strip__nav { display: none !important; } }

/* ── a strip opened: the same list, every design of it, as a grid (6 a row from 900 px, 4 from 561, 3 on phones), a page
      at a time (PAGES in the controller: 18, 16, 12) with «Показати ще», and «Згорнути» back to the row. ── */
.strip.is-open .strip__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; overflow: visible; padding-right: 0;
  scroll-snap-type: none; -webkit-mask-image: none; mask-image: none; }
.strip.is-open .strip__row li { width: auto; }
.strip.is-open .strip__all, .strip.is-open .strip__nav { display: none !important; }
.strip.is-opening .strip__row { animation: strip-in var(--t) var(--ease); }
@keyframes strip-in { from { opacity: 0; } }
.strip__foot { display: none; justify-items: center; gap: 8px; margin-top: 18px; }
.strip.is-open .strip__foot { display: grid; }
.strip__foot [hidden] { display: none !important; }
.strip__more { width: 100%; max-width: 360px; }
.strip__shown { font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.strip__close { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--green); font: 600 15px/1 var(--ui); }
.strip__close svg { width: 18px; height: 18px; flex: none; }
.strip__close:hover { text-decoration: underline; text-underline-offset: 4px; }
@media (min-width: 561px) {
  .strip.is-open .strip__row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
}
@media (min-width: 900px) {
  .strip.is-open .strip__row { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
  .strip__foot { margin-top: 24px; }
}
/* A grid opened by the address (#box-1200: a refresh, a shared link, back from a product), before the script: a one-line
   script at the top of each strip (the template) marks it .is-open before any of its designs is parsed, so it's open from
   the first paint (CSS :target isn't: Chrome sets it late, and a script under the strips ran after the row had painted;
   both moved the page by half a screen), and CSS shows the page the script will show (PAGES: 3 × 4, 4 × 4, 6 × 3),
   «Показати ще» where there are more (data-over) and that layout's numbers (.bp--1/2/3). The script then marks the strip
   data-live and keeps it so: nothing moves. */
.bp--2, .bp--3 { display: none; }
.strip:not([data-live]) :is(.strip__more, .strip__shown) { display: none; }
@media (max-width: 560px) {
  .strip.is-open:not([data-live]) .strip__row > li:nth-child(n+13) { display: none; }
  .strip.is-open[data-over~="12"]:not([data-live]) .strip__more { display: inline-flex; }
  .strip.is-open[data-over~="12"]:not([data-live]) .strip__shown { display: block; }
}
@media (min-width: 561px) and (max-width: 899px) {
  .bp--1 { display: none; } .bp--2 { display: inline; }
  .strip.is-open:not([data-live]) .strip__row > li:nth-child(n+17) { display: none; }
  .strip.is-open[data-over~="16"]:not([data-live]) .strip__more { display: inline-flex; }
  .strip.is-open[data-over~="16"]:not([data-live]) .strip__shown { display: block; }
}
@media (min-width: 900px) {
  .bp--1 { display: none; } .bp--3 { display: inline; }
  .strip.is-open:not([data-live]) .strip__row > li:nth-child(n+19) { display: none; }
  .strip.is-open[data-over~="18"]:not([data-live]) .strip__more { display: inline-flex; }
  .strip.is-open[data-over~="18"]:not([data-live]) .strip__shown { display: block; }
}

/* the cards after the strips */
.others { margin-top: 48px; font-size: clamp(24px, 2.4vw, 30px); }
.others + .listing { margin-top: 20px; }
@media (max-width: 640px) {
  .strips { gap: 32px; }
  .strip__name { font-size: 19px; flex-basis: 100%; }
  /* the name takes its line; the price and «Усі 220 дизайнів» share the next one */
  .strip__price { order: 1; margin-left: 0; }
  .strip__open { order: 2; margin-left: auto; }
  .strip__meta { order: 3; flex-basis: 100%; }
  .strip__head > .note-badge { order: 4; }
  .strip__row { gap: 8px; }
  .strip__row li { width: 112px; }
}
/* a strip's theme chips (the picker's .themes, from stylesheet.css), between its head and its row */
.strip__themes { margin: -4px -3px 10px; }
/* wide screens: one row of them, the rest behind «+N» (product-category.js); the chips' own display beats [hidden].
   The box is one row high from the first paint (56 px: a 44 px chip and room for its focus ring), so the script, which
   hides the chips that wrapped, has nothing left to move: without it every strip jumped 50 px up when it ran. The chips
   still lay out in rows inside, which is what the script measures. An open strip shows them all (they wrap). */
@media (min-width: 861px) {
  .themes.strip__themes { padding: 6px 3px; margin: -7px -3px 4px; max-height: 56px; overflow: hidden; overflow: clip; }
  .strip.is-open .themes.strip__themes { max-height: none; overflow: visible; }
}
/* phones: the chips swipe edge to edge */
@media (max-width: 760px) {
  .strip__themes { margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); padding: 3px var(--gutter); scroll-padding: 0 var(--gutter); }
}
.strip__themes [hidden] { display: none !important; }
/* «+N»: the chips that didn't fit; it opens the strip, where they all show */
.strip__chips-more { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px dashed var(--line-2); border-radius: 999px;
  background: var(--card); color: var(--green); font: 600 14.5px/1 var(--ui); white-space: nowrap; }
.strip__chips-more:hover { border-color: var(--green); }
@media (prefers-reduced-motion: reduce) {
  .strip__tile img, .strip__tile::after, .strip__open svg { transition: none; }
  .strip.is-opening .strip__row { animation: none; }
}

/* ── quick look at a design (native <dialog>: the page behind is out of reach while it's open).
      Wide screens: photo left, the choice right. Phones: a sheet from the bottom, photo on top. ── */
.qv { width: min(880px, calc(100% - 48px)); max-width: none; max-height: calc(100% - 48px); padding: 0; border: 0; border-radius: var(--r-lg);
  background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg); overflow: auto; opacity: 0; transform: translateY(12px);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease); }
.qv[open] { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.qv.is-on { opacity: 1; transform: none; }
.qv::backdrop { background: rgb(24 20 14 / .55); opacity: 0; transition: opacity var(--t) var(--ease); }
.qv.is-on::backdrop { opacity: 1; }
html:has(.qv[open]) { overflow: hidden; }
/* the lock hides the scrollbar: its room stays, so the page behind doesn't jump. On the whole page from its first paint:
   keyed on the dialog (html:has(.qv)), it came with the end of the markup and moved everything sideways */
html { scrollbar-gutter: stable; }
.qv__media { position: relative; aspect-ratio: 1 / 1; background: var(--paper-2); touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.qv__img { width: 100%; height: 100%; object-fit: cover; }
.qv__nav { position: absolute; top: 50%; display: grid; place-items: center; width: 48px; height: 48px; margin-top: -24px; border: 0; border-radius: 50%;
  background: rgb(255 252 246 / .94); color: var(--ink); box-shadow: 0 2px 10px -2px rgb(0 0 0 / .4); }
.qv__nav svg { width: 22px; height: 22px; }
.qv__nav:hover { background: var(--card); color: var(--green); }
.qv__nav--prev { left: 12px; }
.qv__nav--next { right: 12px; }
.qv__info { display: flex; flex-direction: column; gap: 14px; padding: 24px 24px 22px 28px; }
.qv__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.qv__name { font: 600 26px/1.15 var(--serif); text-wrap: balance; }
.qv__design { margin-top: 6px; font-size: 15px; color: var(--ink-2); }
.qv__close { flex: none; margin: -8px -10px 0 0; }
.qv__facts { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.qv__price { font: 700 30px/1.1 var(--ui); }
.qv__price small { font: 500 16px/1 var(--ui); color: var(--ink-2); }
.qv__facts span { font-size: 15.5px; color: var(--ink-2); }
.qv__tier { margin-top: -8px; font-size: 15px; color: var(--ink-2); }
.qv__tier b { color: var(--ink); }
.qv__buy { display: flex; gap: 10px; }
.qv__add { flex: 1; min-height: 52px; padding: 0 16px; font-size: 16px; }
.qv__add[aria-busy="true"] { cursor: progress; opacity: .8; }
.qv__add.is-added { background: var(--green-2); }
.qv__done { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 12px; padding: 4px 4px 4px 12px; border-radius: var(--r); background: var(--green-tint); color: var(--green); font: 500 15px/1.35 var(--ui); }
.qv__done svg { width: 20px; height: 20px; flex: none; }
.qv__done span { flex: 1 1 140px; }
.qv__checkout { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 9px; background: var(--green); color: var(--card);
  font-weight: 600; text-decoration: none; white-space: nowrap; }
.qv__checkout:hover, .qv__checkout:focus { background: var(--green-2); color: var(--card); }
.qv__note { margin-top: 10px; font-size: 14.5px; line-height: 1.4; color: var(--ink-2); }
.qv__note:empty { display: none; }
.qv__err { margin-top: 10px; font-size: 14.5px; line-height: 1.4; color: #9a2c1c; }
.qv__many .btn svg { width: 18px; height: 18px; }
.qv__more { display: inline-flex; align-items: center; align-self: flex-start; min-height: 44px; margin-top: auto; color: var(--green); font: 600 15px/1 var(--ui); text-underline-offset: 4px; }
.qv [hidden] { display: none !important; }
@media (max-width: 760px) {
  .qv { width: 100%; max-width: 100%; max-height: calc(100% - 16px); margin: auto 0 0; border-radius: 20px 20px 0 0; transform: translateY(40px); }
  .qv[open] { grid-template-columns: minmax(0, 1fr); }
  .qv__media { aspect-ratio: auto; height: min(100vw, 50vh); }
  .qv__info { gap: 12px; padding: 16px 16px 20px; }
  .qv__name { font-size: 22px; }
  .qv__design { margin-top: 4px; font-size: 14.5px; }
  .qv__price { font-size: 26px; }
  /* the close button over the photo's corner, where a sheet's close is looked for */
  .qv__close { position: absolute; top: 10px; right: 10px; margin: 0; background: rgb(255 252 246 / .94); box-shadow: 0 2px 10px -2px rgb(0 0 0 / .4); }
  .qv__close:hover { background: var(--card); }
  .qv__nav { width: 44px; height: 44px; margin-top: -22px; }
  .qv__nav--prev { left: 10px; }
  .qv__nav--next { right: 10px; }
  .qv__more { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) { .qv, .qv::backdrop { transition: none; transform: none; } }
