/* ============================================================
   Product Cards — Editorial Maison
   Vertical imagery · borderless · hairline gutters · sharp
   ============================================================ */

:root {
    --card-image-ratio: 3 / 4;           /* long vertical crop */
    --card-star: var(--star, #f4f4f4);
    --card-transition: opacity 0.5s var(--ease-out, ease), transform 0.5s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1));
}

/* ---------- Grid ---------- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 44px 14px;
    align-items: stretch;
    width: 100%;
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 64px 22px;
    }
}

@media (min-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 72px 26px;
    }
}

@media (min-width: 1920px) {
    .products-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 80px 30px;
    }
}

/* Mobile — hairline gutters, edge-to-edge imagery */
@media (max-width: 640px) {
    .products-grid {
        gap: 34px 2px;
    }
}

/* Gentle row-settling snap (mobile) — rows settle fully in view,
   like turning pages of a lookbook. Proximity = never traps scroll. */
@media (max-width: 640px) and (prefers-reduced-motion: no-preference) {
    html {
        scroll-snap-type: y proximity;
    }

    .products-grid .product-card:nth-child(odd) {
        scroll-snap-align: start;
        scroll-margin-top: calc(var(--header-h, 68px) + 86px);
    }
}

/* ---------- Card ---------- */
.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    transition: var(--card-transition);
    position: relative;
    overflow: visible;
    cursor: pointer;
}

/* Entrance is owned by motion.css (scroll-aware, expo-eased). */

.product-card:focus-within {
    outline: 1px solid var(--border-light);
    outline-offset: 3px;
}

/* ---------- Media ---------- */
.product-card__media {
    position: relative;
    background: transparent;
    flex-shrink: 0;
}

.product-card__image-wrap {
    display: block;
    aspect-ratio: var(--card-image-ratio);
    width: 100%;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: hidden;
    background: #141414;
    line-height: 0;
    border-radius: 0;
    border: none;
}

.product-card__image-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: brightness(0.97);
    transform: scale(1.001);
    transition: transform 1.1s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)), filter 0.6s ease;
}

@media (hover: hover) {
    .product-card:hover .product-card__image-wrap img {
        transform: scale(1.055);
        filter: brightness(1.02);
    }
}

/* Discount tag — cut from the corner, editorial price-flag */
.product-card__discount-badge {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
    background: #f4f4f4;
    color: #0a0a0a;
    font-family: var(--font);
    font-size: 0.62rem;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 7px 12px;
    line-height: 1;
}

/* ---------- Body ---------- */
.product-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 14px 2px 0;
    gap: 7px;
    min-width: 0;
    background: transparent;
    align-items: flex-start;
    text-align: left;
}

.product-card__category { display: none; }

.product-card__title {
    font-family: var(--font);
    font-size: 0.92rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1.45;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.25s ease;
}

@media (min-width: 1200px) {
    .product-card__title {
        font-size: 0.98rem;
    }
}

@media (hover: hover) {
    .product-card:hover .product-card__title {
        opacity: 0.65;
    }
}

.product-card__excerpt {
    display: none; /* information lives in title + price — keep cards gallery-quiet */
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Rating — monochrome stars */
.product-card__rating {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--card-star);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
}

.product-card__rating i {
    font-size: 0.62rem;
}

.product-card__rating span {
    color: var(--text-light);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
}

.product-card__reviews,
.product-card__sold {
    display: none;
}

/* ---------- Prices — true strikethrough, side by side ---------- */
.product-card__prices {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 2px;
    padding-top: 0;
}

.product-card__price-sale {
    font-family: var(--font);
    font-size: 1.02rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    color: var(--text);
    order: -1;
    line-height: 1.2;
}

.product-card__price-original {
    font-size: 0.82rem;
    color: var(--text-light);
    text-decoration: line-through;
    text-decoration-thickness: 1px;
    text-decoration-color: rgba(255, 255, 255, 0.55);
    font-weight: 300;
    letter-spacing: 0.03em;
    line-height: 1.3;
}

/* kill legacy "Cut Price:" pseudo label */
.product-card__price-original::before {
    content: none !important;
}

@media (min-width: 1920px) {
    .product-card__price-sale { font-size: 1.1rem; }
}

/* ---------- Add to cart — ghost line button ---------- */
.product-card__add-btn {
    width: 100%;
    margin-top: 12px;
    padding: 13px 16px;
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: transparent;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.66rem;
    font-weight: 400;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease, opacity 0.3s ease;
}

.product-card__add-btn i { display: none; }

@media (hover: hover) {
    .product-card__add-btn:hover:not(:disabled) {
        background: var(--text);
        color: var(--bg);
        border-color: var(--text);
    }
}

.product-card__add-btn:active:not(:disabled) {
    transform: scale(0.99);
}

.product-card__add-btn:disabled {
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.16);
    color: var(--text-light);
    background: transparent;
    cursor: not-allowed;
    opacity: 0.75;
}

.product-card__add-btn.is-added {
    animation: btnPop 0.35s ease;
}

@keyframes btnPop {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.97); }
}

/* ---------- Skeletons ---------- */
.product-card--skeleton {
    pointer-events: none;
    cursor: default;
}

.product-card--skeleton .product-card__image-wrap,
.product-card--skeleton .product-card__title,
.product-card--skeleton .product-card__rating,
.product-card--skeleton .product-card__prices,
.product-card--skeleton .product-card__add-btn {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.3s infinite;
    border-radius: 0;
    color: transparent;
    border: none;
    box-shadow: none;
}

.product-card--skeleton .product-card__title {
    min-height: 1em;
    width: 78%;
}

.product-card--skeleton .product-card__prices {
    width: 55%;
    min-height: 1em;
}

.product-card--skeleton .product-card__add-btn {
    visibility: hidden;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============ Detail-page pricing — struck original beside sale ============ */
.product-price-block {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 14px;
}

.product-price--original {
    font-size: 1rem;
    color: var(--text-light);
    text-decoration: line-through;
    text-decoration-thickness: 1px;
    text-decoration-color: rgba(255, 255, 255, 0.55);
    font-weight: 300;
    order: 2;
}

.product-price--sale {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 500;
    font-style: italic;
    color: var(--text);
    order: 1;
    line-height: 1.1;
}

.product-detail-discount {
    display: inline-block;
    background: var(--text);
    color: var(--bg);
    font-size: 0.66rem;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 0;
    margin-left: 10px;
}
