/* --- CODE CSS COMPLET CORRIGÉ POUR HANOUT BLADI --- */

html, body {
    height: 100% !important;
    margin: 0 !important;
    background-color: #faf8f5 !important;
}

body {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
}

.site-content, .entry-content, .page-content, .ast-container, .container, #primary, #content {
    padding-top: 0 !important;
    margin-top: 0 !important;
    background-color: #faf8f5 !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

.hanout-catalogue-page-bg {
    background-color: #faf8f5 !important;
    background-image: linear-gradient(to bottom, #faf8f5, #f6edda) !important;
    width: 100% !important;
    min-height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

.hanout-catalogue-wrapper {
    max-width: 1280px !important;
    margin: 0 auto;
    padding: 2px 10px 40px 10px !important;
    box-sizing: border-box;
    position: relative;
    width: 100%;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Élimination du titre de la page Boutique */
.hanout-catalogue-page-bg h1, 
.entry-title, 
.page-title {
    display: none !important;
}

/* Style de la Notification Flottante (Toast) */
.hanout-toast-notification {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: var(--msp-primary, #153b27);
    color: #fff;
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    z-index: 999999;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 2px solid var(--msp-accent, #c89b3c);
    animation: hanoutFadeIn 0.1s ease;
    transition: opacity 0.2s ease;
}

@keyframes hanoutFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.hanout-pc-header-controls {
    display: none !important;
}

@media (min-width: 768px) {
    .hanout-pc-header-controls {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        margin: 5px auto 10px auto;
        max-width: 1200px;
        padding: 0 5px;
    }
}

.hanout-left-control {
    display: flex;
    align-items: center;
}

.hanout-right-control {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.hanout-btn-retour {
    background: transparent;
    color: #8c7b6c;
    border: 1px solid #d4c5b9;
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none !important;
    font-size: 12px;
    display: inline-block;
    transition: all 0.2s ease;
}
.hanout-btn-retour:hover {
    background: #8c7b6c;
    color: #fff;
    border-color: #8c7b6c;
}

.hanout-search-form {
    display: flex;
    gap: 8px;
    max-width: 380px;
}
.hanout-search-input {
    flex: 1;
    padding: 7px 12px;
    border: 1px solid #dcd6c8;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    color: #243128;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
}
.hanout-search-btn {
    background: var(--msp-primary, #153b27);
    color: #fff;
    border: none;
    padding: 7px 14px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}
.hanout-search-btn:hover {
    background: var(--msp-accent, #c89b3c);
}

.hanout-search-results-title {
    font-size: 16px;
    color: var(--msp-primary, #153b27);
    margin: 5px 0 10px 0;
    font-weight: 700;
    text-align: left;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* --- STYLE POUR LES RAYONS / CATÉGORIES (MOBILE & PC) --- */
.hanout-rayons-lignes-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    max-width: 700px;
    margin: 2px auto 0 auto;
}

.hanout-rayon-ligne-item {
    display: flex;
    align-items: center;
    text-decoration: none !important;
    background: #ffffff;
    padding: 8px 15px;
    border-radius: 50px;
    border: 1px solid #eae5db;
    box-shadow: 0 3px 10px rgba(21, 59, 39, 0.04);
    gap: 15px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hanout-rayon-ligne-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(21, 59, 39, 0.08);
    border-color: var(--msp-accent, #c89b3c);
}

.hanout-rayon-cercle-grand {
    width: 60px;
    height: 60px;
    min-width: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--msp-accent, #c89b3c);
    background: #faf8f5;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.hanout-rayon-nom {
    font-size: 15px;
    font-weight: 800;
    color: var(--msp-primary, #153b27);
    text-align: left;
    flex: 1;
    text-decoration: none !important;
    border-bottom: none !important;
}

/* --- ADAPTATION PC (GRAND ÉCRAN) --- */
@media (min-width: 768px) {
    .hanout-rayons-lignes-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        max-width: 900px !important;
        margin: 10px auto !important;
    }

    .hanout-rayon-ligne-item {
        flex-direction: row !important;
        text-align: left !important;
        padding: 12px 25px !important;
        border-radius: 60px !important;
        gap: 25px !important;
    }

    .hanout-rayon-cercle-grand {
        width: 80px !important;
        height: 80px !important;
        min-width: 80px !important;
    }

    .hanout-rayon-nom {
        font-size: 20px !important;
        text-align: left !important;
    }

    .hanout-cercles-grid {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
        grid-template-rows: none !important;
        gap: 15px !important;
        max-width: 1200px !important;
        margin: 0 auto !important;
        height: auto !important;
        flex: unset !important;
    }

    .hanout-cercle-card {
        height: auto !important;
        padding: 8px 6px !important;
    }

    .hanout-cercle-img-wrapper {
        width: 120px !important;
        height: 120px !important;
        border-width: 2px;
        margin-bottom: 6px;
    }

    .hanout-cercle-card h3 {
        font-size: 15px !important;
        margin-bottom: 6px;
    }

    .hanout-prix {
        font-size: 15px !important;
        margin-bottom: 5px;
    }

    .hanout-qty-row {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 3px !important;
    }

    .hanout-qty-row button {
        width: 30px !important;
        height: 30px !important;
        font-size: 13px !important;
    }

    .hanout-qty-row input {
        width: 35px !important;
        height: 30px !important;
        font-size: 11px !important;
    }
}

/* --- GRILLE FLUIDE POUR CATÉGORIES ET PRODUITS (MOBILE PAR DÉFAUT) --- */
.hanout-cercles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
    gap: 10px;
    width: 100%;
    margin: 0px auto 0 auto;
    box-sizing: border-box;
}

.hanout-cercle-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none !important;
    width: 100%;
    height: auto !important;
    text-align: center;
    background: #fff;
    padding: 12px 8px; /* Espacement interne généreux sur mobile */
    border-radius: 12px;
    border: 1px solid #eae5db;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
    box-sizing: border-box;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hanout-cercle-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(21, 59, 39, 0.06);
    border-color: var(--msp-accent, #c89b3c);
}

.hanout-card-link {
    text-decoration: none !important;
    border-bottom: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.hanout-cercle-img-wrapper {
    width: 80px; /* Image légèrement agrandie sur mobile */
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--msp-accent, #c89b3c);
    background: #faf8f5;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.hanout-img-nette,
.hanout-grand-cercle-img {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    background-color: #faf8f5;
}

.hanout-cercle-card h3 {
    font-size: 13px; /* Titre plus lisible */
    font-weight: 700;
    color: var(--msp-primary, #153b27);
    margin: 0 0 4px 0;
    line-height: 1.2;
    text-decoration: none !important;
    border-bottom: none !important;
}

.hanout-prix {
    font-size: 14px; /* Prix agrandi pour occuper l'espace et attirer l'œil */
    color: var(--msp-accent, #c89b3c);
    font-weight: 800;
    margin-bottom: 8px;
}

.hanout-quick-cart {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    margin-top: auto;
}

/* Alignement HORIZONTAL et boutons de quantité AGRANDIS sur mobile */
.hanout-qty-row {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
}

.hanout-qty-row button {
    background: #f0ede6 !important;
    border: 1px solid var(--msp-primary, #153b27) !important;
    width: 36px !important;  /* Boutons plus grands et faciles à cliquer */
    height: 34px !important;
    font-size: 15px !important;
    font-weight: 900 !important;
    cursor: pointer !important;
    border-radius: 6px !important;
    color: var(--msp-primary, #153b27) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

.hanout-qty-row input {
    width: 42px !important;  /* Champ input de quantité plus large */
    height: 34px !important;
    text-align: center !important;
    border: 1px solid var(--msp-primary, #153b27) !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    background: #ffffff !important;
    color: #153b27 !important; /* Quantité bien visible en foncé */
    padding: 0 !important;
}

.hanout-btn-mini-panier {
    background: var(--msp-primary, #153b27);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 8px 4px; /* Bouton "Ajouter" plus grand et confortable */
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s;
}
.hanout-btn-mini-panier:hover {
    background: var(--msp-accent, #c89b3c);
}

/* Fiche Produit */
.hanout-fiche-produit {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #ffffff;
    padding: 5px;
    border-radius: 14px;
    border: 1px solid #eae5db;
    max-width: 500px;
    margin: 0px auto 0 auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}
.hanout-grand-cercle-img-wrapper {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--msp-accent, #c89b3c);
    background: #faf8f5;
    margin-top: 1px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.hanout-detail-contenu {
    width: 100%;
}
.hanout-detail-contenu h2 {
    font-size: 16px;
    color: var(--msp-primary, #153b27);
    margin: 0 0 4px 0;
    font-weight: 700;
}
.hanout-prix-detail {
    font-size: 15px;
    color: var(--msp-accent, #c89b3c);
    display: block;
    margin-bottom: 8px;
    font-weight: 800;
}
.hanout-description-courte {
    font-size: 12px;
    color: #555;
    line-height: 1.4;
    margin-bottom: 5px;
    background: #faf8f5;
    padding: 2px 10px;
    border-radius: 6px;
    text-align: left;
}

/* --- FOOTER COLLÉ EN BAS (STICKY FOOTER) --- */
footer, .site-footer {
    margin-top: auto !important;
    width: 100% !important;
}

/* Classes utilitaires et notifications */
.msp-inline-catalogue-01 { text-align:center; padding: 10px; }
.hanout-toast-notification.is-hidden { opacity: 0; }