/*
Theme Name: Salient Child Theme
Description: This is a custom child theme for Salient
Theme URI: https://themeforest.net/item/salient-responsive-multipurpose-theme/4363266
Author: ThemeNectar
Author URI: https://themeforest.net/user/themenectar
Template: salient
Version: 1.0
*/


/* =========================================================
   GOODMAMS — COULEURS
   ========================================================= */

:root {
    --goodmams-beige: #f0e1d2;
    --goodmams-text: #242424;
    --goodmams-heart: #c94f57;
}


/* =========================================================
   1. EN-TÊTE BOUTIQUE ET ARCHIVES
   ========================================================= */

/* Masquer l'en-tête natif de Salient */

body.woocommerce-shop .nectar-shop-header,
body.woocommerce.archive .nectar-shop-header {
    display: none !important;
}


/* En-tête GOODMAMS */

.goodmams-shop-header {
    width: 100%;
    max-width: 900px;
    margin: 42px auto 0;
    padding: 0 20px;
    text-align: center;
}

.goodmams-shop-header h1 {
    margin: 0 0 12px;
    font-size: clamp(38px, 4.5vw, 68px);
    line-height: 1;
}

.goodmams-shop-header p {
    max-width: 650px;
    margin: 0 auto;
}


/* =========================================================
   2. NAVIGATION PRINCIPALE BOUTIQUE
   ========================================================= */

.goodmams-shop-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;

    gap: 10px;

    width: 100%;
    margin: 28px 0 42px;
}

.goodmams-shop-nav__link,
.goodmams-shop-nav__collections > summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;
    padding: 9px 18px;

    border: 1px solid rgba(30, 30, 30, 0.16);
    border-radius: 999px;

    background: transparent;
    color: var(--goodmams-text);

    font-size: 14px;
    line-height: 1;
    font-weight: 400;
    text-decoration: none;

    cursor: pointer;

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


/* Catégorie active */

.goodmams-shop-nav__link.is-active {
    background: var(--goodmams-text);
    border-color: var(--goodmams-text);
    color: #fff;
}


/* =========================================================
   3. MENU DÉROULANT COLLECTIONS
   ========================================================= */

.goodmams-shop-nav__collections {
    position: relative;
}

.goodmams-shop-nav__collections > summary {
    list-style: none;
}

.goodmams-shop-nav__collections > summary::-webkit-details-marker {
    display: none;
}

.goodmams-shop-nav__collections > summary::after {
    content: "↓";
    margin-left: 8px;
    font-size: 11px;
    transition: transform 0.2s ease;
}

.goodmams-shop-nav__collections[open] > summary::after {
    transform: rotate(180deg);
}

.goodmams-shop-nav__dropdown {
    position: absolute;
    z-index: 100;

    top: calc(100% + 8px);
    left: 50%;

    transform: translateX(-50%);

    min-width: 190px;
    padding: 8px;

    background: #fff;

    border: 1px solid rgba(30, 30, 30, 0.12);
    border-radius: 14px;

    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
}

.goodmams-shop-nav__dropdown a {
    display: block;
    padding: 11px 13px;

    border-radius: 9px;

    color: var(--goodmams-text);
    font-size: 13px;
    line-height: 1.3;
    text-decoration: none;
}


/* =========================================================
   4. NAVIGATION DES SOUS-CATÉGORIES
   ========================================================= */

.goodmams-subcategory-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;

    gap: 8px;

    width: 100%;
    margin: -22px 0 38px;
}

.goodmams-subcategory-nav__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 38px;
    padding: 8px 15px;

    border-radius: 999px;

    background: transparent;
    color: #777;

    font-size: 13px;
    line-height: 1;
    text-decoration: none;

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

.goodmams-subcategory-nav__link.is-active {
    background: #eee9e2;
    color: var(--goodmams-text);
}


/* =========================================================
   5. CARTES PRODUITS
   ========================================================= */

