/*
 Theme Name:   Ma Poupee LOL Child
 Theme URI:    https://mapoupeelol.fr
 Description:  Theme enfant de Ma Poupee LOL - Corrections et personnalisations
 Author:       Ma Poupee LOL
 Author URI:   https://mapoupeelol.fr
 Template:     mapoupeelol-theme
 Version:      1.3.3
 License:      GNU General Public License v2 or later
 License URI:  https://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  mapoupeelol-child
*/

/* ==========================================================================
   CORRECTIF : scroll-behavior: smooth du parent cause des saccades sur Safari iOS
   ========================================================================== */

html {
    scroll-behavior: auto !important;
}

/* ==========================================================================
   CORRECTIF : Menu dropdown - les sous-menus restaient visibles en permanence
   Cause : .main-nav ul ciblait aussi les .sub-menu (display: flex)
   Fix : cibler uniquement le ul direct avec > (enfant direct)
   ========================================================================== */

.main-nav, .main-nav > ul {
    display: flex;
    align-items: center;
    gap: 5px;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Force les sous-menus a se cacher (override le .main-nav ul du parent) */
.main-nav .sub-menu {
    display: none;
}

/* Afficher au survol uniquement le sous-menu direct */
.main-nav .menu-item-has-children:hover > .sub-menu {
    display: block;
}

/* ==========================================================================
   Header : logo + mobile menu
   ========================================================================== */

/* Logo desktop : rentre dans le header de 60px */
.custom-logo {
    max-height: 50px;
    width: auto;
    vertical-align: middle;
}

/* Hamburger : plus visible */
.mobile-toggle {
    font-size: 28px;
    padding: 8px;
    color: #1a1a2e;
}

/* Cacher le filtre duplique (le JS parent en cree un, on en a deja un dans le HTML) */
.mpl-filters + .mpl-filters {
    display: none !important;
}

/* ==========================================================================
   Mobile : logo a gauche + menu ameliore
   ========================================================================== */

@media (max-width: 768px) {

    /* Supprimer transitions sur mobile pour fluidite */
    .mpl-product-card {
        transition: none;
    }

    .mpl-product-card:hover {
        transform: none;
        box-shadow: none;
    }

    /* Logo a gauche, pas centre */
    .site-header .container {
        justify-content: space-between;
    }

    .custom-logo {
        max-height: 44px;
    }

    /* Cacher le lien texte site-logo sur mobile, garder juste le logo image */
    .site-logo {
        display: none;
    }

    /* Menu mobile : fond propre, ombre, animation */
    .main-nav.active {
        display: flex !important;
        flex-direction: column;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid #eee;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
        padding: 0;
        z-index: 200;
        max-height: 80dvh;
        overflow-y: auto;
    }

    .main-nav.active > ul {
        flex-direction: column;
        width: 100%;
        gap: 0;
        padding: 0;
    }

    /* Items du menu mobile */
    .main-nav.active ul li {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }

    .main-nav.active ul li:last-child {
        border-bottom: none;
    }

    .main-nav.active ul li a {
        display: block;
        padding: 14px 20px;
        font-size: 15px;
        font-weight: 600;
        color: #1a1a2e;
        border-radius: 0;
    }

    .main-nav.active ul li a:hover {
        background: #fdf2f8;
        color: #e91e8c;
    }

    /* Supprimer la fleche CSS (remplacee par le toggle JS) */
    .main-nav.active .menu-item-has-children > a::after {
        display: none;
    }

    /* Item parent avec sous-menu : flex pour aligner lien + toggle */
    .main-nav.active .menu-item-has-children {
        position: relative;
    }

    /* Bouton toggle fleche */
    .main-nav.active .submenu-toggle {
        position: absolute;
        right: 0;
        top: 0;
        width: 52px;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        color: #999;
        cursor: pointer;
        border-left: 1px solid #f0f0f0;
        transition: color 0.2s, background 0.2s;
        -webkit-user-select: none;
        user-select: none;
    }

    .main-nav.active .submenu-toggle:hover {
        color: #e91e8c;
        background: #fdf2f8;
    }

    .main-nav.active .submenu-open > .submenu-toggle {
        color: #e91e8c;
        background: #fdf2f8;
    }

    /* Lien parent : laisser de la place pour le toggle */
    .main-nav.active .menu-item-has-children > a {
        padding-right: 56px;
    }

    /* Sous-menus mobile : masque par defaut, gere par JS */
    .main-nav.active .sub-menu {
        display: none !important;
        position: static;
        background: #f9f9fb;
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        min-width: unset;
    }

    /* Quand ouvert par JS */
    .main-nav.active .submenu-open > .sub-menu {
        display: block !important;
    }

    .main-nav.active .sub-menu a {
        padding: 12px 20px 12px 36px;
        font-size: 14px;
        font-weight: 500;
        color: #555;
        border-bottom: 1px solid #eee;
    }

    .main-nav.active .sub-menu a:hover {
        color: #e91e8c;
        background: #fdf2f8;
    }

    .main-nav.active .sub-menu li:last-child a {
        border-bottom: none;
    }

    /* Lien "Voir toutes..." en haut du sous-menu */
    .main-nav.active .menu-item-view-all a {
        font-weight: 700;
        color: #e91e8c;
        padding: 14px 20px 14px 36px;
        border-bottom: 2px solid #eee;
        font-size: 14px;
    }

    .main-nav.active .menu-item-view-all a::before {
        content: "→  ";
    }

    .main-nav.active .menu-item-view-all a:hover {
        background: #e91e8c;
        color: #fff;
    }
}

/* ==========================================================================
   Masquer la barre rose du haut (doublons du menu principal)
   ========================================================================== */

.top-bar {
    display: none;
}

/* ==========================================================================
   Hero section pages categories (poupee-lol-garcon, etc.)
   ========================================================================== */

/* Cacher le H1 par defaut du template page.php quand la page a sa propre hero */
.page-id-2219 .page-content > .container > article > h1,
.page-id-2535 .page-content > .container > article > h1 {
    display: none;
}

.page-id-2535 .page-content {
    padding: 0;
    overflow-x: hidden;
}

.page-id-2219 .page-content {
    padding: 0;
    overflow-x: hidden;
}

.category-hero {
    width: 100vw;
    max-width: none;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 60px 20px;
    margin-bottom: 32px;
    min-height: 340px;
    display: flex;
    align-items: center;
}

.category-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(26, 26, 46, 0.6);
}

