/**
 * Innowine – Kedvencek: where the heart sits and how it looks here.
 *
 * The heart itself (size tokens, pressed state, pop) is the Decorrect plugin's
 * wishlist.css. This file places it and gives it the shop's red. Two-class
 * selectors throughout: the card, header and product page rules they sit
 * beside come from Etch's own stylesheets, some unlayered and later.
 */

.dcw-wish,
.dcw-wish-link,
.dcw-wishlist-empty {
  /* The red of the wine dots on the cards (pctyp03). */
  --dcw-wish-on: #c71415;
}

/* ------------------------------------------------------------ the header */

/* `.header__icon` (vahuttw) already makes it a 24px box like the cart. */
.header .header__wish {
  flex: none;
}

.header .header__wish:hover {
  color: var(--black, #000);
}

/* The cart count's bubble (vn0k1im), for the same look side by side. */
.header .header__wish .dcw-wish-link__count {
  inset-block-start: -6px;
  inset-inline-start: auto;
  inset-inline-end: -8px;
  min-inline-size: 20px;
  background-color: var(--danger, #c71415);
  font-weight: 500;
}

/* --------------------------------------------------------------- the card */

/*
 * The heart is the last child of the badges box (pcbdg33). That box is a
 * column in the Etch style; here it becomes a right-aligned row that wraps,
 * so the heart sits to the right of Selection (or Akció) while the two fit,
 * and drops under it on a card too narrow for both. The box stops short of
 * the wine dots on the left (10px inset + about 50px of dots), which is what
 * makes the heart wrap instead of running into them.
 *
 * With both Akció and Selection, Selection keeps the top line to itself and
 * Akció goes under it, the heart beside Akció (the user's call, 2026-09-28;
 * until then Akció sat on top): a zero-height break (`::before`, full width)
 * goes between the two. The heart follows the last pill rather than
 * Selection because Akció and the heart together are narrower than
 * Selection, so they fit on any card; beside Selection, a phone's card
 * would wrap the heart onto a line of its own between the two pills. The 5px
 * between lines is each item's bottom margin rather than a row gap, so the
 * empty break line does not count twice.
 */
.product-card .product-card__badges {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  row-gap: 0;
  max-inline-size: calc(100% - 70px);
}

.product-card .product-card__badges > * {
  margin-block-end: 5px;
}

.product-card .product-card__badges > .product-card__badge--selection {
  order: 1;
}

.product-card .product-card__badges:has(> .product-card__badge--sale:not(:empty)):has(> .product-card__badge--selection:not(:empty))::before {
  content: "";
  order: 2;
  flex-basis: 100%;
  block-size: 0;
}

.product-card .product-card__badges > .product-card__badge--sale {
  order: 3;
}

/* No disc behind it: a white outline over a smoky fill, readable on any
   photo, turning the wine-dot red once saved. */
.product-card .product-card__wish {
  --dcw-wish-size: 28px;
  --dcw-wish-glyph: 24px;
  --dcw-wish-surface: transparent;
  --dcw-wish-surface-hover: transparent;

  order: 4;
  /* A set width (not the content's), so the Selection rule below can
     animate it from zero. The clip keeps the glyph inside while it grows;
     the margin leaves room for its shadow and the pop. */
  inline-size: var(--dcw-wish-size);
  overflow: clip;
  overflow-clip-margin: 4px;
  /* The column takes no clicks (its pills are labels); the heart does. */
  pointer-events: auto;
  /* The glyph's own edge in line with the pills' edge. */
  margin-inline-end: -2px;
  color: #fff;
}

.product-card .product-card__wish:hover {
  box-shadow: none;
}

.product-card .product-card__wish .dcw-wish__icon {
  fill: rgb(0 0 0 / 28%);
  stroke-width: 1.8;
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 30%));
  transition: fill 0.2s ease, transform 0.2s ease;
}

.product-card .product-card__wish:hover .dcw-wish__icon {
  fill: rgb(0 0 0 / 42%);
}

.product-card .product-card__wish[aria-pressed="true"] {
  color: #fff;
}

.product-card .product-card__wish[aria-pressed="true"] .dcw-wish__icon {
  fill: var(--dcw-wish-on);
}

/* Two rings, white inside black: a black outline alone vanished on a dark
   bottle shot (WCAG 2.4.7). This one reads on any photo. */
.product-card .product-card__wish:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #fff;
  border-radius: 6px;
}

/*
 * A Selection wine shows its heart on hover only (the user's call,
 * 2026-09-27), and so does a wine on sale (2026-09-28): at rest the pill has
 * the corner to itself, and on hover the heart opens beside it while the pill
 * slides over. Not on a touch screen, which has no hover; not once saved,
 * since the red heart is the only sign of it; not on the Kedvencek page,
 * where the released heart is the undo. Keyboard focus inside the card opens
 * it too.
 */
