/* ─────────────────────────────────────────────────────────────────────────────
   assets/quick_view.css
   Styles for the quick-view product modal + card trigger button.
───────────────────────────────────────────────────────────────────────────── */

/* ══ CARD TRIGGER ══════════════════════════════════════════════════════════ */

/* Wrapper fills its grid cell */
.product-card-wrap {
  display: block;
}

/* Ensure the card link fills the wrapper */
.product-card-wrap .fluid-resource-card {
  height: 100%;
}

/* Figure is the positioning context for the quick-view overlay */
.fluid-product-card__media {
  position: relative;
}


/* Not needed in horizontal list view */
[data-view="list"] .product-quick-view-btn {
  display: none !important;
}

/* ══ OVERLAY ══════════════════════════════════════════════════════════════ */

.qv-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;

  opacity: 0;
  visibility: hidden;
  pointer-events: none; /* allow clicks to pass through when closed */
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.qv-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto; /* capture clicks when open (backdrop, close) */
}

/* ══ MODAL ════════════════════════════════════════════════════════════════ */

.qv-modal {
  position: relative;
  background: var(--clr-white, #fff);
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: grid;
  grid-template-columns: 44% 56%;
  overflow: hidden;

  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.qv-overlay.is-open .qv-modal {
  transform: scale(1);
}

/* ══ CLOSE BUTTON ═════════════════════════════════════════════════════════ */

.qv-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--clr-gray-200, #e5e7eb);
  background: var(--clr-white, #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--clr-black-500);
  flex-shrink: 0;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.qv-close:hover {
  border-color: var(--clr-primary);
  background-color: var(--clr-gray-100, #f3f4f6);
  color:var(--clr-primary)
}

/* ══ LEFT: SLIDER PANEL ═══════════════════════════════════════════════════ */

.qv-media {
  position: relative;
  background: var(--clr-white, #fff);
  display: flex;
  align-items: stretch;
  min-height: 380px;
  overflow: hidden;
}

.qv-slider-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.qv-slider-wrapper .splide {
  flex: 1;
  height: 100%;
}

.qv-slider-wrapper .splide__track,
.qv-slider-wrapper .splide__list,
.qv-slider-wrapper .splide__slide {
  height: 100%;
}

.qv-slider-wrapper .splide__slide img {
  width: 100%;
  height: 100%;
  max-height: 480px;
  object-fit: contain;
  display: block;
}

/* ══ RIGHT: CONTENT BODY ══════════════════════════════════════════════════ */

.qv-body {
  padding: 2rem 1.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  /* Needs space for the close button which is absolute top-right */
  padding-top: 3rem;
}

/* Brand / vendor */
.qv-brand {
  font-size: 0.8125rem;
  color: var(--clr-black-500);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Product title */
.qv-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--clr-black);
  margin: 0;
}

/* Price row */
.qv-price-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.qv-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--clr-primary);
}

/* Description */
.qv-description {
  font-size: 0.875rem;
  color: var(--clr-black-500);
  line-height: 1.65;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Divider before purchase row */
.qv-divider {
  height: 1px;
  background: var(--clr-gray-200, #e5e7eb);
  margin: 0;
}

/* ══ PURCHASE ROW: block_quantity + block_add_to_cart ════════════════════ */

.qv-purchase-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end
}

/* block_add_to_cart renders with w-full; ensure it fills the column */
.qv-purchase-row .add-to-cart-btn {
  width: 100%;
}

/* ══ TERMS ════════════════════════════════════════════════════════════════ */

.qv-terms {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--clr-black-500);
  cursor: pointer;
  user-select: none;
}
.qv-terms-check {
  margin-top: 1px;
  flex-shrink: 0;
  accent-color: var(--clr-primary);
  cursor: pointer;
}
.qv-terms-link {
  color: var(--clr-black);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.qv-terms-link:hover {
  color: var(--clr-primary);
}

/* ══ BODY SCROLL LOCK ═════════════════════════════════════════════════════ */

body.qv-body-lock {
  overflow: hidden;
}

/* ══ RESPONSIVE ═══════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .qv-modal {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    max-height: 95vh;
  }
  .qv-media {
    min-height: 220px;
  }
  .qv-body {
    padding: 1.25rem;
    padding-top: 2.75rem;
  }
  .qv-title {
    font-size: 1.25rem;
  }
}
