/* BREADCRUMB */
.breadcrumb { font-size: 12px; color: var(--text-light); }
.breadcrumb a { color: var(--purple-text); text-decoration: none; }

/* =========================================
   FIX HAUTEUR IMAGE (ORDINATEUR)
   ========================================= */
@media (min-width: 992px) {
    .recipe-image-container {
        height: 100%;
        max-height: 480px; /* Aligne l'image avec la hauteur du bloc infos à droite */
    }
}

/* ELEMENTS HERO RECETTE */
.main-recipe-img { border-radius: 40px; }
.sidebar-card {
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 25px;
    text-align: center;
}
.sidebar-title { font-weight: 700; font-size: 16px; margin-bottom: 15px; }
.categories-tags { display: flex; justify-content: center; gap: 10px; margin-bottom: 25px; }

.review-btn {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    background: transparent;
    color: var(--text-main);
}
.review-btn i { color: var(--purple-text); }
.action-btn {
    background-color: var(--purple-light);
    border: none;
    border-radius: 20px;
    height: 44px;
    color: var(--purple-text);
    font-size: 16px;
    transition: background 0.2s;
}
.action-btn:hover { background-color: var(--border-color); }
.action-btn.recipe-saved {
    background-color: #fde6ee;
    color: #d87093;
}
.recipe-saved-animation {
    animation: recipe-heart-pop 0.65s ease both;
}
.recipe-carnet-saved,
.recipe-carnet-saved:disabled {
    background-color: #fde6ee;
    border-color: #d87093 !important;
    color: #b34f73;
    opacity: 1;
}
@keyframes recipe-heart-pop {
    0% { transform: scale(1); }
    45% { transform: scale(1.22); }
    75% { transform: scale(0.92); }
    100% { transform: scale(1); }
}

/* META BAR */
.recipe-meta-bar {
    border: 1px solid var(--border-color);
    border-radius: 35px;
}
.meta-item { text-align: center; }
.meta-icon-wrapper { color: var(--purple-text); font-size: 20px; margin-bottom: 6px; }
.meta-label { font-size: 13px; font-weight: 700; color:var(--text-main); }
.meta-value { font-size: 12px; color:var(--text-light); margin-top: 2px; }
.divider-vertical { width: 1px; height: 40px; background-color:var(--border-color); }

/* Flèche de défilement (Mobile) */
    .scroll-arrow-btn {
        position: absolute;
        top: 50%;
        right: 5px; 
        transform: translateY(-50%);
        width: 36px;
        height: 36px;
        border: none; 
        border-radius: 50%;
        background-color: var(--purple-light); 
        color: var(--purple-text); 
        box-shadow: none; 
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10;
        cursor: pointer;
    }
    
    /* L'icône à l'intérieur de la flèche (avec animation de rotation) */
    .scroll-arrow-icon {
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); /* Animation super fluide */
        font-size: 14px;
    }

/* =========================================
   INGRÉDIENTS & MATÉRIELS
   ========================================= */
.portion-control {
    background-color: var(--purple-light);
    border-radius: 25px;
    padding: 12px 20px;
    width: 250px;
    color: var(--purple-text);
    font-weight: 600;
    font-size: 14px;
}
.portion-control i { cursor: pointer; transition: transform 0.2s; }
.portion-control i:hover { transform: scale(1.2); }

.ingredient-list { 
    list-style: none; 
    padding-left: 0; 
    max-width: 350px; /* LA CORRECTION : Limite la largeur pour rapprocher les quantités */
}

.ingredient-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap; 
}

