/**
 * Вопросы по товарам / FAQ (раздел «Помощь»).
 * Подключается глобально: header.php → custom_faq.css
 */
/* ================== Общие элементы ================== */

.faq-section-link {
    margin-bottom: 16px;
}

.faq-section-link .btn-link {
    font-size: 16px;
    text-decoration: none;
}

.faq-disclaimer {
    border: 1px solid #feb300;
    padding: 15px;
    border-radius: 3px;
    margin: 30px 0;
    font-size: 13px;
    line-height: 1.5;
}

.faq-question-title {
    margin: 0;
    font-size: 18px;
    font-weight: 400;
}

.faq-v {
    font-size: 24px;
    font-weight: 400;
    color: #CCCCCC;
    line-height: 27px;
    margin: 30px 0;
}
.ajax_load.block .btn.in-cart i:not(.svg-inline-prediction),
.ajax_load.block .btn.in-cart i:not(.svg-inline-prediction) svg,
.ajax_load.block .btn.in-cart i:not(.svg-inline-prediction) svg * {
    filter: brightness(1) invert(0) !important;
    -webkit-filter: brightness(1) invert(0) !important;
}

/* ================== Блок "Назад" ================== */

.faq-back-wrapper {
    margin-bottom: 30px;
}

.faq-back {
    display: inline-flex;
    align-items: center;
    border: 1px solid #3a3a3a;
    border-radius: 3px;
    text-decoration: none;
    color: #ffffff;
    font-size: 10px;
    font-weight: 400;
    line-height: 1;
    background: transparent;
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.faq-back__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; /* 24px слева + 12px иконка */
    height: 100%;
    padding-left: 24px;
}

.faq-back__icon img {
    width: 12px;
    height: 12px;
    display: block;
}

.faq-back__text {
    display: inline-block;
    padding: 16px 24px 16px 8px; /* 8px от иконки до текста */
    color: #ffffff;
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 400;
    line-height: 15px;
}

.faq-back:hover {
    background-color: #2d2d2d;
    border-color: #4a4a4a;
}

/* ================== Табы ================== */

.faq-tabs {
    display: inline-flex;
    width: 100%;
    padding: 4px;
    gap: 4px;
    background-color: #232323;
    border-radius: 12px;
    margin-bottom: 30px;
}

.faq-tab {
    margin: 0;
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    background-color: transparent;
    color: #ffffff;
    font-size: 14px;
    line-height: 16px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.faq-tab_active {
    background-color: #494949;
}

.faq-tab:not(.faq-tab_active):hover {
    background-color: #333333;
}

/* ================== Список товаров (карточки) ================== */

.faq-product-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-product-item {
    display: block;
    text-decoration: none;
}

/* Карточка товара */
.faq-product-card {
    display: flex;
    background-color: #232323;
    border: 1px solid #3A3A3A;
    align-items: center;
    border-radius: 3px;
    height: 98px;
    padding: 0 16px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.faq-product-item:hover .faq-product-card {
    background-color: #2a2a2a;
    border-color: #505050;
}

.faq-product-card__image {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    margin: 17px 16px 17px 0;
}

.faq-product-card__image img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    display: block;
}

.faq-product-card__image--placeholder {
    background-color: #1a1a1a;
}

.faq-product-card__content {
    flex: 1 1 auto;
    color: #ffffff;
}

.faq-product-card__name {
    font-size: 15px;
    font-weight: 400;
    line-height: 22px;
    margin-bottom: 4px;
}

.faq-product-card__sku {
    font-size: 14px;
    font-weight: 400;
    color: #C6C6C6;
}

.faq-product-card__arrow {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border: 1px solid #3A3A3A;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 16px;
    color: #999999;
}

.faq-product-card__arrow-icon {
    width: 12px;
    height: 12px;
    display: block;
}

/* ================== Связанный товар в карточке вопроса ================== */

.faq-related-product {
    display: flex;
    align-items: center;
    background-color: #232323;
    border-radius: 3px;
    border: 1px solid #3A3A3A;
    padding: 16px;
    margin-bottom: 20px;
}

.faq-related-product__image {
    flex: 0 0 80px;
    width: 80px;
    height: 80px;
    margin-right: 16px;
}

.faq-related-product__image img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    display: block;
}

.faq-related-product__content {
    flex: 1 1 auto;
    color: #FFFFFF;
}

.faq-related-product__name {
    font-size: 20px;
    font-weight: 400;
    line-height: 22px;
    margin: 7px 0 6px;
}

