/* Motion layer: scroll reveal + product quick view. Driven by assets/anim.js.
   html.rv is set in <head> only when reveal is on, so without JS nothing is ever hidden. */

/* ---------- scroll reveal: start hidden, anim.js brings them in ---------- */
/* data-shown is set once an element has played its entrance, so clearing the inline styles doesn't re-hide it */
.rv .hero .wrap > div > *:not([data-shown]),
.rv .hero-photo:not([data-shown]),
.rv .ribbon .wrap > div:not([data-shown]),
.rv .sec-head:not([data-shown]),
.rv #catalog .card:not([data-shown]),
.rv .table-scroll:not([data-shown]),
.rv .gallery figure:not([data-shown]),
.rv .steps .step:not([data-shown]),
.rv .faq details:not([data-shown]),
.rv .cta-band .wrap > div:first-child:not([data-shown]),
.rv .stores a:not([data-shown]),
.rv .cats .cat-card:not([data-shown]),
.rv .other-cat .cat-card:not([data-shown]),
.rv .cat-hero .wrap > *:not([data-shown]) { opacity: 0; }

/* ---------- quick view ---------- */
.qv { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 24px; }
.qv-back { position: absolute; inset: 0; background: rgba(6, 7, 9, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.qv-panel {
  position: relative; width: min(1040px, 100%); max-height: calc(100dvh - 48px);
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); /* minmax(0,…): the thumb strip must scroll, not widen the column */
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55); transform-origin: 0 0;
}
.qv-media { position: relative; background: var(--bg-2); display: flex; flex-direction: column; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.qv-media .qv-shot { flex: none; background: var(--studio); }
.qv-media .qv-shot { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.qv-media .qv-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* thumbnails wrap onto rows (no sideways scrolling) and fill the space under the photo */
.qv-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; padding: 12px; background: var(--bg-2); border-top: 1px solid var(--line); flex: 1; align-content: start; }
.qv-thumbs button { aspect-ratio: 4 / 3; padding: 0; border-radius: 8px; overflow: hidden; border: 1px solid var(--line-2); background: var(--studio); cursor: pointer; }
.qv-thumbs button[aria-current="true"] { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.qv-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qv-thumbs button.vid { position: relative; }
.qv-thumbs button.vid svg { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; padding: 6px 5px 6px 7px; border-radius: 50%; background: rgba(14,16,19,.75); color: #fff; }
.qv-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--studio); }

.qv-info { position: relative; padding: 32px 32px 28px; overflow-y: auto; overflow-x: hidden; min-height: 0; }
.qv-info h2 { font-size: clamp(26px, 3vw, 34px); margin: 12px 0 6px; letter-spacing: -.02em; }
.qv-tag { color: var(--ink-2); }
.qv-price { margin-top: 14px; }
.qv-info .opt { margin: 20px 0 4px; }
.qv-info dl.spec { margin-top: 18px; font-size: 14px; }
.qv-info dl.spec dt, .qv-info dl.spec dd { padding: 10px 0; }
.qv-buy { display: grid; gap: 8px; margin-top: 22px; }
.qv-buy .btn { height: 46px; }
.qv-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; color: var(--blue-ink); font-weight: 600; font-size: 15px; text-decoration: none; }
.qv-more:hover { text-decoration: underline; }
.qv-close {
  position: absolute; top: 14px; right: 14px; z-index: 2; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid var(--line-2); background: rgba(14, 16, 19, .8); color: var(--ink); cursor: pointer;
}
.qv-close:hover { border-color: var(--ink-3); }
.qv-close:focus-visible, .qv-thumbs button:focus-visible { outline: 2px solid var(--blue-ink); outline-offset: 2px; }

/* the photo that flies from the card into the dialog (shared-element transition) */
.qv-fly { position: fixed; z-index: 950; object-fit: cover; pointer-events: none; border-radius: 10px; background: var(--studio); }
body.qv-lock { overflow: hidden; }

@media (max-width: 820px) {
  .qv { padding: 0; align-items: end; }
  .qv-panel { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; max-height: 94dvh; border-radius: var(--r) var(--r) 0 0; overflow-y: auto; overflow-x: hidden; }
  .qv-media { overflow: visible; }
  .qv-info { overflow: visible; padding: 22px 20px 28px; }
  .qv-thumbs { flex: none; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); }
}
