/* ── VARIABLES & BASES ────────────────────────────────────── */

/* ── GRILLE DE PRODUITS ───────────────────────────────────── */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 40px 20px;
    padding: 20px 0;
}

.no-prods {
    grid-column: 1 / -1;
    text-align: center;
    padding: 100px 0;
    font-family: 'Inter', sans-serif;
    color: var(--grey);
    letter-spacing: 1px;
}

/* ── CARTES PRODUITS ──────────────────────────────────────── */
.p-card {
    cursor: pointer;
    position: relative;
    transition: transform 0.4s ease;
}

.p-img-wrap {
    position: relative;
    aspect-ratio: 3 / 4;
    background: var(--light-grey);
    overflow: hidden;
    margin-bottom: 15px;
}

.p-img-main, .p-img-hover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.2, 1, 0.3, 1), opacity 0.5s ease;
}

.p-img-hover {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}

.p-card:hover .p-img-hover { opacity: 1; }
.p-card:hover .p-img-main { transform: scale(1.05); }

/* Badges & Tags */
.p-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 5px 10px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: white;
}
.t-new { background: var(--black); }
.t-sale { background: var(--red); }

.p-type-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 9px;
    text-transform: uppercase;
    color: var(--grey);
    letter-spacing: 1px;
}

/* Hover Actions */
.p-hover {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    display: flex;
    gap: 10px;
    transform: translateY(100%);
    transition: transform 0.4s ease;
    background: linear-gradient(to top, rgba(0,0,0,0.1), transparent);
}

.p-card:hover .p-hover { transform: translateY(0); }

.btn-add {
    flex: 1;
    background: var(--white);
    color: var(--black);
    border: none;
    padding: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
}

.btn-fav {
    background: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-fav svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    transition: fill 0.3s ease;
}

.btn-fav.liked svg { fill: var(--gold); stroke: var(--gold); }

/* Thumbs rapides sur carte */
.p-thumbs {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.p-card:hover .p-thumbs { opacity: 1; }

.p-thumb {
    width: 30px;
    height: 40px;
    object-fit: cover;
    border: 1px solid transparent;
}

.p-thumb.active { border-color: var(--black); }

/* Infos Produit */
.p-info {
    text-align: left;
}

.p-name {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    color: var(--black);
    margin-bottom: 4px;
}

.p-desc {
    font-size: 12px;
    color: var(--grey);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.p-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.p-price { font-weight: 600; font-size: 14px; }
.p-price s { color: var(--red); font-weight: 800; margin-right: 5px; }
.disc { color: var(--red); }

/* ── MODAL PRODUIT ────────────────────────────────────────── */
#productModalBg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f7f4ef;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

#productModalBg.on { opacity: 1; visibility: visible; }

.pm-box {
    width: 90%;
    max-width: 1000px;
    display: flex;
    gap: 40px;
    background: white;
    padding: 20px;
}

.pm-gallery {
    flex: 1.2;
    position: relative;
}

.pm-main-img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.pm-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
}

.pm-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 25px;
}

