/* LEAVAH PARIS — Product Cards — classes identiques DA */

.catalogue-section {
    background: #fafafa;
}

.catalogue-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.catalogue-grid .product-card {
    transition: transform var(--transition), opacity 0.4s ease;
}

.product-card.hidden { display: none; }

.product-card {
    background: #ffffff;
    border: none;
    border-radius: 0;
    overflow: visible;
    cursor: pointer;
    position: relative;
    will-change: transform;
}

.product-card:hover .product-card-overlay {
    opacity: 1;
}

.product-img {
    width: 100%;
    aspect-ratio: 3/4;
    position: relative;
    overflow: hidden;
    background: #f7f7f7;
}

.product-img img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease, transform 0.6s ease;
}

.product-img .img-main {
    opacity: 1;
    z-index: 1;
}

.product-img .img-worn {
    opacity: 0;
    z-index: 2;
}

/* Swap main → worn UNIQUEMENT si une 2e image existe (sinon main resterait
   masquée et laisserait apparaître le fond de .product-img → effet "blanc"). */
.product-card:not(.swatch-hover):has(.img-worn):hover .img-main {
    opacity: 0;
}

.product-card:not(.swatch-hover):hover .img-worn {
    opacity: 1;
}

/* Zoom doux sur l'image au survol — appliqué aussi quand il n'y a qu'une seule
   image, pour conserver un feedback visuel cohérent. */
.product-card:hover .product-img img {
    transform: scale(1.04);
}

/* Pendant le hover swatch : fige main visible, worn caché */
.product-card.swatch-hover .img-main { opacity: 1; }
.product-card.swatch-hover .img-worn  { opacity: 0; }

.product-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
}

/* Masque l'overlay "Ajouter au panier" + badge "Plus que quelques pièces"
   sur MOBILE (téléphone) uniquement — sur tablette et PC ils restent affichés
   (demande client). Critère = largeur d'écran seule (≤600px, breakpoint
   « petit écran » du site ; l'iPad portrait fait 768px → conservé) :
   - fonctionne aussi en émulation responsive desktop (Safari RDM/FF), où un
     critère (hover: none) ne matchait pas (pointeur souris) ;
   - sur téléphone, le 1er tap déclenchait un hover sticky qui affichait
     l'overlay au lieu d'ouvrir la fiche → sans overlay, le tap ouvre
     directement la fiche produit (cf. product-modal.js). */
@media (max-width: 600px) {
    .product-card-overlay { display: none; }
}

.product-fav {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.85);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.product-fav:hover {
    background: #fff;
    transform: scale(1.1);
}

.product-fav svg {
    width: 18px;
    height: 18px;
    stroke: #1a1a1a;
    fill: none;
    stroke-width: 1.8;
    transition: fill 0.25s ease, stroke 0.25s ease;
}

.product-fav.is-fav svg {
    fill: #e74c3c;
    stroke: #e74c3c;
}

/* Tout bouton cœur [data-fav-id] (état piloté par favorites.js via .is-fav) :
   valeurs explicites, jamais currentColor (Safari applique sa couleur d'accent). */
[data-fav-id] svg {
    fill: none;
    stroke: #1a1a1a;
}
[data-fav-id].is-fav svg {
    fill: #e74c3c;
    stroke: #e74c3c;
}

/* ===== TOOLTIP info-bulle favoris ===== */
.product-fav[data-tooltip] {
    position: absolute; /* déjà défini, rappel pour ::after */
}

.product-fav[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: #1a1a1a;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    padding: 5px 10px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
    z-index: 10;
}

.product-fav[data-tooltip]:hover::after {
    opacity: 1;
}

.product-info {
    padding: 14px 0 0 0;
}

.product-info h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    color: #1a1a1a;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    line-height: 1.4;
    text-transform: none;
}

.product-info .product-price {
    font-family: 'Montserrat', sans-serif;
    color: #1a1a1a;
    font-weight: 300;
    font-size: 0.8rem;
    margin-bottom: 14px;
    letter-spacing: 0.3px;
}

.color-swatches {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 8px 0;
    margin: 0;
    /* Zone cliquable élargie — empêche le rollover parasite entre swatches */
    position: relative;
}

.color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    border: none;
    padding: 0;
    outline: none;
    background: none;
}

.color-swatch-inner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: block;
}

.color-swatch::before {
    content: '';
    position: absolute;
    top: -4px; left: -4px; right: -4px; bottom: -4px;
    border-radius: 50%;
    border: 1.5px solid transparent;
    transition: border-color 0.2s ease;
    pointer-events: none;
}

.color-swatch:hover::before,
.color-swatch.active::before {
    border-color: #1a1a1a;
}

