/* Container & Background */
.brw-section {
    background-color: #faf9f5; /* Soft beige from reference */
    padding: 80px 20px;
    font-family: inherit;
}

/* Header & Typography */
.brw-header-wrapper {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 50px auto;
}
.brw-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #976b43;
    text-transform: uppercase;
    display: block;
    margin-bottom: 15px;
}
.brw-main-heading {
    font-size: 48px;
    color: #3e2a1e;
    margin: 0 0 15px 0;
    line-height: 1.1;
}
.brw-subheading {
    font-size: 16px;
    color: #4a4a4a;
    line-height: 1.6;
    margin-bottom: 25px;
}
.brw-rating-summary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    color: #3e2a1e;
    font-weight: 600;
}
.brw-stars-large { color: #e6a337; font-size: 20px; }
.brw-divider { color: #ccc; font-weight: 300; }
.brw-total { color: #884c2a; font-weight: 500; }

/* Filter Bar (Immune to Theme Overrides) */
#brw-immune-filters {
    max-width: 1200px;
    margin: 0 auto 40px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    width: 100%;
}

#brw-immune-filters .brw-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px; 
    width: 100%;
    margin: 0;
    padding: 0;
}

#brw-immune-filters .brw-filter-btn {
    display: inline-block;
    background-color: #f1ece3;
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    color: #3e2a1e;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
    white-space: nowrap; /* Stops text from squishing */
    text-transform: capitalize; 
    user-select: none; /* Stops text highlighting when tapped */
}

#brw-immune-filters .brw-filter-btn:hover { 
    background-color: #e5dac9; 
}

#brw-immune-filters .brw-filter-btn.active {
    background-color: #976b43;
    color: #fff;
}

#brw-immune-filters .brw-sort-wrapper {
    margin-top: 10px;
}

/* Sort Dropdown Menu */
.brw-sort-select {
    background-color: #f1ece3;
    border: none;
    padding: 10px 30px 10px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    color: #3e2a1e;
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%233e2a1e" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
}

/* CSS Column Masonry Grid */
.brw-grid {
    max-width: 1200px;
    margin: 0 auto;
    column-count: 4;
    column-gap: 24px;
}

/* Review Cards (With Borders & Anti-WoodMart Text) */
.brw-card {
    background: #fff !important;
    border-radius: 12px !important;
    border: 1px solid #dcd1c4 !important; /* Premium visible beige border */
    overflow: hidden !important;
    margin-bottom: 24px !important;
    break-inside: avoid !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03) !important;
    transition: transform 0.3s ease !important;
    cursor: pointer !important;
}

.brw-card:hover {
    transform: translateY(-5px) !important;
    border-color: #976b43 !important; /* Border gets slightly darker on hover */
}

.brw-card-image img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    border-bottom: 1px solid #f1ece3 !important; /* Line separating image from text */
}

.brw-card-content { padding: 20px !important; }

.brw-card-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 12px !important;
}

