/* ============================================================================
   quickview-panel — referentie-implementatie
   ----------------------------------------------------------------------------
   Alles loopt via --qv-* custom properties. De component brengt bewust GEEN
   eigen visuele identiteit mee: overschrijf de tokens met die van het project.

   Breekpunt: 900px. Hardgecodeerd omdat CSS geen custom property in een
   media query toelaat. Wijzig je hem, wijzig hem dan ook in quickview.js
   (optie `mobileQuery`) — anders lopen CSS en JS uit elkaar.
   ========================================================================= */

:root {
  /* ruimte boven het paneel: sticky header + eventuele aankondigingsbalk */
  --qv-top: 0px;

  --qv-dur: .3s;
  --qv-ease: cubic-bezier(.4, 0, .2, 1);

  --qv-gap: 1.25rem;
  --qv-radius: 14px;

  --qv-bg: #ffffff;
  --qv-surface: #f7f5f2;
  --qv-ink: #1c1b19;
  --qv-ink-soft: #605c56;
  --qv-line: #e5e2dc;
  --qv-accent: #b4441f;
  --qv-scrim: rgba(22, 20, 18, .42);

  --qv-shadow: -14px 0 44px -26px rgba(0, 0, 0, .38);
  --qv-shadow-sheet: 0 -14px 44px -26px rgba(0, 0, 0, .5);

  --qv-cols: 4;        /* kolommen in ruststand */
  --qv-cols-open: 2;   /* kolommen wanneer het paneel open staat */
  --qv-panel-w: 50vw;
}

/* voorkomt de horizontale sprong wanneer de scrollbar verdwijnt bij scroll-lock */
html { scrollbar-gutter: stable; }

/* ── host + content ──────────────────────────────────────────────────────── */

[data-qv-host] {
  position: relative;
  --qv-content-w: 100%;
}

.qv-content {
  width: var(--qv-content-w);
  transition: width var(--qv-dur) var(--qv-ease);
}

.qv-grid {
  display: grid;
  grid-template-columns: repeat(var(--qv-cols), minmax(0, 1fr));
  gap: var(--qv-gap);
  /* grid-template-columns wordt NIET getransitioneerd: het aantal tracks
     verandert (4→2) en dat is niet interpoleerbaar. De breedte-transitie op
     .qv-content draagt de beweging. */
}

@media (min-width: 900px) {
  [data-qv-host][data-qv-open] {
    --qv-content-w: calc(100% - var(--qv-panel-w));
    --qv-cols: var(--qv-cols-open);
  }
}

/* ── kaart ───────────────────────────────────────────────────────────────── */

.qv-card {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding: .9rem .9rem 1.1rem;
  border-radius: var(--qv-radius);
  background: var(--qv-surface);
  color: inherit;
  text-decoration: none;
  transition: transform .25s var(--qv-ease), box-shadow .25s var(--qv-ease);
}
.qv-card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px -22px rgba(0,0,0,.4); }
.qv-card[aria-current="true"] { outline: 2px solid var(--qv-accent); outline-offset: 2px; }
.qv-card img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; }
.qv-card-name { font-weight: 600; line-height: 1.25; }
.qv-card-price { color: var(--qv-ink-soft); font-variant-numeric: tabular-nums; }

/* ── paneel ──────────────────────────────────────────────────────────────── */

.qv-panel {
  position: fixed;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: var(--qv-bg);
  color: var(--qv-ink);
  visibility: hidden;
  overscroll-behavior: contain;

  top: var(--qv-top);
  right: 0;
  width: var(--qv-panel-w);
  height: calc(100dvh - var(--qv-top));
  border-left: 1px solid var(--qv-line);
  box-shadow: var(--qv-shadow);
  transform: translateX(100%);

  transition:
    transform var(--qv-dur) var(--qv-ease),
    visibility var(--qv-dur) step-end;
}

[data-qv-host][data-qv-open] .qv-panel {
  visibility: visible;
  transform: none;
  transition:
    transform var(--qv-dur) var(--qv-ease),
    visibility 0s;
}

/* tijdens het slepen mag er geen transitie op staan, anders loopt hij achter */
.qv-panel[data-qv-dragging] { transition: none; }

.qv-panel-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--qv-line);
  flex: 0 0 auto;
}
.qv-panel-title {
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--qv-ink-soft);
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border: 1px solid var(--qv-line);
  border-radius: 999px;
  background: var(--qv-bg);
  color: inherit;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background .2s, border-color .2s, opacity .2s;
}
.qv-btn:hover:not(:disabled) { background: var(--qv-surface); border-color: var(--qv-ink-soft); }
.qv-btn:disabled { opacity: 1; color: var(--qv-ink-soft); cursor: not-allowed; }
.qv-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }

