:root {
    /* =================================
     * ۱. متغیرهای رنگ‌بندی اصلی (تم جدید - مینیمال)
     * ================================= */

    /* (این بخش بدون تغییر باقی می‌ماند) */
    --faq-color-primary: #FF6D3A;
    --faq-color-primary-dark: #e05a2d;
    --faq-color-secondary: #1a1b1f;
    --faq-color-text-light: #7E8491;
    --faq-color-text-medium: #5a6170;
    --faq-color-text-dark: #333;
    --faq-color-text-white: #fff;
    --faq-color-transparent: transparent;
    --faq-bg-light-1: #F5F5F5;
    --faq-bg-light-2: #EFEFEF;
    --faq-bg-light-3: #f4f4f4;
    --faq-bg-white: #fff;
    --faq-border-light-1: #e4e6e9;
    --faq-border-light-2: #e4e6e9;
    --faq-shadow-normal: rgba(0, 0, 0, 0.1);
    --faq-shadow-hover: rgba(0, 0, 0, 0.15);
    --faq-shadow-active: rgba(255, 109, 58, 0.4);

    /* =================================
     * ۲. متغیرهای معنایی (بر اساس آیتم)
     * ================================= */

    /* (این بخش بدون تغییر باقی می‌ماند) */
    --search-bg: var(--faq-bg-light-1);
    --search-text: var(--faq-color-text-light);
    --search-text-focus: var(--faq-color-secondary);
    --search-border-focus: var(--faq-color-secondary);
    --search-button-bg: var(--faq-color-transparent);
    --faq-item-bg: var(--faq-bg-white);
    --faq-item-border: var(--faq-border-light-1);
    --faq-question-text: var(--faq-color-secondary);
    --faq-question-text-active: var(--faq-color-secondary);
    --faq-answer-text: var(--faq-color-text-medium);
    --faq-icon-color: var(--faq-color-secondary);
    --sidebar-bg: var(--faq-bg-white);
    --sidebar-border: var(--faq-border-light-1);
    --sidebar-title-text: var(--faq-color-secondary);
    --sidebar-title-border: var(--faq-border-light-2);
    --sidebar-link-text: var(--faq-color-secondary);
    --sidebar-link-text-active: var(--faq-color-primary);
    --sidebar-indicator-dot: #CDD2DC;
    --sidebar-indicator-active-dot: var(--faq-color-primary);
    --sidebar-indicator-active-line: var(--faq-color-primary);
    --mobile-tag-bg: var(--faq-bg-light-1);
    --mobile-tag-text: var(--faq-color-text-light);
    --mobile-tag-bg-active: var(--faq-color-primary);
    --mobile-tag-text-active: var(--faq-color-text-white);
    --cat-box-bg: var(--faq-bg-light-3);
    --cat-box-text: var(--faq-color-text-dark);
    --cat-box-shadow: var(--faq-shadow-normal);
    --cat-box-shadow-hover: var(--faq-shadow-hover);
    --cat-box-bg-active: var(--faq-color-primary);
    --cat-box-text-active: var(--faq-color-text-white);
    --cat-box-shadow-active: var(--faq-shadow-active);
    --retry-btn-bg: var(--faq-color-primary);
    --retry-btn-text: var(--faq-color-text-white);
    --retry-btn-bg-hover: var(--faq-color-primary-dark);
}


