/**
 * The quick view panel.
 *
 * Colours come from Automatic.css so the panel follows the shop rather than
 * carrying its own palette. The add-to-cart button inside it is the product
 * page's own `.product-add_to_cart`, styled by the site stylesheet — nothing
 * here restyles it, so the two can never drift apart.
 */

.innowine-qv {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-s, 2rem);
}

.innowine-qv[hidden] {
  display: none;
}

.innowine-qv__scrim {
  position: absolute;
  inset: 0;
  background-color: rgb(0 0 0 / 55%);
}

.innowine-qv__panel {
  position: relative;
  inline-size: 100%;
  max-inline-size: 980px;
  max-block-size: min(88vh, 760px);
  overflow: auto;
  padding: var(--space-m, 3rem);
  border-radius: var(--radius-s, 0.6666rem);
  background-color: var(--white, #fff);
  box-shadow: 0 24px 60px rgb(0 0 0 / 25%);
}

.innowine-qv__panel:focus-visible {
  outline: 2px solid var(--black, #000);
  outline-offset: 3px;
}

/* The two columns live here rather than on the panel: the fetched markup is
   inserted into this element, so the panel's own children are only ever it. */
.innowine-qv__body {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--space-m, 3rem);
  align-items: stretch;
  min-block-size: 100%;
}

.innowine-qv.is-loading .innowine-qv__body {
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  min-block-size: 220px;
}

.innowine-qv__close {
  position: absolute;
  inset-block-start: 10px;
  inset-inline-end: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 36px;
  block-size: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: transparent;
  color: var(--black, #000);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.innowine-qv__close:hover {
  background-color: #ededed;
}

.innowine-qv__close > svg {
  inline-size: 20px;
  block-size: 20px;
}

/* ------------------------------------------------------------------- media */

.innowine-qv__media {
  position: relative;
  align-self: start;
  overflow: hidden;
  border-radius: var(--radius-s, 0.6666rem);
  background-color: #f2f2f2;
}

.innowine-qv__img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.innowine-qv__img--placeholder {
  display: block;
  inline-size: 100%;
  aspect-ratio: 3 / 4;
}

/* The wine-colour dots sit where they do on the card and the product page. */
.innowine-qv__dots {
  position: absolute;
  inset-block-start: 10px;
  inset-inline-start: 10px;
  z-index: 3;
  inline-size: fit-content;
  cursor: help;
  --_dot-back: #9e191a;
  --_dot-front: #c71415;
}

/* The card's colours. The global `.ball-*` rules paint every wine red. */
.innowine-qv__dots[data-szin="feher"] { --_dot-back: #ffc700; --_dot-front: #ffd53f; }
.innowine-qv__dots[data-szin="roze"]  { --_dot-back: #d00064; --_dot-front: #ee8b93; }
.innowine-qv__dots[data-szin="habzo"] { --_dot-back: #8e9aa6; --_dot-front: #c2ced9; }

.innowine-qv__dots .ball-right { background-color: var(--_dot-back); }
.innowine-qv__dots .ball-left  { background-color: var(--_dot-front); }

/* Rises over the badges while its tooltip is out. */
.innowine-qv__dots:is(:hover, :focus-visible) {
  z-index: 4;
}

/* The card's tooltip. 75% because the front dot is pulled back by a quarter
   of the pair's width, so the box ends 12.5px past what is visible. */
.innowine-qv__dots-name {
  position: absolute;
  inset-inline-start: calc(75% + 5px);
  inset-block-start: 50%;
  translate: 0 -50%;
  padding: 4px 9px;
  border-radius: var(--radius-xs, 0.444rem);
  background-color: var(--black, #000);
  color: var(--white, #fff);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgb(0 0 0 / 22%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s;
  pointer-events: none;
}

.innowine-qv__dots:is(:hover, :focus-visible) .innowine-qv__dots-name {
  opacity: 1;
  visibility: visible;
}

/*
 * The card's badges, top right. Written out here rather than borrowed from the
 * card, whose styles only reach a page that has cards on it.
 */
.innowine-qv__badges {
  position: absolute;
  inset-block-start: 10px;
  inset-inline-end: 10px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  pointer-events: none;
}

.innowine-qv__badge {
  padding: 3px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  background-color: rgb(255 255 255 / 94%);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.innowine-qv__badge--sale {
  border-color: #9e191a;
  color: #9e191a;
}

.innowine-qv__badge--selection {
  border-color: #b08d2e;
  background-image: linear-gradient(135deg, #f7e9b8 0%, #ddbd6a 55%, #b8923a 100%);
  color: #3b2c06;
  box-shadow: 0 2px 8px rgb(138 106 18 / 0.28), inset 0 1px 0 rgb(255 255 255 / 0.55);
}

.innowine-qv__badge--selection::before {
  content: "\2726";
  margin-inline-end: 5px;
  font-size: 0.9em;
}

/* -------------------------------------------------------------------- info */

.innowine-qv__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-xs, 1.33rem);
  min-inline-size: 0;
}

.innowine-qv__title {
  margin: 0;
  padding-inline-end: 44px;
  color: var(--black, #000);
  font-size: calc(var(--text-m) + 6px);
  font-weight: 700;
  line-height: 1.2;
  text-wrap: pretty;
}

/* ------------------------------------------------------------ description */

.innowine-qv__desc-wrap {
  inline-size: 100%;
}

/* Four lines, and the rest behind a button. -webkit-line-clamp is the only
   thing every engine agrees on here; it is unprefixed nowhere yet. */
.innowine-qv__desc {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: #5a5a5a;
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1.6;
}

.innowine-qv__desc-wrap.is-open .innowine-qv__desc {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

/* Two classes deep so a single-class rule elsewhere cannot take the underline
   off it — this is a link in everything but tag name, and it has to read as one. */
.innowine-qv__desc-wrap .innowine-qv__more {
  display: inline-block;
  margin-block-start: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--black, #000);
  font-family: inherit;
  font-size: var(--text-s);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.innowine-qv__desc-wrap .innowine-qv__more:hover {
  text-decoration-thickness: 2px;
}

.innowine-qv__more[hidden] {
  display: none;
}

.innowine-qv__more:focus-visible {
  outline: 2px solid var(--black, #000);
  outline-offset: 2px;
}

.innowine-qv__attrs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
  inline-size: 100%;
  margin: 0;
  padding: var(--space-xs, 1.33rem);
  border-radius: var(--radius-xs, 0.444rem);
  background-color: #f6f6f6;
}

.innowine-qv__attr {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  min-inline-size: 0;
}

.innowine-qv__attr-label {
  margin: 0;
  color: #747474;
  font-size: 1.3rem;
  font-weight: 600;
}

.innowine-qv__attr-value {
  margin: 0;
  color: var(--black, #000);
  font-size: 1.3rem;
}

/* Two classes deep, so the theme's own link colour cannot take it over. */
.innowine-qv__attr-value .innowine-qv__attr-link {
  display: inline;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: #c4c4c4;
  text-underline-offset: 2px;
  transition: text-decoration-color 0.15s ease;
}

.innowine-qv__attr-value .innowine-qv__attr-link:hover,
.innowine-qv__attr-value .innowine-qv__attr-link:focus-visible {
  text-decoration-color: currentColor;
}

.innowine-qv__attr-unit {
  color: #747474;
}

/* ------------------------------------------------------------------ prices */

.innowine-qv__prices {
  inline-size: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  border-block-start: 1px solid #e6e6e6;
}

.innowine-qv__price {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-block: 7px;
  padding-inline: 8px;
  /* Pulled back out so the rules still line up with the text above them. */
  margin-inline: -8px;
  border-block-end: 1px solid #e6e6e6;
  border-radius: var(--radius-xs, 0.444rem);
  font-size: 1.4rem;
  transition: background-color 0.15s ease;
}

.innowine-qv__price.is-hintable {
  cursor: default;
}

.innowine-qv__price.is-hintable:hover,
.innowine-qv__price.is-hintable:focus-within {
  background-color: #f3f3f3;
}

.innowine-qv__price.is-hintable:focus-visible {
  outline: 2px solid var(--black, #000);
  outline-offset: -2px;
}

/* What it takes to reach this level. Absolutely placed so the list does not
   reflow under the cursor, and it keeps pointer events while open so the
   "Jelentkezz be!" inside it can actually be clicked. */
.innowine-qv__price-hint {
  position: absolute;
  inset-inline: 0;
  inset-block-start: calc(100% - 3px);
  z-index: 4;
  padding: 8px 10px;
  border-radius: var(--radius-xs, 0.444rem);
  background-color: var(--black, #000);
  color: var(--white, #fff);
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.45;
  text-align: start;
  box-shadow: 0 10px 24px rgb(0 0 0 / 22%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  pointer-events: none;
}

.innowine-qv__price.is-hintable:hover .innowine-qv__price-hint,
.innowine-qv__price.is-hintable:focus-within .innowine-qv__price-hint {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.innowine-qv__price-hint a {
  color: var(--white, #fff);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.innowine-qv__price-name {
  color: var(--szint-szoveg, #4a4a4a);
  font-weight: 600;
}

/* Only the price being paid is black; the others are there to compare. */
.innowine-qv__price-amount {
  color: #6b6a66; /* still greyer than the black price paid, but 5.4:1 (WCAG AA) */
  font-weight: 500;
  white-space: nowrap;
}

.innowine-qv__price-was {
  color: #6b6a66;
  font-weight: 400;
}

/* "<was> helyett: <now>". One inline-block with its own gap, so the paid
   row's underline and weight stay on the amount alone. */
.innowine-qv__price-elozo {
  display: inline-block;
  margin-inline-end: 6px;
  color: #747474;
  font-weight: 400;
  text-decoration: none;
}

.innowine-qv__price.is-aktiv .innowine-qv__price-elozo {
  font-weight: 400;
}

/* The lowest price of the 30 days before a markdown, under the list. */
.innowine-qv__lowest {
  inline-size: 100%;
  margin: 8px 0 0;
  color: #747474;
  font-size: 1.3rem;
  line-height: 1.4;
}

.innowine-qv__lowest strong {
  color: var(--black, #000);
  font-weight: 600;
}

/* The row the customer is on right now — `is-aktiv` is the pricing module's
   own mark, so a guest gets the list price row and a member gets theirs. */
.innowine-qv__price.is-aktiv .innowine-qv__price-name,
.innowine-qv__price.is-aktiv .innowine-qv__price-amount {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.innowine-qv__price.is-aktiv .innowine-qv__price-amount {
  color: var(--black, #000);
}

/* A chevron pointing at the price being paid. Inline-block, so the amount's
   underline does not run under it. */
.innowine-qv__price.is-aktiv .innowine-qv__price-amount::before {
  content: "";
  display: inline-block;
  inline-size: 0.7em;
  block-size: 0.7em;
  margin-inline-end: 6px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 4l8 8-8 8' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 4l8 8-8 8' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* A row that is no longer an improvement on what this customer pays. The
   product page's table strikes these; muting them says the same thing in a
   list, where a struck price next to a bold one reads as a sale. */
.innowine-qv__price.is-athuzott .innowine-qv__price-name {
  color: #6f6f6f;
  font-weight: 400;
}

.innowine-qv__price.is-athuzott .innowine-qv__price-amount {
  font-weight: 400;
}

/* --------------------------------------------- unit price and the deposit */

.innowine-qv__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 18px;
  inline-size: 100%;
  color: #747474;
  font-size: 1.3rem;
  line-height: 1.4;
}

.innowine-qv__meta-item {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}

.innowine-qv__meta-value {
  color: var(--black, #000);
  font-weight: 600;
}

/* ----------------------------------------------------------------- actions */

.innowine-qv__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs, 1.33rem);
  inline-size: 100%;
  margin-block-start: auto;
  padding-block-start: 4px;
}

/* The button is the product page's; only its width is this panel's business. */
.innowine-qv__actions .product-add_to_cart {
  inline-size: auto;
  min-inline-size: 190px;
  /* Etch's `.product-add_to_cart { height: 100% }` (dd3dn8s) fills the
     action row, which a phone-height panel stretches to a slab. */
  block-size: auto;
  min-block-size: 46px;
  border-radius: 8px;
}

.innowine-qv__link {
  color: var(--black, #000);
  font-size: var(--text-s);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------------ states, small */

.innowine-qv__loading,
.innowine-qv__error {
  grid-column: 1 / -1;
  margin: 0;
  align-self: center;
  color: #747474;
  font-size: var(--text-m);
  text-align: center;
}

.innowine-qv__loading::after {
  content: "";
  display: block;
  inline-size: 26px;
  block-size: 26px;
  margin: 12px auto 0;
  border: 2px solid #d8d8d8;
  border-block-start-color: var(--black, #000);
  border-radius: 50%;
  animation: innowine-qv-spin 0.7s linear infinite;
}

@keyframes innowine-qv-spin {
  to { rotate: 360deg; }
}

/*
 * The preview: the card's name, price and picture in the panel's own layout,
 * and grey bones where the fetched parts will land. Sized after what replaces
 * them — four lines of description, the attribute box, the price rows, the
 * button — so the swap moves as little as possible.
 */
.innowine-qv__bones {
  display: flex;
  flex-direction: column;
  gap: 10px;
  inline-size: 100%;
}

.innowine-qv__bone {
  display: block;
  inline-size: 100%;
  block-size: 12px;
  border-radius: 3px;
  background: linear-gradient(90deg, #ececec 0%, #f6f6f6 50%, #ececec 100%) 0 0 / 200% 100%;
  animation: innowine-qv-shimmer 1.3s ease-in-out infinite;
}

.innowine-qv__bones .innowine-qv__bone:nth-child(4) {
  inline-size: 62%;
}

.innowine-qv__bone--attrs {
  block-size: 112px;
  border-radius: var(--radius-xs, 0.444rem);
}

.innowine-qv__price > .innowine-qv__bone {
  inline-size: 100%;
  block-size: 12px;
  margin-block: 4px;
}

.innowine-qv__bone--button {
  inline-size: 190px;
  block-size: 46px;
  border-radius: 8px;
}

@keyframes innowine-qv-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

body.innowine-qv-open {
  overflow: hidden;
}

/*
 * The card the panel was opened from, held in its resting state after the
 * panel closes (see hush() in the script). !important because the card's own
 * hover rules live in Etch's stylesheet, load after this one, and the
 * Selection variant carries a `:has()` that outweighs any sane selector here.
 */
@media (hover: hover) and (width > 991px) {
  .product-card.is-qv-hush {
    --_pc-border-color: transparent !important;
    --_pc-shadow: 0 0 0 0 rgb(0 0 0 / 0) !important;
    --_pc-price-color: #747474 !important;
    z-index: auto !important;
    background-color: var(--white, #fff) !important;
  }

  .product-card.is-qv-hush .product-card__cart {
    transform: translateY(100%) !important;
  }

  .product-card.is-qv-hush .product-card__tiers {
    opacity: 0 !important;
    visibility: hidden !important;
  }
}

@media (width <= 767px) {
  .innowine-qv {
    padding: 0;
  }

  .innowine-qv__panel {
    max-block-size: 100dvh;
    block-size: 100dvh;
    padding: var(--space-s, 2rem);
    /* The photo runs full width here, so the close button gets its own strip
       above it instead of sitting on the Selection badge. */
    padding-block-start: 56px;
    border-radius: 0;
  }

  .innowine-qv__body {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-s, 2rem);
    align-content: start;
  }

  .innowine-qv__media {
    inline-size: 100%;
  }

  .innowine-qv__attrs {
    grid-template-columns: minmax(0, 1fr);
  }

  .innowine-qv__actions .product-add_to_cart,
  .innowine-qv__bone--button {
    inline-size: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .innowine-qv__loading::after,
  .innowine-qv__bone { animation: none; }
}

.innowine-qv__soldout {
  margin: 0;
  padding: 10px 16px;
  border: 1px solid #e6c9c9;
  border-radius: var(--radius-xs, 0.444rem);
  background-color: #fdf3f3;
  color: #a33;
  font-size: var(--text-s);
  font-weight: 600;
}

.innowine-qv__state {
  inline-size: 100%;
  margin: 0;
  padding: 8px 12px;
  border-radius: var(--radius-xs, 0.444rem);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.4;
}

/* The shop's own "orderable, just not today" colours, as on the card's badge. */
.innowine-qv__state--backorder {
  border: 1px solid #ffecb5;
  background-color: #fff3cd;
  color: #664d03;
}
