/* Header: hero pages (/, /about) — light theme until scroll; other pages — solid bar */

.header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    width: 100%;
    overflow: visible;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        padding 0.2s ease,
        box-shadow 0.2s ease;
}

body.has-header-hero .header.header--hero-mode {
    z-index: 220;
}

.header--theme-solid {
    padding-left: 16px;
    padding-right: 16px;
    background: #fff;
    border-bottom-color: #e2e2ec;
    box-shadow: none;
}

.header-logo-link {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.header-logo-light,
.header-logo-dark {
    display: block;
    height: 28px;
    width: auto;
}

.header-logo-dark {
    display: none;
}

.header--theme-solid .header-logo-light {
    display: none;
}

.header--theme-solid .header-logo-dark {
    display: block;
}

.header-img-light,
.header-img-solid {
    display: block;
    flex-shrink: 0;
}

.header-img-solid {
    display: none;
}

.header--theme-solid .header-img-light {
    display: none;
}

.header--theme-solid .header-img-solid {
    display: block;
}

.header-container {
    width: 100%;
    max-width: var(--content-max-width);
    height: 64px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

.header-logo {
    padding-right: 24px;
}

.header-navigation {
    flex: 1 1 0;
    position: relative;
    overflow: visible;
    min-width: 0;
}

.header-navigation-menu-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2px;
}

.header-navigation-menu-item {
    padding: 8px 12px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background-color 0.2s ease;
}

.header-navigation-menu-item--mega {
    position: relative;
    gap: 0;
}

.header-mega {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.header-mega-trigger {
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    color: rgba(255, 255, 255, 0.75);
    transition: color 0.2s ease;
}

.header--theme-solid .header-mega-trigger {
    color: #151525;
}

.header-catalog-panel {
    position: absolute;
    top: calc(100% + 14px);
    left: 0;
    z-index: 200;
    width: min(720px, calc(100vw - 32px));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition:
        opacity 0.22s ease,
        transform 0.22s ease,
        visibility 0.22s step-end;
}

/* Hover көпірі: триггерден панельге өткенде мәзір жабылмайды */
.header-catalog-panel::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 14px;
}

.header-navigation-menu-item--mega:hover .header-catalog-panel,
.header-navigation-menu-item--mega:focus-within .header-catalog-panel,
.header-navigation-menu-item--mega.is-open .header-catalog-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition:
        opacity 0.22s ease,
        transform 0.22s ease,
        visibility 0s step-start;
}

.header-catalog-panel-card {
    padding: 0;
    border-radius: 16px;
    border: 1px solid #e2e2ec;
    background: #fff;
    box-shadow:
        0 18px 44px rgba(21, 21, 37, 0.09),
        0 2px 10px rgba(21, 21, 37, 0.05);
}

.header-catalog-scroll {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 20px;
    row-gap: 2px;
    max-height: min(58vh, 440px);
    padding: 16px 18px 12px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.header-catalog-scroll::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.header-catalog-link {
    display: block;
    padding: 8px 10px;
    margin: 0 -8px;
    border-radius: 10px;
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    color: #151525;
    text-decoration: none;
    transition:
        background-color 0.18s ease,
        color 0.18s ease;
}

.header-catalog-link:hover {
    background: rgba(37, 38, 145, 0.07);
    color: #252691;
}

.header-catalog-link:focus-visible {
    outline: 2px solid rgba(37, 38, 145, 0.45);
    outline-offset: 2px;
}

.header-catalog-all:focus-visible {
    outline: 2px solid rgba(37, 38, 145, 0.45);
    outline-offset: 3px;
    border-radius: 6px;
}

.header-catalog-footer {
    padding: 12px 18px 16px;
    border-top: 1px solid #e2e2ec;
}

.header-catalog-all {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 14px;
    line-height: 20px;
    color: #252691;
    text-decoration: none;
    transition: opacity 0.18s ease;
}

.header-catalog-all:hover {
    opacity: 0.85;
}

@media (max-width: 700px) {
    .header-catalog-panel {
        width: min(440px, calc(100vw - 24px));
    }

    .header-catalog-scroll {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 14px;
        padding-left: 14px;
        padding-right: 14px;
    }

    .header-catalog-footer {
        padding-left: 14px;
        padding-right: 14px;
    }
}

@media (max-width: 480px) {
    .header-catalog-scroll {
        grid-template-columns: 1fr;
    }
}

/* Тек қалпы бойынша мәзір жолындағы тік сілтемелер; мегаменюдағы .header-catalog-link мұның астында аққа боялып жоғалып кетпесін */
.header-navigation-menu-item > a {
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    color: rgba(255, 255, 255, 0.75);
    transition: color 0.2s ease;
}

.header--theme-solid .header-navigation-menu-item > a {
    color: #151525;
}

.header-navigation-menu-item:hover {
    background: rgba(255, 255, 255, 0.14);
}

.header--theme-solid .header-navigation-menu-item:hover {
    background: rgba(37, 38, 145, 0.08);
}

.header-navigation-menu-item:hover > a,
.header-navigation-menu-item:hover .header-mega-trigger {
    color: #fff;
}

.header--theme-solid .header-navigation-menu-item:hover > a,
.header--theme-solid .header-navigation-menu-item:hover .header-mega-trigger {
    color: #252691;
}

.header-drawer-top {
    display: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-actions-contacts {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.header-phones-list {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    min-width: 0;
}

.header-phone-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.header-phone-link {
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    color: #fff;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.header--theme-solid .header-phone-link {
    color: #151525;
}

.header-drawer-phone {
    display: none;
}

.header-actions-button .header-price-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 18px;
    border: none;
    margin: 0;
    cursor: pointer;
    background: #ff191e;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 14px;
    line-height: 20px;
    color: #fff;
}

.header-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 8px;
    border: none;
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.92);
    line-height: 0;
    transition:
        background-color 0.18s ease,
        color 0.18s ease;
}