/*search bar*/
/* (این بخش بدون تغییر باقی می‌ماند) */
.search-wrapper {
    padding: 8px 16px 8px 8px;
    border-radius: 12px;
    background-color: var(--search-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.search-wrapper button {
    border: none;
    background-color: var(--search-button-bg);
}

.search-wrapper button:hover, .search-wrapper button:focus {
    border: none;
    background-color: var(--search-button-bg);
}

.search-wrapper input[type=text] {
    border: none;
    font-size: 14px;
    font-weight: 400;
    color: var(--search-text);
    background-color: var(--search-bg);
}

.search-wrapper input:focus {
    border: none;
    outline: none;
    font-weight: 600;
    color: var(--search-text-focus);
}

.search-wrapper:has( > input:focus) {
    border: 2px solid var(--search-border-focus);
}


/* =================================
 * ۳. استایل‌های آکاردئون (بازنویسی انیمیشن)
 * ================================= */

.faq-wrapper{
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px var(--cat-box-shadow);
    border: 1px solid var(--faq-item-border);
}

.faq-wrapper .question-container {
    width: 100%;
    background-color: var(--faq-item-bg);
    border-bottom: 1px solid var(--faq-item-border);
    margin: 0;
    padding: 0 12px;
    border-radius: 0;
}

.faq-default-title{
    text-align: center;
    margin: 8px 0;
}

.faq-wrapper .question {
    position: relative;
    color: var(--faq-question-text);
    cursor: pointer;
    margin-bottom: 0;
    width: 100%;
    border: none;
    text-align: right;
    outline: none;
    padding: 12px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.faq-wrapper .question h2 {
    margin-bottom: 0;
}

.faq-wrapper .question-text-wrapper {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.faq-wrapper .question-txt {
    font-weight: 600;
    font-size: 1.1rem;
}

.faq-wrapper .question.active {
    color: var(--faq-question-text-active);
}

.faq-wrapper .question::after,
.faq-wrapper .question::before {
    content: none;
}

.faq-icon-wrapper {
    position: relative;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    /* --- اصلاح: سرعت انیمیشن چرخش --- */
    transition: transform 0.25s ease-in-out;
}

.faq-icon-line-h,
.faq-icon-line-v {
    position: absolute;
    background-color: var(--faq-icon-color);
}

.faq-icon-line-h {
    width: 100%;
    height: 2px;
    top: 6px;
}

.faq-icon-line-v {
    width: 2px;
    height: 100%;
    left: 6px;
}

.faq-wrapper .question.active .faq-icon-wrapper {
    transform: rotate(45deg);
}

.faq-wrapper .answer-container {
    max-height: 0;
    overflow: hidden;
    /* --- اصلاح: سرعت انیمیشن باز شدن --- */
    transition: max-height 0.25s ease-in-out;
}

.faq-wrapper .answer {
    padding-top: 0;
    padding-bottom: 24px;
    margin-bottom: 0;
    color: var(--faq-answer-text);
    line-height: 28px;

    /* --- شروع کدهای انیمیشن Fade/Slide --- */
    opacity: 0;
    transform: translateY(10px);
    /* انیمیشن fade/slide با 0.1 ثانیه تاخیر شروع می‌شود
      تا بعد از شروع انیمیشن max-height اجرا شود.
    */
    transition: opacity 0.3s ease-out 0.1s, transform 0.3s ease-out 0.1s;
    /* --- پایان کدهای انیمیشن --- */
}

/* --- شروع: استایل فعال برای انیمیشن --- */
/* وقتی سوال .active شد، روی کانتینر پاسخ (+) و سپس
  روی محتوای پاسخ (.answer) این استایل‌ها را اعمال کن
*/
.faq-wrapper .question.active + .answer-container .answer {
    opacity: 1;
    transform: translateY(0px);
}

/* --- پایان: استایل فعال --- */


/* =================================
 * ۴. استایل‌های سایدبار
 * ================================= */
/* (این بخش بدون تغییر باقی می‌ماند) */
.faq-categories {
    border: 1.5px solid var(--sidebar-border);
    border-radius: 16px;
    background-color: var(--sidebar-bg);
    padding: 0;
}

.faq-categories h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--sidebar-title-text);
    padding: 20px;
    border-bottom: 1px solid var(--sidebar-title-border);
    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: var(--sidebar-link-text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

@media (min-width: 992px) {
    .category-list ul li::after {
        content: '';
        position: absolute;
        right: -20px;
        top: 10px;
        width: 8px;
        height: 8px;
        background-color: var(--sidebar-indicator-dot);
        border-radius: 50%;
    }

    .category-list ul li.active::after {
        background-color: var(--sidebar-indicator-active-dot);
    }

    .category-list ul li.active::before {
        content: '';
        position: absolute;
        right: -36px;
        top: 13px;
        height: 2px;
        width: 17px;
        background-color: var(--sidebar-indicator-active-line);
    }

    .category-list ul li.active a {
        color: var(--sidebar-link-text-active);
    }
}

/* =================================
 * ۵. Media Queries (موبایل و تبلت)
 * ================================= */
/* (این بخش بدون تغییر باقی می‌ماند) */
@media (max-width: 992px) {
}

@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;
    }

    .category-list ul::-webkit-scrollbar {
        display: none;
    }

    .category-list ul li {
        padding: 8px 16px;
        border-radius: 25px;
        background-color: var(--mobile-tag-bg);
        flex-shrink: 0;
        margin-bottom: 0;
    }

    .category-list ul li a {
        color: var(--mobile-tag-text);
    }

    .category-list ul li.active {
        background-color: var(--mobile-tag-bg-active);
    }

    .category-list ul li.active a {
        color: var(--mobile-tag-text-active);
    }

    .category-list ul li::after,
    .category-list ul li::before {
        content: none !important;
    }
}

/* =================================
 * ۶. باکس‌های دسته‌بندی (آرشیو)
 * ================================= */
/* (این بخش بدون تغییر باقی می‌ماند) */
.faq-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 20px 0;
    justify-items: center;
}

.category-item {
    text-align: center;
    background-color: var(--cat-box-bg);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px var(--cat-box-shadow);
    width: 100%;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s, transform 0.2s;
}

.category-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 10px var(--cat-box-shadow-hover);
}

.category-item.active {
    background-color: var(--cat-box-bg-active);
    box-shadow: 0 4px 10px var(--cat-box-shadow-active);
}

.category-item.active .category-name {
    color: var(--cat-box-text-active);
    font-weight: bold;
}

.category-icon img {
    width: 50px;
    height: 50px;
    margin-bottom: 10px;
}

.category-name {
    font-size: 15px;
    font-weight: bold;
    color: var(--cat-box-text);
    transition: color 0.3s;
}

@media (max-width: 767px) {
    .faq-categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
        padding: 15px 0;
    }

    .category-item {
        padding: 15px 10px;
        border-radius: 8px;
    }

    .category-icon img {
        width: 40px;
        height: 40px;
        margin-bottom: 8px;
    }

    .category-name {
        font-size: 14px;
    }
}

@media (max-width: 360px) {
    .faq-categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* =================================
 * ۷. دکمه تلاش مجدد (AJAX)
 * ================================= */
/* (این بخش بدون تغییر باقی می‌ماند) */
.btn-retry {
    background-color: var(--retry-btn-bg);
    color: var(--retry-btn-text);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn-retry:hover {
    background-color: var(--retry-btn-bg-hover);
}

.faqdm-product-container-auto{
    margin-top: 16px;
    margin-bottom: 16px;
}