@media (hover: hover) {
  .product-card:has(.product-card__badge--selection:not(:empty), .product-card__badge--sale:not(:empty)) .product-card__wish {
    transition: inline-size 0.2s ease, min-inline-size 0.2s ease, margin 0.2s ease, opacity 0.2s ease;
  }

  .product-card:not(.kedvencek-section *):has(.product-card__badge--selection:not(:empty), .product-card__badge--sale:not(:empty)):not(:hover, :focus-within) .product-card__wish[aria-pressed="false"] {
    min-inline-size: 0;
    inline-size: 0;
    /* The row's 5px column gap goes with it, and the glyph's 2px nudge, so
       the pill sits exactly where it sits on a card with no heart. */
    margin-inline: -5px 0;
    opacity: 0;
  }
}

@media (width <= 479px) {
  .product-card .product-card__wish {
    --dcw-wish-size: 26px;
    --dcw-wish-glyph: 21px;
  }
}

/* ------------------------------------------------------ the product page */

/* A square beside the cart button, the stepper's border and height. */
.single-product .single-vasarlas .single-wish,
.single-product .single-vasarlas .elfogyott-sor .single-wish {
  --dcw-wish-size: 46px;
  --dcw-wish-glyph: 20px;
  --dcw-wish-surface: #fff;
  --dcw-wish-surface-hover: #f3f3f3;

  inline-size: 46px;
  border: 1px solid #111;
  border-radius: 0;
}

.single-product .single-vasarlas .single-wish:hover {
  box-shadow: none;
}

.single-product .single-vasarlas .single-wish:focus-visible {
  outline-offset: -4px;
}

/* Sold out: the "Összes termékünk" button and the heart share the row. */
.single-product .single-vasarlas .elfogyott-sor {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 12px;
  inline-size: 100%;
}

.single-product .single-vasarlas .elfogyott-sor .elfogyott-gomb {
  flex: 1 1 auto;
  inline-size: auto;
}

/* ---------------------------------------------------------- the list page */

/* The archive's frame: hero, sidebar with the filters, toolbar, grid
   (innowine-archive.css, innowine-facets.css). What differs is below. */

.kedvencek-section .kedvencek-hero {
  padding-block-end: var(--space-s, 2rem);
}

.kedvencek-hero .kedvencek-hero__count {
  color: #6b6b6b;
  font-size: 16px;
}

/* Nothing saved: no count line under the title, the empty state says it. */
.kedvencek-hero .kedvencek-hero__count:not(:has(.dcw-wish-count:not([hidden]))) {
  display: none;
}

/* Nothing saved: nothing to filter either. The sidebar and the toolbar come
   out empty (innowine-kedvencek.php), and the empty state takes the width. */
.kedvencek-section .archive-body:not(:has(.innowine-facets)) {
  grid-template-columns: minmax(0, 1fr);
}

.kedvencek-section .archive-sidebar:not(:has(*)),
.kedvencek-section .archive-toolbar:not(:has(*)) {
  display: none;
}

.kedvencek-section .dcw-wishlist-empty {
  margin-block: 0 24px;
}

/* A guest's "this browser keeps it" line, over the toolbar. */
.kedvencek-section .dcw-wishlist-note {
  margin: 0;
  padding: 12px 16px;
  border-radius: 3px;
  background-color: #f5f5f5;
  color: #4a4a4a;
  font-size: 14px;
}

/* Saved wines, but the filters leave none. */
.kedvencek-section .kedvencek-nincs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 48px 16px;
  text-align: center;
}

.kedvencek-nincs .kedvencek-nincs__szoveg {
  margin: 0;
  color: #4a4a4a;
  font-size: 16px;
}

.kedvencek-nincs .kedvencek-nincs__gomb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 46px;
  padding: 0 28px;
  border-radius: 0;
  background-color: #111;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kedvencek-nincs .kedvencek-nincs__gomb:hover {
  background-color: #333;
  color: #fff;
}

/* A released card fades, all but its heart: pressing it again is the undo. */
.kedvencek-section .product-card.is-dcw-removed {
  opacity: 1;
}

.kedvencek-section .product-card.is-dcw-removed :is(
  .product-card__media-link,
  .product-card__type,
  .product-card__badge,
  .product-card__stock,
  .product-card__cart,
  .product-card__body
) {
  opacity: 0.35;
  filter: grayscale(1);
  transition: opacity 0.25s ease, filter 0.25s ease;
}

/*
 * Elfogyott kedvenc: szürke, halványabb fotó. A rács végén áll
 * (innowine-kedvencek.php, `the_posts`), a sárga „Jelenleg nincs raktáron.”
 * felirat és a letiltott Kosárba gomb mellé ez adja az első pillantásra
 * látható jelet. Rámutatva kicsit visszajön, hogy a bor felismerhető legyen.
 */
.kedvencek-section .product-card[data-state="elfogyott"] .product-card__media-link img {
  filter: grayscale(1);
  opacity: 0.55;
  transition: opacity 0.25s ease, filter 0.25s ease;
}

@media (hover: hover) {
  .kedvencek-section .product-card[data-state="elfogyott"]:hover .product-card__media-link img {
    filter: grayscale(0.6);
    opacity: 0.8;
  }
}
