/* ═══════════════════════════════════════════════════════════════════════════
   PRODUCT QUICK-VIEW MODAL (W-132) — styles

   Scoped to .hzo-quick-view*. The OVERLAY chrome (backdrop, panel, open/close
   motion, scroll-lock, z-index) is inherited from components/modal (.hzo-modal /
   .hzo-modal__dialog) — this sheet only styles the trigger affordance and the
   quick-view BODY (gallery, details, skeleton, error). Tokens only: no bare hex,
   no bare z-index, no bare ms/ease. z-index comes entirely from the modal layer
   (--z-modal). Reduced-motion stops the skeleton shimmer (PRESERVE-5: the
   aria-busy state + hzo.announce carry "loading", so no motion is required).
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Trigger affordance (composes on .hzo-btn) ─────────────────────────────── */
.hzo-quick-view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
}
.hzo-quick-view__icon {
    width: 1.15em;
    height: 1.15em;
    flex-shrink: 0;
}
/* Compact card-corner variant: icon only, but keeps a real accessible name. */
.hzo-quick-view--icon-only {
    gap: 0;
    min-width: 44px;
    min-height: 44px;
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
}
.hzo-quick-view__sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Quick-view dialog sizing (wider than the base modal for two columns) ──── */
.hzo-quick-view__dialog {
    width: 100%;
    max-width: 860px;
}
.hzo-quick-view__header {
    /* No title row — the close button sits top-right over the body. Keep it in
       the flow but let the grid start at the top. */
    padding-bottom: 0;
    justify-content: flex-end;
    min-height: 0;
}
.hzo-quick-view__body {
    padding-top: var(--space-sm);
}

/* ── Layout grid ───────────────────────────────────────────────────────────── */
.hzo-quick-view__grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: var(--space-lg);
    align-items: start;
}

/* ── Gallery ───────────────────────────────────────────────────────────────── */
.hzo-quick-view__stage {
    border-radius: var(--radius-card);
    overflow: hidden;
    background: var(--bg-alt);
}
.hzo-quick-view__main-wrap { display: block; }
.hzo-quick-view__main,
.hzo-quick-view__main-wrap img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}
.hzo-quick-view__thumbs {
    list-style: none;
    margin: var(--space-sm) 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}
.hzo-quick-view__thumb-item { margin: 0; }
.hzo-quick-view__thumb {
    display: block;
    width: 56px;
    height: 56px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: var(--radius-input);
    background: var(--bg-alt);
    cursor: pointer;
    overflow: hidden;
    transition: border-color var(--dur-2) var(--ease-standard);
}
.hzo-quick-view__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hzo-quick-view__thumb:hover { border-color: var(--text-muted); }
.hzo-quick-view__thumb.is-active { border-color: var(--brand); }
.hzo-quick-view__thumb:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

/* ── Details column ────────────────────────────────────────────────────────── */
.hzo-quick-view__details {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}
.hzo-quick-view__title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 24px;
    line-height: 1.25;
    color: var(--text-heading);
}
.hzo-quick-view__title:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
    border-radius: var(--radius-input);
}
.hzo-quick-view__rating { display: inline-flex; }
.hzo-quick-view__price {
    font-family: var(--font-number, var(--font-heading));
    font-size: 22px;
    font-weight: 700;
    color: var(--text-heading);
}
.hzo-quick-view__price del { color: var(--text-muted); font-weight: 400; margin-right: var(--space-xs); }
.hzo-quick-view__price ins { text-decoration: none; }
.hzo-quick-view__desc {
    color: var(--text-body);
    line-height: 1.6;
}
.hzo-quick-view__desc > :first-child { margin-top: 0; }
.hzo-quick-view__desc > :last-child { margin-bottom: 0; }

/* ── Buy row (qty + engine ATC button) ─────────────────────────────────────── */
.hzo-quick-view__buy {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-xs);
}
.hzo-quick-view__buy--link { display: block; }
.hzo-quick-view__add { flex: 1 1 auto; }

.hzo-quick-view__full {
    margin-top: var(--space-xs);
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
    align-self: flex-start;
}
.hzo-quick-view__full:hover { color: var(--brand); }

/* ── Loading skeleton (§2 async-gap; REDUCED-MOTION-SLOWS-STATUS / G47) ─────── */
.hzo-qv-skel {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-input);
    background: var(--bg-alt);
}
.hzo-qv-skel::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent 0, var(--surface) 50%, transparent 100%);
    opacity: 0.55;
    animation: hzo-qv-shimmer calc(var(--dur-4) * 3) var(--ease-standard) infinite;
}
.hzo-qv-skel--stage { aspect-ratio: 1 / 1; border-radius: var(--radius-card); }
.hzo-qv-skel--title { height: 28px; width: 80%; }
.hzo-qv-skel--price { height: 24px; width: 40%; }
.hzo-qv-skel--line  { height: 14px; width: 100%; }
.hzo-qv-skel--short { width: 60%; }
.hzo-qv-skel--buy   { height: 48px; width: 100%; margin-top: var(--space-sm); }

@keyframes hzo-qv-shimmer {
    to { transform: translateX(100%); }
}

/* ── Error state (§1 error / §2 fail — names failure + recovery) ───────────── */
.hzo-quick-view__error {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    align-items: flex-start;
    padding: var(--space-lg) 0;
}
.hzo-quick-view__error-title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 20px;
    color: var(--text-heading);
}
.hzo-quick-view__error-text { margin: 0; color: var(--text-body); }
.hzo-quick-view__error-actions { display: flex; gap: var(--space-sm); }

/* ── Phone: single column, dialog docks as a bottom sheet (modal.css) ──────── */
@media (max-width: 640px) {
    .hzo-quick-view__grid { grid-template-columns: 1fr; }
    .hzo-quick-view__stage { max-width: 320px; margin-inline: auto; }
}

/* ── Reduced motion: freeze the shimmer to a static placeholder (no busy
     freeze — the aria-busy state + hzo.announce carry "loading"). ──────────── */
@media (prefers-reduced-motion: reduce) {
    .hzo-qv-skel::after { animation: none; }
    .hzo-quick-view__thumb { transition: none; }
}

/* ── Forced colors / High Contrast (§12.2): skeleton + active thumb readable
     without relying on tinted backgrounds. ─────────────────────────────────── */
@media (forced-colors: active) {
    .hzo-qv-skel { border: 1px solid CanvasText; background: Canvas; }
    .hzo-qv-skel::after { animation: none; background: none; }
    .hzo-quick-view__thumb.is-active { border-color: Highlight; }
}
