/*
 * Product Card, on sale (2026-09-28): the list price struck through, and
 * "Akciós ár:" with the sale price in the club price's slot, in the Akció
 * badge's burgundy (#9e191a, 8:1 on white). The markup comes from the
 * `render_block` filter in innowine-product-data.php.
 *
 * A file rather than etch_styles, which the builder can roll back. The card's
 * Etch styles sit in a layer, so these plain rules win without a fight, the
 * card's hover colour included.
 */

.product-card .product-card__prices--sale del {
  text-decoration-line: line-through;
  text-decoration-thickness: 1px;
}

.product-card .product-card__price--sale .product-card__price-label,
.product-card .product-card__price--sale .product-card__price-value {
  color: #9e191a;
}

/* A member the sale reaches: their own tier's name on the left, in its colour. */
.product-card .product-card__prices--sale .product-card__price[data-szint]:not([data-szint=""]) .product-card__price-label {
  color: var(--szint-szoveg, #747474);
}

/*
 * The hover panel on a sale card: every row is name, the price without the
 * sale struck through (where the sale lowers it), and the price now. Since
 * 2026-11-27 any card's panel too, where a tier's Klubszint-akció strikes its
 * club price (innowine_kartya_panel_athuzas()).
 */
.product-card .product-card__tiers--sale .dcw-card-level__price del,
.product-card .product-card__tiers .dcw-card-level__price del {
  margin-inline-end: 6px;
  color: #6b6a66; /* a struck price is still text: 5.4:1, not 3.5:1 */
  font-weight: 400;
  text-decoration-thickness: 1px;
}

.product-card .product-card__tiers--sale .innowine-card-level--list .dcw-card-level__name {
  color: #4a4a4a;
}

/*
 * A product with no tier price (a pálinka, say) still prints the tier row's
 * link, empty: 0x0px, invisible, and yet a Tab stop that reads "Klubtagsági
 * szintek" out of nowhere (WCAG 2.4.3). Empty, it goes.
 */
.product-card .product-card__price-label:empty {
  display: none;
}

/*
 * The picture's link fills the media box, which clips (overflow: hidden), so
 * the usual outline around it was cut away. On a desktop the cart bar sliding
 * in gave focus away anyway; on a touch screen that bar is always out, and the
 * focused picture looked exactly like the others (WCAG 2.4.7). The ring goes
 * inside instead, drawn over the photo: ink, then white, visible on a light
 * bottle shot and a dark one alike.
 */
.product-card .product-card__media-link {
  position: relative;
}

.product-card .product-card__media-link:focus-visible {
  outline: none;
}

.product-card .product-card__media-link:focus-visible::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 2px #111, inset 0 0 0 4px #fff;
  pointer-events: none;
}

/*
 * How long the sale lasts, on the "Akció" badge's hover and focus only
 * (2026-11-27): a small dark note under the badge.
 */
.product-card .product-card__badge--sale.has-vege {
  position: relative;
  /* It opens the product, like the image under it. */
  cursor: pointer;
  /* The badge column takes no pointer (the image link under it does); this
     badge has to, or its note never shows. */
  pointer-events: auto;
}

.product-card .product-card__badge--sale.has-vege:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

.product-card .product-card__badge-tipp {
  position: absolute;
  inset-block-start: calc(100% + 6px);
  inset-inline-end: 0;
  z-index: 6;
  padding: 5px 9px;
  border-radius: 2px;
  background-color: #111;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.4;
  text-transform: none;
  /* Narrow enough to stay inside the card's image, which clips. */
  inline-size: max-content;
  max-inline-size: 160px;
  white-space: normal;
  text-align: start;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-3px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  pointer-events: none;
}

.product-card .product-card__badge--sale.has-vege:is(:hover, :focus) .product-card__badge-tipp {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* The whole card opens the product (the script in innowine-product-data.php). */
.product-card {
  cursor: pointer;
}
