/* Dana quick view: the template's #quickView (.modal-quick-view, styles.css
 * 5870-5977, 18800-18816; chrome.md 2.4.5). components/quick-view.jinja keeps
 * the dialog in a <template>; assets/quick-view.js clones it onto <body>, so
 * every rule targets that live <dialog data-dana-qv>.
 *
 * Measured on index.html with the modal open (2026-09-29): from 768 a
 * 1100px box (1130 with the dialog's 15px sides; the window less 30px under
 * that), 16px corners, the picture column 43.4% wide and as tall as its
 * picture up to 650px, the details beside it scrolling inside 32px of
 * padding; the close X 16px in a 46px box 5px from the corner. Name 24/29 at
 * 500 (22 under 1200, 20 under 768), 14px over the price; the price 24/29 in
 * the accent with the old one at 60% struck, 6px apart, and the badge 14/20
 * with 5px 10px on the accent; the text 14/22.4; each option's label 16/19.2
 * at 700, 12px over its buttons (48px rounds with a 1px line, 34px colour
 * rounds), options 20px apart and 34px over the buy row (30 on phones); the
 * quantity a 126 x 48 pill on #f1f1f1 (42px tall under 992), the add button
 * filling the rest 12px away, «Buy now» the accent across 17px under it;
 * «View full details» 14/16.8 at 500, 32px under. Under 768 the picture
 * stands on top, the details under it with 15px padding, and the whole box
 * scrolls. Colours, corners and type are Dana's tokens; one sheet for both
 * directions (logical properties).
 */
.dana-qv, .dana-qv *, .dana-qv *::before, .dana-qv *::after { box-sizing: border-box; }
/* The page behind stays where it is while the dialog is open. */
html.dana-qv-open { overflow: hidden; }

.dana-qv {
  --dana-qv-h: min(650px, calc(100dvh - 60px));
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 0;
  border: 0;
  inline-size: min(1100px, calc(100vw - 30px));
  max-inline-size: none;
  block-size: fit-content;
  max-block-size: calc(100dvh - 60px);
  border-radius: var(--dana-radius-card);
  background-color: var(--dana-bg);
  color: var(--dana-text);
  font-family: var(--dana-font-body);
  font-size: 14px;
  line-height: 20px;
  overflow: hidden;
  z-index: 3000;
}
/* display only while open: a class that sets display beats the browser's
   hidden state of a closed <dialog> (runbook C4). */
.dana-qv[open] { display: block; animation: dana-qv-in .3s ease-out; }
.dana-qv::backdrop { background: rgb(0 0 0 / .4); }
.dana-qv[open]::backdrop { animation: dana-qv-fade .3s ease; }
@keyframes dana-qv-in { from { opacity: 0; transform: translateY(24px); } }
@keyframes dana-qv-fade { from { opacity: 0; } }
.dana-qv :is(a, button, input, [tabindex]):is(:focus, :focus-visible) { outline: none; }

.dana-qv__panel { position: relative; display: flex; align-items: stretch; max-block-size: calc(100dvh - 60px); }

/* The close X (.icon-close-popup): 16px in a 46px box 5px from the corner,
   the accent on hover. */
.dana-qv__close {
  position: absolute;
  z-index: 10;
  inset-block-start: 5px;
  inset-inline-end: 5px;
  display: grid;
  place-items: center;
  inline-size: 46px;
  block-size: 46px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dana-heading);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: color .3s ease-in-out, transform .3s ease-in-out;
}
.dana-qv__close .di { display: flex; inline-size: 1em; block-size: 1em; }
.dana-qv__close:hover, .dana-qv__close:focus-visible { color: var(--dana-accent-ink); transform: rotate(90deg); }

/* ---- Pictures (.tf-product-media-wrap): a one-picture Swiper with the
   template's arrows 10px in from the sides. ------------------------------- */
