/**
 * Game catalog section page — hero/breadcrumbs aligned with /catalog/,
 * mobile SEO fold, section spacing. Subnav chips: catalog-section-subnav.css.
 * Product 2-col: catalog-listing-modern-cards.css.
 *
 * Spacing contract (same as catalog root):
 *   .pmPageMain top pad 22px + .pmPageContainer side pad 20px + .pmPageBreadcrumb margin-bottom 18px
 */

/* Hide Bitrix header crumbs — visual crumbs live in content (same as /catalog/) */
body:has(.pageCatalogService--refresh) .bx_breadcrumb,
body:has(.pmMissionProtoPage--catalogSection) .bx_breadcrumb {
    display: none !important;
}

/*
 * Section hero photo: same edge fade as product cards /reviews/
 * (mask left+right+bottom + side/bottom vignettes). Photo lives on .wrapper::before;
 * main.js raw background-image on .wrapper is disabled.
 */
body:has(.pmMissionProtoPage--catalogSection) {
    --bh-pm-catalog-page-bg: linear-gradient(180deg, #111b29 0%, #0a0e14 45%, #11131e 100%);
    --bh-hero-blend-bg: #111b29;
    --bh-hero-vignette-v-top: 0.34;
    --bh-hero-vignette-v-bot: 0.18;
    --bh-hero-photo-mask-x: 22%;
    --bh-hero-photo-mask-bottom: 28%;
    --bh-catalog-section-hero-height: min(56.25vw, 900px);
    background-color: #111b29;
    background-image: var(--bh-pm-catalog-page-bg);
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.pmMissionProtoPage--catalogSection {
    background-color: transparent;
    background-image: none;
}

body:has(.pmMissionProtoPage--catalogSection) .wrapper {
    position: relative;
    isolation: isolate;
    background-color: transparent !important;
    background-image: none !important;
    background-size: auto !important;
    background-repeat: no-repeat !important;
}

body:has(.pmMissionProtoPage--catalogSection) .wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 0;
    width: 100vw;
    max-width: 1920px;
    height: var(--bh-catalog-section-hero-height);
    transform: translateX(-50%);
    pointer-events: none;
    background-image:
        linear-gradient(
            90deg,
            rgba(0, 0, 0, 0.28) 0%,
            rgba(0, 0, 0, 0.18) 14%,
            rgba(0, 0, 0, 0.08) 32%,
            transparent 58%
        ),
        linear-gradient(
            270deg,
            rgba(0, 0, 0, 0.28) 0%,
            rgba(0, 0, 0, 0.18) 14%,
            rgba(0, 0, 0, 0.08) 32%,
            transparent 58%
        ),
        linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.18) 0%,
            rgba(0, 0, 0, 0.12) 14%,
            rgba(0, 0, 0, 0.05) 30%,
            transparent 62%
        ),
        linear-gradient(
            180deg,
            rgba(0, 0, 0, var(--bh-hero-vignette-v-top)) 0%,
            rgba(0, 0, 0, var(--bh-hero-vignette-v-bot)) 54%,
            transparent 100%
        ),
        var(--bh-bg-detail-pic, none);
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    -webkit-mask-image:
        linear-gradient(
            90deg,
            transparent 0%,
            #000 var(--bh-hero-photo-mask-x),
            #000 calc(100% - var(--bh-hero-photo-mask-x)),
            transparent 100%
        ),
        linear-gradient(
            0deg,
            transparent 0%,
            #000 var(--bh-hero-photo-mask-bottom),
            #000 100%
        );
    -webkit-mask-size: 100% 100%;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(
            90deg,
            transparent 0%,
            #000 var(--bh-hero-photo-mask-x),
            #000 calc(100% - var(--bh-hero-photo-mask-x)),
            transparent 100%
        ),
        linear-gradient(
            0deg,
            transparent 0%,
            #000 var(--bh-hero-photo-mask-bottom),
            #000 100%
        );
    mask-size: 100% 100%;
    mask-position: center;
    mask-repeat: no-repeat;
    mask-composite: intersect;
}

body:has(.pmMissionProtoPage--catalogSection) .wrapper > * {
    position: relative;
    z-index: 1;
}

body:has(.pmMissionProtoPage--catalogSection) .bgMain__img,
body:has(.pmMissionProtoPage--catalogSection) picture:has(.bgMain__img) {
    display: none !important;
}

.pageCatalogService--refresh .pageCatalogService__section_1--refresh {
    max-width: none;
    width: 100%;
    margin: 0 0 18px;
    /* Match .pmPageMain { padding: 22px 0 … } — not the old 4–8px */
    padding: 22px 0 0;
    box-sizing: border-box;
}

