/**
 * Блок FAQ.
 * BEM: faq.
 * Desktop: сайдбар + список · Tablet/Phone: колонка.
 * Только var(--site-*), rem.
 */

.faq {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    width: 100%;
    max-width: 81.25rem; /* 1300px */
    margin: 0 auto;
    padding: 0 0 var(--site-section-gap);
    box-sizing: border-box;
}

.faq__sidebar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.875rem;
    flex: 0 0 19.5rem; /* 312px */
    width: 19.5rem;
}

.faq__intro {
    display: flex;
    flex-direction: column;
    gap: 1.875rem;
}

.faq__title {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--site-text);
}

.faq__text {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--site-text-body);
}

.faq__text--tablet {
    display: none;
}

.faq__sidebar-row {
    display: contents;
}

.faq__support {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-sizing: border-box;
    width: 100%;
    max-width: 18.8844rem;
    padding: 1.25rem;
    background-color: var(--site-surface);
    border-radius: 1.25rem;
    box-shadow: inset 0 0 0 0.0625rem var(--site-image-ring);
}

.faq__support-top {
    display: flex;
    flex-direction: row;
    gap: 0.625rem;
}

.faq__support-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    background-color: var(--site-step-bg);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--site-accent);
}

.faq__support-copy {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.faq__support-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--site-text);
}

.faq__support-text {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--site-text);
}

.faq__support-btn {
    display: flex;
    flex-direction: row;
    flex-shrink: 0;
    align-items: center;
    gap: 0.625rem;
    box-sizing: border-box;
    width: fit-content;
    height: 2.5rem;
    padding: 0 1.25rem;
    border-radius: 0.625rem;
    background-color: var(--site-accent);
    box-shadow: inset 0 0 0 0.0844rem var(--site-btn-ring);
    font-size: 1rem;
    font-weight: 700;
    line-height: normal;
    text-align: center;
    white-space: nowrap;
    color: var(--site-on-accent);
    text-decoration: none;
}

.faq__support-btn:hover,
.faq__support-btn:focus-visible {
    background-color: var(--site-accent-hover);
}

.faq__support-btn-icon {
    display: block;
    flex-shrink: 0;
    width: 1.0094rem;
    height: 1.05rem;
    filter: brightness(0) invert(1);
}

.faq__divider {
    flex: 0 0 0.0625rem;
    align-self: stretch;
    width: 0.0625rem;
    background-color: var(--site-faq-divider);
}

.faq__main {
    display: flex;
    flex-direction: column;
    gap: 1.875rem;
    flex: 1 1 0;
    min-width: 0;
}

.faq__tabs {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem;
}

.faq__tab {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    box-sizing: border-box;
    height: 2.5rem;
    margin: 0;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: 3.125rem;
    background-color: transparent;
    box-shadow: inset 0 0 0 0.0844rem var(--site-badge-bg);
    cursor: pointer;
    font: inherit;
}

.faq__tab--active {
    background-color: var(--site-badge-bg);
    box-shadow: none;
}

.faq__tab-icon {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    object-fit: contain;
}

.faq__tab-label {
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--site-accent);
    white-space: nowrap;
}

.faq__panel {
    display: none;
}

.faq__panel--active {
    display: block;
}

.faq__items {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.faq__item {
    box-sizing: border-box;
    padding: 1.25rem;
    background-color: var(--site-surface);
    border-radius: 0.625rem;
    box-shadow: inset 0 0 0 0.0625rem var(--site-image-ring);
}

.faq__item--open {
    box-shadow: inset 0 0 0 0.0625rem var(--site-accent);
}

.faq__question {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.25rem;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font: inherit;
}

.faq__toggle {
    position: relative;
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.375rem;
    background-color: var(--site-badge-bg);
}

.faq__item--open .faq__toggle {
    background-color: var(--site-accent);
}

.faq__toggle::before,
.faq__toggle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    background-color: var(--site-accent);
    border-radius: 0.0625rem;
    transform: translate(-50%, -50%);
}

.faq__toggle::before {
    width: 0.875rem;
    height: 0.125rem;
}

.faq__toggle::after {
    width: 0.125rem;
    height: 0.875rem;
}

.faq__item--open .faq__toggle::before,
.faq__item--open .faq__toggle::after {
    background-color: var(--site-on-accent);
}

.faq__item--open .faq__toggle::after {
    display: none;
}

.faq__question-text {
    flex: 1 1 0;
    min-width: 0;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--site-text);
}

.faq__answer {
    margin-top: 0.5rem;
    padding-left: 2.75rem;
}

.faq__answer-text {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--site-text);
}

.faq__answer-link {
    color: var(--site-accent);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.125rem;
}

.faq__answer-link:hover,
.faq__answer-link:focus-visible {
    color: var(--site-accent-hover);
}

/* Tablet */
@media (max-width: 63.9375rem) {
    .faq {
        flex-direction: column;
        gap: 3.125rem;
    }

    .faq__sidebar {
        flex: none;
        width: 100%;
        max-width: none;
    }

    .faq__intro {
        gap: 0;
    }

    .faq__text--desktop {
        display: none;
    }

    .faq__sidebar-row {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 1.875rem;
    }

    .faq__text--tablet {
        display: block;
        flex: 1 1 0;
        font-size: 1rem;
    }

    .faq__support {
        flex-shrink: 0;
        max-width: 18.8844rem;
    }

    .faq__divider {
        display: none;
    }

    .faq__main {
        width: 100%;
    }
}

/* Phone */
@media (max-width: 47.9375rem) {
    .faq {
        gap: 2.5rem;
    }

    .faq__title {
        font-size: 1.875rem;
    }

    .faq__sidebar-row {
        flex-direction: column;
        align-items: stretch;
        gap: 1.875rem;
    }

    .faq__support {
        max-width: none;
    }

    .faq__text--tablet {
        font-size: 0.875rem;
    }

    .faq__tab {
        padding: 0.625rem 1rem;
    }

    .faq__tab-icon {
        width: 1rem;
        height: 1rem;
        object-fit: contain;
    }

    .faq__support-btn-icon {
        width: 0.875rem;
        height: 0.875rem;
    }
}