.pm-sizes {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.size-btn {
    border: 1px solid #ddd;
    background: none;
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.size-btn.active { background: var(--black); color: white; border-color: var(--black); }
.size-btn.oos { text-decoration: line-through; color: #ccc; cursor: not-allowed; }

/* ── RECHERCHE ────────────────────────────────────────────── */
#searchBar {
    position: fixed;
    top: -100px;
    left: 0;
    width: 100%;
    background: white;
    padding: 20px;
    transition: top 0.4s ease;
    z-index: 1500;
    border-bottom: 1px solid var(--light-grey);
}

#searchBar.open { top: 0; }

#searchResults {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

#searchResults.open { display: block; }

.search-result-item {
    display: flex;
    padding: 15px 10%;
    gap: 20px;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid var(--light-grey);
}

.search-result-item:hover { background: var(--off-white); }
.sri-img { width: 50px; height: 60px; object-fit: cover; }

/* ── ANIMATIONS ───────────────────────────────────────────── */
@keyframes up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
/* On cible l'ID précis pour avoir une priorité maximale */
#pmSizeErr.error-msg-luxe {
    display: none; /* Caché par défaut */
    color: #b22222 !important; /* Rouge Maison Lamarque */
    background: transparent !important; /* Supprime le fond blanc */
    border: none !important; /* Supprime toute bordure héritée */
    font-size: 11px !important;
    font-weight: 500;
    margin-top: 10px;
    padding: 0 !important; /* Supprime le padding qui donne l'effet "bloc" */
    text-transform: none;
    letter-spacing: 0.5px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* ── MOBILE ───────────────────────────────────────────────── */
@media (max-width: 768px) {
    .pm-box { flex-direction: column; overflow-y: auto; max-height: 90vh; }
    .grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
}
/*

*/
.pm-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    max-width: 1000px;
    background: var(--white);
    position: relative;
}
/* ── MODE SOMBRE SPÉCIFIQUE (HOMME) ── */

/* Fond de la section */
.cat-products-dark {
    background-color: #f7f4ef !important; /* Noir profond */
}

/* Adaptation de la carte en mode sombre */
.cat-products-dark .p-card {
    background: white;
}

.cat-products-dark .p-img-wrap {
    background: white; /* Fond des images un peu plus sombre */
}

.cat-products-dark .p-name {
    color: var(--black); /* Nom en blanc sur fond noir */
}

.cat-products-dark .p-desc {
    color: var(--grey);
}

.cat-products-dark .p-price {
    color: var(--gold); /* Le doré ressort mieux sur le noir */
}

/* Ajustement de la bordure d'info pour le mode sombre */
.cat-products-dark .p-info {
    border-color: rgba(255, 255, 255, 0.05);
}
.pm-gallery { background: #f9f9f9; padding: 20px; }
.pm-main-img { width: 100%; aspect-ratio: 3/4; object-fit: contain; }
.pm-thumbs { display: flex; gap: 10px; margin-top: 15px; justify-content: center; }
.pm-thumb { width: 60px; height: 80px; object-fit: cover; cursor: pointer; border: 1px solid transparent; }
.pm-thumb.active { border-color: var(--black); }

.pm-info { padding: 40px; display: flex; flex-direction: column; gap: 20px; }
.pm-name { font-family: var(--font-display); font-size: 32px; font-weight: 300; }
.pm-price { font-size: 24px; color: var(--gold); }

.pm-actions { display: flex; gap: 15px; margin-top: 20px; }
button.btn-add-large {
    appearance: none;
    -webkit-appearance: none;
    flex: 1;
    width: 100%;
    background: var(--black, #0A0A0A);
    color: var(--white, #F5F0E8);
    border: 1px solid var(--black, #0A0A0A);
    padding: 18px;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

button.btn-add-large:hover {
    background: var(--gold, #C8A050);
    color: var(--black, #0A0A0A);
    border-color: var(--gold, #C8A050);
}

.btn-fav-large { background: var(--off-white); border: none; cursor: pointer; }
.icon-heart { width: 24px; fill: none; stroke: var(--black); stroke-width: 1.5; transition: 0.3s; }
.btn-fav-large.active .icon-heart { fill: var(--red); stroke: var(--red); }

@media (max-width: 768px) {
    .pm-box { grid-template-columns: 1fr; }
}
/* Bouton "Ajouter au panier" quand il est désactivé */
.btn-add:disabled, .btn-sold-out {
    background-color: #e0e0e0 !important;
    color: #999 !important;
    cursor: not-allowed !important;
    border: 1px solid #ccc !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

/* Style spécifique pour les pastilles de tailles épuisées */
.size-btn.out-of-stock {
    position: relative;
    opacity: 0.5;
    background: #f9f9f9;
    color: #ccc;
    cursor: not-allowed;
    text-decoration: line-through; /* Optionnel : barre la taille */
}

/* Petit message d'alerte discret sous le bouton */
.stock-alert {
    color: #c5a059; /* Ton doré Lamarque */
    font-family: 'Jost', sans-serif;
    font-size: 0.85rem;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 400;
}

/* Animation pour faire apparaître le message doucement */
.fade-in-alert {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}
/* 1. Le Badge "Sold Out" sur l'image (Grille de produits) */
.product-card { position: relative; overflow: hidden; }

.sold-out-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    color: #111;
    padding: 8px 15px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 2px;
    z-index: 10;
    border: 1px solid #eee;
    backdrop-filter: blur(5px);
}

/* 2. L'image du produit épuisé (Effet noir et blanc léger) */
.product-card.is-sold-out img {
    filter: grayscale(0.8) opacity(0.7);
    transition: all 0.5s ease;
}

/* 3. Sélecteur de tailles pro */
.size-selector {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.size-btn {
    width: 45px;
    height: 45px;
    border: 1px solid #ddd;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Jost', sans-serif;
    position: relative;
}

/* Taille épuisée : La croix fine en diagonale */
.size-btn.out-of-stock {
    color: #ccc;
    background: #fdfdfd;
    cursor: not-allowed;
    border-color: #eee;
}

.size-btn.out-of-stock::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: #eee;
    transform: rotate(-45deg);
}

/* 4. Le bouton d'action principal */
.btn-add {
    width: 100%;
    padding: 18px;
    background: #111;
    color: #fff;
    border: none;
    font-family: 'Jost', sans-serif;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 500;
    transition: 0.4s;
}

.btn-add:disabled {
    background: #f4f4f4;
    color: #aaa;
    border: 1px solid #eee;
    cursor: not-allowed;
}

/* Message sous le bouton */
.stock-status-msg {
    margin-top: 15px;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1rem;
    color: #c5a059; /* Ton doré */
    text-align: center;
}
/* Rend l'image du produit un peu plus fade si épuisé */
.p-card.is-sold-out .p-img-main {
    filter: grayscale(0.6) opacity(0.8);
}

/* Badge Sold Out élégant */
.sold-out-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    padding: 5px 12px;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 1px solid #000;
    z-index: 5;
}

/* Bouton Ajouter au panier quand désactivé */
.btn-add.disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
}
/* Style de base du bouton de taille */
.size-btn {
    position: relative;
    width: 45px;
    height: 45px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden; /* Important pour que la barre ne dépasse pas */
}

/* État : Épuisé (La taille barrée) */
.size-btn.out-of-stock {
    color: #ccc !important;
    background: #fdfdfd !important;
    border-color: #eee !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

/* La ligne diagonale fine */
.size-btn.out-of-stock::after {
    content: "";
    position: absolute;
    top: 50%;
    left: -10%;
    width: 120%;
    height: 1px;
    background: #ccc; /* Couleur de la barre */
    transform: rotate(-45deg); /* Angle de la barre */
    transform-origin: center;
}

/* État : Sélectionné (Taille disponible cliquée) */
.size-btn.active {
    background: #111;
    color: #fff;
    border-color: #111;
}
/* Message d'erreur élégant (pas de boîte de dialogue) */
.error-msg-luxe {
    color: var(--red);
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 10px;
    font-weight: 500;
}

/* Animation de secousse */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}
/* Bouton de taille épuisée */
.size-btn.oos, .size-btn:disabled {
    position: relative;
    color: #ccc !important;
    background: #f9f9f9 !important;
    border-color: #eee !important;
    cursor: not-allowed !important;
    text-decoration: none !important; /* On gère la barre nous-mêmes */
}

/* La ligne diagonale fine (La croix) */
.size-btn.oos::after, .size-btn:disabled::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: #ddd;
    transform: rotate(-45deg);
}
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000 !important;
}

.success-animation {
    background-color: var(--gold) !important;
    color: var(--black) !important;
    border-color: var(--gold) !important;
    transition: all 0.2s ease;
}