.woocommerce ul.products li.product {
    position: relative !important;

    overflow: hidden;
    padding-bottom: 0;

    background-color: var(--goodmams-beige);
    border-radius: 14px;

    text-align: left !important;

    transition: transform 0.25s ease;
}


/* =========================================================
   6. ZONE IMAGE PRODUIT
   ========================================================= */

/*
 * Tous les conteneurs de l'image utilisent
 * le même beige que le bas de la carte.
 */

.woocommerce ul.products li.product .product-wrap,
.woocommerce ul.products li.product .product-image-wrap {
    position: relative;

    background-color: var(--goodmams-beige) !important;
}

.woocommerce ul.products li.product .product-wrap {
    overflow: hidden;
    border-radius: 14px 14px 0 0;
}

/* Évite qu'un lien ajoute un fond différent */

.woocommerce ul.products li.product
.product-image-wrap > a {
    background-color: transparent;
}


/* Image principale */

.woocommerce ul.products li.product .product-wrap img {
    display: block;

    width: 100%;
    height: auto;

    margin: 0 !important;

    background-color: transparent !important;

    transition: transform 0.4s ease;
}


/* =========================================================
   7. INFORMATIONS PRODUIT
   ========================================================= */

.woocommerce ul.products li.product .product-meta {
    position: relative !important;

    min-height: 76px;

    padding: 17px 68px 15px 18px !important;

    background-color: var(--goodmams-beige) !important;

    text-align: left !important;
}


/* Nom du produit */

.woocommerce ul.products li.product h2,
.woocommerce ul.products li.product
.woocommerce-loop-product__title {
    margin: 0 0 5px !important;

    color: #202020 !important;

    font-size: 16px !important;
    line-height: 1.25 !important;
    font-weight: 500 !important;

    text-align: left !important;
}


/* Prix */

.woocommerce ul.products li.product .price {
    display: block;

    margin: 0 !important;

    color: #202020 !important;

    font-size: 14px !important;
    line-height: 1.3 !important;
    font-weight: 400 !important;

    text-align: left !important;
}


/* =========================================================
   8. WISHLIST YITH — POSITION DU CŒUR
   ========================================================= */

/*
 * Zone tactile : 44 × 44 px
 * Cœur visible : 19 × 19 px
 */

.woocommerce ul.products li.product
.yith-add-to-wishlist-button-block {
    position: absolute !important;

    top: 8px !important;
    right: 8px !important;

    z-index: 30;

    width: 44px !important;
    height: 44px !important;

    margin: 0 !important;
    padding: 0 !important;
}

.woocommerce ul.products li.product
.yith-wcwl-add-to-wishlist-button {
    position: relative;

    display: flex !important;
    align-items: center;
    justify-content: center;

    width: 44px !important;
    height: 44px !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;

    background: transparent !important;
    box-shadow: none !important;

    color: #292929 !important;

    text-decoration: none !important;
}


/* Masquer visuellement le texte YITH */

.woocommerce ul.products li.product
.yith-wcwl-add-to-wishlist-button__label {
    display: none !important;
}


/* Masquer le dessin d'origine */

.woocommerce ul.products li.product
.yith-wcwl-add-to-wishlist-button-icon {
    width: 19px !important;
    height: 19px !important;

    opacity: 0 !important;
}


/* =========================================================
   9. CŒUR GOODMAMS — CONTOUR
   ========================================================= */

.woocommerce ul.products li.product
.yith-wcwl-add-to-wishlist-button::after {
    content: "";

    position: absolute;

    width: 19px;
    height: 19px;

    inset: 0;
    margin: auto;

    pointer-events: none;

    background-color: #242424;

    -webkit-mask:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78L12 21.23l8.84-8.84a5.5 5.5 0 0 0 0-7.78z' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
        center / contain no-repeat;

    mask:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78L12 21.23l8.84-8.84a5.5 5.5 0 0 0 0-7.78z' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
        center / contain no-repeat;

    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}


