/* =========================================================
   Motiv — Quick View modal
   ========================================================= */

.motiv-qv {
  --qv-ink: #151515;
  --qv-accent: #d7ff3f;
  --qv-paper: #f6f5f0;
  --qv-border: rgba(0, 0, 0, .12);
  --qv-muted: rgba(0, 0, 0, .55);

  position: fixed;
  inset: 0;
  z-index: 900;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.motiv-qv.is-open {
  display: flex;
}

/* ---------- Overlay ---------- */
.motiv-qv__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .3s ease;
}

.motiv-qv.is-open .motiv-qv__overlay {
  opacity: 1;
}

/* ---------- Panel ---------- */
.motiv-qv__panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  max-width: 960px;
  max-height: 92vh;
  overflow: hidden;
  background: var(--qv-paper);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .3);

  opacity: 0;
  transform: translateY(20px) scale(.98);
  transition: opacity .35s ease, transform .45s cubic-bezier(.16, 1, .3, 1);
}

.motiv-qv.is-open .motiv-qv__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.motiv-qv__panel.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(246, 245, 240, .7);
  backdrop-filter: blur(2px);
}

.motiv-qv__panel.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 11;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 2px solid var(--qv-ink);
  border-inline-end-color: transparent;
  border-radius: 50%;
  animation: motivQvSpin .7s linear infinite;
}

@keyframes motivQvSpin {
  to { transform: rotate(360deg); }
}

/* ---------- Close button ---------- */
.motiv-qv__close {
  position: absolute;
  top: .75rem;
  inset-inline-end: .75rem;
  z-index: 20;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 0;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
  transition: background .2s, transform .2s;
}

.motiv-qv__close:hover {
  background: var(--qv-accent);
  transform: rotate(90deg);
}

/* ---------- Media ---------- */
.motiv-qv__media {
  position: relative;
  background: #e4e3dc;
  overflow: hidden;
}

.motiv-qv__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity .3s ease;
}

/* ---------- Body ---------- */
.motiv-qv__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .75rem;
  padding: 3rem 2.5rem;
  overflow-y: auto;
}

.motiv-qv__eyebrow {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--qv-muted);
}

.motiv-qv__title {
  margin: .25rem 0 0;
  font-family: "Manrope", system-ui, sans-serif;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.04em;
  color: var(--qv-ink);
}

.motiv-qv__price {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--qv-ink);
}
.motiv-qv__price del {
  color: var(--qv-muted);
  margin-inline-end: .5rem;
  font-weight: 400;
}
.motiv-qv__price ins {
  text-decoration: none;
  font-weight: 600;
}

.motiv-qv__desc {
  margin: .5rem 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--qv-muted);
}

/* ---------- Colors ---------- */
.motiv-qv__colors,
.motiv-qv__sizes {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--qv-border);
  margin-top: .5rem;
}

.motiv-qv__colors[hidden],
.motiv-qv__sizes[hidden] {
  display: none;
}

.motiv-qv__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--qv-ink);
}
.motiv-qv__label b {
  font-weight: 500;
  color: var(--qv-muted);
  text-transform: none;
  letter-spacing: 0;
  margin-inline-start: .25rem;
}

.motiv-qv__swatches {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}

.motiv-qv__swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .18);
  outline: 1px solid transparent;
  outline-offset: 4px;
  transition: outline-color .2s, transform .2s;
}
.motiv-qv__swatch:hover {
  transform: scale(1.08);
}
.motiv-qv__swatch.is-active {
  outline-color: var(--qv-ink);
}

/* ---------- Sizes ---------- */
.motiv-qv__size-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.motiv-qv__size {
  min-width: 48px;
  height: 44px;
  padding: 0 .85rem;
  background: transparent;
  border: 1px solid var(--qv-border);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--qv-ink);
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.motiv-qv__size:hover {
  border-color: var(--qv-ink);
}
.motiv-qv__size.is-active {
  background: var(--qv-ink);
  color: #fff;
  border-color: var(--qv-ink);
}

/* ---------- Actions ---------- */
.motiv-qv__actions {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-top: 1.25rem;
}

.motiv-qv__atc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  min-height: 54px;
  padding: 0 1.25rem;
  background: var(--qv-ink);
  color: #fff;
  border: 1px solid var(--qv-ink);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  cursor: pointer;
  transition: background .25s, color .25s, transform .25s;
}
.motiv-qv__atc:hover:not(:disabled) {
  background: var(--qv-accent);
  color: var(--qv-ink);
  border-color: var(--qv-accent);
  transform: translateY(-2px);
}
.motiv-qv__atc:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.motiv-qv__atc-arrow {
  font-size: 1em;
}

