/*search bar*/

.search-wrapper {
    padding: 8px 16px 8px 8px;
    border-radius: 12px;
    background-color: #F5F5F5;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.search-wrapper button {
    border: none;
    background-color: transparent;
}

.search-wrapper button:hover,
.search-wrapper button:focus {
    border: none;
    background-color: transparent;
}

.search-wrapper input[type=text] {
    border: none;
    font-size: 14px;
    font-weight: 400;
    color: #7E8491;
    background-color: #F5F5F5;
}

.search-wrapper input:focus {
    border: none;
    outline: none;
    font-weight: 600;
    color: #001F5B;
}

.search-wrapper:has( > input:focus) {
    border: 2px solid #001F5B;
}


/* =================================
 * ۳. استایل‌های آکاردئون (FAQ List)
 * ================================= */

.faq-wrapper .question-container {
    width: 100%;
    background-color: #EFEFEF;
    /* خط bottom-border که قبلاً حذف خواستید، کامنت شده است. */
    /* border-bottom: 1px solid #EFEFEF; */
    margin: 24px 0;
    padding: 20px;
    border-radius: 16px;
}

.faq-wrapper .question {
    position: relative;
    color: #646973;
    cursor: pointer;
    margin-bottom: 0;
    width: 100%;
    border: none;
    text-align: right;
    outline: none;
}

.faq-wrapper .question.active {
    color: #001F5B;
}

.faq-wrapper .question::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    width: 24px;
    height: 24px;
    background-image: url("../img/down.svg");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.5s ease-in-out;
    filter: invert(0.6);
}

.faq-wrapper .question.active::after {
    transform: translateY(-80%) rotate(180deg);
    filter: invert(0.1);
}

.faq-wrapper .answer-container {
    max-height: 0;
    overflow: hidden;
    transition: 0.3s;
}

.faq-wrapper .answer {
    padding-top: 16px;
    margin-bottom: 0;
    color: #001F5B;
    line-height: 28px;
}


/* =================================
 * ۴. استایل‌های سایدبار (دسکتاپ)
 * ================================= */

/* استایل‌های اصلی کانتینر سایدبار */
.faq-categories {
    border: 1.5px solid #EBEBEB; /* مرز اصلی سایدبار */
    border-radius: 16px;
    background-color: #fff;
    padding: 0; /* پدینگ‌ها در h2 و ul/li مدیریت می‌شوند */
}

.faq-categories h2 {
    font-size: 16px;
    font-weight: 600;
    color: #001F5B;
    padding: 20px;
    border-bottom: 1px solid #EFEFEF;
    margin-bottom: 0;
}

.category-list ul {
    list-style: none;
    padding: 0 0 0 20px; /* پدینگ سمت چپ برای فضای بیشتر */
    margin: 0;
}

.category-list ul li {
    padding: 0;
    margin-bottom: 20px;
    position: relative;
    list-style: none;
}

.category-list ul li a {
    font-size: 14px;
    color: #001F5B;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

/* نشانگرهای فعال (Active Indicators) در دسکتاپ */
@media (min-width: 992px) {
    .category-list ul li::after {
        content: '';
        position: absolute;
        right: -20px;
        top: 10px;
        width: 8px;
        height: 8px;
        background-color: #CDD2DC;
        border-radius: 50%;
    }

    .category-list ul li.active::after {
        background-color: #FF6D3A;
    }

    .category-list ul li.active::before {
        content: '';
        position: absolute;
        right: -36px;
        top: 13px;
        height: 2px;
        width: 17px;
        background-color: #FF6D3A;
    }

    .category-list ul li.active a {
        color: #FF6D3A;
    }
}


/* =================================
 * ۵. Media Queries (موبایل و تبلت)
 * ================================= */

/* کوچک کردن آیکون در موبایل */
@media (max-width: 992px) {
    .faq-wrapper .question::after {
        width: 19px;
        height: 19px;
    }
}


/* استایل‌های مخصوص حالت موبایل (زیر ۹۹۲ پیکسل) */
@media (max-width: 992px) {

    .faq-wrapper html {
        font-size: 14px;
    }

    /* استایل‌دهی مجدد کانتینر دسته‌بندی در موبایل */
    .faq-categories {
        border: none; /* حذف حاشیه دسکتاپ */
        border-radius: 0;
        padding: 0 10px; /* اضافه کردن پدینگ افقی برای نمایش بهتر در موبایل */
    }

    /* عنوان دسته‌بندی در موبایل */
    .faq-categories h2 {
        font-size: 20px; /* بزرگتر شدن عنوان اصلی در موبایل */
        padding: 0 0 15px 0;
        text-align: right;
        border-bottom: none;
    }

    /* کانتینر لیست برای اسکرول افقی */
    .category-list ul {
        display: flex;
        white-space: nowrap;
        padding: 0;
        margin-bottom: 20px; /* فاصله از پایین */
        gap: 10px;
        overflow-x: auto; /* ⭐ کلید اسکرول افقی ⭐ */
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    /* پنهان کردن scrollbar در موبایل */
    .category-list ul::-webkit-scrollbar {
        display: none;
    }

    /* استایل تگ‌های فعال در موبایل */
    .category-list ul li {
        padding: 8px 16px;
        border-radius: 25px;
        background-color: #F5F5F5;
        flex-shrink: 0; /* مهم: تگ‌ها جمع نشوند */
        margin-bottom: 0; /* حذف margin عمودی */
    }

    .category-list ul li a {
        color: #7E8491;
    }

    .category-list ul li.active {
        background-color: #FF6D3A;
    }

    .category-list ul li.active a {
        color: #fff;
    }

    /* حذف نشانگرهای فعال دسکتاپ در حالت موبایل */
    .category-list ul li::after,
    .category-list ul li::before {
        content: none !important;
    }
}