/* --- RECIPE GRID LAYOUT --- */

.ast-container{
    max-width: 100% !important;
    width: 100% !important;
    padding: 0px !important;

}
.content-area{
    padding: 0px !important;
    margin: 0px !important;
}

.recipe-layout-wrapper{
    max-width: 100vw;
    width: 100vw;
    margin: 0px;
    padding: 0px;
}

/* --- WAVY HEADER & FOOTER DIVIDERS --- */
.cl-wavy-divider {
    position: absolute;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}
.cl-wavy-divider svg {
    display: block;
    width: calc(100% + 1.3px);
    height: 40px;
}
.cl-wavy-divider .cl-shape-fill {
    fill: var(--color-offwhite);
}
.cl-wavy-bottom {
    bottom: -1px;
    transform: rotate(180deg);
}
.cl-wavy-top {
    top: -1px;
}

/* --- WAVY HEADER --- */
.recipe-header-wavy {
    background-color: var(--color-yellow);
    position: relative;
    padding: 30px 0px 60px 0px;
    margin-bottom: 40px;
    /*border-radius: 8px 8px 0 0; /* Optional: if you want top corners rounded */
}

.recipe-header-wavy-content {
    max-width: 90vw;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.recipe-mini-header-info {
    display: flex;
    flex-direction: column;
}

.recipe-mini-header-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-primary);
    display: block;
    margin-bottom: 4px;
}

.recipe-course-title {
    margin: 0;
    color: var(--color-primary);
    font-size: 18px;
    display: inline-block;
    margin-right: 10px;
}

.recipe-back-button {
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: var(--color-white);
    border: 1px solid var(--color-primary);
    padding: 8px 16px;
    border-radius: 4px;
    background: var(--color-primary);
    transition: all 0.2s;
}

.recipe-back-button:hover {
    background: #061c27; /* Darker blue */
    color: var(--color-white);
}

/* --- WAVY FOOTER --- */
.recipe-footer-wavy {
    background-color: var(--color-yellow);
    position: relative;
    padding: 60px 20px 40px 20px;
    margin-top: 60px;
    /*border-radius: 0 0 8px 8px; /* Optional: rounded bottom corners */
}

.recipe-footer-wavy-title {
    text-align: center;
    color: var(--color-primary);
    margin-bottom: 30px;
    font-size: 28px;
}

.recipe-footer-wavy-content {
    max-width: 1200px;
    margin: 0 auto;
}

/* --- MAIN TITLE --- */
.recipe-header {
    margin-bottom: 30px;
    text-align: center;
}

.recipe-main-title {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin: 0;
}

/* --- FOOTER PRODUCTS GRID --- */
.recipe-footer-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 30px;
}

.recipe-footer-product-card {
    background: var(--color-white);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: var(--color-primary);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}

.recipe-footer-product-card:hover {
    transform: translateY(-5px);
    color: var(--color-primary);
}

.recipe-footer-product-card img, .recipe-footer-no-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.recipe-footer-no-img {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 30px;
}

.recipe-footer-product-title {
    padding: 15px;
    font-weight: 600;
    font-size: 15px;
    text-align: center;
    line-height: 1.3;
}

/* --- FOOTER --- */
.recipe-footer-content {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
    text-align: center;
}

.recipe-footer-attribution {
    color: var(--color-primary);
    font-style: italic;
    margin: 0;
    opacity: 0.8;
}

/* 1. Il Contenitore (Desktop) */
@media (min-width: 1360px) {
    .recipe-grid {
        display: grid;
        grid-template-columns: 3fr 1fr;
        /* Proporzione 75% - 25% */
        gap: 40px;
        align-items: start;
        /* Allinea in alto */
        width: 90vw;
        margin: 0px 5vw;
        position: relative;
    }

    .recipe-sidebar {
        /* Questo spinge la colonna in basso, così non parte attaccata al titolo */
        margin-top: 80px;
    }
}

/* 2. La Sidebar Sticky */
.sidebar-sticky {
    /* Effetto Sticky: Segue lo scroll */
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
}

/* --- SIDEBAR MODULES --- */
.sidebar-module {
    background: var(--color-offwhite);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #eee;
    margin-bottom: 20px;
}
.sidebar-module:last-child {
    margin-bottom: 0;
}

.sidebar-module h3 {
    font-size: 16px;
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--color-primary);
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Related Recipes */
.sidebar-related-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-related-list li {
    margin-bottom: 15px;
}
.sidebar-related-list li:last-child {
    margin-bottom: 0;
}
.sidebar-related-item {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--color-primary);
    transition: transform 0.2s;
}
.sidebar-related-item:hover {
    transform: translateX(5px);
    color: var(--color-yellow);
}
.sidebar-related-img, .sidebar-related-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}
.sidebar-related-placeholder {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 20px;
}
.sidebar-related-title {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
    color: #000;
}

/* 3. Scroll Area dei Commenti */
.comments-scroll-area {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    padding-right: 5px;
    font-size: 0.9em;
    max-height: 50vh;
}

/* 4. Form Pulizia */
.comment-form-wrapper textarea {
    width: 100%;
    resize: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
}

.comment-form-wrapper .comment-form-cookies-consent,
.comment-form-wrapper .comment-notes {
    display: none !important;
    /* Nascondiamo robaccia inutile di WP */
}

/* Mobile: Torna tutto in colonna */
@media (max-width: 1359px) {
    .recipe-grid {
        display: flex;
        flex-direction: column;
        width: 94vw;
        margin: 0px 3vw;
    }

    .recipe-sidebar {
        order: 2;
        margin-top: 30px;
        padding-top: 20px;
        border-top: 2px solid #eee;
    }

    /* Modal per i commenti */
    .sidebar-comments-module {
        position: fixed;
        bottom: -100%;
        left: 0;
        width: 100%;
        height: 75vh;
        background: var(--color-white);
        z-index: 9999;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.15);
        transition: bottom 0.3s ease-in-out;
        box-sizing: border-box;
        overflow-y: auto;
        margin-bottom: 0;
        border: none;
    }

    .sidebar-comments-module.modal-open {
        bottom: 0;
    }

    .close-comments-modal {
        display: block !important;
        position: absolute;
        top: 15px;
        right: 15px;
        background: none;
        border: none;
        font-size: 20px;
        color: #999;
        cursor: pointer;
    }
}

@media (min-width: 1360px) {
    .close-comments-modal {
        display: none !important;
    }
}

/* --- ZEN MOBILE CHAT TRIGGER --- */

/* 1. Stile Base del Bottone */
.mobile-chat-trigger {
    display: none;
    /* Default: nascosto su Desktop */
    position: fixed;
    z-index: 990;
    /* Sopra al contenuto, sotto ai modali (di solito 1000+) */

    /* POSIZIONAMENTO 5/6 DELLO SCHERMO */
    right: 20px;
    bottom: 35vh;
    /* 75% dal basso = circa 1/4 dell'altezza */

    /* Estetica */
    width: 50px;
    height: 50px;
    background-color: #0a2838;
    color: #fff !important;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);

    /* Centratura Icona */
    align-items: center;
    justify-content: center;
    font-size: 20px;
    text-decoration: none;
    transition: transform 0.2s ease;
}

/* Effetto click */
.mobile-chat-trigger:active {
    transform: scale(0.95);
}

/* 2. Badge Numero Commenti (Il pallino rosso) */
.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #333;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

/* 3. VISIBILITÀ: Solo su Mobile */
@media (max-width: 1359px) {
    .mobile-chat-trigger {
        display: flex;
        /* Ora appare */
    }
}