.qv-panel-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.4rem 1.6rem 2.4rem;
}

/* sleepgreep — alleen zichtbaar in de bottom-sheet */
.qv-grip { display: none; }

/* ── inhoud van het paneel (voorbeeldopmaak, project overschrijft dit) ───── */

.qv-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; align-items: start; }
.qv-hero img { width: 100%; border-radius: var(--qv-radius); background: var(--qv-surface); }
.qv-title { font-size: 1.5rem; line-height: 1.15; margin: 0 0 .35rem; }
.qv-sub { color: var(--qv-ink-soft); margin: 0 0 1rem; line-height: 1.6; }
.qv-price { font-size: 1.25rem; font-variant-numeric: tabular-nums; margin: 0 0 1rem; }
.qv-cta {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 1.5rem; border-radius: 999px;
  background: var(--qv-ink); color: #fff;
  font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
  text-decoration: none; border: none; cursor: pointer;
  transition: background .25s;
}
.qv-cta:hover { background: var(--qv-accent); }
.qv-section { border-top: 1px solid var(--qv-line); margin-top: 1.6rem; padding-top: 1.2rem; }
.qv-section h3 { margin: 0 0 .5rem; font-size: .95rem; }
.qv-section p  { margin: 0; color: var(--qv-ink-soft); line-height: 1.7; }
.qv-full {
  display: inline-block; margin-top: 1.6rem;
  color: var(--qv-accent); font-size: .82rem;
}

/* ── skelet + fout ───────────────────────────────────────────────────────── */

.qv-skeleton { display: grid; gap: .8rem; }
.qv-skeleton span {
  display: block; height: 14px; border-radius: 6px;
  background: linear-gradient(90deg, var(--qv-surface) 0%, #eeeae4 50%, var(--qv-surface) 100%);
  background-size: 200% 100%;
  animation: qv-shimmer 1.2s linear infinite;
}
.qv-skeleton span:first-child { height: 190px; }
.qv-skeleton span:nth-child(2) { width: 55%; height: 22px; }
.qv-skeleton span:nth-child(4) { width: 80%; }
@keyframes qv-shimmer { to { background-position: -200% 0; } }

.qv-error { color: var(--qv-accent); line-height: 1.7; }
.qv-error button {
  margin-top: .8rem; padding: .5rem 1.1rem; cursor: pointer;
  border: 1px solid currentColor; border-radius: 999px; background: none; color: inherit;
}

/* ── scrim (alleen in de modale, mobiele tak) ────────────────────────────── */

.qv-scrim {
  position: fixed; inset: 0; z-index: 55;
  background: var(--qv-scrim);
  opacity: 0; visibility: hidden;
  transition: opacity var(--qv-dur) var(--qv-ease), visibility var(--qv-dur) step-end;
  display: none;
}
[data-qv-host][data-qv-open] .qv-scrim {
  opacity: 1; visibility: visible;
  transition: opacity var(--qv-dur) var(--qv-ease), visibility 0s;
}

/* scroll-lock; JS zet deze klasse alleen in de modale tak */
html.qv-locked, html.qv-locked body { overflow: hidden; }

/* ── mobiel: bottom-sheet ────────────────────────────────────────────────── */

@media (max-width: 899.98px) {
  .qv-scrim { display: block; }

  .qv-panel {
    top: auto; bottom: 0; left: 0; right: 0;
    width: 100%;
    height: min(90dvh, 100dvh - 2rem);
    border-left: none;
    border-top-left-radius: var(--qv-radius);
    border-top-right-radius: var(--qv-radius);
    box-shadow: var(--qv-shadow-sheet);
    transform: translateY(100%);
  }

  .qv-grip {
    display: block;
    flex: 0 0 auto;
    padding: .55rem 0 .1rem;
    cursor: grab;
    touch-action: none;   /* nodig: anders pikt de browser de sleep in als scroll */
  }
  .qv-grip::after {
    content: '';
    display: block;
    width: 42px; height: 4px;
    margin: 0 auto;
    border-radius: 999px;
    background: var(--qv-line);
  }

  .qv-hero { grid-template-columns: 1fr; }
  .qv-panel-body { padding: 1.1rem 1.2rem 2rem; }
}

/* ── toegankelijkheid ────────────────────────────────────────────────────── */

.qv-card:focus-visible,
.qv-panel :focus-visible {
  outline: 2px solid var(--qv-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.qv-sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .qv-panel, .qv-scrim, .qv-content, .qv-card { transition: none !important; }
  .qv-skeleton span { animation: none; }
}