.dana-qv__media { position: relative; flex: 0 0 43.4%; min-inline-size: 0; align-self: flex-start; background-color: var(--dana-surface); }
.dana-qv__swiper { inline-size: 100%; aspect-ratio: var(--dana-card-ratio, 0.7037); max-block-size: var(--dana-qv-h); }
.dana-qv__swiper .swiper-wrapper, .dana-qv__swiper .swiper-slide { block-size: 100%; }
.dana-qv__swiper img { display: block; inline-size: 100%; block-size: 100%; object-fit: var(--dana-card-fit, cover); padding: var(--dana-card-pad, 0px); }
.dana-qv__nav { position: absolute; z-index: 3; inset-block-start: 50%; margin-block-start: -22px; }
.dana-qv__nav--prev { inset-inline-start: 10px; }
.dana-qv__nav--next { inset-inline-end: 10px; }
.dana-qv__media:not(.has-many) .dana-qv__nav { display: none; }
/* The template's .arrow-1: the long arrow in the round, pointing the way it
   moves (in Arabic «previous» sits on the right and points right). */
.dana-qv .dana-qv__nav::after { content: "\e904"; }
.dana-qv .dana-qv__nav--prev::after { transform: scaleX(-1); }
[dir="rtl"] .dana-qv .dana-qv__nav--prev::after { transform: none; }
[dir="rtl"] .dana-qv .dana-qv__nav--next::after { transform: scaleX(-1); }

/* ---- Details (.tf-product-info-wrap) ------------------------------------- */
.dana-qv__info { position: relative; flex: 1 1 0; min-inline-size: 0; }
.dana-qv__inner {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 32px;
  scrollbar-width: thin;
  scrollbar-color: var(--dana-accent) var(--dana-line);
}
.dana-qv__inner::-webkit-scrollbar { inline-size: 6px; }
.dana-qv__inner::-webkit-scrollbar-thumb { background: var(--dana-accent); }
.dana-qv__inner::-webkit-scrollbar-track { background: var(--dana-line); }
.dana-qv__inner > * { margin: 0; }
.dana-qv__heading { display: grid; gap: 12px; margin-block-end: 20px; padding-inline-end: 24px; }
.dana-qv__heading > * { margin: 0; }
.dana-qv__name { margin-block-end: 14px; font-family: var(--dana-font-heading); font-size: 24px; line-height: 29px; font-weight: 500; color: var(--dana-heading); overflow-wrap: anywhere; }
.dana-qv__name a { color: inherit; text-decoration: none; transition: color .3s ease-in-out; }
.dana-qv__name a:hover, .dana-qv__name a:focus-visible { color: var(--dana-accent-ink); }
.dana-qv__price { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-block-end: 14px; font-size: 24px; line-height: 29px; font-weight: 500; }
.dana-qv__now { color: var(--dana-accent-ink); unicode-bidi: isolate; }
.dana-qv__price.is-sale .dana-qv__now { color: var(--dana-sale-ink); }
.dana-qv__old { color: var(--dana-price-old); text-decoration: line-through; text-decoration-thickness: 1px; unicode-bidi: isolate; }
.dana-qv__badge { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: var(--dana-radius-badge); background-color: var(--dana-badge-bg); color: var(--dana-badge-text); font-size: 14px; line-height: 20px; font-weight: 400; unicode-bidi: isolate; }
.dana-qv__badge--out { background-color: var(--dana-heading); color: var(--dana-bg); }
/* The short description keeps the merchant's lines (quick-view.js writes a
   line break for each paragraph, <br> or list item). */
