/* 1. Force Two-Column Layout */
.wp-faq-container { 
    display: flex !important; 
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 30px !important; 
    max-width: 1100px !important; 
    margin: 40px !important; 
    background-color: #f8fafc !important; /* Matches the light background in your image */
    padding: 30px !important; 
    border-radius: 12px !important; 
}

.page-title, .entry-title, .post-title {
    display: none !important;
}

/* 2. Sidebar Restyling (Removing Theme Bullets) */
.wp-faq-sidebar { 
    flex: 0 0 280px !important; 
    width: 280px !important;
}

ul.faq-category-list { 
    list-style-type: none !important; 
    padding: 0 !important; 
    margin: 0 0 20px 0 !important; 
    background: #fff !important; 
    border-radius: 8px !important; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important; 
    overflow: hidden !important; 
}

ul.faq-category-list li { 
    list-style-type: none !important; /* Hides default theme bullets */
    padding: 16px 20px !important; 
    cursor: pointer !important; 
    border-bottom: 1px solid #f0f0f0 !important; 
    display: flex !important; 
    align-items: center !important; 
    gap: 12px !important; 
    color: #4a5568 !important; 
    font-weight: 600 !important; 
    font-size: 14px !important; 
    transition: all 0.3s ease !important; 
    margin: 0 !important;
}

ul.faq-category-list li:hover, 
ul.faq-category-list li.active { 
    background-color: #fff5f5 !important; 
    color: #e53e3e !important; 
}

/* 3. CTA Box Styling */
.faq-cta-box { 
    background: #fff !important; 
    border-radius: 8px !important; 
    padding: 30px 20px !important; 
    text-align: center !important; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important; 
}