/* =========================================================
   10. CŒUR ROUGE — PRODUIT EN FAVORIS
   ========================================================= */

.woocommerce ul.products li.product
.yith-wcwl-add-to-wishlist-button--added::after {
    -webkit-mask-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78L12 21.23l8.84-8.84a5.5 5.5 0 0 0 0-7.78z' fill='black'/%3E%3C/svg%3E");

    mask-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78L12 21.23l8.84-8.84a5.5 5.5 0 0 0 0-7.78z' fill='black'/%3E%3C/svg%3E");

    background-color: var(--goodmams-heart);
}


/* Supprimer l'effet de fond YITH */

.woocommerce ul.products li.product
.yith-add-to-wishlist-button-block
.background-color-expand {
    display: none !important;
}


/* =========================================================
   11. PANIER — POSITION
   ========================================================= */

/*
 * Zone tactile : 44 × 44 px
 * Cercle visible : 40 × 40 px
 */

.woocommerce ul.products li.product
.product-meta .product-add-to-cart {
    position: absolute !important;

    top: auto !important;
    right: 12px !important;
    bottom: 12px !important;
    left: auto !important;

    display: flex !important;
    align-items: center;
    justify-content: center;

    width: 44px !important;
    height: 44px !important;

    margin: 0 !important;
    padding: 0 !important;

    opacity: 1 !important;
    visibility: visible !important;

    pointer-events: auto !important;

    transform: none !important;
}


/* =========================================================
   12. PANIER — BOUTON WOOCommerce
   ========================================================= */

.woocommerce ul.products li.product
.product-meta .product-add-to-cart > a.add_to_cart_button {
    position: relative !important;

    display: flex !important;
    align-items: center;
    justify-content: center;

    width: 40px !important;
    height: 40px !important;

    min-width: 40px !important;
    min-height: 40px !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;
    border-radius: 50% !important;

    background: #fff !important;
    color: #292929 !important;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.05),
        inset 0 0 0 1px rgba(0, 0, 0, 0.025) !important;

    opacity: 1 !important;
    visibility: visible !important;

    transform: none !important;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease !important;
}


/* Masquer le texte du bouton */

.woocommerce ul.products li.product
.product-meta .product-add-to-cart > a.add_to_cart_button span {
    display: none !important;
}


/* Icône du sac */

.woocommerce ul.products li.product
.product-meta .product-add-to-cart > a.add_to_cart_button i {
    display: block !important;

    position: static !important;

    margin: 0 !important;
    padding: 0 !important;

    color: #292929 !important;

    font-size: 15px !important;
    line-height: 1 !important;

    opacity: 1 !important;
    visibility: visible !important;

    transform: none !important;
}


/* Masquer Quick View sur les cartes */

.woocommerce ul.products li.product
.product-meta .product-add-to-cart .nectar_quick_view {
    display: none !important;
}


/* =========================================================
   13. EFFETS AU SURVOL — SOURIS UNIQUEMENT
   ========================================================= */

@media (hover: hover) and (pointer: fine) {

    .goodmams-shop-nav__link:hover,
    .goodmams-shop-nav__collections > summary:hover {
        background: #242424;
        border-color: #242424;
        color: #fff;
    }

    .goodmams-shop-nav__dropdown a:hover {
        background: #f3efe9;
    }

    .goodmams-subcategory-nav__link:hover {
        background: #eee9e2;
        color: #242424;
    }

    .woocommerce ul.products li.product:hover {
        transform: translateY(-2px);
    }

    .woocommerce ul.products li.product:hover
    .product-wrap img {
        transform: scale(1.015);
    }

    .woocommerce ul.products li.product
    .yith-wcwl-add-to-wishlist-button:hover {
        transform: scale(1.08);
    }

    .woocommerce ul.products li.product
    .product-meta .product-add-to-cart > a.add_to_cart_button:hover {
        transform: scale(1.06) !important;

        box-shadow:
            0 4px 12px rgba(0, 0, 0, 0.08),
            inset 0 0 0 1px rgba(0, 0, 0, 0.035) !important;
    }
}