.dana-qv__text { font-size: 14px; line-height: 22.4px; color: var(--dana-text); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.dana-qv__notes { margin-block-end: 20px; font-size: 14px; line-height: 20px; color: var(--dana-muted); }

/* Zid's options (.tf-product-variant). */
.dana-qv__variant { display: grid; gap: 20px; margin-block-end: 34px; }
.dana-qv__option { display: grid; gap: 12px; }
.dana-qv__label { margin: 0; font-size: 16px; line-height: 19.2px; font-weight: 700; color: var(--dana-heading); letter-spacing: -0.03em; }
[dir="rtl"] .dana-qv__label { letter-spacing: 0; }
.dana-qv__label-value { font-weight: 700; }
.dana-qv__choices { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.dana-qv__choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 48px;
  block-size: 48px;
  padding: 0 14px;
  border: 1px solid var(--dana-line);
  border-radius: 999px;
  background: transparent;
  color: var(--dana-heading);
  font-family: inherit;
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .3s ease-in-out, color .3s ease-in-out, opacity .3s ease-in-out;
}
.dana-qv__choice:hover, .dana-qv__choice:focus-visible, .dana-qv__choice[aria-checked="true"] { border-color: var(--dana-heading); }
/* A choice no variant in stock has: dimmed and struck, still choosable (it
   then says «Option not available» on the button). */
.dana-qv__choice.is-out { color: var(--dana-muted); text-decoration: line-through; text-decoration-thickness: 1px; }
/* A colour choice (Zid's choices_metadata type_value): a 34px round with a
   28px swatch inside (.color-btn / .check-color). */
.dana-qv__choice--color { min-inline-size: 34px; inline-size: 34px; block-size: 34px; padding: 2px; border-color: transparent; }
.dana-qv__choice--color.is-out { opacity: .4; }
.dana-qv__swatch { display: block; inline-size: 28px; block-size: 28px; border-radius: 50%; border: 1px solid #dcdcdc; }

/* The buy row (.tf-product-total-quantity). */
.dana-qv__total { display: grid; gap: 17px; margin-block-end: 32px; }
.dana-qv__total:not(:has(> :not([hidden]))) { display: none; }
.dana-qv__group { display: flex; align-items: center; gap: 12px; }
.dana-qv__group[hidden] { display: none; }
/* The quantity pill: the template's #f1f1f1 as the heading at 5.5% over the
   page (the product page's own pill, product.css .dana-qty), so a dark page
   gets a dark pill under its light digits; the button shape's corners, 43px
   at most. */
.dana-qv__qty { flex: none; display: flex; justify-content: space-between; inline-size: 126px; block-size: 48px; border-radius: min(var(--dana-radius-button), 43px); background-color: color-mix(in srgb, var(--dana-heading) 5.5%, var(--dana-bg)); overflow: hidden; }
.dana-qv__step {
  display: grid;
  place-items: center;
  inline-size: 42px;
  block-size: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dana-heading);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: color .3s ease-in-out;
}
.dana-qv__step .di { display: flex; inline-size: 1em; block-size: 1em; }
.dana-qv__step:hover, .dana-qv__step:focus-visible { color: var(--dana-accent-ink); }
.dana-qv__step:disabled { opacity: .35; cursor: not-allowed; }
.dana-qv__qty-input { inline-size: 42px; min-inline-size: 0; padding: 0; border: 0; background: none; color: var(--dana-heading); font-family: inherit; font-size: 20px; line-height: 30px; font-weight: 500; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.dana-qv__qty-input::-webkit-outer-spin-button, .dana-qv__qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.dana-qv .dana-qv__add, .dana-qv .dana-qv__buynow, .dana-qv .dana-qv__page { block-size: 48px; min-inline-size: 0; padding-block: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dana-qv .dana-qv__add { flex: 1 1 auto; }
.dana-qv .dana-qv__buynow, .dana-qv .dana-qv__page { inline-size: 100%; }
.dana-qv .dana-qv__add:disabled { opacity: .5; cursor: not-allowed; }
.dana-qv .dana-qv__add.is-added { background-color: var(--dana-heading); border-color: var(--dana-heading); color: var(--dana-bg); }
.dana-qv [aria-busy="true"] { opacity: .7; cursor: progress; }
.dana-qv__buynow[hidden], .dana-qv__page[hidden] { display: none; }

/* «View full details» (.view-details). */
.dana-qv__view { display: inline-flex; align-items: center; gap: 4px; color: var(--dana-heading); font-size: 14px; line-height: 16.8px; font-weight: 500; text-decoration: none; transition: color .3s ease-in-out, gap .3s ease-in-out; }
.dana-qv__view .di { font-size: 12px; }
.dana-qv__view:hover, .dana-qv__view:focus-visible { color: var(--dana-accent-ink); gap: 8px; }

/* ---- Loading and error ------------------------------------------------------ */
.dana-qv__skeleton { display: none; border-radius: 6px; background: linear-gradient(90deg, var(--dana-surface) 0%, color-mix(in srgb, var(--dana-line) 70%, var(--dana-surface)) 50%, var(--dana-surface) 100%) 0 0 / 200% 100%; animation: dana-qv-shimmer 1.2s linear infinite; }
@keyframes dana-qv-shimmer { to { background-position: -200% 0; } }
.dana-qv__skeleton--media { position: absolute; inset: 0; border-radius: 0; }
.dana-qv__media:not(.has-media) .dana-qv__skeleton--media { display: block; }
.dana-qv__skeleton--text { block-size: 67px; -webkit-mask: repeating-linear-gradient(#000 0 14px, transparent 14px 22px); mask: repeating-linear-gradient(#000 0 14px, transparent 14px 22px); }
.dana-qv[data-state="loading"] .dana-qv__heading:has(.dana-qv__text[hidden]) .dana-qv__skeleton--text { display: block; }
.dana-qv[data-state="ready"] .dana-qv__skeleton, .dana-qv[data-state="error"] .dana-qv__skeleton { display: none; }
.dana-qv__error { display: grid; justify-items: center; gap: 16px; inline-size: 100%; padding: 64px 32px; text-align: center; }
.dana-qv__error[hidden] { display: none; }
.dana-qv__error-text { margin: 0; font-size: 16px; line-height: 24px; color: var(--dana-heading); }
.dana-qv[data-state="error"] :is(.dana-qv__media, .dana-qv__info) { display: none; }

@media (min-width: 1200px) {
  .dana-qv__heading { margin-block-end: 40px; }
}
@media (max-width: 1199px) {
  .dana-qv__name { font-size: 22px; }
  .dana-qv__price { font-size: 22px; }
}
@media (max-width: 991px) {
  .dana-qv__qty { block-size: 42px; }
}
/* ---- Phones: the picture on top, the details under it, the box scrolls. -- */
@media (max-width: 767px) {
  .dana-qv { max-block-size: calc(100dvh - 30px); overflow-y: auto; overscroll-behavior: contain; }
  .dana-qv__panel { flex-direction: column; max-block-size: none; }
  .dana-qv__media { flex: none; inline-size: 100%; }
  .dana-qv__swiper { max-block-size: 70dvh; }
  .dana-qv__nav { inline-size: 40px; block-size: 40px; margin-block-start: -20px; }
  .dana-qv__info { flex: none; }
  .dana-qv__inner { position: static; overflow: visible; padding: 15px; }
  .dana-qv__heading { padding-inline-end: 0; }
  .dana-qv__name { font-size: 20px; }
  .dana-qv__price { font-size: 20px; }
  .dana-qv__variant { margin-block-end: 30px; }
  .dana-qv__total { margin-block-end: 30px; }
  .dana-qv .dana-qv__add, .dana-qv .dana-qv__buynow, .dana-qv .dana-qv__page { block-size: 38px; }
  .dana-qv__close { inset-block-start: 0; inset-inline-end: 0; inline-size: 44px; block-size: 44px; font-size: 14px; background-color: var(--dana-bg); border-end-start-radius: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .dana-qv[open], .dana-qv[open]::backdrop { animation: none; }
  .dana-qv__skeleton { animation: none; }
}
