/* ==========================================================
   ZANDOS MARKETPLACE — PAGE D’ACCUEIL
   INDEX.CSS
   Version Premium lisible

   MAINTENANCE RAPIDE :

   1. Variables
   2. Sections
   3. Carrousels
   4. Cartes produits
   5. Photos
   6. Promotions
   7. Favoris
   8. Informations et prix
   9. Flèches
   10. Marques
   11. Responsive

   COMPORTEMENT :

   - Ordinateur : 4 produits visibles
   - Tablette   : 3 produits visibles
   - Mobile     : presque 2 produits visibles
   - Les produits supplémentaires défilent horizontalement
========================================================== */


/* ==========================================================
   1. VARIABLES
========================================================== */

:root {
    --black: #111111;
    --text: #343434;
    --gray: #6f6f6f;

    --border: #e7e7e7;

    --photo-background: #f2f2f2;

    --white: #ffffff;
    --promo: #e30613;
    --orange: #f76902;

    --radius-photo: 16px;
    --page-padding: 4%;
}


/* ==========================================================
   2. BASE
========================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;

    overflow-x: hidden;

    color: var(--black);
    background: var(--white);

    font-family: "Inter", sans-serif;
    font-size: 14px;

    -webkit-font-smoothing: antialiased;
}

main {
    width: 100%;
    overflow: hidden;
}

img {
    display: block;

    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}


/* ==========================================================
   3. SECTIONS

   Toutes les sections restent blanches.

   Pour réduire ou augmenter l’espace vertical entre
   les catégories, modifie la valeur 72px.
========================================================== */

.featured-section,
.category-section {
    position: relative;

    width: 100%;

    padding:
        72px
        var(--page-padding);

    background: var(--white);
}

.featured-section {
    padding-top: 78px;
}

#categories-container {
    width: 100%;
}


/* ==========================================================
   4. EN-TÊTES DES SECTIONS
========================================================== */

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 30px;
    margin-bottom: 30px;
}

.section-header > div {
    display: flex;
    flex-direction: column;

    min-width: 0;

    gap: 7px;
}

.section-header h2 {
    color: var(--black);

    font-size: clamp(28px, 2.35vw, 37px);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -1.4px;
}

.section-header p {
    color: var(--gray);

    font-size: 14px;
    line-height: 1.55;
}

.section-header > a,
.section-header button {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;

    min-height: 38px;

    padding: 0;

    color: var(--black);
    background: transparent;

    border: 0;

    font-size: 14px;
    font-weight: 650;

    cursor: pointer;
}

.section-header > a::after,
.section-header button::after {
    content: "\2192";

    margin-left: 9px;

    font-size: 18px;
    font-weight: 400;

    transition: transform 0.2s ease;
}

.section-header > a:hover::after,
.section-header button:hover::after {
    transform: translateX(4px);
}


/* ==========================================================
   5. CONTENEUR DU CARROUSEL
========================================================== */

.products-slider {
    position: relative;

    width: 100%;
}


/* ==========================================================
   6. LIGNE DES PRODUITS
========================================================== */

.product-row {
    display: flex;

    width: 100%;

    gap: 16px;

    overflow-x: auto;
    overflow-y: hidden;

    padding: 0 0 14px;

    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;

    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;

    overscroll-behavior-inline: contain;
}

.product-row::-webkit-scrollbar {
    display: none;
}


/* ==========================================================
   7. CARTE PRODUIT

   Le calcul permet d’afficher exactement quatre cartes
   sur ordinateur avec trois espacements de 16px.
========================================================== */

.product-card {
    position: relative;

    flex: 0 0 calc((100% - 48px) / 4);
    min-width: calc((100% - 48px) / 4);

    overflow: visible;

    background: transparent;

    cursor: pointer;

    scroll-snap-align: start;
}

.product-card:focus-visible {
    outline: 3px solid rgba(17, 17, 17, 0.2);
    outline-offset: 5px;
}


/* ==========================================================
   8. PHOTO DU PRODUIT

   object-fit: cover remplit la case.

   Si tes images possèdent déjà toutes un fond identique
   et ne doivent jamais être coupées, tu peux remplacer :

   object-fit: cover;

   par :

   object-fit: contain;
========================================================== */

.product-image {
    position: relative;

    width: 100%;
    aspect-ratio: 3 / 4;

    overflow: hidden;

    background: var(--photo-background);

    border-radius: var(--radius-photo);

    isolation: isolate;
}

.product-image img {
    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center;

    transition: transform 0.4s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.02);
}


/* ==========================================================
   9. BADGE PROMOTIONNEL

   Le badge doit se trouver dans .product-image.
========================================================== */

.product-badge {
    position: absolute;
    z-index: 5;

    bottom: 11px;
    left: 11px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 28px;

    padding: 5px 10px;

    color: var(--white);
    background: var(--promo);

    border-radius: 5px;

    font-size: 11px;
    font-weight: 750;
    line-height: 1;
}


/* ==========================================================
   10. FAVORIS

   Le bouton fonctionne visuellement.

   Son enregistrement permanent dans un compte client
   nécessitera une route backend dédiée.
========================================================== */

