#product-quickview-modal[open] + .product-quickview-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 2001;
  display: block;
  opacity: 1;
  transition: opacity var(--duration-default) ease, visibility 0s;
}
#product-quickview-modal[open] + .product-quickview-modal-backdrop::after {
  content: ' ';
  display: block;
}
#product-quickview-modal{
  display: none;
}
#product-quickview-modal[open]{
  /* Space-separated, like every colour variable in this theme: reference.css and
     transplant.css read them as rgb(var(--color-foreground) / 10%). The base's comma
     triplets (0,0,0) made each such declaration invalid inside the modal, silently —
     the quantity stepper lost its border that way. */
  --color-foreground: 0 0 0;
  --color-background: 248 249 250;
  display: block;
  transform: translate(-50%, -50%);
  transition: transform var(--duration-default) ease, visibility 0s;
  z-index: 10000;
  background-color: #F8F9FA;
  position: fixed;
  top: 45%;
  left: 50%;
  width: 100%;
  max-width: 950px;
  color: #000;
  text-align: left;
  min-height: 500px;
}

.product-quickview {
  display: flex;
  flex-direction: row;
}
.product-quickview .product-quickview__img-wrapper{
  width: 100%;
  max-width: 500px;
  background: rgba(0, 0, 0, 0.05);
}
.product-quickview .product-quickview__img-wrapper img{
  display: block;
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: contain;
  object-position: center;
}
.product-quickview .product-quickview__content-wrapper{
  padding: 30px 30px 0;
  max-width: 450px;
  max-height: 500px;
  overflow-y: auto;
  flex: 1 1 auto;
}
.product-quickview-modal-wrapper .product-quickview-modal__close{
  position: absolute;
  top: 10px;
  right: 10px;
  width: 35px;
  height: 35px;
  background-color: transparent;
  border: none;
  cursor: pointer;
  background-color: #F8F9FA;
  border-radius: 50%;
}
.quickview-sticky-actions{
  position: sticky;
  left: 0;
  bottom: 0;
  width: 100%;
  padding: 0 0 20px;
  background: #F8F9FA;
  box-shadow: 0 0 30px 25px #F8F9FA;
}
.quickview-sticky-actions .button{
  position: relative;
  margin: 0;
}

.product-quickview h2{
  margin: 0.5em 0 0.7em;
}
.product-quickview .quickview-title:not(:hover){
  text-decoration: none;
}
.product-quickview #price{
  margin-bottom: 0.6em;
}
.product-quickview .product-form{
  margin-top: 1em;
}

.product-quickview-modal-wrapper .loading-overlay{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.product-quickview-modal-wrapper .loading-overlay__spinner{
  width: 4rem;
}

/* Promotion label */
.quickview_promo-promo-label{
  position: relative;
  cursor: pointer;
  display: inline-block;
  margin-right: 5px;
  margin-top: 5px;
  border: 1px solid;
  font-size: 0.7em;
  padding: 5px 10px;
  font-weight: 400;
  line-height: 1.3;
  border-radius: 2px;
  max-width: 100%;
  text-decoration: none;
}

.quickview_promo-promo-label:before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: currentColor;
  z-index: 1;
  opacity: 0.05;
  top: 0;
  left: 0;
  border-radius: 2px;
}

.quickview_promo-promo-label.quickview_promo-label-unclickable{
  border: 1px dashed;
}

.quickview_promo-promo-label.quickview_promo-label-clickable{
  padding-right: 2.6em;
}

.quickview_promo-promo-label .quickview_promo-svg-icon{
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translate(0,-50%);
  -webkit-transform: translate(0,-50%);
  width: 1.4em;
  height: 1.4em;
  fill: none;
}

@media screen and (max-width: 998px) {
  #product-quickview-modal[open]{
    min-height: 80dvh;
  }
  .product-quickview {
    flex-direction: column;
    overflow-y: auto;
    max-width: 100%;
    height: 80dvh;
  }
  #product-quickview-modal[open]{
    transform: translate(0%, 0%);
    top: initial;
    bottom: 0;
    left: 0;
    width: 100%;
  }
  .product-quickview .product-quickview__img-wrapper{
    max-width: 100%;
  }
  .product-quickview .product-quickview__img-wrapper img{
    max-height: 300px;
  }
  .product-quickview .product-quickview__content-wrapper {
    max-width: 100%;
    max-height: none;
    overflow-y: visible;
  }
}

