/* ==============================================
   FAQ Accordion (a2_faq_acc) - Базовые стили
   ============================================== */

.faq-accordion-wrapper {
    margin-bottom: 20px;
    font-family: inherit; /* Наследуем шрифт темы */
}

.faq-item {
    border: 1px dotted var(--global-palette7, #AEBCCF);
    border-radius: 0;
    margin-bottom: 10px;
    overflow: hidden;
    background: var(--global-palette9, #fff);
    transition: all 0.3s ease;
    position: relative;
}

/* ===== ЗАГОЛОВОК (КЛИКАБЕЛЬНЫЙ) ===== */
.faq-question {
    width: 100%;
    padding: 15px 15px 15px 54px;
    background: var(--global-palette9, #fff);
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    color: var(--global-palette3, #2A4360);
    display: block;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: normal;
    position: relative;
    margin: 0;
    border: none;
    outline: none;
    user-select: none;
    text-align: left;
    line-height: 1.3;
}

.faq-question:hover {
    background: var(--global-palette7, #D5DCE4);
    color: var(--global-palette4, #063956);
}

.faq-question:focus-visible {
    outline: 2px solid var(--global-palette4, #063956);
    outline-offset: -2px;
    background: var(--global-palette8, #F1F3F8);
}

.faq-question[aria-expanded="true"] {
    background: var(--global-palette5, #5D7B9D);
    color: var(--global-palette9, #fff);
}

/* ===== ИКОНКА ===== */
.faq-icon-wrapper {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.faq-icon {
    color: var(--global-palette5, #5D7B9D);
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.faq-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
    transition: all 0.3s ease;
}

.faq-icon svg[viewBox="0 0 512 512"] {
    transform: scale(0.85);
    transform-origin: center;
}

.faq-question:hover .faq-icon {
    color: var(--global-palette4, #063956);
    transform: scale(1.05);
}

.faq-question[aria-expanded="true"] .faq-icon {
    color: var(--global-palette9, #fff);
}

.faq-question[aria-expanded="true"] .faq-icon svg {
    animation: iconPulse 0.5s ease;
}

@keyframes iconPulse {
    0% { transform: scale(0.85); }
    50% { transform: scale(0.92); }
    100% { transform: scale(0.85); }
}

/* ===== ОТВЕТ (СКРЫТЫЙ БЛОК) ===== */
.faq-answer {
    background: var(--global-palette8, #7D94AF0F); /* Светлый фон из палитры */
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transition-property: max-height, opacity, visibility;
    position: relative;
    padding-left: 15px;
}

.faq-answer.open {
    max-height: 5000px;
    opacity: 1;
    visibility: visible;
}

.faq-answer-content {
    padding: 15px 15px 15px 0;
    line-height: 1.5;
    color: var(--global-palette3, #123560); /* Основной текст темный */
    font-weight: 500;
    letter-spacing: normal;
}

.faq-answer-content-inner {
    padding: 15px 0;
}

.faq-answer-content p {
    margin-bottom: 15px;
    font-size: 1em;
}

.faq-answer-content p:last-child {
    margin-bottom: 0;
}

.faq-answer-content a {
    color: var(--global-palette2, #084E81);
    text-decoration: underline;
    font-weight: 700;
    transition: color 0.2s ease;
}

.faq-answer-content a:hover {
    color: var(--global-palette3, #123560);
}

/* ===== СПИСКИ ВНУТРИ ОТВЕТОВ ===== */
.faq-answer-content ul,
.faq-answer-content ol {
    margin: 10px 0 15px 20px;
    padding: 0;
    list-style-position: outside;
}

.faq-answer-content li {
    margin-bottom: 8px;
}

/* ===== ЕСЛИ ОДИН ВОПРОС (БЕЗ КНОПКИ) ===== */
.faq-item .faq-question:not([role="button"]) {
    padding-left: 15px;
    cursor: default;
    background: var(--global-palette2, #084E81);
    color: var(--global-palette9, #fff);
}

.faq-item .faq-question:not([role="button"]):hover {
    background: var(--global-palette2, #084E81);
}

.faq-item .faq-answer:not([style*="max-height"]) {
    opacity: 1;
    visibility: visible;
}

.no-faq {
    text-align: center;
    color: var(--global-palette6, #a0aec0);
    font-style: italic;
    padding: 60px 20px;
    font-size: 1.2em;
    border: 2px dashed var(--global-palette7, #e2e8f0);
    border-radius: 0;
    background: var(--global-palette9, #f7fafc);
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
    .faq-item {
        margin-bottom: 8px;
    }
    
    .faq-question {
        padding: 12px 12px 12px 48px;
    }
    
    .faq-item .faq-question:not([role="button"]) {
        padding-left: 12px;
    }
    
    .faq-icon-wrapper {
        left: 12px;
        width: 22px;
        height: 22px;
    }
    
    .faq-icon {
        width: 22px;
        height: 22px;
    }
    
    .faq-icon svg[viewBox="0 0 512 512"] {
        transform: scale(0.8);
    }
    
    .faq-answer {
        padding-left: 12px;
    }
    
    .faq-answer-content {
        padding: 12px 12px 12px 0;
    }
    
    .faq-answer-content-inner {
        padding: 12px 0;
    }
    
    .faq-answer-content p {
        font-size: 0.95em;
        margin-bottom: 12px;
    }
}