/* ==========================================================================
   Component: quick-view  →  snippets/quick-view.liquid + assets/component-quick-view.css
   Figma 1359-2537: a 1114×605 dialog centred over the page — 520px image panel (#f4f4f4), 2px gap,
   592px white panel with the shared product form (assets/css/components/product-info.css) 64px in
   and 63.5px down, "VIEW DETAILS" 64px below it. Backdrop: 50% #080808 with a 10px blur.
   One native <dialog> for the whole theme; its content is cloned from a product <template>
   (assets/js/components/quick-view.js). The close button is an addition: Figma draws none.
   ========================================================================== */
html.has-quick-view {
  overflow: hidden;
}

.quick-view {
  width: min(1114px, 100% - 2 * var(--page-gutter));
  max-width: none;
  max-height: calc(100svh - 32px);
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  color: var(--color-text-primary);
  opacity: 0;
  transform: translateY(8px) scale(0.985);
  transition: opacity 250ms ease, transform 300ms var(--ease-out), overlay 300ms allow-discrete,
    display 300ms allow-discrete;
}

.quick-view[open] {
  opacity: 1;
  transform: none;
}

@starting-style {
  .quick-view[open] {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
}

.quick-view::backdrop {
  background: rgba(8, 8, 8, 0);
  backdrop-filter: blur(0);
  transition: background-color 300ms ease, backdrop-filter 300ms ease, overlay 300ms allow-discrete,
    display 300ms allow-discrete;
}

.quick-view[open]::backdrop {
  background: rgba(8, 8, 8, 0.5);
  backdrop-filter: blur(10px);
}

@starting-style {
  .quick-view[open]::backdrop {
    background: rgba(8, 8, 8, 0);
    backdrop-filter: blur(0);
  }
}

.quick-view__panel {
  display: grid;
  grid-template-columns: minmax(0, 520fr) minmax(0, 592fr);
  gap: 2px;
  height: min(605px, 100svh - 32px);
}

/* Image panel — cover crop (the hero model) or a placed cut-out (the product-card model) */
.quick-view__media {
  position: relative;
  overflow: hidden;
  background: #f4f4f4;
}

.quick-view__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focal-x, 50%) var(--focal-y, 50%);
  transform: scale(var(--zoom, 1));
  transform-origin: var(--focal-x, 50%) var(--focal-y, 50%);
}

.quick-view__image--cutout {
  inset: auto;
  top: var(--img-y, 0);
  left: var(--img-x, 0);
  width: var(--img-w, 100%);
  max-width: none;
  height: var(--img-h, 100%);
  transform: none;
  filter: var(--img-shadow, none);
}

/* Form panel — Figma's content sits 63.5px down; the column scrolls if a small window cuts it */
.quick-view__info {
  display: flex;
  flex-direction: column;
  gap: 64px;
  padding: 63.5px 64px 40px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--color-white);
}

/* This instance: the badge has no stroke on the white panel, the review count is #3b3b3b */
.quick-view__info .badge {
  box-shadow: none;
}

.quick-view__info .product-info__reviews {
  color: var(--color-border-secondary);
}

.quick-view__close {
  position: absolute;
  z-index: 1;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--color-icon-primary);
  cursor: pointer;
  transition: background-color var(--duration-fast) ease;
}

.quick-view__close:hover {
  background: var(--color-surface-tertiary);
}

.quick-view__close:focus-visible {
  outline: 2px solid var(--color-black);
  outline-offset: 2px;
}

@media (max-width: 989px) {
  .quick-view__info {
    padding: 48px 40px 32px;
  }
}

/* Phones: one column, image on top; the panel scrolls so the close button stays put */
@media (max-width: 749px) {
  .quick-view {
    width: calc(100% - 24px);
    max-height: calc(100svh - 24px);
  }

  .quick-view__panel {
    display: block;
    height: auto;
    max-height: calc(100svh - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .quick-view__close {
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.88);
  }

  .quick-view__media {
    aspect-ratio: 520 / 605;
    max-height: 56svh;
    width: 100%;
  }

  .quick-view__info {
    gap: 40px;
    padding: 32px 20px;
    overflow: visible;
  }
}

@media (prefers-reduced-motion: reduce) {
  .quick-view,
  .quick-view::backdrop {
    transition: none;
  }
}