.faq-related-product__sku {
    font-size: 13px;
    font-weight: 400;
    color: #CCCCCC;
}

/* ================== Карточки разделов ================== */

/* сетка */
.faq-section-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

/* карточка (десктоп: иконка слева, текст справа) */
.faq-section-card {
    position: relative;
    display: flex;
    background-color: #232323;
    border: 1px solid #3A3A3A;
    align-items: center;
    border-radius: 3px;
    padding: 24px;
    text-decoration: none;
    color: #ffffff;
    gap: 16px;
    height: 122px;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.faq-section-card:hover {
    background-color: #2a2a2a;
    border-color: #505050;
    transform: translateY(-1px);
}

.faq-section-card__icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 3.5px;
    background-color: #2b2b2b;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.faq-section-card__icon {
    max-width: 24px;
    max-height: 24px;
    display: block;
}

.faq-section-card__title {
    margin: 0;
    font-size: 18px;
    line-height: 24px;
    font-weight: 400;
    padding-right: 55px;          /* место под стрелку */
    overflow-wrap: break-word;
    word-break: break-word;
}

.faq-section-card__arrow {
    position: absolute;
    right: 24px;
    width: 30px;
    height: 30px;
    border-radius: 3px;
    border: 1px solid #3A3A3A;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999999;
}

.faq-section-card__arrow-icon {
    width: 12px;
    height: 12px;
    display: block;
}
.faq-related-product-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.faq-related-product-link:hover .faq-related-product {
    border-color: #505050;
    background-color: #2a2a2a;
}

/* ================== Популярные вопросы: поиск, подсветка ================== */

.faq-sections-page .faq-popular-answer {
    font-size: 15px;
    line-height: 1.55;
    color: #e0e0e0;
}

.faq-sections-page mark.faq-popular-highlight {
    background-color: #feb300;
    color: #1a1a1a;
    padding: 0 3px;
    border-radius: 2px;
    font-weight: 600;
}

.faq-sections-page .faq-popular-item--answer-match .faq-question-title {
    color: #feb300;
}

.faq-sections-page .faq-popular-item--answer-match mark.faq-popular-highlight {
    background-color: rgba(254, 179, 0, 0.35);
    color: #feb300;
    font-weight: 600;
}

/* Пустая выдача поиска по популярным вопросам (макет) */
.faq-sections-page .faq-popular-empty {
    margin-top: 8px;
    margin-bottom: 8px;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

.faq-sections-page .faq-popular-empty__title {
    margin: 0 0 16px;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 1.3;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.faq-sections-page .faq-popular-empty__hint {
    margin: 0 0 28px;
    max-width: 640px;
    font-size: 15px;
    line-height: 22px;
    font-weight: 400;
    color: #b6b5b5;
}

.faq-sections-page .faq-popular-empty__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 15%;
    min-width: 170px;
    max-width: none;
    min-height: 48px;
    padding: 14px 24px;
    margin: 0;
    border: none;
    border-radius: 3px;
    background: #feb300;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 11px;
    line-height: 14px;
    letter-spacing: 0.04em;
    color: #121212;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: filter 0.2s ease, background-color 0.2s ease;
}

.faq-sections-page .faq-popular-empty__cta:hover,
.faq-sections-page .faq-popular-empty__cta:focus {
    filter: brightness(1.06);
    color: #121212;
    outline: none;
}

.faq-sections-page .faq-popular-empty__cta:active {
    filter: brightness(0.98);
}

/* Пустая выдача поиска по товарам (?q=): блок и кнопка на всю ширину контента (как линия поиска и меню) */
.faq-sections-page .faq-search-empty {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

.faq-sections-page .faq-search-empty__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.faq-sections-page .faq-search-empty__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 15%;
    min-width: 170px;
    max-width: none;
    box-sizing: border-box;
}

.faq-sections-page .faq-search-empty__secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    border: 1px solid #feb300;
    background: transparent;
    color: #feb300;
    font-weight: 600;
    font-size: 11px;
    line-height: 14px;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    padding: 14px 24px;
    min-height: 48px;
    border-radius: 3px;
    transition: background-color 0.2s, color 0.2s;
}

.faq-sections-page .faq-search-empty__secondary:hover,
.faq-sections-page .faq-search-empty__secondary:focus {
    background-color: rgba(254, 179, 0, 0.12);
    color: #feb300;
    text-decoration: none;
}

.faq-sections-page .faq-search-empty__secondary:focus {
    outline: none;
}

/* ================== Модалка «Задать вопрос сотруднику» ================== */