.category-hero .container {
    max-width: var(--max-width, 1200px);
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
    width: 100%;
}

.category-hero-image {
    display: none;
}

.category-hero h1 {
    font-size: 38px;
    font-weight: 800;
    line-height: 1.2;
    color: #fff;
    margin-bottom: 16px;
    max-width: 600px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.category-hero p {
    font-size: 16px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
    max-width: 550px;
    margin: 0;
}

.category-hero p strong {
    color: #fff;
}

@media (max-width: 768px) {
    .category-hero {
        min-height: 260px;
        padding: 40px 20px;
    }
    .category-hero h1 {
        font-size: 26px;
    }
    .category-hero p {
        font-size: 14px;
    }
}

/* ==========================================================================
   Hero section homepage - modernisation UX/UI
   ========================================================================== */

/* Hero homepage : image en background */
.hero {
    padding: 70px 0 60px;
    background-color: #1a1a2e;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(26, 26, 46, 0.6);
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-image {
    display: none;
}

/* H1 plus impactant */
.hero h1 {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.15;
    color: #fff;
    margin-bottom: 20px;
    max-width: 600px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Texte descriptif */
.hero p {
    font-size: 16px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 28px;
    max-width: 550px;
}

.hero p strong {
    color: #fff;
}

/* CTA principal */
.hero .btn.btn-outline {
    background: #e91e8c;
    color: #fff;
    border-color: #e91e8c;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 12px;
    letter-spacing: 0.3px;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 24px;
}

.hero .btn.btn-outline:hover {
    background: #c4177a;
    border-color: #c4177a;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 30, 140, 0.3);
}

/* Masquer l'autocomplete AJAX (bugue) */
.poupee-autocomplete {
    display: none !important;
}

/* Barre de recherche modernisee */
.hero-search-form {
    display: flex;
    align-items: center;
    max-width: 440px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.hero-search-form:focus-within {
    border-color: #e91e8c;
    box-shadow: 0 4px 20px rgba(233, 30, 140, 0.15);
}

.hero-search-form .hero-search-field {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 18px;
    font-size: 15px;
    color: #333;
    background: transparent;
    font-family: inherit;
}

.hero-search-form .hero-search-field::placeholder {
    color: #aaa;
}

.hero-search-form .hero-search-btn {
    background: #e91e8c;
    color: #fff;
    border: none;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
}

.hero-search-form .hero-search-btn:hover {
    background: #c4177a;
}

/* Image hero masquee (background a la place) */
.hero-image {
    display: none;
}

@media (max-width: 768px) {
    .hero .container {
        text-align: center;
    }
    .hero h1 {
        font-size: 28px;
        max-width: none;
    }
    .hero p {
        max-width: none;
    }
    .hero-search-form {
        margin: 0 auto;
    }
}

/* ==========================================================================
   CORRECTIF : Grille produits "Meilleures ventes" - pas de mise en colonnes
   Les classes .mpl-products-grid et .mpl-cols-4 n'avaient aucun CSS
   ========================================================================== */

.mpl-products-grid {
    display: grid;
    gap: 24px;
    margin-bottom: 48px;
}

.mpl-products-grid.mpl-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* --- Carte produit --- */
.mpl-product-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.mpl-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(233, 30, 140, 0.12);
}

/* --- Image produit --- */
.mpl-product-card .mpl-product-img {
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    min-height: 220px;
}

.mpl-product-card .mpl-product-img img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    display: block;
}

/* --- Lien produit (contient titre + prix) --- */
.mpl-product-card .mpl-product-link {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-decoration: none;
    color: inherit;
}

/* --- Titre produit --- */
.mpl-product-card .mpl-product-title {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    padding: 14px 16px 0;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Prix --- */
.mpl-product-card .mpl-product-price {
    display: block;
    padding: 8px 16px 0;
    font-size: 18px;
    font-weight: 700;
    color: #e91e8c;
}

.mpl-product-card .mpl-product-price del {
    color: #999;
    font-weight: 400;
    font-size: 14px;
}

.mpl-product-card .mpl-product-price ins {
    text-decoration: none;
}

/* --- Bouton "Voir sur Amazon" --- */
.mpl-product-card .mpl-product-btn {
    display: block;
    margin: auto 16px 16px;
    padding: 12px 16px;
    background: #e91e8c;
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    transition: background 0.2s ease;
}

.mpl-product-card .mpl-product-btn:hover {
    background: #c4177a;
}

/* ==========================================================================
   Guide SEO + FAQ - modernisation UX/UI
   ========================================================================== */

/* Conteneur du guide */
.seo-content {
    max-width: var(--max-width, 1200px);
    margin: 0 auto;
    line-height: 1.8;
    color: #333;
}

/* H2 du guide : barre rose a gauche + fond leger */
.seo-content h2 {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a2e;
    margin: 48px 0 20px;
    padding: 16px 0 16px 20px;
    border-left: 4px solid #e91e8c;
    background: linear-gradient(90deg, rgba(233, 30, 140, 0.06) 0%, transparent 100%);
    border-radius: 0 8px 8px 0;
}

.seo-content h2:first-child {
    margin-top: 0;
}

/* H3 du guide : style pill rose */
.seo-content h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 36px 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0e6f6;
}

/* H4 du guide : sous-sections gammes */
.seo-content h4 {
    font-size: 17px;
    font-weight: 700;
    color: #e91e8c;
    margin: 28px 0 10px;
}

/* Paragraphes */
.seo-content p {
    margin-bottom: 16px;
    font-size: 15.5px;
}

/* Liens */
.seo-content a {
    color: #e91e8c;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid rgba(233, 30, 140, 0.3);
    transition: border-color 0.2s;
}

.seo-content a:hover {
    border-bottom-color: #e91e8c;
}

/* Listes a puces stylisees */
.seo-content ul {
    list-style: none;
    padding: 0;
    margin: 12px 0 20px;
}

.seo-content ul li {
    position: relative;
    padding: 10px 16px 10px 28px;
    margin-bottom: 6px;
    background: #f9f9fb;
    border-radius: 10px;
    font-size: 15px;
    line-height: 1.6;
}

.seo-content ul li::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 16px;
    width: 8px;
    height: 8px;
    background: #e91e8c;
    border-radius: 50%;
}

/* FAQ items */
.seo-content .faq-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 16px;
    transition: box-shadow 0.2s;
}