.brw-stars { color: #e6a337 !important; font-size: 15px !important; letter-spacing: 1px !important; }
.brw-date { font-size: 12px !important; color: #888 !important; font-weight: 500 !important; }

/* BULLETPROOF BODY TEXT: Bold, larger, and cuts off after 4 lines */
.brw-card-body, 
.brw-card-body p {
    font-size: 15px !important; /* Bigger text */
    font-weight: 600 !important; /* BOLD text */
    color: #222 !important; /* Darker, higher contrast */
    line-height: 1.5 !important;
    margin: 0 0 15px 0 !important;
    
    /* This cuts the text off after 4 lines with an ellipsis (...) */
    display: -webkit-box !important;
    -webkit-line-clamp: 4 !important; 
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.brw-card-footer {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.brw-avatar {
    width: 30px !important; height: 30px !important; border-radius: 50% !important;
    overflow: hidden !important; background-color: #f1ece3 !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    color: #3e2a1e !important; font-weight: 700 !important; font-size: 12px !important;
}
.brw-avatar img { width: 100% !important; height: 100% !important; object-fit: cover !important; }
.brw-author { font-size: 14px !important; font-weight: 700 !important; color: #3e2a1e !important; }

.brw-verified {
    margin-left: auto !important; font-size: 11px !important; color: #b88d5b !important;
    display: flex !important; align-items: center !important; gap: 4px !important;
}
.brw-verified svg { width: 14px !important; height: 14px !important; }

/* Load More */
.brw-load-more-wrapper { text-align: center; margin-top: 20px; }
.brw-btn-load-more {
    background: transparent;
    border: 1px solid #976b43;
    color: #976b43;
    padding: 12px 35px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}
.brw-btn-load-more:hover {
    background: #976b43;
    color: #fff;
}
.brw-btn-load-more.loading { opacity: 0.5; pointer-events: none; }

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .brw-grid { column-count: 3; }
}

@media (max-width: 768px) {
    /* Tablet & Large Mobile */
    .brw-grid { column-count: 2; column-gap: 15px; }
    .brw-card { margin-bottom: 15px; }
    .brw-main-heading { font-size: 36px; }
    .brw-filters { flex-direction: column; gap: 20px; }
    .brw-rating-summary { flex-direction: column; gap: 5px; }
}

@media (max-width: 480px) {
    /* Restore 2-Column Mobile Masonry */
    .brw-grid { column-count: 2 !important; column-gap: 10px !important; }
    .brw-card { margin-bottom: 10px !important; border-radius: 8px !important; }
    .brw-card-content { padding: 12px !important; }
    
    /* Stack Stars & Date to save space */
    .brw-card-header { flex-direction: column !important; align-items: flex-start !important; gap: 4px !important; margin-bottom: 8px !important; }
    .brw-stars { font-size: 11px !important; letter-spacing: 1px !important; }
    .brw-date { font-size: 10px !important; }
    
    /* Push text size up and keep it BOLD on mobile */
    .brw-card-body, 
    .brw-card-body p { 
        font-size: 14px !important; /* Large text for mobile 2-column */
        font-weight: 600 !important; /* Bold and visible */
        line-height: 1.4 !important; 
        margin-bottom: 12px !important; 
        -webkit-line-clamp: 5 !important; /* Cut short after 5 lines on mobile */
    }
    
    .brw-card-footer { gap: 6px !important; }
    .brw-avatar { width: 22px !important; height: 22px !important; font-size: 9px !important; }
    .brw-author { font-size: 12px !important; line-height: 1.1 !important; font-weight: 700 !important; }
    .brw-verified { display: none !important; } /* Hide to save space */
    
    .brw-main-heading { font-size: 28px !important; }
    #brw-immune-filters .brw-filter-btn { font-size: 11px !important; padding: 8px 16px !important; }

    /* Hides the empty white box if the review is ONLY an image */
    .brw-no-text .brw-card-content { display: none !important; }
    .brw-no-text .brw-card-image img { border-bottom: none !important; border-radius: 8px !important; }
}
    
    /* Header (Stars & Date) */
    .brw-card-header { 
        flex-direction: column; /* Stack stars and date to save horizontal space */
        align-items: flex-start; 
        gap: 4px; 
        margin-bottom: 8px;
    }
    .brw-stars { font-size: 11px; letter-spacing: 1px; }
    .brw-date { font-size: 10px; }
    
    /* Body Text */
    .brw-card-body { 
        font-size: 12px; /* Shrink text for 2-column mobile layout */
        line-height: 1.4; 
        margin-bottom: 12px; 
    }
    
    /* Footer (Avatar & Name) */
    .brw-card-footer { 
        gap: 6px; 
    }
    .brw-avatar { 
        width: 22px; 
        height: 22px; 
        font-size: 9px; 
    }
    .brw-author { 
        font-size: 11px; 
        line-height: 1.1; 
    }
    
    /* Hide the 'Verified Buyer' text on mobile, just show the badge/name to save space */
    .brw-verified { display: none; }
    
    /* Shrink Section Headers */
    .brw-main-heading { font-size: 28px; }
    .brw-subheading { font-size: 14px; padding: 0 10px; }
    .brw-filter-btn { font-size: 12px; padding: 8px 16px; }
}

/* Make cards clickable */
.brw-card { cursor: pointer; }

/* --- POPUP MODAL STYLES (Bulletproof) --- */
.brw-modal {
    display: none !important; /* Forces it to hide by default */
    position: fixed !important; 
    z-index: 999999 !important;
    left: 0 !important; 
    top: 0 !important; 
    width: 100vw !important; 
    height: 100vh !important;
    align-items: center !important; 
    justify-content: center !important;
}
.brw-modal.active { 
    display: flex !important; /* Only shows when clicked */
}

.brw-modal-overlay {
    position: absolute; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
}

.brw-modal-content {
    position: relative; background: #fff;
    width: 850px; max-width: 90%; max-height: 90vh;
    border-radius: 20px; display: flex; overflow: hidden;
    z-index: 2; box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.brw-modal-close {
    position: absolute; top: 15px; right: 15px;
    width: 36px; height: 36px; background: #f1ece3;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: #3e2a1e; cursor: pointer;
    z-index: 10; transition: 0.3s; line-height: 1;
}
.brw-modal-close:hover { background: #e5dac9; }

/* Left Side: Image */
.brw-modal-left { width: 50%; background: #faf9f5; }
.brw-modal-left img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Right Side: Text */
.brw-modal-right {
    width: 50%; padding: 40px; overflow-y: auto;
    display: flex; flex-direction: column;
}
/* If there is no image, the text box takes up 100% width cleanly */
.brw-modal-right.full-width { width: 100%; }

.brw-modal-header { display: flex; align-items: center; gap: 15px; border-bottom: 1px solid #f1ece3; padding-bottom: 20px; margin-bottom: 20px; }
.brw-modal-author-info h3 { margin: 0 0 5px 0; font-size: 18px; color: #3e2a1e; }
.brw-verified-badge { font-size: 12px; color: #b88d5b; display: flex; align-items: center; gap: 4px; }
.brw-verified-badge svg { width: 14px; height: 14px; }
.brw-modal-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.brw-modal-body p { font-size: 16px; color: #4a4a4a; line-height: 1.7; margin: 0; }

/* Mobile Modal Adjustments (Bulletproof Overlap Fix) */
@media (max-width: 768px) {
    .brw-modal-content { 
        display: block !important; /* Removes flexbox to prevent overlap */
        flex-direction: column !important; 
        overflow-y: auto !important; 
        height: auto !important;
        max-height: 90vh !important;
        background: #fff !important; /* Ensures the background behind text is solid white */
    }
    
    .brw-modal-left { 
        width: 100% !important; 
        height: auto !important; 
        max-height: 50vh !important; /* Stops the image from filling the whole screen */
        background: #f4f4f4 !important; /* Soft background behind screenshot */
        display: block !important;
    }
    
    .brw-modal-left img { 
        width: 100% !important; 
        height: 100% !important; 
        max-height: 50vh !important;
        object-fit: contain !important; /* CRITICAL: Stops WhatsApp screenshots from being cropped! */
        display: block !important;
    }
    
    .brw-modal-right { 
        width: 100% !important; 
        padding: 25px !important; 
        background: #ffffff !important; /* Forces solid white background */
        display: block !important;
    }
    
    .brw-modal-close { 
        top: 10px !important; 
        right: 10px !important; 
        background: rgba(255,255,255,0.95) !important; 
        box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
    }
}