/**
 * Quick-view modal (snippets/cart-drawer.liquid <quick-view-modal>) and the
 * fetched product content it hosts (sections/quick-view-card.liquid).
 * Loaded from both files (see each file's own comment on why) - identical
 * <link> tags are harmless, the browser dedupes the request.
 */
/* Scroll lock: `html.overlay-open` in base.css, shared with every other
   overlay. It matters here that the lock is stack-aware - this modal opens
   on top of an already-locked cart drawer. See ThemeOverlay.lockScroll. */
.quick-view-modal {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(880px, calc(100vw - var(--space-6) * 2));
  max-width: 100%;
  /* dvh so the panel is bounded by the screen actually visible on a phone,
     not by the taller viewport vh assumes once the toolbars retract. */
  max-height: min(680px, calc(100vh - var(--space-6) * 2));
  max-height: min(680px, calc(100dvh - var(--space-6) * 2));
  padding: 0;
  border: none;
  border-radius: var(--radius-m);
  background-color: var(--color-bg);
  color: var(--color-ink);
}

.quick-view-modal::backdrop {
  background-color: rgb(0 0 0 / 40%);
}

.quick-view-modal[open] {
  display: flex;
}

/* This modal used to appear and vanish on a single frame while the cart
   drawer it opens over glided in and out. Same shape as .cart-drawer's:
   the closed "from" state is scoped to [open]:not(.is-visible) so
   assets/overlay-motion.js can commit it as a real painted style, then
   animate away from it - @starting-style provably never applies to these
   dialogs (that file explains the measurement). Timings are the shared
   --motion-overlay tokens, so all four overlays move as one. */
@media (prefers-reduced-motion: no-preference) {
  .quick-view-modal {
    transition: opacity var(--motion-overlay) var(--motion-overlay-ease), transform var(--motion-overlay)
        var(--motion-overlay-ease);
  }

  .quick-view-modal[open]:not(.is-visible) {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

  .quick-view-modal::backdrop {
    opacity: 0;
    transition: opacity var(--motion-scrim) ease;
  }

  .quick-view-modal[open].is-visible::backdrop {
    opacity: 1;
  }
}

/* Box, border, backplate and hover all come from [data-icon-close]
   (assets/base.css) - only the placement is this component's business. */
.quick-view-modal__close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 1;
}

.quick-view-modal__content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.quick-view-modal__content.is-loading {
  min-height: 320px;
}

/* ------------------------------------------------------------------ */
/* Fetched content (sections/quick-view-card.liquid)                   */
/* ------------------------------------------------------------------ */
.quick-view {
  display: flex;
  flex-direction: column;
}

@media screen and (min-width: 750px) {
  .quick-view {
    flex-direction: row;
  }
}

.quick-view__media {
  position: relative;
  flex: 0 0 auto;
  background-color: color-mix(in srgb, var(--color-ink) 4%, transparent);
}

@media screen and (min-width: 750px) {
  .quick-view__media {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

.quick-view__images {
  position: relative;
  aspect-ratio: 1 / 1;
}

.quick-view__image-slide {
  display: none;
  width: 100%;
  height: 100%;
}

.quick-view__image-slide.is-active {
  display: block;
}

.quick-view__image-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quick-view__placeholder-svg {
  width: 100%;
  height: 100%;
}

.quick-view__dots {
  position: absolute;
  inset-inline: 0;
  bottom: var(--space-4);
  display: flex;
  justify-content: center;
  gap: var(--space-2);
}

.quick-view__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-bg);
  opacity: 0.5;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.quick-view__dot.is-active {
  opacity: 1;
  transform: scale(1.4);
}

.quick-view__info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
}

@media screen and (min-width: 750px) {
  .quick-view__info {
    padding: var(--space-7) var(--space-6);
  }
}

.quick-view__title {
  margin: 0;
  padding-right: var(--space-6);
}

.quick-view__full-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 13px;
  color: var(--color-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.quick-view__full-link:hover {
  color: var(--color-ink);
}