.seo-content .faq-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.seo-content .faq-item h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 10px;
    padding: 0;
    border: none;
}

.seo-content .faq-item h3::before {
    content: "Q.";
    display: inline-block;
    color: #e91e8c;
    font-weight: 800;
    margin-right: 8px;
}

.seo-content .faq-item p {
    margin: 0;
    color: #555;
    font-size: 15px;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .mpl-products-grid.mpl-cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .mpl-products-grid {
        gap: 10px;
    }

    .mpl-products-grid.mpl-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .mpl-product-card {
        border-radius: 10px;
    }

    .mpl-product-card .mpl-product-img {
        min-height: 140px;
        padding: 10px;
    }

    .mpl-product-card .mpl-product-img img {
        height: 130px;
    }

    .mpl-product-card .mpl-product-title {
        padding: 10px 10px 0;
        font-size: 13px;
    }

    .mpl-product-card .mpl-product-price {
        padding: 6px 10px 0;
        font-size: 16px;
    }

    .mpl-product-card .mpl-product-btn {
        margin: auto 10px 10px;
        padding: 10px 10px;
        font-size: 13px;
        border-radius: 8px;
    }
}

/* ==========================================================================
   Page produit single (single-poupee.php)
   ========================================================================== */

.mpl-single-wrap {
    padding: 20px 0 40px;
}

