﻿.faq-wrapper {
    position: relative; /* Crucial for containing the absolute-positioned sidebar */
}

.faq-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.faq-sidebar-wrapper {
    width: 280px;
    flex-shrink: 0;
    height: 100px; /* Placeholder height, will be adjusted by JS */
}

.faq-sidebar {
    width: 280px;
    height: auto; /* Let content define height */
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: top 0.1s ease-out; /* Smooth transitions */
}

    /* JS-Controlled Positioning Classes */
    .faq-sidebar.is-fixed {
        position: fixed;
        top: 60px;
    }

    .faq-sidebar.is-absolute-bottom {
        position: absolute;
        bottom: 0;
        top: auto; /* Override fixed top position */
    }


    /* Custom scrollbar for sidebar */
    .faq-sidebar::-webkit-scrollbar {
        width: 6px;
    }

    .faq-sidebar::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }

    .faq-sidebar::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 10px;
    }

        .faq-sidebar::-webkit-scrollbar-thumb:hover {
            background: #555;
        }

    .faq-sidebar ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .faq-sidebar li {
        margin-bottom: 0.5rem;
    }

    .faq-sidebar a {
        display: block;
        padding: 0.5rem 1rem;
        color: #666;
        text-decoration: none;
        border-radius: 4px;
        transition: all 0.3s;
        font-size: 0.95rem;
    }

        .faq-sidebar a:hover,
        .faq-sidebar a.active {
            background: #a8df02;
            color: #000;
            font-weight: 600;
        }

    .faq-sidebar .sub-section {
        padding-left: 0;
        margin-top: 0.25rem;
    }

        .faq-sidebar .sub-section li {
            margin-bottom: 0.25rem;
        }

        .faq-sidebar .sub-section a {
            padding: 0.4rem 1rem 0.4rem 2rem;
            font-size: 0.85rem;
            position: relative;
        }

            .faq-sidebar .sub-section a:before {
                content: "→";
                position: absolute;
                left: 1rem;
                opacity: 0.5;
            }

.faq-content {
    flex: 1;
    min-width: 0;
}

.faq-section {
    margin-bottom: 3rem;
    scroll-margin-top: 60px; /* Match sticky top value */
    padding: 30px 0px;
}

    .faq-section:first-child {
        padding-top: 0px;
    }

    .faq-section h2 {
        margin-bottom: 1.5rem;
        padding-bottom: 0.5rem;
        font-size: 2.5rem;
        text-align: center;
    }

    .faq-section h3 {
        margin-top: 2.5rem;
        margin-bottom: 0.5rem;
        font-size: 1.8rem;
    }

        .faq-section h3:first-child {
            margin-top: 0px;
        }

.faq-subsection {
    margin-bottom: 2rem;
}

    .faq-subsection h3 {
        margin-bottom: 1rem;
        font-size: 1.3rem;
        color: #333;
    }

.acc_content strong {
    font-weight: 600;
}
@media (max-width: 991px) {
    .faq-container {
        flex-direction: column;
    }

    .faq-sidebar-wrapper, .faq-sidebar {
        width: 100%;
        position: relative !important; /* Override JS positioning */
        top: auto !important;
        left: auto !important;
        bottom: auto !important;
        height: auto;
        max-height: 400px;
        margin-bottom: 2rem;
    }

    .faq-section {
        scroll-margin-top: 80px;
    }
}