/* Side inset comes from .pmPageContainer (20px), not section_1 */
.pageCatalogService--refresh .pageCatalogService__section_1--refresh > .pmPageContainer {
    padding-top: 0;
    padding-bottom: 0;
}

/* Keep base .pmPageBreadcrumb from pm-mission-prototype-lk.css (18px bottom, 1.25rem) */
.pageCatalogService--refresh .pageCatalogService__section_1--refresh .pmPageBreadcrumb {
    margin: 0 0 18px;
}

.pageCatalogService--refresh .pmPageHero--catalogSectionHead {
    margin-bottom: 8px;
}

.pageCatalogService--refresh .pmPageHero--catalogSectionHead .pmPageHero__title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: clamp(2.4rem, 4vw, 3.6rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    text-wrap: balance;
    color: rgba(255, 255, 255, 0.98);
}

.pageCatalogService--refresh .pmPageHero__gameIcon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.pageCatalogService--refresh .pmPageHero__titleText {
    min-width: 0;
}

.pageCatalogService--refresh .pmPageHero--catalogSectionHead .pmPageHero__lead {
    margin: 12px 0 0;
    max-width: 62ch;
    font-size: 1.35rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.68);
}

@media (max-width: 767px) {
    .pageCatalogService--refresh .pageCatalogService__section_1--refresh {
        padding: 22px 0 0;
    }

    .pageCatalogService--refresh .pmPageHero--catalogSectionHead .pmPageHero__title {
        font-size: clamp(2.1rem, 7vw, 2.6rem);
        gap: 10px;
    }

    .pageCatalogService--refresh .pmPageHero__gameIcon {
        width: 34px;
        height: 34px;
        border-radius: 8px;
    }

    .pageCatalogService--refresh .pmPageBreadcrumb__current {
        overflow-wrap: anywhere;
    }
}

/* ========== SEO text: collapsed on mobile, always open on desktop ========== */
.bhCatalogSeoFold {
    margin: 20px 0 8px;
    padding: 0;
    border: none;
    background: transparent;
}

.bhCatalogSeoFold__summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.25rem;
    font-weight: 600;
    user-select: none;
}

.bhCatalogSeoFold__summary::-webkit-details-marker {
    display: none;
}

.bhCatalogSeoFold__summary::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-left: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.bhCatalogSeoFold[open] > .bhCatalogSeoFold__summary::after {
    transform: rotate(225deg);
    margin-top: 4px;
}

.bhCatalogSeoFold__body {
    margin-top: 14px;
}

/*
 * SEO copy: same typography as product .pmProductDesc--main
 * (pm-mission-prototype-lk.css already loaded on section pages).
 * Override legacy .content / global h2 so sizes match the card.
 */
.pageCatalogService--refresh .bhCatalogSeoFold__body.pmProductDesc--main {
    max-width: none;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding: 0;
    font-size: 1.35rem;
    line-height: 1.58;
    color: rgba(255, 255, 255, 0.78);
    box-sizing: border-box;
}

.pageCatalogService--refresh .bhCatalogSeoFold__body.pmProductDesc--main > p {
    margin: 0 0 1em;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    text-align: left;
}

.pageCatalogService--refresh .bhCatalogSeoFold__body.pmProductDesc--main > :last-child {
    margin-bottom: 0;
}

/* Headings: same as product DETAIL_TEXT (global orange h2 inside pmProductDesc) */
.pageCatalogService--refresh .bhCatalogSeoFold__body.pmProductDesc--main h2,
.pageCatalogService--refresh .bhCatalogSeoFold__body.pmProductDesc--main .h2 {
    margin: 1.1em 0 0.55em;
    color: #fe9900;
    font-weight: 800;
    line-height: 1.2;
}

.pageCatalogService--refresh .bhCatalogSeoFold__body.pmProductDesc--main h2:first-child,
.pageCatalogService--refresh .bhCatalogSeoFold__body.pmProductDesc--main .h2:first-child {
    margin-top: 0;
}

.pageCatalogService--refresh .bhCatalogSeoFold__body.pmProductDesc--main h3,
.pageCatalogService--refresh .bhCatalogSeoFold__body.pmProductDesc--main .h3 {
    margin: 1em 0 0.5em;
}

.pageCatalogService--refresh .bhCatalogSeoFold__body.pmProductDesc--main ul,
.pageCatalogService--refresh .bhCatalogSeoFold__body.pmProductDesc--main ol {
    margin: 0 0 1em;
    padding-left: 1.25em;
    overflow: visible;
    line-height: inherit;
}