/* ---------------------------------------------------------------------------
   Theme addition: open/close motion + a deliberate loading state.
   The shell toggles [open] (display:none -> block), which a transition can
   never animate, so the modal used to pop in as an empty 950x500 box with a
   small spinner and the content then jumped in. Keyframe animations DO run on
   first render, so: backdrop fades, the modal pops in, the loading box is a
   compact centred spinner, and the fetched content fades up when it lands.
   --------------------------------------------------------------------------- */
@keyframes qv-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes qv-pop-in {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.96); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes qv-pop-out {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  to   { opacity: 0; transform: translate(-50%, -47%) scale(0.98); }
}
@keyframes qv-content-in {
  from { opacity: 0; transform: translateY(0.6rem); }
  to   { opacity: 1; transform: none; }
}
#product-quickview-modal[open] + .product-quickview-modal-backdrop {
  animation: qv-backdrop-in 0.25s ease both;
}
#product-quickview-modal[open] {
  min-height: 0;
  border-radius: 2rem;
  overflow: hidden;
  box-shadow: 0 2.4rem 6rem rgb(0 0 0 / 0.25);
  animation: qv-pop-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
#product-quickview-modal[open].is-loading {
  min-height: 32rem;
}
#product-quickview-modal[open].is-closing {
  animation: qv-pop-out 0.2s ease both;
}
#product-quickview-modal[open].is-closing + .product-quickview-modal-backdrop {
  animation: qv-backdrop-in 0.2s ease reverse both;
}
#product-quickview-modal .loading-overlay {
  position: absolute;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  width: auto;
  height: auto;
  transform: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
#product-quickview-modal .loading-overlay.hidden {
  display: none;
}
#product-quickview-modal .loading-overlay__spinner {
  width: 4.8rem;
}
#product-quickview-modal .product-quickview-modal__body {
  animation: qv-content-in 0.28s ease both;
}
@media (prefers-reduced-motion: reduce) {
  #product-quickview-modal[open],
  #product-quickview-modal[open].is-closing,
  #product-quickview-modal[open] + .product-quickview-modal-backdrop,
  #product-quickview-modal .product-quickview-modal__body {
    animation: none;
  }
}

/* Phones: the desktop two-column box does not fit; present the modal as a bottom
   sheet that scrolls inside itself (the desktop rules clip overflow, which left the
   add-to-cart button unreachable below the fold). */
@keyframes qv-sheet-in {
  from { opacity: 0; transform: translateY(6%); }
  to   { opacity: 1; transform: none; }
}
@keyframes qv-sheet-out {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(6%); }
}
@media (max-width: 749px) {
  #product-quickview-modal[open] {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    max-height: 92dvh;
    transform: none;
    border-radius: 2rem 2rem 0 0;
    display: flex;
    flex-direction: column;
    animation: qv-sheet-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  #product-quickview-modal[open].is-closing {
    animation: qv-sheet-out 0.2s ease both;
  }
  #product-quickview-modal .product-quickview-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .product-quickview {
    flex-direction: column;
  }
  .product-quickview .product-quickview__img-wrapper {
    max-width: none;
  }
  .product-quickview .product-quickview__img-wrapper img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }
  .product-quickview .product-quickview__content-wrapper {
    max-width: none;
    max-height: none;
    overflow: visible;
    padding: 2rem 2rem 0;
  }
  .product-quickview-modal-wrapper .product-quickview-modal__close {
    top: 1.2rem;
    right: 1.2rem;
    z-index: 3;
  }
  @media (prefers-reduced-motion: reduce) {
    #product-quickview-modal[open],
    #product-quickview-modal[open].is-closing {
      animation: none;
    }
  }
}

/* ---------------------------------------------------------------------------
   Theme addition: the struck compare-at price keeps its tint.
   component-price.css (base copy) writes it as rgba(var(--color-foreground), 0.75)
   — the comma syntax, which resolved only while this modal declared its colours
   as comma triplets. snippets/price is rendered here and nowhere else, so the same
   tint is said here, in this theme's syntax.
   --------------------------------------------------------------------------- */
.product-quickview .price--on-sale .price-item--regular {
  color: rgb(var(--color-foreground) / 75%);
}

/* ---------------------------------------------------------------------------
   Theme addition: the close button stays on top at every width.
   The product content fades in with an animation, which makes it a stacking
   context — later in the DOM than the button, so it painted over it: a click on
   the X landed on the content and the quick view stayed open. Only the phone
   rule above lifted the button.
   --------------------------------------------------------------------------- */
.product-quickview-modal-wrapper .product-quickview-modal__close {
  z-index: 3;
}