.faq-cta-box h4 { margin: 0 0 10px 0 !important; color: #2d3748 !important; font-size: 16px !important; font-weight: bold !important;}
.faq-cta-box p { font-size: 13px !important; color: #718096 !important; margin-bottom: 20px !important; line-height: 1.5 !important; }
.cta-button { display: inline-block !important; background: linear-gradient(90deg, #ed8936 0%, #e53e3e 100%) !important; color: #fff !important; padding: 12px 24px !important; border-radius: 25px !important; text-decoration: none !important; font-weight: bold !important; font-size: 13px !important; border: none !important; }

/* 4. Right Content Area (Accordion) */
.wp-faq-content { flex: 1 !important; width: 100% !important; }

.faq-header h3 { 
    margin: 0 0 20px 0 !important; 
    display: flex !important; 
    align-items: center !important; 
    gap: 10px !important; 
    color: #2d3748 !important; 
    padding-bottom: 15px !important; 
    border-bottom: 2px solid #e2e8f0 !important; 
    font-size: 20px !important; 
    font-weight: bold !important;
}

.faq-item { 
    background: #fff !important; 
    border: 1px solid #e2e8f0 !important; 
    margin-bottom: 12px !important; 
    border-radius: 8px !important; 
    overflow: hidden !important; 
}

button.faq-question { 
    width: 100% !important; 
    background: #fff !important; 
    border: none !important; 
    padding: 18px 20px !important; 
    text-align: left !important; 
    cursor: pointer !important; 
    font-size: 15px !important; 
    font-weight: 600 !important; 
    color: #4a5568 !important; 
    display: flex !important; 
    justify-content: space-between !important; 
    align-items: center !important; 
}

.faq-answer { 
    max-height: 0; 
    overflow: hidden; 
    transition: max-height 0.3s ease-out; 
    background: #fff !important; 
}

.faq-answer-inner { 
    padding: 0 20px 20px 20px !important; 
    color: #718096 !important; 
    line-height: 1.6 !important; 
    font-size: 14px !important; 
}

/* 5. Mobile Responsiveness */
/* Mobile Responsiveness & Reordering */
@media (max-width: 768px) { 
    .wp-faq-container { 
        flex-direction: column !important; 
    } 
    
    /* "Unboxes" the sidebar so we can move its children individually */
    .wp-faq-sidebar { 
        display: contents !important; 
    } 
    
    /* Keeps the FAQs and Categories near the top */
    .wp-faq-content {
        order: 5 !important; 
    }

    /* Pushes the CTA box to the absolute bottom */
    .faq-cta-box { 
        order: 10 !important; 
        margin-top: 20px !important; 
    } 
}

/* Mobile Responsiveness & Reordering */
@media (max-width: 768px) { 
    .wp-faq-container { 
        flex-direction: column !important; 
    } 
    
    .wp-faq-sidebar { display: contents !important; } 
    .wp-faq-content { order: 5 !important; }
    .faq-cta-box { order: 10 !important; margin-top: 20px !important; } 

    /* ----------------------------------------- */
    /* NEW: Horizontal Scrolling Category Tabs   */
    /* ----------------------------------------- */
    ul.faq-category-list {
        display: flex !important;
        flex-wrap: nowrap !important; 
        overflow-x: auto !important;  
        -webkit-overflow-scrolling: touch !important; 
        gap: 10px !important;
        padding-bottom: 5px !important;
        scrollbar-width: none !important; 

        /* NEW FIX: Forces the boundary so scrolling works */
        width: 100% !important;
        max-width: 100vw !important; 
    } 

    .page-title, .entry-title, .post-title {
        display: none !important;
    }

    /* Hides the ugly scrollbar on Chrome, Safari, Edge */
    ul.faq-category-list::-webkit-scrollbar {
        display: none !important; 
    }

    ul.faq-category-list li {
        flex: 0 0 auto !important; /* Prevents the buttons from squishing */
        white-space: nowrap !important; /* Keeps text on one single line */
        margin-bottom: 0 !important; 
    }
}

/* ----------------------------------- */
/* POPUP MODAL STYLES                  */
/* ----------------------------------- */
.faq-modal-overlay {
    position: fixed !important; 
    top: 0 !important; 
    left: 0 !important; 
    width: 100% !important; 
    height: 100% !important;
    background: rgba(0, 0, 0, 0.7) !important;
    z-index: 999999 !important; /* Forces it above everything else */
    display: flex !important; 
    justify-content: center !important; 
    align-items: center !important;
    opacity: 0; 
    visibility: hidden;
    transition: all 0.3s ease !important;
}

.faq-modal-overlay.active {
    opacity: 1 !important; 
    visibility: visible !important;
}

.faq-modal-content {
    background: #fff !important; 
    width: 90% !important; 
    max-width: 450px !important;
    padding: 30px !important; 
    border-radius: 12px !important;
    position: relative !important;
    transform: translateY(-20px);
    transition: transform 0.3s ease !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2) !important;
}

.faq-modal-overlay.active .faq-modal-content {
    transform: translateY(0) !important;
}

.faq-modal-close {
    position: absolute !important; 
    top: 15px !important; 
    right: 20px !important;
    font-size: 28px !important; 
    cursor: pointer !important; 
    color: #a0aec0 !important;
    line-height: 1 !important;
}

.faq-modal-close:hover { 
    color: #e53e3e !important; 
}

.faq-modal-content h3 { 
    margin: 0 0 10px 0 !important; 
    color: #2d3748 !important; 
    font-size: 22px !important;
}

.faq-modal-content p { 
    color: #718096 !important; 
    font-size: 14px !important; 
    margin-bottom: 20px !important;
    line-height: 1.5 !important;
}

.faq-modal-form input, 
.faq-modal-form textarea {
    width: 100% !important; 
    padding: 12px !important; 
    margin-bottom: 15px !important;
    border: 1px solid #e2e8f0 !important; 
    border-radius: 6px !important;
    font-family: inherit !important; 
    box-sizing: border-box !important;
    font-size: 14px !important;
}

.faq-modal-form button[type="submit"] {
    width: 100% !important;
    margin: 0 !important;
}

/* Live Search Bar */
.faq-search-wrapper {
    position: relative !important;
    margin-bottom: 20px !important;
}

.faq-search-wrapper input {
    width: 100% !important;
    padding: 14px 20px 14px 45px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    color: #4a5568 !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02) !important;
    box-sizing: border-box !important;
    transition: border-color 0.3s ease !important;
}

.faq-search-wrapper input:focus {
    outline: none !important;
    border-color: #a0aec0 !important; 
}

.faq-search-icon {
    position: absolute !important;
    left: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #a0aec0 !important;
    font-size: 16px !important;
}
/* Live Search Highlight Style */
mark.faq-highlight {
    background-color: #fef08a !important; /* Nice soft yellow */
    color: #1a202c !important; /* Dark text for contrast */
    padding: 0 2px !important;
    border-radius: 3px !important;
}

/* 1. Centered Top Header */
.faq-top-header {
    width: 100% !important;
    display: block !important;
    text-align: center !important;
    margin-bottom: 40px !important;
    margin-top: 51px;
}

.faq-top-header h2 {
    font-size: 36px !important;
    font-weight: 700 !important;
    color: #2d3748 !important;
    margin: 0 auto 15px auto !important;
    text-align: center !important;
}

.faq-top-header p {
    font-size: 18px !important;
    color: #718096 !important;
    max-width: 800px !important;
    margin: 0 auto !important;
    text-align: center !important;
}

/* 2. Main Layout - Force Side-by-Side */
.faq-main-layout-wrapper {
    display: flex !important;
    flex-wrap: nowrap !important; /* STRICT: Forces them on the same line */
    gap: 40px !important;
    align-items: flex-start !important;
    width: 100% !important;
}

/* 3. Left Side (FAQs) */
.faq-main-layout-wrapper .wp-faq-container {
    width: 65% !important;
    flex: 0 0 65% !important; /* STRICT: Locks width at 65% */
    margin: 0 !important;
}

/* 4. Right Side (Image) */
.faq-right-side-image {
    width: 35% !important;
    flex: 0 0 35% !important; /* STRICT: Locks width at 35% */
    position: sticky !important;
    top: 20px !important;
}

.faq-right-side-image img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05) !important;
    display: block !important;
}

/* 5. Mobile Breakpoint (Stacks them neatly on small screens) */
@media (max-width: 992px) {
    .faq-main-layout-wrapper {
        flex-wrap: wrap !important; /* Allows them to stack on phones */
    }
    .faq-main-layout-wrapper .wp-faq-container, 
    .faq-right-side-image {
        width: 100% !important;
        flex: 0 0 100% !important;
    }
    .faq-right-side-image {
        margin-top: 30px !important;
        position: relative !important;
    }
}