.pageCatalogService--refresh .bhCatalogSeoFold__body.pmProductDesc--main ul li,
.pageCatalogService--refresh .bhCatalogSeoFold__body.pmProductDesc--main ol li {
    position: static;
    margin: 0 0 0.45em;
    padding: 0 0 0 0.25em;
    overflow: visible;
    list-style: inherit;
    line-height: inherit;
    font-size: inherit;
    color: inherit;
}

.pageCatalogService--refresh .bhCatalogSeoFold__body.pmProductDesc--main ul li:last-child,
.pageCatalogService--refresh .bhCatalogSeoFold__body.pmProductDesc--main ol li:last-child {
    margin-bottom: 0;
}

.pageCatalogService--refresh .bhCatalogSeoFold__body.pmProductDesc--main ul li::after,
.pageCatalogService--refresh .bhCatalogSeoFold__body.pmProductDesc--main ol li::after {
    content: none;
    display: none;
}

.pageCatalogService--refresh .bhCatalogSeoFold__body.pmProductDesc--main ul {
    list-style-type: disc;
}

.pageCatalogService--refresh .bhCatalogSeoFold__body.pmProductDesc--main ul li::marker {
    color: #fe9900;
}

.pageCatalogService--refresh .bhCatalogSeoFold__body.pmProductDesc--main ol {
    list-style-type: decimal;
}

.pageCatalogService--refresh .bhCatalogSeoFold__body.pmProductDesc--main ol li::marker {
    color: #fe9900;
    font-weight: 800;
}

.pageCatalogService--refresh .bhCatalogSeoFold__body.pmProductDesc--main a {
    color: #fe9900;
}

.pageCatalogService--refresh .bhCatalogSeoFold__body.pmProductDesc--main a:hover {
    color: #ffc266;
}

@media (max-width: 767px) {
    .pageCatalogService--refresh .bhCatalogSeoFold__body.pmProductDesc--main {
        font-size: 1.25rem;
    }

    /* Align with main.css mobile h2 (2rem) used on product pages */
    .pageCatalogService--refresh .bhCatalogSeoFold__body.pmProductDesc--main h2,
    .pageCatalogService--refresh .bhCatalogSeoFold__body.pmProductDesc--main .h2 {
        font-size: 2rem;
    }
}

@media (min-width: 768px) {
    .bhCatalogSeoFold {
        margin: 24px 0 12px;
    }

    /* Summary hidden — section is always open on desktop (JS sets [open]) */
    .bhCatalogSeoFold > .bhCatalogSeoFold__summary {
        display: none;
    }

    /* Fallback if JS off: still show SEO body */
    .bhCatalogSeoFold > .bhCatalogSeoFold__body {
        display: block !important;
    }
}

/* Pagination: equal circular slots, ghost inactive, filled active */
.pageCatalogService--refresh .pagination {
    gap: 6px;
    margin: 20px 0 36px;
}

.pageCatalogService--refresh .pagination__list {
    margin: 0;
    gap: 6px;
}