.favorite-btn {
    position: absolute;
    z-index: 6;

    top: 11px;
    right: 11px;

    display: grid;

    width: 42px;
    height: 42px;

    place-items: center;

    padding: 0;

    color: var(--black);
    background: rgba(255, 255, 255, 0.96);

    border: 0;
    border-radius: 50%;

    font-size: 19px;

    cursor: pointer;

    transition:
        color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}

.favorite-btn:hover {
    color: var(--promo);

    transform: scale(1.05);
}

.favorite-btn.active {
    color: var(--white);
    background: var(--promo);
}


/* ==========================================================
   11. INFORMATIONS DU PRODUIT
========================================================== */

.product-content {
    padding:
        13px
        1px
        2px;
}


/* Marque du produit */

.product-content h3 {
    overflow: hidden;

    margin-bottom: 4px;

    color: var(--black);

    font-size: 15px;
    font-weight: 750;
    line-height: 1.35;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* Petite description */

.product-description {
    display: -webkit-box;

    min-height: 41px;

    overflow: hidden;

    margin-bottom: 9px;

    color: var(--text);

    font-size: 14px;
    line-height: 1.45;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* ==========================================================
   VENDEUR SUR CARTE PRODUIT
========================================================== */

.product-seller {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 4px;

    margin-top: 6px;

    color: #777777;

    font-size: 11px;
    line-height: 1.4;
}


.product-seller-label {
    color: #8a8a8a;
}


.product-seller-name {
    color: #333333;

    font-weight: 600;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}


.product-seller-verified {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    color: #f76902;

    font-size: 11px;
}

/* ==========================================================
   NOTE ET AVIS DU PRODUIT
========================================================== */

.product-rating {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    min-height: 22px;

    gap: 6px;
    margin-bottom: 9px;

    color: var(--gray);

    font-size: 12px;
    line-height: 1.4;
}


/* Groupe des cinq étoiles */

.product-stars {
    display: inline-flex;
    align-items: center;

    gap: 2px;

    color: var(--black);

    font-size: 11px;
    line-height: 1;
}


/* Valeur numérique : exemple 4,8 */

.product-rating-value {
    color: var(--black);

    font-size: 12px;
    font-weight: 650;
}


/* Nombre d’avis */

.product-review-count {
    color: var(--gray);

    font-size: 12px;
    font-weight: 400;
}


/* ==========================================================
   NOTE ET AVIS — MOBILE
========================================================== */

@media (max-width: 700px) {

    .product-rating {
        min-height: 20px;

        gap: 4px;
        margin-bottom: 7px;

        font-size: 11px;
    }

    .product-stars {
        gap: 1px;

        font-size: 9px;
    }

    .product-rating-value,
    .product-review-count {
        font-size: 11px;
    }

}


/* ==========================================================
   NOTE ET AVIS — TRÈS PETIT ÉCRAN
========================================================== */

@media (max-width: 360px) {

    .product-rating {
        gap: 3px;
    }

    .product-stars {
        font-size: 8px;
    }

    /*
       La valeur numérique est masquée uniquement sur
       les écrans extrêmement étroits.

       Les étoiles et le nombre d’avis restent visibles.
    */

    .product-rating-value {
        display: none;
    }

}

/* ==========================================================
   12. PRIX
========================================================== */

.price-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    gap: 4px;
}

.normal-price,
.new-price {
    color: var(--black);

    font-size: 16px;
    font-weight: 650;
    line-height: 1.3;
}

.new-price {
    color: var(--promo);

    font-weight: 750;
}

.reference-price {
    color: var(--gray);

    font-size: 12px;
    line-height: 1.5;
}

.old-price {
    color: var(--gray);

    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

.discount {
    margin-left: 3px;

    color: var(--promo);

    font-weight: 650;
}


/* ==========================================================
   13. FLÈCHES DU CARROUSEL

   La flèche gauche disparaît au début.
   La flèche droite disparaît à la fin.
========================================================== */

.slider-arrow {
    position: absolute;
    z-index: 20;

    top: 40%;

    display: grid;

    width: 46px;
    height: 46px;

    place-items: center;

    color: var(--black);
    background: rgba(255, 255, 255, 0.97);

    border: 1px solid var(--border);
    border-radius: 50%;

    box-shadow: 0 7px 22px rgba(0, 0, 0, 0.12);

    font-size: 15px;

    cursor: pointer;

    transform: translateY(-50%);

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        color 0.2s ease,
        background 0.2s ease;
}

.slider-arrow:hover {
    color: var(--white);
    background: var(--black);
}

.slider-arrow-left {
    left: -21px;
}

.slider-arrow-right {
    right: -21px;
}

.slider-arrow:disabled {
    opacity: 0;
    visibility: hidden;

    pointer-events: none;
}


/* ==========================================================
   14. MARQUES
========================================================== */

.brands {
    width: 100%;

    padding:
        72px
        var(--page-padding)
        88px;

    background: var(--white);

    border-top: 1px solid var(--border);
}

.brands h2 {
    margin-bottom: 26px;

    color: var(--black);

    font-size: clamp(28px, 2.35vw, 37px);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -1.4px;
}

.brand-scroll {
    display: flex;

    width: 100%;

    gap: 10px;

    overflow-x: auto;

    padding-bottom: 8px;

    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.brand-scroll::-webkit-scrollbar {
    display: none;
}

.brand-scroll a {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;

    min-height: 44px;

    padding: 0 21px;

    color: var(--black);
    background: var(--white);

    border: 1px solid var(--border);
    border-radius: 50px;

    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;

    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}

.brand-scroll a:hover {
    color: var(--white);
    background: var(--black);
    border-color: var(--black);
}


/* ==========================================================
   15. ÉTAT VIDE
========================================================== */

.empty-products {
    width: 100%;

    padding: 40px 0;

    color: var(--gray);

    font-size: 14px;
}


/* ==========================================================
   16. TABLETTE — TROIS PRODUITS
========================================================== */

@media (max-width: 1100px) {

    .product-row {
        gap: 14px;
    }

    .product-card {
        flex-basis: calc((100% - 28px) / 3);
        min-width: calc((100% - 28px) / 3);
    }

    .slider-arrow-left {
        left: -17px;
    }

    .slider-arrow-right {
        right: -17px;
    }

}


/* ==========================================================
   17. MOBILE — PRESQUE DEUX PRODUITS

   Une petite partie du produit suivant reste visible pour
   indiquer que la section peut défiler horizontalement.
========================================================== */

@media (max-width: 700px) {

    :root {
        --page-padding: 16px;
        --radius-photo: 11px;
    }


    /* SECTIONS */

    .featured-section,
    .category-section {
        padding-top: 48px;
        padding-bottom: 48px;
    }


    /* EN-TÊTES */

    .section-header {
        align-items: flex-end;

        gap: 12px;
        margin-bottom: 22px;
    }

    .section-header h2 {
        font-size: 24px;
        letter-spacing: -0.9px;
    }

    .section-header p {
        max-width: 220px;

        font-size: 13px;
        line-height: 1.5;
    }

    .section-header > a,
    .section-header button {
        min-height: 30px;

        font-size: 12px;
        white-space: nowrap;
    }

    .section-header > a::after,
    .section-header button::after {
        margin-left: 6px;

        font-size: 16px;
    }


    /* CARROUSEL */

    .product-row {
        width: calc(100% + var(--page-padding));

        gap: 10px;

        padding-right: var(--page-padding);
        padding-bottom: 10px;
    }

    .product-card {
        flex: 0 0 46%;
        min-width: 46%;
    }


    /* Sur mobile, le doigt remplace les flèches */

    .slider-arrow {
        display: none;
    }


    /* PHOTO */

    .product-image {
        border-radius: var(--radius-photo);
    }

    .product-card:hover .product-image img {
        transform: none;
    }


    /* BADGE PROMO */

    .product-badge {
        bottom: 8px;
        left: 8px;

        min-height: 24px;

        padding: 4px 8px;

        font-size: 10px;
    }


    /* FAVORIS */

    .favorite-btn {
        top: 8px;
        right: 8px;

        width: 35px;
        height: 35px;

        font-size: 16px;
    }


    /* INFORMATIONS */

    .product-content {
        padding-top: 10px;
    }

    .product-content h3 {
        margin-bottom: 3px;

        font-size: 13px;
    }

    .product-description {
        min-height: 35px;

        margin-bottom: 7px;

        font-size: 12px;
        line-height: 1.45;
    }


    /* PRIX */

    .normal-price,
    .new-price {
        font-size: 15px;
    }

    .reference-price {
        font-size: 11px;
        line-height: 1.45;
    }


    /* MARQUES */

    .brands {
        padding-top: 52px;
        padding-bottom: 64px;
    }

    .brands h2 {
        margin-bottom: 21px;

        font-size: 24px;
        letter-spacing: -0.9px;
    }

    .brand-scroll a {
        min-height: 42px;

        padding: 0 18px;

        font-size: 13px;
    }

}


/* ==========================================================
   18. TRÈS PETITS ÉCRANS
========================================================== */

@media (max-width: 360px) {

    .product-card {
        flex-basis: 48%;
        min-width: 48%;
    }

    /*
       La description de section peut être masquée afin
       de laisser suffisamment d’espace au lien Voir tout.
    */

    .section-header p {
        display: none;
    }

    .product-content h3 {
        font-size: 12px;
    }

    .product-description {
        font-size: 11px;
    }

    .normal-price,
    .new-price {
        font-size: 14px;
    }

}


/* ==========================================================
   19. ACCESSIBILITÉ
========================================================== */

.favorite-btn:focus-visible,
.slider-arrow:focus-visible,
.section-header a:focus-visible,
.section-header button:focus-visible,
.brand-scroll a:focus-visible {
    outline: 3px solid rgba(247, 105, 2, 0.3);
    outline-offset: 3px;
}


/* ==========================================================
   20. RÉDUCTION DES ANIMATIONS
========================================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }

}