.swatch-inner-gold    { background: #d4b06a; }
.swatch-inner-silver  { background: #c0c0c0; }
.swatch-inner-rosegold { background: #d4a0a0; }

.btn-add {
    width: 100%;
    padding: 12px 20px;
    background: #1a1a1a;
    border: none;
    border-radius: 0;
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-add:hover { background: #333; }
.btn-add--out { background: #999; cursor: not-allowed; }
.btn-add--out:hover { background: #999; }
.stock-badge-low {
    display: none;
    font-size: 0.6rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #c8a05a;
    text-align: center;
    margin-top: 6px;
}
/* Affiché par catalogue-filter.js quand la couleur sélectionnée est en stock faible */
.stock-badge-low.is-visible { display: block; }

/* ===== PAGES CATALOGUE / CATÉGORIE ===== */
.catalogue-page-wrap {
    padding-top: 80px;
}

.catalogue-page-wrap .section {
    padding-top: 40px;
}

/* ===== FILTRES + TRI ===== */
.filters-bar {
    display: flex;
    align-items: stretch;
    margin-bottom: 60px;
    border-top: 1px solid #d8d0c4;
    border-bottom: 1px solid #d8d0c4;
}

.filters {
    display: flex;
    flex: 1;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0;
    border: none;
    margin-bottom: 0;
}

.sort-btns {
    display: flex;
    align-items: center;
    border-left: 1px solid #d8d0c4;
    border-right: 1px solid #d8d0c4;
    padding: 0 12px;
    gap: 4px;
    flex-shrink: 0;
}

.sort-form {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 8px 10px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #6e6e6e; /* contraste AA (4,5:1) sur fond clair ; #aaa : 2,2:1 */
    font-family: 'Montserrat', sans-serif;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.sort-btn:hover { color: #1a1a1a; border-color: #d8d0c4; }
.sort-btn.active { color: #1a1a1a; border-color: var(--gold); }


.filter-btn {
    padding: 18px 22px;
    background: transparent;
    border: none;
    border-right: 1px solid #d8d0c4;
    color: #6e6e6e; /* contraste AA (4,5:1) sur fond clair ; #aaa : 2,2:1 */
    font-family: 'Montserrat', sans-serif;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.filter-btn:first-child { border-left: 1px solid #d8d0c4; }

.filter-btn::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: var(--gold);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active { color: #1a1a1a; }

.filter-btn:hover::after,
.filter-btn.active::after { transform: scaleX(1); }

.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    padding: 1px 5px;
    background: #e8e2d8;
    color: #888;
    font-size: 0.55rem;
    font-weight: 600;
    border-radius: 10px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    transition: background 0.3s, color 0.3s;
}

.filter-btn.active .filter-count,
.filter-btn:hover .filter-count {
    background: var(--gold);
    color: #fff;
}

@media (max-width: 900px) {
    .catalogue-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* Sur mobile, on garde 2 colonnes (l'UX e-commerce attend de voir 4 produits
   d'un coup au scroll, pas 1 énorme par ligne). On réduit la taille des
   éléments internes du card pour rester lisible. */
@media (max-width: 600px) {
    .catalogue-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .product-card {
        font-size: 0.85rem;
    }
    .product-card .product-name,
    .product-card .product-title {
        font-size: 0.82rem;
        line-height: 1.3;
    }
    .product-card .product-price {
        font-size: 0.85rem;
    }
    /* Image carrée pour gagner en hauteur vs portrait */
    .product-card .product-img,
    .product-card .img-main {
        aspect-ratio: 1;
        height: auto;
    }
    /* Padding contenu compact */
    .product-card .product-info {
        padding: 8px 10px;
    }
    /* Boutons swatches couleurs plus petits. Le disque interne DOIT suivre
       la même taille que le bouton, sinon il déborde et le cercle de
       sélection (::before, calé sur le bouton) n'est plus centré sur la
       pastille visible. */
    .product-card .color-swatch {
        width: 14px;
        height: 14px;
    }
    .product-card .color-swatch-inner {
        width: 14px;
        height: 14px;
    }

    /* Filtres compacts pour qu'ils tiennent sans scroll horizontal
       sur 375px (TOUT + ARGENT + OR + OR ROSE + 3 boutons tri).
       Les pastilles count sont masquées en mobile (info redondante,
       on voit déjà la grille filtrée). */
    .filters { overflow-x: hidden; }
    .filter-btn {
        padding: 12px 4px;
        font-size: 0.5rem;
        letter-spacing: 0.5px;
        flex: 1;
        min-width: 0;
        text-align: center;
    }
    .filter-count { display: none; }
    .sort-btns { padding: 0 4px; gap: 2px; }
    .sort-btn { padding: 6px 3px; font-size: 0.55rem; gap: 1px; }
}
