/*
    Definitive Final CSS for the "Page Flip" Review Widget
    - FIXES: Mobile view where the card was cut off.
    - The review widget container on mobile now has a flexible height.
*/

/*
============================================================
    DESKTOP: TWO-COLUMN LAYOUT (Screens > 992px)
============================================================
*/
#hero.hero-section {
    display: flex; flex-direction: row; justify-content: space-between;
    align-items: center; width: 100%; padding: 0 5%; min-height: 90vh;
}
.hero-content { flex: 1 1 45%; max-width: 45%; text-align: left; }
.hero-content h2 { text-align: left; }
.reviews-container {
    position: relative; flex: 1 1 50%;
    height: 380px; max-width: 600px;
    top: auto; right: auto; transform: none;
    perspective: 1500px;
}
.review-card {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0;
    display: flex; flex-direction: column;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px) saturate(150%); -webkit-backdrop-filter: blur(15px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px; padding: 2rem;
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.35);
    color: #f0f0f0;
    transform: rotateX(90deg) translateY(50px);
    transform-origin: bottom center;
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.8s ease;
    backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.review-card.active { opacity: 1; transform: rotateX(0deg) translateY(0px); }
.review-header { flex-shrink: 0; display: flex; align-items: center; margin-bottom: 1.5rem; }
.reviewer-photo { width: 70px; height: 70px; margin-right: 1.5rem; border: 0px solid var(--primary-color); }
.reviewer-info { display: flex; flex-direction: column; }
.reviewer-name { font-size: 1.5rem; font-weight: 700; color: #ffffff; }
.review-rating { font-size: 1.2rem; color: var(--primary-color); }
.review-text { font-size: 1.1rem; line-height: 1.6; flex-grow: 1; overflow-y: auto; padding-right: 15px; margin-bottom: 1.5rem; }
.reviews-more-btn {
    display: block; flex-shrink: 0; width: 60%; margin: 0 auto;
    padding: 12px 25px; font-size: 1rem; text-align: center;
    background: transparent; border: 2px solid #ffffff; color: #ffffff;
    border-radius: 25px; font-weight: 700; text-decoration: none;
    transition: all 0.3s ease;
}
.reviews-more-btn:hover { background: #ffffff; border-color: #ffffff; color: #000000; transform: translateY(-2px); }
.reviews-nav { position: absolute; bottom: -40px; width: 100%; text-align: center; }
.nav-dot { display: inline-block; width: 12px; height: 12px; background-color: rgba(255, 255, 255, 0.4); border-radius: 50%; margin: 0 6px; cursor: pointer; transition: background-color 0.3s ease, transform 0.3s ease; }
.nav-dot.active { background-color: var(--primary-color); transform: scale(1.2); }
.nav-dot:hover { background-color: rgba(255, 255, 255, 0.7); }
.review-text::-webkit-scrollbar { width: 8px; }
.review-text::-webkit-scrollbar-track { background: transparent; }
.review-text::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, 0.3); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }

/*
============================================================
    MOBILE RESPONSIVE STYLES (Screens <= 992px)
============================================================
*/
@media (max-width: 992px) {
    #hero.hero-section { flex-direction: column; justify-content: center; height: auto; padding-top: 10vh; padding-bottom: 15vh; }
    .hero-content, .reviews-container { flex: 1 1 100%; max-width: 90%; width: 90%; }
    .hero-content { text-align: center; margin-bottom: 5vh; }
    .hero-content h2 { text-align: center; }
    
    /* --- THE FIX IS HERE --- */
    .reviews-container {
        height: auto; /* CRITICAL: Allows the container to grow with its content */
        max-width: 380px;
    }
    .review-card {
        position: relative; /* On mobile, the active card can be relative */
        opacity: 1;         /* We don't need the flip effect on mobile, show the card */
        transform: none;    /* Reset desktop transforms */
        height: auto;       /* The card itself also has a flexible height */
        padding: 1.5rem;
        border-radius: 15px;
    }
    /* Hide non-active cards on mobile to prevent layout issues */
    .review-card:not(.active) {
        display: none;
    }
    /* --- END OF THE MAIN FIX --- */

    .reviewer-photo { width: 50px; height: 50px; margin-right: 1rem; }
    .reviewer-name { font-size: 1.1rem; }
    .review-rating { font-size: 1rem; }
    .review-text { font-size: 0.95rem; flex-grow: 0; height: auto; min-height: 100px; } /* Reset flex behavior */
    .reviews-more-btn { padding: 8px 15px; font-size: 0.9rem; }
    .reviews-nav { position: relative; bottom: auto; margin-top: 20px; } /* Put nav dots back in the flow */
    .nav-dot { width: 9px; height: 9px; }
}