.header-menu-toggle:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.65);
    outline-offset: 2px;
}

.header--theme-solid .header-menu-toggle {
    color: #151525;
}

.header--theme-solid .header-menu-toggle:focus-visible {
    outline-color: rgba(37, 38, 145, 0.45);
}

.header-menu-toggle-icon {
    display: block;
    flex-shrink: 0;
}

.header-drawer-backdrop {
    display: none;
}

.header-drawer-cta {
    display: none;
}

@media (max-width: 1200px) {
    .header-drawer-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1;
        border: none;
        padding: 0;
        margin: 0;
        background: rgba(14, 14, 26, 0.48);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition:
            opacity 0.22s ease,
            visibility 0.22s step-end;
    }

    #site-header.is-drawer-open .header-drawer-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition:
            opacity 0.22s ease,
            visibility 0s step-start;
    }

    .header-menu-toggle {
        display: inline-flex;
    }

    .header-actions {
        gap: 10px;
        min-width: 0;
    }

    .header-actions-contacts {
        min-width: 0;
    }

    .header-phone-link {
        white-space: nowrap;
    }

    .header-actions-button {
        display: none;
    }

    .header-drawer-top {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex-shrink: 0;
        width: 100%;
        box-sizing: border-box;
        padding: calc(60px + env(safe-area-inset-top, 0px)) 0 12px;
        margin-bottom: 4px;
        border-bottom: 1px solid #e2e2ec;
    }

    .header-drawer-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin: 0;
        padding: 7px;
        border: 1px solid #e2e2ec;
        border-radius: 50%;
        background: #fff;
        cursor: pointer;
        line-height: 0;
        transition:
            background-color 0.18s ease,
            border-color 0.18s ease;
    }

    .header-drawer-close:hover {
        background: #f6f6fa;
        border-color: #d8daf2;
    }

    .header-drawer-close:focus-visible {
        outline: 2px solid rgba(37, 38, 145, 0.45);
        outline-offset: 2px;
    }

    .header-drawer-close img {
        display: block;
        width: 22px;
        height: 22px;
        object-fit: contain;
    }

    .header-drawer-phone {
        display: block;
        padding: 16px 12px 14px;
        margin-bottom: 4px;
        border-bottom: 1px solid #e2e2ec;
    }

    .header-drawer-phone .header-phones-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    .header-drawer-phone .header-phone-link {
        color: #151525;
    }

    .header-navigation {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(340px, 88vw);
        flex: none !important;
        margin: 0;
        padding: 0 18px 28px;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        background: #fff;
        border-left: 1px solid #e2e2ec;
        box-shadow:
            -14px 0 42px rgba(21, 21, 37, 0.12),
            -2px 0 12px rgba(21, 21, 37, 0.06);
        z-index: 2;
        transform: translateX(100%);
        transition: transform 0.26s ease;
        gap: 0;
        pointer-events: none;
    }

    #site-header.is-drawer-open .header-navigation {
        transform: translateX(0);
        pointer-events: auto;
    }

    .header-navigation-menu-list {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        flex: 1 1 auto;
        width: 100%;
    }

    .header-navigation-menu-item {
        flex-wrap: wrap;
        padding: 10px 12px;
        border-radius: 12px;
    }

    .header-navigation-menu-item--mega {
        position: relative;
        z-index: 0;
    }

    .header-navigation-menu-item--mega.is-open {
        z-index: 20;
    }

    .header-navigation-menu-item > a,
    .header--theme-solid .header-navigation-menu-item > a {
        color: #151525;
    }

    .header-mega-trigger,
    .header--theme-solid .header-mega-trigger {
        color: #151525;
        flex: 1 1 auto;
        min-width: 0;
    }

    .header-navigation .header-img-light {
        display: none !important;
    }

    .header-navigation .header-img-solid {
        display: block !important;
    }

    .header-mega {
        position: relative;
        flex-wrap: wrap;
        width: 100%;
        gap: 6px;
    }

    /* Каталог: document flow-та кірмейді — төменгі мәзір жолдары жылжымайды */
    .header-catalog-panel {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        z-index: 25;
        width: auto;
        margin-top: 8px;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;
        transition: none;
        display: none;
        box-shadow: none;
        border: none;
        background: transparent;
    }

    .header-catalog-panel::before {
        display: none;
    }

    .header-catalog-panel-card {
        border-radius: 12px;
        border: 1px solid #e2e2ec;
        background: #f7f7fb;
        box-shadow:
            0 14px 36px rgba(21, 21, 37, 0.12),
            0 2px 10px rgba(21, 21, 37, 0.06);
    }

    .header-navigation-menu-item--mega:hover .header-catalog-panel,
    .header-navigation-menu-item--mega:focus-within .header-catalog-panel {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;
        display: none;
    }

    .header-navigation-menu-item--mega.is-open .header-catalog-panel {
        display: block;
    }

    .header-catalog-scroll {
        grid-template-columns: 1fr;
        max-height: min(42vh, 320px);
        padding: 12px 14px 10px;
    }

    .header-catalog-footer {
        padding: 10px 14px 14px;
    }

    .header-drawer-cta {
        display: block;
        flex-shrink: 0;
        margin-top: auto;
        padding-top: 20px;
        border-top: 1px solid #e2e2ec;
    }

    .header-drawer-cta .header-price-cta {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
        padding: 12px 18px;
        border-radius: 14px;
        border: none;
        margin: 0;
        cursor: pointer;
        background: #ff191e;
        font-family: var(--font-family);
        font-weight: 600;
        font-size: 14px;
        line-height: 20px;
        color: #fff;
        text-decoration: none;
        text-align: center;
        transition: opacity 0.18s ease;
    }

    .header-drawer-cta .header-price-cta:hover {
        opacity: 0.92;
    }

    .header-drawer-cta .header-price-cta:focus-visible {
        outline: 2px solid rgba(37, 38, 145, 0.45);
        outline-offset: 2px;
    }
}

