/* ==============================================
   FAQ Accordion (msh_faq) — Базовые стили.
   Все цвета — через var(--global-paletteN), без fallback.
   ============================================== */

.faq-accordion-wrapper {
    margin-bottom: 20px;
    font-family: inherit;
}

.faq-item {
    border: 1px dotted var(--global-palette7);
    border-radius: 0;
    margin-bottom: 10px;
    overflow: hidden;
    background: var(--global-palette9);
    transition: all 0.3s ease;
    position: relative;
}

/* ===== ЗАГОЛОВОК ===== */

.faq-question {
    width: 100%;
    padding: 15px 15px 15px 54px;
    background: var(--global-palette9);
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    color: var(--global-palette3);
    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);
    color: var(--global-palette4);
}

.faq-question:focus-visible {
    outline: 2px solid var(--global-palette4);
    outline-offset: -2px;
    background: var(--global-palette8);
}

.faq-question[aria-expanded="true"] {
    background: var(--global-palette5);
    color: var(--global-palette9);
}

/* ===== ИКОНКА ===== */

.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);
    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);
    transform: scale(1.05);
}

.faq-question[aria-expanded="true"] .faq-icon {
    color: var(--global-palette9);
}

.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);
    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);
    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);
    text-decoration: underline;
    font-weight: 700;
    transition: color 0.2s ease;
}

.faq-answer-content a:hover {
    color: var(--global-palette3);
}

/* ===== СПИСКИ ВНУТРИ ОТВЕТОВ ===== */

.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);
    color: var(--global-palette9);
}

.faq-item .faq-question:not([role="button"]):hover {
    background: var(--global-palette2);
}

.faq-item .faq-answer:not([style*="max-height"]) {
    opacity: 1;
    visibility: visible;
}

.no-faq {
    text-align: center;
    color: var(--global-palette6);
    font-style: italic;
    padding: 60px 20px;
    font-size: 1.2em;
    border: 2px dashed var(--global-palette7);
    border-radius: 0;
    background: var(--global-palette9);
}

/* ===== АДАПТИВНОСТЬ ===== */

@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;
    }
}