/* Layout 2 colonnes : image + infos */
.mpl-product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
    margin-bottom: 48px;
}

/* Image produit */
.mpl-product-gallery {
    background: #f8f8fa;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    position: sticky;
    top: 80px;
}

.mpl-product-main-img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    border-radius: 8px;
}

/* Infos produit */
.mpl-product-info-title {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.3;
    margin-bottom: 12px;
}

.mpl-product-collections {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.mpl-product-tag {
    display: inline-block;
    background: #fdf2f8;
    color: #e91e8c;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mpl-product-tag:hover {
    background: #e91e8c;
    color: #fff;
}

/* Prix */
.mpl-product-price-block {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: #f8f8fa;
    border-radius: 12px;
}

.mpl-price-current {
    font-size: 32px;
    font-weight: 800;
    color: #e91e8c;
}

.mpl-price-old {
    font-size: 18px;
    font-weight: 400;
    color: #999;
    text-decoration: line-through;
}

.mpl-price-badge {
    display: inline-block;
    background: #e91e8c;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
}

/* Extrait */
.mpl-product-excerpt {
    font-size: 15px;
    line-height: 1.7;
    color: #555;
    margin-bottom: 24px;
}

.mpl-product-excerpt p {
    margin: 0;
}

/* CTA */
.mpl-product-cta {
    margin-bottom: 24px;
}

.mpl-product-cta .mpl-cta-button {
    display: block;
    width: 100%;
    text-align: center;
    background: #e91e8c;
    color: #fff !important;
    font-size: 18px;
    font-weight: 700;
    padding: 18px 32px;
    border-radius: 12px;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(233, 30, 140, 0.3);
}

.mpl-product-cta .mpl-cta-button:hover {
    background: #c4177a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 30, 140, 0.4);
}

.mpl-cta-note {
    font-size: 12px;
    color: #999;
    text-align: center;
    margin-top: 10px;
}

/* Garanties */
.mpl-product-guarantees {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid #eee;
}

.mpl-guarantee-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

.mpl-guarantee-icon {
    font-size: 16px;
}

/* Accordéon produit */
.mpl-accordion {
    border-top: 1px solid #eee;
}

.mpl-accordion-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 20px 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    font-family: inherit;
}

.mpl-accordion-toggle:hover {
    color: #e91e8c;
}

.mpl-accordion-icon {
    font-size: 14px;
    transition: transform 0.3s;
}

.mpl-accordion-toggle[aria-expanded="true"] .mpl-accordion-icon {
    transform: rotate(180deg);
}

.mpl-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.mpl-accordion-content .entry-content {
    padding-bottom: 24px;
    font-size: 15px;
    line-height: 1.8;
    color: #444;
}

.mpl-accordion-content .entry-content h3 {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 20px 0 10px;
}

.mpl-accordion-content .entry-content ul {
    list-style: none;
    padding: 0;
    margin: 12px 0 20px;
}

.mpl-accordion-content .entry-content ul li {
    position: relative;
    padding: 8px 0 8px 24px;
    font-size: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.mpl-accordion-content .entry-content ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 15px;
    width: 8px;
    height: 8px;
    background: #e91e8c;
    border-radius: 50%;
}

.mpl-accordion-content .entry-content ul li:last-child {
    border-bottom: none;
}

/* Table infos accordéon */
.mpl-info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    font-size: 14px;
}

.mpl-info-table tr {
    border-bottom: 1px solid #f0f0f0;
}

.mpl-info-table td {
    padding: 12px 0;
}

.mpl-info-label {
    font-weight: 600;
    color: #1a1a2e;
    width: 140px;
}

/* Produits similaires */
.mpl-related-section {
    background: #f8f9fa;
    padding: 48px 0;
}

.mpl-related-title {
    font-size: 24px;
    font-weight: 700;
    color: #e91e8c;
    text-transform: uppercase;
    margin-bottom: 24px;
}

/* Responsive single produit */
@media (max-width: 768px) {
    .mpl-product-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .mpl-product-gallery {
        position: static;
        padding: 16px;
    }

    .mpl-product-info-title {
        font-size: 22px;
    }

    .mpl-price-current {
        font-size: 26px;
    }

    .mpl-product-guarantees {
        flex-direction: column;
        gap: 10px;
    }

    .mpl-related-section .mpl-products-grid.mpl-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}
