/**
 * Harvest — Quick View modal (T13).
 *
 * Styles ONLY the content Harvest injects into the native `Magento_Ui/js/modal/modal`
 * widget (the widget owns the overlay, close button, focus-trap, ESC and its own
 * z-index — we do not restyle its scrim/positioning). Everything here is scoped
 * under the `.hrv-quickview-modal` modalClass passed to the widget, plus the
 * `.hrv-quickview` content root, so it cannot bleed onto any other modal (minicart,
 * auth, etc.).
 *
 * Token-only: every value is a --hrv-* custom property, so all 5 palettes + dark
 * Midnight work with no rebuild. No hardcoded hex.
 *
 * Responsive: two-column media|info from 768px up; single column below. The widget
 * caps its own width; here we keep the body usable and scrollable at 375/768/1440
 * with no horizontal overflow.
 */

/* Widget dialog surface (the widget renders .modal-inner-wrap inside .modal-popup). */
.hrv-quickview-modal .modal-inner-wrap {
  background: var(--hrv-surface);
  border-radius: var(--hrv-radius);
  max-width: 860px;
  margin: auto;
}
.hrv-quickview-modal .modal-header {
  padding: 18px 20px 8px;
}
.hrv-quickview-modal .modal-header .modal-title {
  font-family: var(--hrv-font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--hrv-text);
  border: 0;
}
.hrv-quickview-modal .modal-content {
  padding: 8px 20px 22px;
}

/* Recolour the widget's own close (X) button to the palette. */
.hrv-quickview-modal .action-close {
  color: var(--hrv-text-muted);
}
.hrv-quickview-modal .action-close:hover,
.hrv-quickview-modal .action-close:focus-visible {
  color: var(--hrv-accent);
}

/* ---------- Content layout ---------- */
.hrv-quickview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.hrv-quickview__media {
  border-radius: var(--hrv-radius-md);
  overflow: hidden;
  background: color-mix(in oklab, var(--hrv-text) 5%, var(--hrv-surface));
  aspect-ratio: 1 / 1;
}
.hrv-quickview__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hrv-quickview__media-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--hrv-text-subtle);
  font-size: 13px;
}

.hrv-quickview__info {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hrv-quickview__name {
  margin: 0;
  font-family: var(--hrv-font-display);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.25;
}
.hrv-quickview__name-link {
  color: var(--hrv-text);
  text-decoration: none;
}
.hrv-quickview__name-link:hover {
  color: var(--hrv-accent);
}

/* Price — inherit the card's price-box typography (cloned markup carries
   .price-box / .price, already themed by _product-card.css). Just sizes it up. */
.hrv-quickview__price .price-box .price {
  font-size: 22px;
}

.hrv-quickview__atc {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 4px 0 0;
}
.hrv-quickview__atc-btn {
  min-width: 180px;
}

.hrv-quickview__view {
  font-weight: 600;
  font-size: 13px;
  color: var(--hrv-accent);
  text-decoration: none;
}
.hrv-quickview__view:hover {
  color: var(--hrv-accent-hover);
  text-decoration: underline;
}

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
  .hrv-quickview {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .hrv-quickview__media {
    max-width: 320px;
    margin: 0 auto;
  }
  .hrv-quickview__name { font-size: 19px; }
  .hrv-quickview__atc-btn { min-width: 0; flex: 1 1 100%; }
}

/* ---- T13: constrain the modal image ---------------------------------------------------- */
/*
 * FOUND BY LOOKING, NOT BY MEASURING. Every numeric check passed — modal opens, real title,
 * real price, real image src, correct PDP link — and the screenshot showed the product photo
 * filling almost the entire dialog, pushing the title and price to the very bottom of a
 * ~950px-tall popup. The stylesheet never constrained .hrv-quickview-image because that
 * element had never existed until now.
 *
 * max-height in vh so the dialog fits the viewport rather than a fixed pixel guess.
 */
.hrv-quickview-modal .hrv-quickview-image {
    display: block;
    width: 100%;
    max-height: 42vh;
    object-fit: contain;
    margin: 0 auto 18px;
}

.hrv-quickview-modal .hrv-quickview-title {
    margin: 0 0 6px;
    font-family: var(--hrv-font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--hrv-text);
}

.hrv-quickview-modal .hrv-quickview-full {
    display: inline-block;
    margin: 10px 0 0;
    font-weight: 700;
    color: var(--hrv-accent);
}
