.layout-main__header {
    .header__panel {
        .header__panel-l-side {
            width: 330px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            align-items: flex-start;

            .header__site-description {
                color: #514B4B;

                text-align: center;
                font-family: Conv_HouschkaPro-Medium, sans-serif;
                font-size: 13px;
                font-style: normal;
                font-weight: 500;
                letter-spacing: 0;
                line-height: 14px;
                padding-bottom: 8px;
            }
        }

        .aside__hr {
            flex-grow: 1;
        }

        .header__content-side {
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            gap: 14px;
            justify-content: center;
        }

        .header__content-top {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
    }

    .header-search-row {
        width: 100%;

        .header-search-row__inner {
            position: relative;
            width: 100%;
        }

        .header-search-row__form {
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 42px;
            padding: 0 15px 0 20px;
            background: #fff;
            border: 1px solid rgba(209, 221, 231, 0.5);
            border-radius: 30px;
        }

        .header-search-row__input {
            flex: 1;
            height: 100%;
            border: none;
            outline: none;
            background: transparent;
            font-size: 16px;
            font-family: 'Conv_HouschkaPro-Medium', sans-serif;
            color: #333;
        }

        .header-search-row__input::placeholder {
            color: #a2b1c4;
        }

        .header-search-row__btn {
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            width: 20px;
            height: 20px;
            border: none;
            background: transparent;
            padding: 0;
            cursor: pointer;
            color: #1f96ff;
        }

        .header-search-row__btn .svg-icon {
            width: 20px;
            height: 20px;
            fill: #1f96ff;
        }
        .header-search-row__btn .cs-icon-spinner {
            width: 20px;
            height: 20px;
            animation: spin 1s linear infinite;
        }
        .header-search-row__btn:hover .svg-icon {
            fill: #0d7de6;
        }

        &.header-search-row--active .search-dropdown {
            display: block;
        }

        .search-dropdown {
            display: none;
            position: absolute;
            top: calc(100% + 8px);
            left: 0;
            width: 100%;
            z-index: 100;
            background: #fff;
            box-shadow: 0 2px 3px rgba(0, 0, 0, 0.12);
            padding: 22px 17px 16px 18px;
            max-height: calc(100vh - 130px);
            overflow-y: auto;

            .search-dropdown__state {
                display: none;
                flex-direction: column;
            }

            &[data-state="initial"] .search-dropdown__state--initial,
            &[data-state="suggestions"] .search-dropdown__state--suggestions,
            &[data-state="results"] .search-dropdown__state--results,
            &[data-state="empty"] .search-dropdown__state--empty {
                display: flex;
            }

            .search-dropdown__section {
                display: flex;
                flex-direction: column;
                gap: 0;

                & + .search-dropdown__section {
                    margin-top: 16px;
                }
            }

            .search-dropdown__section-header {
                display: flex;
                justify-content: space-between;
                align-items: center;
                height: 24px;
            }

            .search-dropdown__section-title {
                font-family: Conv_HouschkaPro-DemiBold, sans-serif;
                font-size: 12px;
                color: #9db1c6;
                text-transform: uppercase;
                letter-spacing: 0.84px;
            }

            .search-dropdown__link {
                font-family: Conv_HouschkaPro-DemiBold, sans-serif;
                font-size: 15px;
                color: #488ce6;
                text-decoration: none;
                border-bottom: 1px dashed #488ce6;
                padding-bottom: 2px;

                &:hover {
                    color: #2c77bc;
                    border-bottom-color: #2c77bc;
                }
            }

            .search-dropdown__state--initial {
                gap: 0;
            }

            .search-dropdown__history-list {
                display: flex;
                flex-direction: column;
                align-items: flex-start;
                gap: 20px;
                padding: 12px 0 16px;
                border-bottom: 1px solid #eaedf1;

                a {
                    font-family: Conv_HouschkaPro-DemiBold, sans-serif;
                    font-size: 13px;
                    color: #514b4b;
                    text-transform: uppercase;
                    letter-spacing: 0.52px;
                    text-decoration: none;
                    line-height: 14px;

                    &:hover {
                        color: #488ce6;
                    }
                }
            }

            .search-dropdown__suggestions-list {
                display: flex;
                flex-direction: column;
                gap: 20px;
                padding-bottom: 8px;
            }

            .search-dropdown__suggestion-item {
                font-family: Conv_HouschkaPro-Medium, sans-serif;
                font-size: 17px;
                color: #514b4b;
                text-decoration: none;

                &:hover {
                    color: #488ce6;
                }
            }

            .search-dropdown__state--results {
                flex-direction: column;
                gap: 0;
            }

            .search-dropdown__category {
                display: flex;
                flex-direction: column;
                padding-bottom: 6px;
                border-bottom: 1px solid #eaedf1;

                &:last-child {
                    border-bottom: none;
                    padding-bottom: 0;
                }

                & + .search-dropdown__category {
                    margin-top: 16px;
                }
            }

            .search-dropdown__products {
                display: flex;
                flex-direction: column;
            }

            .search-dropdown__product {
                display: flex;
                align-items: center;
                gap: 10px;
                padding: 12px 0;
                border-top: 1px solid #eaedf1;
                text-decoration: none;
                color: inherit;

                &:first-child {
                    border-top: none;
                }
            }

            .search-dropdown__product-img {
                flex-shrink: 0;
                width: 60px;
                height: 60px;
                border-radius: 15px;
                overflow: hidden;

                img {
                    width: 100%;
                    height: 100%;
                    object-fit: contain;
                    display: block;
                }
            }

            .search-dropdown__product-info {
                flex: 1;
                min-width: 0;
                display: flex;
                flex-direction: column;
                gap: 4px;
            }

            .search-dropdown__product-name {
                font-family: Conv_HouschkaPro-Medium, sans-serif;
                font-size: 17px;
                color: #514b4b;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }

            .search-dropdown__product-price {
                display: flex;
                align-items: center;
                gap: 6px;
            }

            .search-dropdown__price-old {
                font-family: Conv_HouschkaPro-DemiBold, sans-serif;
                font-size: 15px;
                color: #666;
                text-decoration: line-through;
                line-height: 22px;
            }

            .search-dropdown__price-current {
                font-family: Conv_HouschkaPro-Bold, sans-serif;
                font-size: 18px;
                color: #292929;
                line-height: 18px;
            }

            .search-dropdown__product-action {
                flex-shrink: 0;
                width: 120px;
                display: flex;
                justify-content: flex-end;
            }

            .search-dropdown__cart-btn {
                border: 1px solid #d1dce8;
                border-radius: 50px;
                padding: 13px 25px 11px;
                background: transparent;
                font-family: Conv_HouschkaPro-DemiBold, sans-serif;
                font-size: 12px;
                color: #2c77bc;
                text-transform: uppercase;
                line-height: 12px;
                cursor: pointer;
                white-space: nowrap;
                transition: border-color 0.2s, color 0.2s;

                &:hover {
                    border-color: #2c77bc;
                    color: #1a5a99;
                }
            }

            .search-dropdown__empty {
                display: flex;
                flex-direction: column;
                align-items: center;
                gap: 30px;
                padding-bottom: 20px;
                width: 100%;
            }

            .search-dropdown__empty-text {
                font-family: Conv_HouschkaPro-Medium, sans-serif;
                font-size: 17px;
                color: #607389;
                text-align: center;
                width: 100%;
            }

            .search-dropdown__empty-icon {
                display: flex;
                justify-content: center;
            }
        }
    }

    &.search-overlay-header::before {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(107, 174, 237, 0.2);
        z-index: 50;
        pointer-events: none;
    }

    &.search-overlay-header .header-search-row {
        position: relative;
        z-index: 51;
    }
}

.header-search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(107, 174, 237, 0.2);
    z-index: 99;
}

.header-search-overlay--active {
    display: block;
}


@media (max-width: 799px) {
    .layout-main__header {

        &.search-overlay-header::before {
            display: none;
        }

        &.search-overlay-header .header-search-row {
            z-index: auto;
        }

        .header-search-row {
            .search-dropdown {
                position: fixed;
                top: 109px;
                left: 0;
                width: 100%;
                transform: none;
                max-height: calc(100vh - 109px);
                padding: 16px 18px;

                .search-dropdown__product {
                    position: relative;
                    align-items: flex-start;
                    padding-bottom: 48px;
                }

                .search-dropdown__product-name {
                    white-space: normal;
                }

                .search-dropdown__price-current {
                    font-size: 15px;
                }

                .search-dropdown__product-price {
                    position: absolute;
                    bottom: 12px;
                    left: 70px;
                }

                .search-dropdown__product-action {
                    position: absolute;
                    bottom: 8px;
                    right: 0;
                    width: auto;
                }
            }
        }
    }
}

@media (max-width: 600px) {
    .layout-main__header {
        .header-search-row {
            .search-dropdown {
                padding: 16px 18px;

                .search-dropdown__product-name {
                    font-size: 15px;
                }

                .search-dropdown__suggestions-list .search-dropdown__suggestion-item {
                    font-size: 15px;
                }
            }
        }
    }
}

@media (max-width: 480px) {
    .layout-main__header {
        .header-search-row {
            .search-dropdown {
                .search-dropdown__cart-btn {
                    padding: 13px 25px 11px 25px;
                    font-size: 12px;
                }

                .search-dropdown__product-action {
                    width: auto;
                }
            }
        }
    }
}

@media (max-width: 1069px) {
    .layout-main__header {
        .header__panel-l-side {
            .header__site-description {
                display: none;
            }
        }

        .header {
            gap: 30px;
        }

        .header__panel {
            flex-grow: 2;

            .header__panel-l-side {
                width: initial;
            }
        }
    }
}

@media (max-width: 799px) {
    .layout-main__header {
        height: 109px;
        background: #f7f9fa;
        padding: 12px 0;

        .header {
            flex-wrap: wrap;
            gap: 5px 0;
            align-items: flex-start;
        }

        .header__mobile-panel {
            order: 0;
            flex: 1;
        }

        .header__panel {
            order: 0;
            flex: 0 0 auto;

            .header__content-side {
                flex-wrap: wrap;
                gap: 8px;
                justify-content: flex-end;
            }

            .header__content-top {
                flex: 0 0 auto;
            }

            .header-search-row {
                position: fixed;
                top: 55px;
                left: 10px;
                right: 10px;
                width: auto;
                margin-left: 0;
                z-index: 101;

            }
        }
    }
}

@media (max-width: 600px) {
    .layout-main__header {
        .header {
            .header__basket {
                display: inline-flex;
                justify-content: flex-end;
            }

            .header__toggle-aside {
                height: 40px;
            }

            .header__panel {
                .header__content-side {
                    gap: 0;
                }
            }
        }

        .basket-small .basket-small__toggle {
            height: 28px;
            width: 32px;

        }

    }
}

@media (max-width: 480px) {
    .layout-main__header {
        .header {
            .basket-small .basket-small__counter {
                top: -6px;
                left: 25px;
            }
        }

        .header__panel {
            .header__content-side {
                gap: 0;
            }
        }
    }

    .layout-main .layout-main__aside {
        top: 109px !important;
    }
}

@media (max-width: 430px) {
    .layout-main__header {
        .header .header__panel {
            .header__content-side {
                gap: 12px
            }
        }
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

html {
    scrollbar-gutter: stable;
}

body.search-open {
    overflow: clip;
}

/*promo pages*/

body.promo__page, .new_base-layout {
    .header-search-row, .header-search-overlay,
    .header__site-description {
        display: none;
    }
}

body.promo__page, .new_base-layout {
    .layout-main .layout-main__main {
        padding-top: 90px
    }

    .layout-main__header {
        height: 90px;

        .header {
            align-items: center;
        }
    }
}

@media (max-width: 799px) {
    body.promo__page, .new_base-layout {
        .layout-main__header {
            height: 83px;
        }

        .header {
            .header__panel {
                width: 100%;
            }
        }
    }
}

@media (max-width: 450px) {
    body:has(.page-checkout) {
        .layout-main .layout-main__main {
            margin-top: 0;
        }

        .layout-main__header {
            & .header__panel {
                .header__content-top {
                    margin-top: -14px;
                }
            }
        }
    }
}

@media (max-width: 430px) {
    body.promo__page, .new_base-layout {
        .layout-main {
            .layout-main__main {
                padding-top: 0;
                margin-top: 0;
            }
        }
    }
}