body.faq-ask-modal-open {
    overflow: hidden;
}

.faq-ask-modal {
    display: none;
    position: fixed;
    inset: 0;
    /* Выше шапки Aspro (#headerfixed ~997–1061, .header_wrap до 3000); сам блок в JS переносится в body */
    z-index: 100500;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    box-sizing: border-box;
}

.faq-ask-modal--open {
    display: flex;
}

.faq-ask-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    cursor: pointer;
}

.faq-ask-modal__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 28px 28px 32px;
    box-sizing: border-box;
    background: #1b1b1b;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.faq-ask-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.faq-ask-modal__close:hover,
.faq-ask-modal__close:focus {
    opacity: 1;
    outline: none;
}

.faq-ask-modal__title {
    margin: 0 48px 24px 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 22px;
    line-height: 1.3;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.faq-ask-form__field {
    margin-bottom: 20px;
}

.faq-ask-form__field:last-of-type {
    margin-bottom: 24px;
}

.faq-ask-form__label {
    display: block;
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 400;
    color: #b6b5b5;
}

.faq-ask-form__star {
    color: #ff4d4d;
    font-weight: 600;
}

.faq-ask-form__input,
.faq-ask-form__textarea {
    display: block;
    width: 100%;
    margin: 0;
    padding: 12px 14px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    color: #f0f0f0;
    background: #0d0d0d;
    border: 1px solid #3a3a3a;
    border-radius: 3px;
    transition: border-color 0.2s ease;
}

.faq-ask-form__input::placeholder,
.faq-ask-form__textarea::placeholder {
    color: #6a6a6a;
}

.faq-ask-form__input:hover,
.faq-ask-form__textarea:hover {
    border-color: #4a4a4a;
}

.faq-ask-form__input:focus,
.faq-ask-form__textarea:focus {
    border-color: #feb300;
    outline: none;
}

.faq-ask-form__textarea {
    min-height: 120px;
    resize: vertical;
}

.faq-ask-form__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 14px 28px;
    margin: 0;
    border: none;
    border-radius: 3px;
    background: #feb300;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 11px;
    line-height: 14px;
    letter-spacing: 0.04em;
    color: #121212;
    text-transform: uppercase;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: filter 0.2s ease;
}

.faq-ask-form__submit:hover,
.faq-ask-form__submit:focus {
    filter: brightness(1.06);
    outline: none;
}

.faq-ask-form__submit:active {
    filter: brightness(0.98);
}

/* ================== Адаптив ================== */

@media (max-width: 1199px) {
    .faq-section-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}

@media (max-width: 767px) {
    .faq-product-card__name {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        font-size: 15px;
    }

    .faq-sections-page .faq-search-empty__cta {
        width: 100%;
    }

    .faq-sections-page .faq-popular-empty__cta {
        width: 100%;
    }

    .container.pt-4.pb-5 {
        padding-left: 0;
        padding-right: 0;
    }

    .faq-tabs {
        margin-bottom: 20px;
        height: 40px;
    }

    .faq-tab {
        font-size: 13px;
        white-space: nowrap;
    }

    .faq-back-wrapper {
        margin-bottom: 20px;
    }

    /* Список категорий: одна колонка, карточка в ряд (иконка | текст | стрелка) */
    .faq-section-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    /*
     * Вложенный .container (шапка страницы) даёт двойные поля — компенсируем,
     * край экрана ≈ 16px как в макете Figma.
     */
    /* Прямой или через .maxwidth-theme вложенный контейнер */
    .middle .container .container.faq-sections-page.pt-4.pb-5 {
        margin-left: -15px;
        margin-right: -15px;
        width: calc(100% + 30px);
        max-width: none;
        padding-left: 16px;
        padding-right: 16px;
        box-sizing: border-box;
    }

    .faq-sections-page.container.pt-4.pb-5 {
        padding-left: 16px;
        padding-right: 16px;
    }

    .faq-section-card {
        flex-direction: row;
        align-items: center;
        padding: 14px 44px 14px 14px;
        height: auto;
        min-height: 64px;
        border-radius: 5px;
    }

    .faq-section-card__icon-wrap {
        margin-bottom: 0;
    }

    .faq-section-card__title {
        flex: 1 1 auto;
        min-width: 0;
        padding-right: 10px;
        font-size: 15px;
        line-height: 1.35;
    }

    .faq-section-card__arrow {
        top: 50%;
        right: 12px;
        transform: translateY(-50%);
        border-radius: 50%;
        background-color: #2b2b2b;
    }
}