/*
 * Editorial product card.
 * Tall image with hover Quick-view CTA, category eyebrow, name, price.
 * Animated SALE %-off badge, floating wishlist heart, scroll-reveal.
 */

.product-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    color: var(--color-text);
    text-decoration: none;
    position: relative;
    transition: opacity 600ms cubic-bezier(0.2, 0.8, 0.2, 1) var(--pc-delay, 0ms),
                transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1) var(--pc-delay, 0ms);
}

/* Hide-then-reveal only inside a [data-reveal-section] wrapper that
   hasn't fired yet. Plain grids (shop, category pages) render visibly. */
[data-reveal-section] .product-card {
    opacity: 0;
    transform: translateY(24px);
}
[data-reveal-section].is-in .product-card,
.product-card.is-in {
    opacity: 1;
    transform: translateY(0);
}

.product-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.product-card-image {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: linear-gradient(135deg, #d6d0c4 0%, #ece6db 100%);
    isolation: isolate;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 900ms cubic-bezier(0.2, 0.8, 0.2, 1),
                filter   400ms ease;
    will-change: transform;
}

.product-card:hover .product-card-image img {
    transform: scale(1.06);
    filter: brightness(0.96);
}

/* Soft overlay that strengthens on hover */
.product-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,0.18) 100%);
    pointer-events: none;
    transition: background 400ms ease;
    z-index: 1;
}
.product-card:hover .product-card-overlay {
    background: linear-gradient(180deg, rgba(0,0,0,0.04) 0%, rgba(0,0,0,0.32) 100%);
}

.product-card-image-placeholder {
    background: linear-gradient(135deg, #d6d0c4 0%, #ece6db 100%);
}

/* SALE %-off badge — refined typography */
.product-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;
    background: var(--color-text);
    color: var(--color-surface);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 5px 9px;
    line-height: 1;
    border-radius: 2px;
}
.product-card-badge--sale {
    background: var(--color-accent);
    color: var(--color-surface);
}

/* Wishlist heart — top-right of card, fades in on hover */
.product-card-wishlist {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 4;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 0;
    color: var(--color-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 280ms ease, transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
                color 200ms ease, background 200ms ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
}
.product-card:hover .product-card-wishlist,
.product-card-wishlist:focus-visible {
    opacity: 1;
    transform: translateY(0);
}
.product-card-wishlist:hover {
    color: var(--color-accent);
    background: var(--color-surface);
}
.product-card-wishlist.is-active {
    color: var(--color-accent);
}
.product-card-wishlist.is-active i::before {
    content: "\f004";
    font-weight: 900;
}

/* Quick view overlay — slides up from bottom on hover */
.product-card-quickview {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 3;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 10.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 600;
    padding: 10px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 320ms ease, transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;
}
.product-card:hover .product-card-quickview {
    opacity: 1;
    transform: translateY(0);
}
.product-card-quickview i {
    font-size: 9px;
    transition: transform 250ms ease;
}
.product-card:hover .product-card-quickview i {
    transform: translateX(3px);
}

/* Meta below image */
.product-card-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 6px;
    color: inherit;
    text-decoration: none;
}

.product-card-cat {
    font-size: 9.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    font-weight: 600;
}

.product-card-name {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 13.5px;
    margin: 0;
    line-height: 1.25;
    color: var(--color-text);
    transition: color 220ms ease;
}
.product-card:hover .product-card-name {
    color: var(--color-accent);
}

.product-card-price {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: baseline;
    font-size: 13px;
    margin-top: 2px;
}

.product-card-price-current,
.product-card-price-sale {
    font-weight: 700;
    color: var(--color-text);
    font-size: 13.5px;
}

.product-card-price-original {
    color: var(--color-text-muted);
    text-decoration: line-through;
    font-size: 12px;
    font-weight: 400;
}

.product-card-price-off {
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-accent);
    font-weight: 700;
}

@media (max-width: 640px) {
    .product-card-wishlist {
        opacity: 1;
        transform: none;
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    .product-card-quickview {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-card,
    .product-card-image img,
    .product-card-overlay,
    .product-card-wishlist,
    .product-card-quickview,
    .product-card-name {
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}