@media (max-width: 600px) {
    .header-navigation {
        width: 100%;
        max-width: 100%;
        left: 0;
        right: 0;
        border-left: none;
        box-shadow:
            0 12px 40px rgba(21, 21, 37, 0.14),
            0 2px 12px rgba(21, 21, 37, 0.06);
        padding: 0 16px 24px;
    }

    .header-navigation-menu-list {
        flex: 0 1 auto;
    }

    .header-drawer-cta {
        margin-top: 16px;
        padding-top: 16px;
    }

    .header-actions {
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }

    .header-container {
        height: auto;
        min-height: 64px;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .header-actions-contacts {
        align-items: flex-end;
    }

    .header-phones-list {
        flex-direction: column;
        align-items: flex-end;
        gap: 0;
    }

    .header-phone-item {
        gap: 4px;
    }

    .header-phone-link {
        font-size: 12px;
        line-height: 16px;
    }

    .header-menu-toggle {
        flex-shrink: 0;
        align-self: center;
    }
}

html.header-drawer-scroll-lock {
    overflow: hidden;
    padding-right: var(--header-drawer-scrollbar-gap, 0px);
}

/* Drawer ашылғанда негізгі контент пен sticky элементтердің үстіне шығу */
#site-header.is-drawer-open {
    z-index: 1000;
}

@media (prefers-reduced-motion: reduce) {
    .header-catalog-panel {
        transition-duration: 0.01ms;
    }

    .header-navigation {
        transition-duration: 0.01ms;
    }

    .header-drawer-backdrop {
        transition-duration: 0.01ms;
    }
}

body.has-header-solid {
    padding-top: 64px;
}

/* Главная / О нас: над кейіпгер желі ақ немесе ашық түске түскенде мәзір мен каталог триггері жоғалып кетпесін */
body.has-header-hero .header.header--hero-mode:not(.header--theme-solid) {
    background: linear-gradient(
        180deg,
        rgba(14, 14, 26, 0.78) 0%,
        rgba(14, 14, 26, 0.42) 52%,
        rgba(14, 14, 26, 0) 100%
    );

    padding-left: 16px;
    padding-right: 16px;
}

body.has-header-hero .header.header--hero-mode:not(.header--theme-solid) .header-container {
    position: relative;
    z-index: 2;
}