/* ==========================================================================
   FAQ — «Центр справки». Подгружается только на странице /faq/.
   Глобальные правила body/header/footer/*{} — НЕ копируем, их задаёт тема.
   ========================================================================== */

/* Принудительный вертикальный скролл на html (скроллится именно он —
   у body тема ставит overflow-x: hidden). В JS дублируется на всякий случай. */
html:has(body.zfaq-page) {
    overflow-y: scroll;
}

.zfaq-app *,
.zfaq-app *::before,
.zfaq-app *::after {
    box-sizing: border-box;
}

/* Тема оборачивает наш <main> в Bootstrap-строку .row (display: flex).
   Без col-* класса <main> становится flex-элементом auto-ширины, и при
   «Ничего не найдено» схлопывается до ширины контента — из-за этого
   .support-intro визуально «съезжает влево». Принудительно даём 100%.
   Высокая специфичность + !important нужны, чтобы перебить Bootstrap-стили,
   которые тема минифицирует и кэширует.                                    */
main.page-main.zfaq-app,
.zfaq-app {
    flex: 1 1 100% !important;
    flex-basis: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

.zfaq-app {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #000000;
    background: #ffffff;
    font-size: 20px;
    line-height: 1.5;
    display: block;
    /* Отрезаем любой случайный горизонтальный оверфлоу — тема/Bootstrap
       на мобильных иногда расширяют .row на 15px за счёт negative-margin. */
    overflow-x: clip;
}

.zfaq-app a {
    text-decoration: none;
    color: inherit;
}

.zfaq-app .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Intro (заголовок, крошки, поиск).
   Заголовок и крошки темы woodmart отключены в ssr.php
   через remove_action('woodmart_after_header', 'woodmart_page_title').
   ========================================================================== */

.zfaq-app .support-intro.page-title {
    background-color: #ffffff;
    text-align: center;
    padding-top: 64px !important;
    padding-right: 40px !important;
    padding-bottom: 44px !important;
    padding-left: 40px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.zfaq-app .support-intro__inner.page-title-inner.container {
    max-width: 1192px;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.zfaq-app .support-intro__inner.page-title-inner.container > .entry-title.support-intro__title,
.zfaq-app .support-intro__inner.page-title-inner.container > .support-intro__breadcrumbs,
.zfaq-app .support-intro__inner.page-title-inner.container > .support-intro__help {
    width: 100%;
    max-width: 100%;
}

.zfaq-app .support-intro.page-title.title-size-default .entry-title.title.support-intro__title {
    font-family: 'Open Sans Condensed', 'Open Sans', sans-serif;
    font-weight: 700;
    font-size: 28px;
    line-height: 1;
    color: #000000;
    margin: 0 0 12px;
}

@media (min-width: 1025px) {
    .zfaq-app .support-intro.page-title.title-size-default .entry-title.title.support-intro__title {
        font-size: 35px;
    }
}

.zfaq-app .support-intro .breadcrumbs.support-intro__breadcrumbs {
    margin: 0 0 20px;
    min-height: 22px;
    line-height: 22px;
    text-align: center;
    font-family: 'Encode Sans Condensed', 'Open Sans Condensed', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    color: #000000;
}

.zfaq-app .support-intro .breadcrumbs.support-intro__breadcrumbs :is(a, span) {
    text-transform: uppercase;
    font-weight: 600;
    font-size: 14px;
}

.zfaq-app .support-intro .breadcrumbs a {
    color: #000000;
    text-decoration: none;
    transition: color 0.2s;
}

.zfaq-app .support-intro .breadcrumbs a:hover {
    color: #E64A19;
}

.zfaq-app .support-intro .breadcrumbs .current {
    color: #000000;
}

.zfaq-app .support-intro__help {
    font-family: 'Open Sans Condensed', 'Open Sans', sans-serif;
    font-size: clamp(18px, 2.2vw, 22px);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #444444;
    margin: 0 0 14px;
}

.zfaq-app .support-intro__lead {
    font-size: 16px;
    line-height: 1.55;
    color: #666666;
    width: 100%;
    max-width: 560px;
    margin: 0 0 28px;
    text-align: center;
    align-self: center;
}

.zfaq-app .support-intro .support-search {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: min(560px, 100%);
    margin: 0;
    flex-shrink: 0;
    align-self: center;
}

.zfaq-app .support-search__field {
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.zfaq-app .support-search__icon {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    color: #888888;
    pointer-events: none;
}

.zfaq-app .support-search__input {
    /* Тема принудительно даёт input[type="search"] { box-sizing: content-box },
       из-за чего 100%-ширина + padding 52/24 выходит за контейнер на мобильном. */
    box-sizing: border-box !important;
    width: 100%;
    height: 52px;
    border: 1px solid #e3e3e3;
    border-radius: 9999px;
    padding: 0 24px 0 52px;
    font-size: 15px;
    font-family: inherit;
    color: #242424;
    background: #fafafa;
    outline: none;
    box-shadow: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.zfaq-app .support-search__input::placeholder {
    color: #999999;
}

.zfaq-app .support-search__input:hover {
    border-color: #d0d0d0;
    background: #ffffff;
}

.zfaq-app .support-search__input:focus {
    border-color: #E64A19;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(230, 74, 25, 0.2);
}

.zfaq-app .support-search__hint {
    margin: 12px 0 0;
    padding: 0 4px;
    font-size: 14px;
    line-height: 1.45;
    color: #777777;
    text-align: center;
}

/* ==========================================================================
   Popular / секция с карточками
   ========================================================================== */

.zfaq-app .support-popular {
    scroll-margin-top: max(104px, calc(env(safe-area-inset-top, 0px) + 72px));
}

.zfaq-app .support-popular__inner {
    max-width: 1222px;
    margin: 0 auto;
    padding: 48px 40px 40px;
    width: 100%;
}

.zfaq-app .section-heading {
    font-family: 'Open Sans Condensed', 'Open Sans', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: #222222;
    margin-bottom: 28px;
}

.zfaq-app #faq-section-heading,
.zfaq-app .no-results {
    scroll-margin-top: max(104px, calc(env(safe-area-inset-top, 0px) + 72px));
}

.zfaq-app .faq-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.zfaq-app .faq-blocks.support-blocks {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
}

.zfaq-app .faq-root {
    display: block;
    grid-column: 1 / -1;
}

.zfaq-app .no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 0 8px;
    color: #888888;
    font-size: 18px;
    display: none;
}

.zfaq-app .no-results.visible {
    display: block;
}

/* ==========================================================================
   Центр справки: shell / sidebar / main
   ========================================================================== */

.zfaq-app .faq-help-shell {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 28px;
    max-width: 100%;
    min-width: 0;
    position: relative;
}

.zfaq-app .faq-help-sidebar-toggle {
    display: none;
    flex-shrink: 0;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px;
    margin-bottom: 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    background: #ffffff;
    color: #333333;
    cursor: pointer;
    width: 100%;
    max-width: 320px;
}

.zfaq-app .faq-help-sidebar-toggle:hover {
    border-color: rgba(230, 74, 25, 0.45);
    color: #c73d12;
}

.zfaq-app .faq-help-sidebar-backdrop {
    display: none;
}

.zfaq-app .faq-help-sidebar {
    flex: 0 0 260px;
    max-width: 280px;
    min-width: 0;
    position: sticky;
    top: max(88px, calc(env(safe-area-inset-top, 0px) + 56px));
    align-self: flex-start;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    padding: 4px 4px 12px 0;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}

.zfaq-app .faq-help-sidebar-cats {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
}

.zfaq-app .faq-help-cat-group.hidden {
    display: none;
}

.zfaq-app .faq-help-cat-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 10px 10px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #333333;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.zfaq-app .faq-help-cat-btn::after {
    content: '';
    flex-shrink: 0;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease;
    margin-left: 4px;
}

.zfaq-app .faq-help-cat-group--open > .faq-help-cat-btn::after {
    transform: rotate(180deg);
}

.zfaq-app .faq-help-cat-btn:hover {
    background: rgba(230, 74, 25, 0.08);
    color: #111111;
}

.zfaq-app .faq-help-cat-btn.is-active {
    background: rgba(230, 74, 25, 0.14);
    color: #b8380f;
}

.zfaq-app .faq-help-cat-btn-label {
    flex: 1;
    min-width: 0;
}

.zfaq-app .faq-help-cat-dropdown {
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0 10px 4px;
    margin-left: 4px;
    border-left: 2px solid rgba(230, 74, 25, 0.15);
}

.zfaq-app .faq-help-cat-group--open .faq-help-cat-dropdown {
    display: flex;
}

.zfaq-app .faq-help-q-btn.hidden {
    display: none;
}

.zfaq-app .faq-help-cat-open-full {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 8px 10px 8px 14px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    border: none;
    border-radius: 0 8px 8px 0;
    background: transparent;
    color: #e64a19;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.zfaq-app .faq-help-cat-open-full:hover {
    color: #c73d12;
}

.zfaq-app .faq-help-q-btn {
    display: block;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 10px 8px 14px;
    border: none;
    border-left: 3px solid transparent;
    border-radius: 0 8px 8px 0;
    background: transparent;
    color: #444444;
    cursor: pointer;
    line-height: 1.35;
    transition: background 0.15s, border-color 0.15s;
}

.zfaq-app .faq-help-q-btn:hover {
    background: rgba(0, 0, 0, 0.04);
}

.zfaq-app .faq-help-q-btn.is-active {
    border-left-color: #e64a19;
    background: rgba(230, 74, 25, 0.06);
    color: #222222;
}

.zfaq-app .faq-help-main {
    flex: 1;
    min-width: 0;
}

.zfaq-app .faq-help-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    align-items: stretch;
}

.zfaq-app .faq-help-card {
    display: flex;
    flex-direction: column;
    padding: 22px 22px 18px;
    border-radius: 16px;
    background: #f9fafb;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s, background 0.2s;
}

.zfaq-app .faq-help-card:hover {
    background: #ffffff;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.07);
}

.zfaq-app .faq-help-card.hidden {
    display: none;
}

.zfaq-app .faq-help-card__head {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin: 0 0 14px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(230, 74, 25, 0.18);
}

.zfaq-app .faq-help-card__title {
    flex: 1;
    min-width: 0;
    font-family: 'Open Sans Condensed', 'Open Sans', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: #222222;
    margin: 0;
    line-height: 1.3;
}

.zfaq-app .faq-help-card__icon-wrap {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 11px;
    background: #eeeeee;
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.zfaq-app .faq-help-card__icon {
    width: 28px;
    height: 28px;
    display: block;
    object-fit: contain;
}

.zfaq-app .faq-help-card__preview {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    flex: 1;
}

.zfaq-app .faq-help-card__preview-item {
    font-size: 14px;
    line-height: 1.45;
    color: #555555;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: color 0.15s;
}

.zfaq-app .faq-help-card__preview-item:hover {
    color: #E64A19;
}

.zfaq-app .faq-help-card__preview-item:hover .faq-help-card__preview-q {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.zfaq-app .faq-help-card__preview-item:last-child {
    border-bottom: none;
}

.zfaq-app .faq-help-card__preview-item.hidden {
    display: none;
}

.zfaq-app .faq-help-card__more {
    margin-top: auto;
    align-self: flex-start;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 0;
    border: none;
    background: none;
    color: #e64a19;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.zfaq-app .faq-help-card__more:hover {
    color: #c73d12;
}

.zfaq-app .faq-help-category-page {
    padding: 4px 0 32px;
}

.zfaq-app .faq-help-back-home {
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 0 16px;
    margin-bottom: 8px;
    border: none;
    background: none;
    color: #e64a19;
    cursor: pointer;
    text-align: left;
}

.zfaq-app .faq-help-back-home:hover {
    color: #c73d12;
    text-decoration: underline;
}

.zfaq-app .faq-help-category-page__head {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    margin: 0 0 28px;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(230, 74, 25, 0.2);
}

.zfaq-app .faq-help-category-page__title {
    flex: 1;
    min-width: 0;
    font-family: 'Open Sans Condensed', 'Open Sans', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.2;
}

.zfaq-app .faq-help-category-page__icon-wrap {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: #eeeeee;
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.zfaq-app .faq-help-category-page__icon {
    width: 32px;
    height: 32px;
    display: block;
    object-fit: contain;
}

.zfaq-app .faq-help-steps {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.zfaq-app .faq-help-step {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 18px;
    scroll-margin-top: max(104px, calc(env(safe-area-inset-top, 0px) + 72px));
}

.zfaq-app .faq-help-step.hidden {
    display: none;
}

.zfaq-app .faq-help-step__num {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(145deg, #e64a19 0%, #c73d12 100%);
    color: #ffffff;
    font-family: 'Open Sans Condensed', 'Open Sans', sans-serif;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.zfaq-app .faq-help-step__body {
    flex: 1;
    min-width: 0;
}

.zfaq-app .faq-help-step__title {
    font-family: 'Open Sans Condensed', 'Open Sans', sans-serif;
    font-size: 19px;
    font-weight: 700;
    color: #222222;
    margin: 0 0 12px;
    line-height: 1.3;
}

.zfaq-app .faq-help-step__answer {
    font-size: 16px;
    line-height: 1.6;
    color: #444444;
}

.zfaq-app .faq-help-step__answer p {
    margin: 0 0 1em;
}

.zfaq-app .faq-help-step__answer p:last-child {
    margin-bottom: 0;
}

.zfaq-app .faq-help-step__answer img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
}

.zfaq-app .faq-help-step__answer ul,
.zfaq-app .faq-help-step__answer ol {
    margin: 0 0 1em 1.4em;
}

@media (max-width: 1100px) {
    .zfaq-app .faq-help-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .zfaq-app .faq-help-shell {
        flex-direction: column;
        gap: 0;
    }

    .zfaq-app .faq-help-sidebar-toggle {
        display: block;
    }

    .zfaq-app .faq-help-sidebar {
        position: fixed;
        z-index: 200;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(320px, 88vw);
        max-width: none;
        max-height: none;
        padding: 16px 12px 24px;
        background: #ffffff;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
        border-right: none;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        overflow-y: auto;
    }

    .zfaq-app .faq-help-shell--sidebar-open .faq-help-sidebar {
        transform: translateX(0);
    }

    .zfaq-app .faq-help-shell--sidebar-open .faq-help-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 199;
        margin: 0;
        padding: 0;
        border: none;
        background: rgba(0, 0, 0, 0.35);
        cursor: pointer;
    }

    .zfaq-app .faq-help-main {
        width: 100%;
    }

    .zfaq-app .faq-help-grid {
        grid-template-columns: 1fr;
    }

    .zfaq-app .support-intro.page-title {
        padding-top: 48px !important;
        padding-right: max(24px, env(safe-area-inset-right, 0px)) !important;
        padding-bottom: 36px !important;
        padding-left: max(24px, env(safe-area-inset-left, 0px)) !important;
    }

    .zfaq-app .support-popular__inner {
        padding-left: max(24px, env(safe-area-inset-left, 0px));
        padding-right: max(24px, env(safe-area-inset-right, 0px));
    }

    .zfaq-app .support-search__input {
        font-size: 16px;
        min-height: 48px;
        height: auto;
    }
}

@media (max-width: 767px) {
    .zfaq-app {
        font-size: 16px;
    }

    .zfaq-app .support-intro.page-title.title-size-default .entry-title.title.support-intro__title {
        font-size: 24px;
    }

    .zfaq-app .support-intro__lead {
        font-size: 15px;
    }

    .zfaq-app .section-heading {
        font-size: 22px;
        margin-bottom: 20px;
    }
}

/* Подсветка совпадений в поиске */
.zfaq-app mark.faq-search-hit {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(230, 74, 25, 0.22);
    color: inherit;
    font: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    vertical-align: baseline;
    border-radius: 2px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    box-shadow: none;
}
