/*
 * product-card.css — styling voor de gedeelde ProductCardRenderer-kaart.
 * Hoort bij de kaart-component, dus geladen op élke pagina die kaarten toont
 * (overzicht, productdetail-gerelateerd/onlangs-bekeken, favorieten). Voorheen
 * stond dit alleen in layer-product-overview.css → op de detailpagina waren de
 * kaarten daardoor ongestyled (o.a. blauwe link-kleur op titel/subtitle).
 *
 * Gebruikt de webshop-tokens (--ws-*); die worden door de pagina-CSS geladen
 * (variables/webshop.css via de layer-stylesheets).
 */

/* De zichtbare doos is de shell-cel `.card__content` (gedeeld met álle card-
   types via CardCollectionRenderer). De product-variant zet daar z'n eigen
   webshop-tokens op; `.product-card` zelf is enkel de layout/positioning-laag
   voor de inner-content + overlays (heart/badges) — geen eigen box meer. */
.card--product .card__content {
    background: var(--color-bg-elev, #fff);
    border: var(--ws-card-border);
    border-radius: var(--ws-card-radius);
    box-shadow: var(--ws-card-shadow);
    transition: box-shadow .25s ease, transform .25s ease;
    /* overflow:hidden + position:relative + flex-column komen al uit .card__content */
}
.product-card {
    display: flex;
    flex-direction: column;
    position: relative;   /* positioning-context voor heart/badges */
    height: 100%;         /* vult .card__content (gelijke kaarthoogtes) */
}

/* Kaarslicht-hover: zachte warme gloed valt over de kaart (radiale toplaag),
   plus een warm getinte gloed-shadow + iets sterkere lift. Glow-kleur via
   `--ws-card-glow` (themable per lijn). pointer-events: none → klikbaar.
   De generieke hover is op `:not(.card--product)` gescoped (layers.css), dus
   hier geen specificiteit-truc nodig. */
.card--product .card__content::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(120% 80% at 50% -10%,
        var(--ws-card-glow, rgba(200, 144, 42, .22)) 0%, transparent 60%);
    transition: opacity .25s ease;
}
.card--product:hover .card__content {
    box-shadow: var(--ws-card-shadow-hover),
                0 14px 40px var(--ws-card-glow-shadow, rgba(200, 144, 42, .26));
    transform: translateY(-3px) scale(1.008);
}
.card--product:hover .card__content::after { opacity: 1; }

/* Badges: rechtsboven, gestapeld (sale + new kunnen tegelijk).
   Geen ::before, omdat ::before en ::after maar één label kunnen
   dragen — een echte <span class="product-card__badge"> in de
   renderer is flexibeler. Voor backwards-compat behouden we het
   ::before-pad voor `--sale` waar de renderer 'm niet zelf rendert. */
.product-card--sale::before {
    content: "Sale";
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    background: var(--ws-sale-badge-bg);
    color: var(--ws-sale-badge-color);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    z-index: 1;
}