.pageCatalogService--refresh .pagination__arrow,
.pageCatalogService--refresh .pagination__arrow:visited,
.pageCatalogService--refresh .pagination__list a,
.pageCatalogService--refresh .pagination__list a:visited,
.pageCatalogService--refresh .pagination__list .active {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border-radius: 50%;
    border: 1px solid transparent;
    font-family: var(--bh-font-sans);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.pageCatalogService--refresh .pagination__list a,
.pageCatalogService--refresh .pagination__list a:visited {
    color: rgba(255, 255, 255, 0.9);
    background: transparent;
    border-color: rgba(255, 255, 255, 0.16);
}

.pageCatalogService--refresh .pagination__arrow,
.pageCatalogService--refresh .pagination__arrow:visited {
    color: #fe9900;
    background: rgba(254, 153, 0, 0.08);
    border-color: rgba(254, 153, 0, 0.38);
    font-size: 1.7rem;
}

.pageCatalogService--refresh .pagination__list a:hover,
.pageCatalogService--refresh .pagination__arrow:hover {
    color: #fe9900;
    background: rgba(254, 153, 0, 0.16);
    border-color: rgba(254, 153, 0, 0.55);
}

.pageCatalogService--refresh .pagination__list a:focus-visible,
.pageCatalogService--refresh .pagination__arrow:focus-visible {
    color: #fe9900;
    background: rgba(254, 153, 0, 0.16);
    border-color: rgba(254, 153, 0, 0.55);
    outline: none;
    box-shadow: 0 0 0 3px rgba(254, 153, 0, 0.35);
}

.pageCatalogService--refresh .pagination__list .active,
.pageCatalogService--refresh .pagination__list .active:visited,
.pageCatalogService--refresh .pagination__list .active:hover,
.pageCatalogService--refresh .pagination__list .active:focus,
.pageCatalogService--refresh .pagination__list .active:focus-visible {
    color: #0b0e14;
    background: #fe9900;
    border-color: #fe9900;
    box-shadow: none;
    cursor: default;
    pointer-events: none;
}

/* SEO + FAQ under products: same column width as block_2 (sidebar 342px + gap) */
.pageCatalogService__belowGrid {
    max-width: 1370px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    column-gap: 12px;
    box-sizing: border-box;
}

.pageCatalogService__belowGrid::before {
    content: "";
    flex: 0 0 342px;
    width: 342px;
    max-width: 342px;
}

.pageCatalogService__belowGridMain {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    box-sizing: border-box;
}

.pageCatalogService__sectionSeo {
    margin: 0;
    padding: 0;
}

/* Mobile: jump back to product grid after long SEO */
.bhCatalogBackToProducts {
    display: none;
    margin: 14px 0 0;
    padding: 0;
}

.bhCatalogBackToProducts__link {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(254, 153, 0, 0.45);
    background: rgba(254, 153, 0, 0.12);
    color: #fe9900;
    font-size: 1.35rem;
    font-weight: 700;
    text-decoration: none;
    line-height: 1.2;
}

.bhCatalogBackToProducts__link:hover,
.bhCatalogBackToProducts__link:focus-visible {
    background: rgba(254, 153, 0, 0.22);
    color: #fff;
    outline: none;
}

.bhCatalogBackToProducts__link::before {
    content: "↑";
    font-weight: 800;
}

@media screen and (max-width: 767px) {
    .bhCatalogBackToProducts {
        display: block;
    }
}

/* Lazy reviews skeleton */
.bhCatalogReviewsSkeleton {
    padding: 28px 0 12px;
}

.bhCatalogReviewsSkeleton__title {
    width: min(280px, 55%);
    height: 22px;
    margin-bottom: 18px;
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
    background-size: 200% 100%;
    animation: bhCatalogSkeletonShine 1.2s linear infinite;
}

.bhCatalogReviewsSkeleton__row {
    width: 100%;
    height: 140px;
    border-radius: 14px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
    background-size: 200% 100%;
    animation: bhCatalogSkeletonShine 1.2s linear infinite;
}

@keyframes bhCatalogSkeletonShine {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bhCatalogReviewsSkeleton__title,
    .bhCatalogReviewsSkeleton__row {
        animation: none;
    }
}

/* FAQ + reviews: same content width as .footer_cont_2__boxs */
.pageCatalogService__sectionFaq,
.pageCatalogService--refresh .pageCatalogService__section_3.pageCatalogService__section_3--reviewsPm {
    max-width: 1370px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
}

.pageCatalogService__sectionFaq {
    padding-top: 8px;
    padding-bottom: 0;
}

.pageCatalogService--refresh .pageCatalogService__section_3.pageCatalogService__section_3--reviewsPm {
    padding-top: 8px;
    padding-bottom: 22px;
}

.pageCatalogService--refresh .pageCatalogService__sectionFaq .pmPageBlock--faq {
    margin-top: 8px;
    margin-bottom: 8px;
}

@media screen and (max-width: 975px) {
    .pageCatalogService__belowGrid {
        flex-wrap: wrap;
    }

    .pageCatalogService__belowGrid::before {
        display: none;
    }

    .pageCatalogService__belowGridMain {
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
        padding: 0 12px;
        box-sizing: border-box;
    }
}

/* Match footer_cont_2__boxs side padding at ≤1023px (main.css) */
@media screen and (max-width: 1023px) {
    .pageCatalogService__sectionFaq,
    .pageCatalogService--refresh .pageCatalogService__section_3.pageCatalogService__section_3--reviewsPm {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* Pagination touch spacing under sticky header */
@media (max-width: 767px) {
    .pageCatalogService--refresh .bx-pagination,
    .pageCatalogService--refresh .modern-page-navigation,
    .pageCatalogService--refresh nav[aria-label*="age"],
    .pageCatalogService--refresh .pagination {
        margin-top: 16px;
        padding-bottom: 8px;
    }

    .pageCatalogService--refresh .pmPageHero--catalogSectionHead .pmPageHero__lead {
        font-size: 1.25rem;
        max-width: none;
    }
}