/* =========================================================
   14. TABLETTE ET PETIT DESKTOP
   ========================================================= */

@media (max-width: 1000px) {

    .goodmams-shop-header {
        margin-top: 34px;
    }

    .goodmams-shop-nav {
        gap: 8px;
        margin: 24px 0 34px;
    }

    .goodmams-shop-nav__link,
    .goodmams-shop-nav__collections > summary {
        padding: 9px 15px;
        font-size: 13px;
    }

    .goodmams-subcategory-nav {
        margin-top: -16px;
        margin-bottom: 32px;
    }

    .woocommerce ul.products li.product {
        border-radius: 12px;
    }

    /* Garder le panier visible sur tactile */

    .woocommerce ul.products li.product
    .product-meta .product-add-to-cart {
        display: flex !important;

        opacity: 1 !important;
        visibility: visible !important;

        pointer-events: auto !important;
    }
}


/* =========================================================
   15. MOBILE
   ========================================================= */

@media (max-width: 600px) {

    /* En-tête */

    .goodmams-shop-header {
        margin-top: 26px;
        padding: 0 16px;
    }

    .goodmams-shop-header h1 {
        margin-bottom: 10px;

        font-size: clamp(34px, 11vw, 48px);
        line-height: 1.05;
    }

    .goodmams-shop-header p {
        font-size: 14px;
        line-height: 1.5;
    }


    /* Navigation principale */

    .goodmams-shop-nav {
        justify-content: center;

        gap: 7px;
        margin: 20px 0 30px;
    }

    .goodmams-shop-nav__link,
    .goodmams-shop-nav__collections > summary {
        min-height: 44px;

        padding: 10px 14px;

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

    .goodmams-shop-nav__dropdown {
        left: auto;
        right: 0;

        transform: none;
        min-width: 180px;
    }


    /* Sous-catégories */

    .goodmams-subcategory-nav {
        justify-content: center;

        gap: 5px;

        margin-top: -16px;
        margin-bottom: 28px;
    }

    .goodmams-subcategory-nav__link {
        min-height: 44px;

        padding: 10px 13px;

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


    /* Cartes produits */

    .woocommerce ul.products li.product {
        border-radius: 10px;
    }

    .woocommerce ul.products li.product .product-meta {
        min-height: 68px;

        padding: 12px 58px 12px 12px !important;
    }

    .woocommerce ul.products li.product h2,
    .woocommerce ul.products li.product
    .woocommerce-loop-product__title {
        font-size: 14px !important;
        line-height: 1.25 !important;
    }

    .woocommerce ul.products li.product .price {
        font-size: 13px !important;
    }


    /* Cœur */

    .woocommerce ul.products li.product
    .yith-add-to-wishlist-button-block {
        top: 5px !important;
        right: 5px !important;
    }


    /* Panier */

    .woocommerce ul.products li.product
    .product-meta .product-add-to-cart {
        right: 7px !important;
        bottom: 7px !important;

        display: flex !important;

        width: 44px !important;
        height: 44px !important;

        opacity: 1 !important;
        visibility: visible !important;

        pointer-events: auto !important;
    }

    .woocommerce ul.products li.product
    .product-meta .product-add-to-cart > a.add_to_cart_button {
        width: 40px !important;
        height: 40px !important;

        min-width: 40px !important;
        min-height: 40px !important;
    }
}

/* =========================================================
   GOODMAMS — FILTRES BOUTIQUE SUR MOBILE
   Navigation horizontale défilable
   ========================================================= */

@media (max-width: 600px) {

    .goodmams-shop-nav {
        display: flex;
        flex-wrap: nowrap !important;
        align-items: flex-start;
        justify-content: flex-start !important;

        width: 100%;
        max-width: 100%;
        gap: 8px;

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

        padding: 4px 0 10px;
        margin: 20px 0 30px;

        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;

        scrollbar-width: none;
    }

    /* Masquer la barre de défilement */
    .goodmams-shop-nav::-webkit-scrollbar {
        display: none;
    }

    /* Empêcher les catégories de passer à la ligne */
    .goodmams-shop-nav__link,
    .goodmams-shop-nav__collections {
        flex: 0 0 auto;
    }

    .goodmams-shop-nav__link,
    .goodmams-shop-nav__collections > summary {
        min-height: 44px;
        white-space: nowrap;
    }

    /* Conserver le menu Collections utilisable */
    .goodmams-shop-nav__dropdown {
        position: static;
        top: auto;
        left: auto;
        right: auto;
        transform: none;

        min-width: 190px;
        margin-top: 8px;
    }
}

/* =========================================================
   GOODMAMS — FAVORIS SUR FICHE PRODUIT
   ========================================================= */

body.single-product .summary
.yith-wcwl-add-to-wishlist-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 9px;

    min-height: 44px;
    padding: 10px 16px !important;

    border: 1px solid #e8d9ca !important;
    border-radius: 999px !important;

    background: #f5ede4 !important;
    color: #242424 !important;

    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;

    box-shadow: none !important;
}

body.single-product .summary
.yith-wcwl-add-to-wishlist-button-icon {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0;
}

body.single-product .summary
.yith-wcwl-add-to-wishlist-button--added {
    color: #c94f57 !important;
}

/* GOODMAMS — Cœur rouge après ajout aux favoris */

body.single-product .summary
.yith-wcwl-add-to-wishlist-button--added
.yith-wcwl-add-to-wishlist-button-icon {
    color: #c94f57 !important;
    fill: #c94f57 !important;
    stroke: #c94f57 !important;
}

body.single-product .summary
.yith-wcwl-add-to-wishlist-button--added
.yith-wcwl-add-to-wishlist-button-icon svg,
body.single-product .summary
.yith-wcwl-add-to-wishlist-button--added
.yith-wcwl-add-to-wishlist-button-icon svg path {
    fill: #c94f57 !important;
    stroke: #c94f57 !important;
}

/* =========================================================
   GOODMAMS — FAVORIS DANS LE HEADER
   Icône assortie au compte et au panier + compteur
   ========================================================= */

#header-outer .goodmams-favorites-link > a {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 34px;
    height: 40px;
    padding: 0 !important;

    font-size: 0 !important;
    line-height: 1 !important;
}

/* Cœur noir, avec un trait proche des icônes Salient */
#header-outer .goodmams-favorites-link > a::before {
    content: "" !important;
    display: block !important;

    width: 21px;
    height: 21px;
    flex-shrink: 0;

    background-color: #222222;

    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1.1-1.1a5.5 5.5 0 0 0-7.8 7.8L12 21l8.8-8.6a5.5 5.5 0 0 0 0-7.8Z' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;

    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1.1-1.1a5.5 5.5 0 0 0-7.8 7.8L12 21l8.8-8.6a5.5 5.5 0 0 0 0-7.8Z' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Rouge au survol */
#header-outer .goodmams-favorites-link > a:hover::before {
    background-color: #c94f57;
}

/* Compteur */
#header-outer .goodmams-favorites-count {
    position: absolute;
    top: 5px;
    right: -5px;

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

    min-width: 16px;
    height: 16px;
    padding: 0 4px;

    border-radius: 999px;
    background: #c7b49e;
    color: #ffffff;

    font-family: Arial, sans-serif;
    font-size: 10px !important;
    font-weight: 600;
    line-height: 1;
    box-sizing: border-box;
}

/* Pas de pastille quand aucun favori */
#header-outer .goodmams-favorites-count[hidden] {
    display: none !important;
}