.motiv-qv__view-details {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--qv-ink);
  text-decoration: none;
  padding: .5rem;
  transition: color .2s;
}
.motiv-qv__view-details:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Body class lock ---------- */
body.motiv-qv-open {
  overflow: hidden;
}

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
  .motiv-qv {
    padding: 0;
    align-items: flex-end;
  }

  .motiv-qv__panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    max-width: 100%;
    max-height: 92vh;
    border-radius: 0;
  }

  .motiv-qv__media {
    aspect-ratio: 4 / 5;
    max-height: 40vh;
  }

  .motiv-qv__body {
    padding: 1.5rem;
  }

  .motiv-qv__title {
    font-size: 1.5rem;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .motiv-qv__panel,
  .motiv-qv__overlay,
  .motiv-qv__close,
  .motiv-qv__swatch,
  .motiv-qv__size,
  .motiv-qv__atc {
    transition: none !important;
    transform: none !important;
  }
  .motiv-qv__panel.is-loading::after {
    animation: none;
  }
}
/* Drawer presentation shared by native and legacy product cards. */
.motiv-qv { z-index: 100010; padding: 0; justify-content: flex-end; }
.motiv-qv__panel { display: flex; flex-direction: column; width: min(100%, 520px); height: 100vh; height: 100dvh; max-height: none; max-width: 520px; transform: translateX(var(--qv-enter-x, 100%)); }
.motiv-qv.is-open .motiv-qv__panel { transform: translateX(0); }
.motiv-qv__header { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; padding: 18px 28px; border-bottom: 1px solid var(--qv-border); font-size: 22px; letter-spacing: -.04em; }
.motiv-qv__close { position: static; width: 44px; height: 44px; background: transparent; border: 1px solid var(--qv-border); box-shadow: none; color: var(--qv-ink); }
.motiv-qv__scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding: 24px 28px 32px; }
.motiv-qv__media { width: 100%; height: auto; max-height: none; aspect-ratio: 4 / 5; background: #e8e7e0; }
.motiv-qv .motiv-qv__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.motiv-qv__body { display: flex; overflow: visible; padding: 24px 0 0; gap: 12px; }
.motiv-qv__title { font-size: clamp(28px, 3vw, 36px); letter-spacing: -.055em; }
.motiv-qv__price { font-weight: 400; }
.motiv-qv__desc { font-size: 14px; line-height: 1.75; }
.motiv-qv__colors, .motiv-qv__sizes { gap: 14px; padding-top: 20px; margin-top: 6px; }
.motiv-qv__swatches { gap: 16px; padding: 5px; }
.motiv-qv__swatch { width: 32px; height: 32px; }
.motiv-qv__size-buttons { display: grid; grid-template-columns: repeat(auto-fit,minmax(48px,1fr)); }
.motiv-qv__size { min-width: 0; padding: 0 8px; }
.motiv-qv__status { margin: 8px 0 0; color: var(--qv-muted); font-size: 13px; line-height: 1.6; }
.motiv-qv__actions { display: grid; grid-template-columns: 80px minmax(0,1fr); gap: 12px; align-items: end; margin-top: 0; }
.motiv-qv__quantity { display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: var(--qv-muted); }
.motiv-qv__quantity input { box-sizing: border-box; width: 100%; height: 54px; padding: 12px; background: transparent; border: 1px solid var(--qv-border); border-radius: 0; font: inherit; font-size: 14px; color: var(--qv-ink); }
.motiv-qv__quantity[hidden] + .motiv-qv__atc { grid-column: 1 / -1; }
.motiv-qv__view-details { grid-column: 1 / -1; min-height: 44px; text-decoration: underline; text-underline-offset: 4px; }
.motiv-qv [hidden] { display: none !important; }
.motiv-qv button:focus-visible, .motiv-qv a:focus-visible, .motiv-qv input:focus-visible { outline: 2px solid var(--qv-ink); outline-offset: 4px; }
.motiv-card-media { position: relative; }
.motiv-card-media .motiv-card-quick-view { position: absolute; z-index: 2; inset-inline: 16px; bottom: 16px; display: flex; align-items: center; justify-content: center; min-height: 44px; border: 0; background: var(--wp--preset--color--paper, #f6f5f0); color: var(--wp--preset--color--ink, #151515); font: inherit; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.motiv-card-media:hover .motiv-card-quick-view, .motiv-card-media:focus-within .motiv-card-quick-view { opacity: 1; transform: none; }
.motiv-card-media .motiv-card-quick-view:hover { background: var(--wp--preset--color--acid, #d7ff3f); }
.motiv-card-quick-view:focus-visible { outline: 2px solid var(--wp--preset--color--ink, #151515); outline-offset: 3px; }
@media (hover: none), (max-width: 767px) {
  .motiv-card-media .motiv-card-quick-view { opacity: 1; transform: none; inset-inline: 10px; bottom: 10px; }
}
@media (max-width: 599px) {
  .motiv-qv__header { padding: 12px 20px; }
  .motiv-qv__scroll { padding: 20px; }
  .motiv-qv__media { height: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .motiv-card-media .motiv-card-quick-view { transition: none; }
}

.motiv-card-quick-view { visibility: hidden; }
.motiv-quick-view-ready .motiv-card-quick-view { visibility: visible; }

/* Product gallery remains independent of the selected purchase options. */
.motiv-qv__thumbnails { display: flex; gap: 10px; overflow-x: auto; padding: 12px 3px 4px; scrollbar-width: thin; }
.motiv-qv__thumbnail { flex: 0 0 56px; width: 56px; padding: 2px; background: transparent; border: 1px solid transparent; cursor: pointer; }
.motiv-qv .motiv-qv__thumbnail img { display: block; width: 100%; height: 65px; object-fit: cover; }
.motiv-qv__thumbnail[aria-pressed="true"] { border-color: var(--qv-ink); }
.motiv-qv__thumbnail:hover { border-color: var(--qv-muted); }
.woocommerce-page .motiv-qv__actions .motiv-qv__quantity {
  margin-bottom: 0;
}
[dir="rtl"] .motiv-qv { --qv-enter-x: -100%; }
