/* ============================================================
   1. STRUCTURE COMMUNE & MOBILE (2 cartes par slide)
   ============================================================ */

/* Conteneur des sliders (Top Brands / Vendors) */
#top-brands,
#top-vendors,
.category-container {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 10px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

#top-brands::-webkit-scrollbar,
#top-vendors::-webkit-scrollbar {
    display: none;
}
.category-title {
    margin-top: 10px;
    margin-left: 10px;
    color: #1a237e;
    font-size: 1.5rem;
}
/* Grille Explorar Ofertas */
#explore-grid.category-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* 2 colonnes fixes */
    gap: 10px;
}

/* LA CARTE (Fixée à ~50% pour en voir 2) */
.market-item {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    /* On retire 20px pour l'espace entre les cartes et les bords */
    flex: 0 0 calc(50% - 20px);
    min-width: calc(50% - 20px);
    scroll-snap-align: start;
    border-radius: 8px;
    overflow: hidden;
}

.product-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    z-index: 1;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- LOGO (Z-index 20 pour être au-dessus de tout) --- */
.card-header-brand {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 20;
    pointer-events: none;
}

.brand-logo-mini {
    width: 50px;
    height: auto;
    /* filter: drop-shadow(0px 0px 3px rgba(0,0,0,0.5)); */
}

/* --- CONTENU MOBILE (Positionnement chirurgical) --- */
.partner-card-content {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 10px;
    background: #fff;
    min-height: 140px;
    /* Assure l'espace pour le bouton et la promo */
}

.partner-desc p {
    font-size: 12px;
    color: #333;
    margin: 0;
}

/* Bouton "Ir a ver" : 5px du bas */
.promo-button.js-market-link {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 15px;
    border-radius: 20px;
    background: #006edb;
    color: #fff;
    font-size: 13px;
    /* font-weight: bold; */
    text-decoration: none;
    white-space: nowrap;
}

/* Promo Code : 5px au dessus du bouton */
.promo-code-container,
.discount-container {
    position: absolute;
    bottom: 50px;
    left: 10px;
    right: 10px;
}

/* Input et Bouton Copier (Cohabitation forcée) */
.promo-code-box {
    display: flex;
    width: 100%;
    border-radius: 24px;
    background: #fff;
    justify-content: center;
    align-items: center;
    border: 1px solid #f8f8f8;

}

.promo-code-box input {
    flex: 1;
    min-width: 0;
    /* Permet à l'input de rétrécir */
    height: 30px;
    font-size: 11px;
    padding: 0 5px;
    background: transparent;
    border: none;
    border-radius: 24px 0 0 24px;
}

.promo-code-box .copy-btn {
    flex-shrink: 0;
    /* Interdit au bouton de rétrécir */
    height: 28px;
    padding: 0 8px;
    font-size: 11px;
    color: #333;
    background: transparent;
    border-radius: 14px;
    border-top: none;
    border-right: none;
    margin-right: 2px;
}

.filter-btn {
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid #f4f4f4;
    background-color: #e9e9e9;
    color: #333;
    /* font-size: 14px; */
    /* font-weight: 500; */
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* ============================================================
   2. GRANDS ÉCRANS (DESKTOP 1024px+)
   ============================================================ */

@media (min-width: 1024px) {
    .category-title {
    margin-top: 25px;
    margin-left: 25px;
    font-size: 2rem;
}
    .market-item {
        width: 400px !important;
        height: 400px !important;
        flex: 0 0 400px;
        min-width: 400px;
        /* 1. Le parent principal doit créer un nouveau contexte d'empilement */
        position: relative;
        overflow: hidden; /* Pour que le voile ne dépasse pas des arrondis */
    }

    #explore-grid.category-container {
        grid-template-columns: repeat(auto-fill, 400px);
        justify-content: center;
    }

    /* 2. L'image de fond doit être poussée en arrière-plan du contexte */
    .product-image-wrapper {
        position: relative;
        z-index: 1;
        /* Un étage bas */
    }

    
/* 2. LE VOILE NOIR (1/3 du bas) */
    .partner-card-content {
        position: absolute;
        /* On remplace inset: 0 par un positionnement ciblé */
        top: 66%;    /* Commence aux 2/3 de la hauteur */
        left: 0;
        right: 0;
        bottom: 0;
        
        height: 34%; /* Prend le tiers inférieur */
        z-index: 5;
        background: rgba(0, 0, 0, 0.5); /* Un peu plus sombre pour la lisibilité */
        
        padding: 10px 20px;
        display: flex;
        flex-direction: column;
        justify-content: flex-end; /* Centre le contenu dans le tiers */
    }
   
/* 3. LE LOGO (En haut à gauche) */
    /* Comme le voile s'arrête à 66%, il ne touchera JAMAIS le logo */
    .card-header-brand {
        position: absolute;
        top: 15px;
        left: 15px;
        z-index: 10;
    }

    .brand-logo-mini {
        width: 80px;
        height: auto;
        /* Optionnel : ombre pour qu'il ressorte sur l'image */
        /* filter: drop-shadow(0px 2px 4px rgba(0,0,0,0.3)); */
    }
    /* Reset du positionnement absolute pour le mode Overlay Desktop */
    .promo-button.js-market-link,
    .promo-code-container,
    .discount-container {
        position: static;
        transform: none;
        margin-top: 10px;
    }

    .promo-code-box {
        width: 45%;
        background: rgba(0, 0, 0, 0.2);
        border: 1px solid rgba(119, 119, 119, 0.5);
    }

    .promo-code-box input {
        flex: unset;
        background: transparent;
        border: none;
        padding-left: 10px;
        color: white;
    }

    .promo-code-box .copy-btn {
        color: #ccc;
    }

    .promo-button.js-market-link {
        font-size: unset;
        padding: 10px 15px;
        border-radius: 20px;
        text-align: center;
        background: #fff;
        color: #333;
        width: fit-content;
        align-self: center;
    }

    .partner-desc p {
        color: #fff;
        font-size: 14px;
    }
}