.product-card--new:not(.product-card--sale)::before,
.product-card__badge--new {
    content: "Nieuw";
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    background: var(--color-primary, #c8902a);
    color: var(--color-primary-fg, #fff);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    z-index: 1;
}

/* Beide tegelijk: stapel ze (sale rechtsboven, new eronder). */
.product-card--sale.product-card--new .product-card__badge--new {
    top: calc(var(--space-2) + 1.6rem);
}

.product-card__link {
    color: inherit;
    text-decoration: none;
    display: block;
    /* Groeit mee in de flex-column-kaart zodat de knop eronder naar de bodem
       zakt — kaarten in een rij zijn even hoog, dus de knoppen lijnen uit. */
    flex: 1 1 auto;
}

.product-card__image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.product-card__body {
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.product-card__title {
    font-size: 1rem;
    font-weight: 600;
    line-height: var(--line-tight);
    margin: 0;
}

.product-card__subtitle {
    color: color-mix(in srgb, currentColor 65%, transparent);
    font-size: 0.85rem;
    margin: 0;
}

/* Uitvoeringen-hint: kleur-swatches + "2 maten". Swatch-rand via color-mix
   zodat ook lichte kleuren (Wit) zichtbaar blijven op de card-achtergrond. */
.product-card__axes {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    margin-top: var(--space-1);
}

.product-card__swatch {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
    flex: none;
}

.product-card__axes-text,
.product-card__axes-more {
    color: color-mix(in srgb, currentColor 60%, transparent);
    font-size: 0.8rem;
}

/* Tekst-as na dots: subtiele scheiding ("● ● ●  · 2 maten"); de "+N"-rest
   (axes-more) plakt juist zonder scheidingsteken aan de dots vast. */
.product-card__swatch + .product-card__axes-text,
.product-card__axes-more + .product-card__axes-text {
    margin-left: var(--space-1);
}

.product-card__swatch + .product-card__axes-text::before,
.product-card__axes-more + .product-card__axes-text::before {
    content: '· ';
}

.product-card__price-box {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.product-card__price-old {
    color: var(--ws-price-old-color);
    text-decoration: line-through;
    font-size: 0.9rem;
}

.product-card__price {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--ws-price-color);
}

.product-card--sale .product-card__price {
    color: var(--ws-price-sale-color);
}

.product-card__from {
    color: color-mix(in srgb, currentColor 65%, transparent);
    font-size: 0.85rem;
    width: 100%;
}

.product-card__unit {
    color: color-mix(in srgb, currentColor 60%, transparent);
    font-size: 0.8rem;
    width: 100%;
}

.product-card__favorite {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: color-mix(in srgb, var(--color-bg, #fff) 85%, transparent);
    backdrop-filter: blur(4px);
    cursor: pointer;
    color: color-mix(in srgb, currentColor 50%, transparent);
    transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.product-card__favorite:hover {
    color: var(--color-primary, #c00);
    background: color-mix(in srgb, var(--color-bg, #fff) 95%, transparent);
    transform: scale(1.1);
}

.product-card__favorite[aria-pressed="true"] {
    color: var(--ws-fav-color, #c00);
}

.product-card__favorite svg path {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linejoin: round;
    transition: fill 0.15s ease;
}

.product-card__favorite[aria-pressed="true"] svg path {
    fill: currentColor;
    stroke: currentColor;
}

.product-card__add, .product-card__detail {
    margin: var(--space-2) var(--space-3) var(--space-3);
}
/* "Bekijk →"-detaillink: label + pijltje dat op hover iets meeschuift. */
.product-card__detail {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2, .5rem);
}
.product-card__detail-arrow {
    transition: transform .15s ease;
}
.product-card__detail:hover .product-card__detail-arrow,
.product-card__detail:focus-visible .product-card__detail-arrow {
    transform: translateX(.2em);
}

/* ── Branduur-meter ─────────────────────────────────────────────────────────
   Mini-kaars (HTML-spans, kolom-flex met de basis vast onderaan) + "± X uur".
   Op hover "brandt" de was korter → de vlam zakt vanzelf mee omdat 'ie de
   bovenste flex-sibling is. Themable via --burn-wax / --burn-flame. */
.product-card__burn {
    display: flex;
    align-items: center;
    gap: var(--space-2, .5rem);
    margin: var(--space-1, .25rem) 0 0;
    font-size: .8rem;
    color: var(--color-fg-muted);
}
.burn-candle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;   /* basis blijft onderaan staan */
    width: 10px;
    height: 26px;
    flex: 0 0 auto;
}
.burn-candle__flame {
    width: 6px;
    height: 8px;
    margin-bottom: 1px;
    border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%;
    background: radial-gradient(ellipse at 50% 70%,
        #fff6d2 0%, var(--burn-flame, #ffb028) 55%, transparent 75%);
    transform-origin: 50% 100%;
    animation: burn-flicker 1.6s ease-in-out infinite;
}
.burn-candle__body {
    width: 8px;
    height: 16px;
    border-radius: 2px 2px 1px 1px;
    background: linear-gradient(var(--burn-wax, var(--color-primary, #c8902a)),
        color-mix(in srgb, var(--burn-wax, var(--color-primary, #c8902a)) 75%, #000));
    transition: height .9s var(--ease-out, ease);
}
.product-card:hover .burn-candle__body { height: 6px; }   /* brandt op */

@keyframes burn-flicker {
    0%, 100% { transform: scale(1)    rotate(-1deg); opacity: 1;   }
    50%      { transform: scaleY(.88) rotate(1deg);  opacity: .85; }
}
@media (prefers-reduced-motion: reduce) {
    .burn-candle__flame { animation: none; }
    .burn-candle__body  { transition: none; }
    .product-card:hover .burn-candle__body { height: 16px; }  /* geen burn-down */
}

/* B2B-klantprijs op de kaart: "Uw prijs"-mini-label + origineel doorgestreept. */
.product-card__price-yours {
    display: block;
    width: 100%;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent, currentColor);
}
/* Label en prijs horen visueel bij elkaar: kleinere rij-afstand in de box
   zodra er een "Uw prijs"-label staat (kolom-gap blijft normaal). */
.product-card__price-box:has(.product-card__price-yours) {
    row-gap: 0.15rem;
}
.product-card__price-box .product-card__price-old {
    text-decoration: line-through;
    opacity: 0.55;
}