/* (Gardez ici vos règles sur le design de la checkbox) */
.ingredient-item input[type="checkbox"] {
    appearance: none;
    position: relative; 
    width: 20px;
    height: 20px;
    border: 2px solid var(--purple-mid);
    border-radius: 4px;
    margin-right: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.ingredient-item input[type="checkbox"]:checked {
    background-color: var(--purple-dark);
    border-color: var(--purple-dark);
}
.ingredient-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    width: 5px; height: 10px; 
    border: solid white; border-width: 0 3px 3px 0;
    transform: rotate(45deg); margin-bottom: 2px; 
}
.ingredient-item:has(input[type="checkbox"]:checked) {
    color: #b0b0b0; 
    text-decoration: line-through; 
}
.ingredient-item:has(input[type="checkbox"]:checked) .ingredient-qty { color: #b0b0b0; }

.ingredient-qty {
    margin-left: auto; /* Aligne parfaitement à droite, mais bloqué à 350px par le parent */
    color: var(--purple-text);
    font-style: italic;
    font-weight: 600;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

/* ÉTAPES DE PRÉPARATION */
.step-number {
    width: 35px; height: 35px;
    background-color: var(--purple-light);
    color: var(--purple-text);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.step-content h4 { font-size: 16px; font-weight: 700; margin-bottom: 5px; }
.step-content p { font-size: 14px; color: var(--text-light); }

/* SECTION REVIEWS */
.reviews-section {
    background-color: var(--beige-bg);
    border-radius: 40px;
}
.reviews-section .highlight::after { background-color: #E2CFBE; }

.review-card {
    background-color: var(--bg-color);
    border: 1px solid var(--brown-card);
    border-radius: 40px;
    padding: 25px;
    display: flex; flex-direction: column; justify-content: space-between;
    transition: all 0.3s ease; cursor: pointer; 
}
.review-card.brown {
    background-color: var(--brown-card);
    color: white; border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); 
}
.stars { color: #A566D2; font-size: 14px; margin-bottom: 15px; transition: color 0.3s; }
.review-card.brown .stars { color: #333; }
.review-text { font-size: 13px; margin-bottom: 25px; }
.review-author { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; }
.author-avatar { 
    width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; 
    background-color: #FEECE5; color: #FF8A65; transition: all 0.3s; 
}
.author-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
}
.author-avatar.green { background-color: #E8F5E9; color: #4CAF50; }
.review-card.brown .author-avatar { background-color: rgba(255,255,255,0.2); color: #4A72B2; }

.review-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15); }
.review-card.brown:hover { box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25); }

.btn-comment {
    display: block; width: 100%; padding: 15px;
    background-color: var(--brown-btn); color: #000; text-align: center; border: none;
    border-radius: 30px; text-decoration: none; font-weight: 800; font-size: 18px;
    transition: filter 0.2s, transform 0.2s; 
}
.btn-comment:hover { filter: brightness(0.85); color: #000; }
.btn-comment:active { transform: scale(0.98); }
.btn-secondary-comment {
    background-color: transparent;
    border: 1px solid var(--brown-btn);
    color: var(--text-main);
}
.btn-secondary-comment:hover { background-color: var(--beige-bg); color: var(--text-main); }

.all-comments-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.all-comments-list .review-card { min-height: 180px; }

/* STYLE DE LA POP-UP (MODALE BOOTSTRAP) */
.custom-modal-backdrop {
    backdrop-filter: blur(8px);
    background-color: rgba(0, 0, 0, 0.4);
}
.custom-modal {
    background-color: var(--bg-color); 
    border-radius: 40px; 
    border: none;
    padding: 40px 30px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}
.custom-modal .modal-title {
    font-size: 22px;
    color: var(--text-title);
    font-weight: 700;
}
.custom-close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    background: transparent;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.2s ease;
    z-index: 10;
}
.custom-close-btn:hover {
    color: var(--brown-btn);
}
.star-rating {
    display: flex;
    flex-direction: row-reverse; 
    justify-content: center;
    gap: 5px;
    margin-bottom: 25px;
}
.star-rating input {
    display: none; 
}
.star-rating label {
    font-size: 45px;
    color: #e4e4e4;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}
.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
    color: var(--purple-text); 
}
.modal-textarea {
    width: 100%;
    border: 2px solid var(--beige-bg);
    border-radius: 20px;
    padding: 20px;
    font-family: inherit;
    font-size: 14px;
    resize: none; 
    margin-bottom: 20px;
    outline: none;
    transition: border-color 0.3s ease;
    background-color: #fafafa;
}
.modal-textarea:focus {
    border-color: var(--brown-card);
    background-color: var(--bg-color);
}


/* =========================================
   SYSTÈME DE SWIPE HORIZONTAL (MOBILE)
   ========================================= */
.mobile-swipe-row {
    -webkit-overflow-scrolling: touch; 
    scrollbar-width: none; 
}
.mobile-swipe-row::-webkit-scrollbar {
    display: none; 
}

/* =========================================
   RÈGLES RESPONSIVES (SMARTPHONES UNIQUEMENT)
   ========================================= */
@media (max-width: 767px) {
    
    /* Titres réduits */
    .page-title h1 { font-size: 2rem !important; }
    .page-title p { font-size: 13px !important; }
    .section-title { font-size: 1.5rem !important; }

    /* Ingrédients */
    .portion-control { width: 100%; justify-content: space-between; margin-bottom: 25px; }
    .ingredient-item { font-size: 13px; margin-bottom: 12px; }
    
    /* Etapes de préparation */
    .step-number { width: 30px; height: 30px; font-size: 14px; }
    .step-content h4 { font-size: 14.5px; }
    .step-content p { font-size: 12.5px; }

    /* Section Commentaires */
    .reviews-section { padding: 20px 15px !important; border-radius: 30px; }
    .review-card { padding: 18px; border-radius: 25px; }
    .btn-comment { font-size: 15px; padding: 12px; }
    .all-comments-list { grid-template-columns: 1fr; }

    /* Suggestions */
    .suggestions-wrapper { border-radius: 40px; }
}











/* =========================================
   POINTILLÉS DES INGRÉDIENTS (Discrets et alignés en bas)
   ========================================= */
.ingredient-name {
    display: flex;
    align-items: center;
    flex-grow: 1; 
    white-space: nowrap; 
}

.ingredient-name::after {
    content: "";
    flex-grow: 1;
    border-bottom: 2px dotted var(--purple-text); /* Trait plus fin */
    margin: 0 12px;
    height: 0; 
    transform: translateY(6px); /* Décale les pointillés vers le bas (modifiez ce chiffre si besoin) */
    opacity: 0.25; /* Rend la couleur beaucoup plus douce et discrète */
}

.ingredient-qty {
    color: var(--purple-text);
    font-style: italic;
    font-weight: 600;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

/* =========================================
   MODE IMPRESSION — FICHE RECETTE A4 (Design Élégant)
   Une seule page / recto
   ========================================= */

@media print {

    /* -----------------------------------------
       1. PAGE A4 & TYPOGRAPHIE GLOBALE
       ----------------------------------------- */
    @page {
        size: A4 portrait;
        margin: 10mm;
    }

    html, body {
        width: 100%; min-height: 100%;
        margin: 0 !important; padding: 0 !important;
        background: #ffffff !important;
        color: #222222 !important; /* Noir doux, plus élégant que le noir pur */
        font-family: "Times New Roman", Georgia, serif !important;
        font-size: 9pt !important;
        line-height: 1.3 !important;
    }

    /* Génération du faux logo "LAURA PÂTISSERIE" en haut */
    body::before {
        content: "LAURA PÂTISSERIE";
        display: block;
        text-align: center;
        font-family: "Times New Roman", Georgia, serif !important;
        font-size: 15pt !important;
        letter-spacing: 5px !important;
        border-bottom: 1px solid #111 !important;
        padding-bottom: 6mm !important;
        margin-bottom: 6mm !important;
        text-transform: uppercase !important;
    }

    /* Génération du "Bonne dégustation !" en bas */
    body::after {
        content: "Bonne dégustation !";
        display: block;
        text-align: center;
        font-style: italic !important;
        font-size: 13pt !important;
        color: #555 !important;
        margin-top: 6mm !important;
        padding-top: 4mm !important;
        border-top: 1px solid #d8d4ce !important;
    }

    /* -----------------------------------------
       2. NETTOYAGE : SUPPRESSION DU SUPERFLU
       ----------------------------------------- */
    header, nav, footer, .sidebar-card, .reviews-section, .suggestions-section,
    button, .btn, .action-btn, .scroll-arrow-btn, .modal, .modal-backdrop,
    .ingredient-item input[type="checkbox"], /* Plus de cases à cocher */
    .step .ratio, .step-content img /* Plus de photos d'étapes */ {
        display: none !important;
    }

    /* -----------------------------------------
       3. GRILLE PRINCIPALE (Header + Recette)
       ----------------------------------------- */
    .custom-container {
        display: grid !important;
        width: 100% !important; max-width: none !important;
        grid-template-columns: 38% 62% !important; /* Ratio équilibré */
        grid-template-areas:
            "title title"
            "image meta"
            "recipe recipe" !important;
        column-gap: 8mm !important;
        row-gap: 4mm !important;
        align-items: start !important;
    }

    /* -----------------------------------------
       4. TITRE DE LA RECETTE
       ----------------------------------------- */
    .page-title { grid-area: title !important; text-align: center !important; margin: 0 0 4mm 0 !important; }
    .page-title h1 {
        font-size: 26pt !important;
        font-weight: normal !important;
        color: #171717 !important;
        margin: 0 !important;
    }
    .page-title h1 .highlight { background: none !important; padding: 0 !important; color: #171717 !important; }
    .page-title p { display: none !important; } /* On cache la description sous le titre */

    /* -----------------------------------------
       5. IMAGE PRINCIPALE
       ----------------------------------------- */
    .custom-container > section.row.g-3 { grid-area: image !important; margin: 0 !important; }
    .custom-container > section.row.g-3 > .col-12 { width: 100% !important; padding: 0 !important; }
    .custom-container > section.row.g-3 > .col-md-6:last-child { display: none !important; }
    
    .custom-container > section.row.g-3 img {
        width: 100% !important;
        height: 48mm !important; /* Réduit pour gagner de la place */
        object-fit: cover !important;
        border-radius: 12px !important; /* Bords arrondis élégants */
    }

    /* -----------------------------------------
       6. INFORMATIONS (TEMPS, DIFFICULTÉ)
       ----------------------------------------- */
    .recipe-meta-bar {
        grid-area: meta !important;
        display: block !important;
        padding: 2mm 0 0 5mm !important;
        border: none !important; background: transparent !important;
    }
    
    #metaScroll {
        display: flex !important; flex-direction: column !important;
        gap: 4mm !important; padding: 0 !important; margin: 0 !important;
    }
    
    /* Style de chaque ligne d'info (Icône + Texte) */
    .meta-item, #metaScroll > div {
        display: flex !important; align-items: center !important;
        gap: 4mm !important; padding: 0 !important; border: none !important;
    }
    
    /* Icônes */
    .meta-item i, #metaScroll > div > div:first-child {
        width: 10mm !important; height: 10mm !important;
        display: flex !important; align-items: center !important; justify-content: center !important;
        border: 1.5px solid #d8d4ce !important; border-radius: 50% !important;
        font-size: 12pt !important; color: #222 !important;
    }

    /* -----------------------------------------
       7. COLONNES (INGRÉDIENTS & PRÉPARATION)
       ----------------------------------------- */
    .custom-container > section.row.mb-4 {
        grid-area: recipe !important;
        display: flex !important; flex-direction: row !important;
        width: 100% !important; margin: 0 !important; padding: 0 !important;
    }

    /* TITRES DES SECTIONS (Ingrédients, Matériel, Étapes) */
    h2.section-title {
        font-size: 16pt !important; margin: 0 0 4mm 0 !important;
        font-weight: normal !important; border: none !important; color: #111 !important;
    }
    h2.section-title .highlight { background: none !important; }

    /* --- GAUCHE : INGRÉDIENTS (Fond beige) --- */
    .custom-container > section.row.mb-4 > .col-lg-5 {
        width: 38% !important;
        background: #F8F6F0 !important; /* Le beau fond beige de référence */
        border-radius: 12px !important;
        padding: 5mm 6mm !important;
    }
    
    .portion-control { font-style: italic !important; font-size: 9pt !important; color: #666 !important; border: none !important; padding: 0 !important; margin-bottom: 4mm !important; background: transparent !important;}
    .portion-control i { display: none !important; }
    
    .ingredient-item {
        display: flex !important; align-items: baseline !important;
        font-family: Arial, sans-serif !important; font-size: 8pt !important;
        margin-bottom: 2mm !important;
    }
    .ingredient-name { display: flex !important; flex: 1 1 auto !important; }
    .ingredient-name::after {
        content: "" !important; flex: 1 1 auto !important;
        border-bottom: 1.5px dotted #c9c5bf !important; /* Pointillés clairs */
        margin: 0 2mm !important; transform: translateY(-2px) !important;
    }
    .ingredient-qty { font-family: "Times New Roman", serif !important; font-weight: bold !important; font-size: 8.5pt !important; }

    /* --- DROITE : PRÉPARATION --- */
    .custom-container > section.row.mb-4 > .col-lg-7 {
        width: 62% !important;
        padding-left: 8mm !important; margin-left: 4mm !important;
        border-left: 1px solid #d8d4ce !important; /* Ligne de séparation élégante */
    }

    h3 { font-size: 11pt !important; margin: 0 0 1mm 0 !important; color: #111 !important; }
    
    .step {
        display: flex !important; align-items: flex-start !important;
        gap: 3mm !important; margin-bottom: 4mm !important;
        page-break-inside: avoid !important;
    }
    
    /* Cercles numérotés beiges */
    .step-number {
        width: 8mm !important; height: 8mm !important; min-width: 8mm !important;
        display: flex !important; align-items: center !important; justify-content: center !important;
        background: #E8E5DF !important; border-radius: 50% !important;
        font-family: Arial, sans-serif !important; font-size: 8pt !important; font-weight: bold !important;
        margin-top: 1mm !important;
    }
    
    .step-content p {
        font-family: Arial, sans-serif !important; font-size: 8.5pt !important;
        line-height: 1.35 !important; color: #333 !important; margin: 0 !important;
    }

    /* -----------------------------------------
       8. PRÉVENTION DES COUPURES & OMBRES
       ----------------------------------------- */
    .step, .ingredient-list, .recipe-meta-bar { page-break-inside: avoid !important; }
    *, *::before, *::after { box-shadow: none !important; text-shadow: none !important; }
}