/* ==========================================================
 LINGVOERA | GLOBAL SELECT CSS v1.1
 Joomla 6 + Balbooa Gridbox 2.20.4.0
 Development: WEB-S.KZ

 FIX:
 - Устранение двойных стрелок
 - Устранение двойных рамок
 - Вертикальное выравнивание текста
 - Сохранение SVG-флагов HERO
 - Единое оформление выпадающих списков
 - Совместимость с калькулятором
 - Нативное управление
 - Responsive 320px — 4K

 Полностью заменяет GLOBAL SELECT CSS v1.0.
========================================================== */


/* ==========================================================
 01. DESIGN TOKENS
========================================================== */

:root {
    --lv-select-bg: #f5f7fa;
    --lv-select-text: #252932;
    --lv-select-border: #dce2e9;
    --lv-select-gold: #f5b323;
    --lv-select-gold-dark: #916000;
    --lv-select-radius: 12px;

    --lv-select-shadow:
        0 3px 10px rgba(25,35,50,.035);

    --lv-select-focus-shadow:
        0 0 0 4px rgba(245,179,35,.12);

    --lv-select-picker-shadow:
        0 16px 45px rgba(25,35,50,.15),
        0 3px 10px rgba(25,35,50,.06);

    --lv-select-arrow:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a97008' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}


/* ==========================================================
 02. GLOBAL NATIVE SELECT
========================================================== */

html body select:not(#lv-select-style-exempt):not(
    [multiple],
    [hidden],
    [data-lv-select-native],
    .select2-hidden-accessible,
    .choices__input
):is(:not([size]),[size="0"],[size="1"]) {

    box-sizing: border-box !important;

    -webkit-appearance: none !important;
    appearance: none !important;

    min-width: 0;
    max-width: 100%;

    border: 1px solid var(--lv-select-border) !important;
    border-radius: var(--lv-select-radius) !important;

    background:
        var(--lv-select-arrow)
        right 12px center / 18px 18px no-repeat,
        linear-gradient(
            145deg,
            #ffffff,
            #f3f5f8
        ) !important;

    padding-right: 40px !important;

    color: var(--lv-select-text) !important;
    -webkit-text-fill-color: var(--lv-select-text) !important;

    font-family: inherit !important;
    font-weight: 550;
    line-height: 1.5;

    text-align: left !important;
    text-indent: 0;
    text-transform: none !important;

    color-scheme: light;

    box-shadow: var(--lv-select-shadow) !important;

    cursor: pointer;
    touch-action: manipulation;

    -webkit-tap-highlight-color: transparent;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}


/* ==========================================================
 03. HOVER
========================================================== */

@media (hover: hover) and (pointer: fine) {

    html body select:not(#lv-select-style-exempt):not(
        [multiple],
        [hidden],
        [data-lv-select-native],
        .select2-hidden-accessible,
        .choices__input
    ):is(:not([size]),[size="0"],[size="1"]):enabled:hover {

        border-color: #d5b36e !important;

        box-shadow:
            0 5px 16px rgba(150,110,30,.07) !important;
    }
}


/* ==========================================================
 04. FOCUS
========================================================== */

html body select:not(#lv-select-style-exempt):not(
    [multiple],
    [hidden],
    [data-lv-select-native],
    .select2-hidden-accessible,
    .choices__input
):is(:not([size]),[size="0"],[size="1"]):focus {

    border-color: #d5aa51 !important;

    box-shadow:
        var(--lv-select-focus-shadow) !important;
}

html body select:not(#lv-select-style-exempt):not(
    [multiple],
    [hidden],
    [data-lv-select-native],
    .select2-hidden-accessible,
    .choices__input
):is(:not([size]),[size="0"],[size="1"]):focus-visible {

    outline: 2px solid #b98317 !important;
    outline-offset: 2px;
}


/* ==========================================================
 05. DISABLED STATE
========================================================== */

html body select:not(#lv-select-style-exempt):not(
    [multiple],
    [hidden],
    [data-lv-select-native],
    .select2-hidden-accessible,
    .choices__input
):is(:not([size]),[size="0"],[size="1"]):disabled {

    opacity: .6;
    cursor: not-allowed;

    border-color: #dfe4eb !important;
    box-shadow: none !important;
}


/* ==========================================================
 06. VALIDATION
========================================================== */

html body select:not(#lv-select-style-exempt):not(
    [multiple],
    [hidden],
    [data-lv-select-native],
    .select2-hidden-accessible,
    .choices__input
):is(:not([size]),[size="0"],[size="1"])[aria-invalid="true"] {

    border-color: #b84d43 !important;

    box-shadow:
        0 0 0 3px rgba(184,77,67,.09) !important;
}


/* ==========================================================
 07. NATIVE OPTION FALLBACK
========================================================== */

html body select:not(#lv-select-style-exempt):not(
    [multiple],
    [hidden],
    [data-lv-select-native],
    .select2-hidden-accessible,
    .choices__input
):is(:not([size]),[size="0"],[size="1"]) option {

    background-color: #ffffff;
    color: #252932;

    font-family: inherit;
    font-weight: 500;
}


/* ==========================================================
 08. HERO — REMOVE DOUBLE BORDER

 Рамку рисует только SELECT.
 Внешняя оболочка становится прозрачной.
========================================================== */

#lv-hero .lv-native-field > .lv-native-control {

    border: 0 !important;

    background: transparent !important;
    background-image: none !important;

    box-shadow: none !important;

    overflow: visible !important;
}

#lv-hero .lv-native-field > .lv-native-control:hover,
#lv-hero .lv-native-field > .lv-native-control:focus-within {

    border: 0 !important;
    box-shadow: none !important;
}


/* ==========================================================
 09. HERO — REMOVE OLD CHEVRON

 Оставляем только одну глобальную SVG-стрелку.
========================================================== */

#lv-hero .lv-native-control > .lv-native-chevron {

    display: none !important;
    visibility: hidden !important;
}


/* ==========================================================
 10. HERO — LANGUAGE SELECT

 Исходные размеры и позиционирование сохраняются.
========================================================== */

#lv-hero .lv-native-control > select:is(
    #lv-native-source,
    #lv-native-target
) {

    box-sizing: border-box !important;

    padding: 0 29px 0 43px !important;

    border: 1px solid #dce2e9 !important;
    border-radius: 11px !important;

    background:
        var(--lv-select-arrow)
        right 9px center / 16px 16px no-repeat,
        linear-gradient(
            145deg,
            #ffffff,
            #f3f5f8
        ) !important;

    color: #252932 !important;
    -webkit-text-fill-color: #252932 !important;

    line-height: 1.4 !important;

    text-align: left !important;
    text-indent: 0 !important;

    box-shadow: none !important;
}

#lv-hero .lv-native-control > select:is(
    #lv-native-source,
    #lv-native-target
):focus {

    border-color: #d5aa51 !important;

    box-shadow:
        var(--lv-select-focus-shadow) !important;
}


/* ==========================================================
 11. HERO — SVG FLAG PROTECTION
========================================================== */

#lv-hero .lv-native-control > .lv-native-flag-box {

    position: absolute !important;

    top: 50% !important;

    transform: translateY(-50%) !important;

    pointer-events: none !important;

    z-index: 3 !important;
}


/* ==========================================================
 12. MODERN CUSTOMIZABLE SELECT

 Полноценное оформление раскрытого списка.
 Только для поддерживаемых браузеров.
========================================================== */

@supports (appearance: base-select)
    and selector(select::picker(select)) {


    /* ACTIVATE MODERN SELECT */

    html body select:not(#lv-select-style-exempt):not(
        [multiple],
        [hidden],
        [data-lv-select-native],
        .select2-hidden-accessible,
        .choices__input
    ):is(:not([size]),[size="0"],[size="1"]),

    html body select:not(#lv-select-style-exempt):not(
        [multiple],
        [hidden],
        [data-lv-select-native],
        .select2-hidden-accessible,
        .choices__input
    ):is(:not([size]),[size="0"],[size="1"])::picker(select) {

        appearance: base-select !important;
    }


    /* VERTICAL TEXT ALIGNMENT */

    html body select:not(#lv-select-style-exempt):not(
        [multiple],
        [hidden],
        [data-lv-select-native],
        .select2-hidden-accessible,
        .choices__input
    ):is(:not([size]),[size="0"],[size="1"]) {

        display: flex !important;

        align-items: center !important;
        justify-content: flex-start !important;
    }


    /* REMOVE BROWSER ARROW */

    html body select:not(#lv-select-style-exempt):not(
        [multiple],
        [hidden],
        [data-lv-select-native],
        .select2-hidden-accessible,
        .choices__input
    ):is(:not([size]),[size="0"],[size="1"])::picker-icon {

        display: none !important;
    }


    /* ======================================================
       13. OPEN STATE
    ====================================================== */

    html body select:not(#lv-select-style-exempt):not(
        [multiple],
        [hidden],
        [data-lv-select-native],
        .select2-hidden-accessible,
        .choices__input
    ):is(:not([size]),[size="0"],[size="1"]):open {

        border-color: #d5aa51 !important;

        box-shadow:
            var(--lv-select-focus-shadow) !important;
    }


    /* ======================================================
       14. PREMIUM DROPDOWN PANEL
    ====================================================== */

    html body select:not(#lv-select-style-exempt):not(
        [multiple],
        [hidden],
        [data-lv-select-native],
        .select2-hidden-accessible,
        .choices__input
    ):is(:not([size]),[size="0"],[size="1"])::picker(select) {

        box-sizing: border-box;

        min-inline-size: anchor-size(width);
        max-inline-size: calc(100vw - 24px);

        max-height: min(340px,45vh);

        margin-block: 7px;

        padding: 6px;

        border: 1px solid #dce2e9;
        border-radius: 14px;

        background: #ffffff;

        color: #252932;

        box-shadow:
            var(--lv-select-picker-shadow);

        overflow-x: hidden;
        overflow-y: auto;

        overscroll-behavior: contain;

        scrollbar-width: thin;

        scrollbar-color:
            #d4b575 #f3f5f8;

        color-scheme: light;
    }


    /* ======================================================
       15. OPTION ROW
    ====================================================== */

    html body select:not(#lv-select-style-exempt):not(
        [multiple],
        [hidden],
        [data-lv-select-native],
        .select2-hidden-accessible,
        .choices__input
    ):is(:not([size]),[size="0"],[size="1"]) option:not([hidden]) {

        box-sizing: border-box;

        display: flex;

        align-items: center;
        justify-content: space-between;

        gap: 10px;

        min-width: 0;
        min-height: 44px;

        margin: 2px 0;
        padding: 10px 12px;

        border: 1px solid transparent;
        border-radius: 8px;

        background: #ffffff;

        color: #303744;
        -webkit-text-fill-color: #303744;

        font-size: 14px;
        font-weight: 500;
        line-height: 1.4;

        white-space: normal;
        overflow-wrap: anywhere;

        cursor: pointer;

        transition:
            background .15s ease,
            border-color .15s ease;
    }


    /* OPTION HOVER */

    html body select:not(#lv-select-style-exempt):not(
        [multiple],
        [hidden],
        [data-lv-select-native],
        .select2-hidden-accessible,
        .choices__input
    ):is(:not([size]),[size="0"],[size="1"]) option:enabled:hover {

        background: #f5f7fa;

        border-color: #e4e8ef;

        color: #916000;
        -webkit-text-fill-color: #916000;
    }


    /* ======================================================
       16. SELECTED OPTION
    ====================================================== */

    html body select:not(#lv-select-style-exempt):not(
        [multiple],
        [hidden],
        [data-lv-select-native],
        .select2-hidden-accessible,
        .choices__input
    ):is(:not([size]),[size="0"],[size="1"]) option:checked {

        border-color: #ecd29a;

        background:
            linear-gradient(
                135deg,
                #fff8e7,
                #ffedbe
            );

        color: #805400;
        -webkit-text-fill-color: #805400;

        font-weight: 700;
    }


    /* SELECTED CHECKMARK */

    html body select:not(#lv-select-style-exempt):not(
        [multiple],
        [hidden],
        [data-lv-select-native],
        .select2-hidden-accessible,
        .choices__input
    ):is(:not([size]),[size="0"],[size="1"]) option::checkmark {

        order: 1;

        margin-inline-start: auto;

        color: #a97008;
        -webkit-text-fill-color: #a97008;

        font-size: 16px;
        font-weight: 800;
    }


    /* DISABLED OPTION */

    html body select:not(#lv-select-style-exempt):not(
        [multiple],
        [hidden],
        [data-lv-select-native],
        .select2-hidden-accessible,
        .choices__input
    ):is(:not([size]),[size="0"],[size="1"]) option:disabled {

        color: #8993a2;
        -webkit-text-fill-color: #8993a2;

        background: #f5f7fa;

        cursor: not-allowed;
    }


    /* ======================================================
       17. HERO — CRITICAL CENTERING FIX
    ====================================================== */

    #lv-hero .lv-native-control > select:is(
        #lv-native-source,
        #lv-native-target
    ) {

        appearance: base-select !important;

        display: flex !important;

        align-items: center !important;
        justify-content: flex-start !important;

        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

}


/* ==========================================================
 18. MOBILE — 767px
========================================================== */

@media (max-width: 767px) {

    /* GLOBAL SELECT */

    html body select:not(#lv-select-style-exempt):not(
        [multiple],
        [hidden],
        [data-lv-select-native],
        .select2-hidden-accessible,
        .choices__input
    ):is(:not([size]),[size="0"],[size="1"]) {

        font-size: 16px !important;

        border-radius: 11px !important;

        padding-right: 35px !important;

        background-position:
            right 10px center,
            center !important;

        background-size:
            17px 17px,
            100% 100% !important;
    }


    /* HERO — COMPACT LANGUAGE SELECT */

    #lv-hero .lv-native-control > select:is(
        #lv-native-source,
        #lv-native-target
    ) {

        padding: 0 25px 0 36px !important;

        font-size: 11px !important;

        background-position:
            right 7px center,
            center !important;

        background-size:
            15px 15px,
            100% 100% !important;
    }


    /* MOBILE DROPDOWN */

    @supports (appearance: base-select)
        and selector(select::picker(select)) {

        html body select:not(#lv-select-style-exempt):not(
            [multiple],
            [hidden],
            [data-lv-select-native],
            .select2-hidden-accessible,
            .choices__input
        ):is(:not([size]),[size="0"],[size="1"])::picker(select) {

            max-inline-size: calc(100vw - 20px);

            max-height: min(320px,45vh);

            padding: 5px;

            border-radius: 13px;
        }

    }

}


/* ==========================================================
 19. SMALL MOBILE — 380px

 Сохраняем вертикальную компоновку языковых
 полей из исходного HERO CSS.
========================================================== */

@media (max-width: 380px) {

    #lv-hero .lv-native-control > select:is(
        #lv-native-source,
        #lv-native-target
    ) {

        padding-left: 40px !important;
        padding-right: 25px !important;

        font-size: 12px !important;
    }

}


/* ==========================================================
 20. ACCESSIBILITY — REDUCED MOTION
========================================================== */

@media (prefers-reduced-motion: reduce) {

    html body select:not(#lv-select-style-exempt):not(
        [multiple],
        [hidden],
        [data-lv-select-native],
        .select2-hidden-accessible,
        .choices__input
    ),

    html body select:not(#lv-select-style-exempt):not(
        [multiple],
        [hidden],
        [data-lv-select-native],
        .select2-hidden-accessible,
        .choices__input
    ) option {

        animation: none !important;
        transition: none !important;
    }

}


/* ==========================================================
 21. HIGH CONTRAST MODE
========================================================== */

@media (forced-colors: active) {

    html body select:not(#lv-select-style-exempt):not(
        [multiple],
        [hidden],
        [data-lv-select-native],
        .select2-hidden-accessible,
        .choices__input
    ):is(:not([size]),[size="0"],[size="1"]),

    #lv-hero .lv-native-control > select:is(
        #lv-native-source,
        #lv-native-target
    ) {

        appearance: auto !important;

        background-image: none !important;
        background-color: ButtonFace !important;

        color: ButtonText !important;
        -webkit-text-fill-color: ButtonText !important;

        border: 1px solid ButtonText !important;

        box-shadow: none !important;
    }

}


/* ==========================================================
 END | LINGVOERA GLOBAL SELECT CSS v1.1

 Development: WEB-S
 https://web-s.kz/
========================================================== */

/* ==========================================================
 LINGVOERA | HERO HEADER OFFSET v1.0
 Joomla 6 + Balbooa Gridbox 2.20.4.0
 Development: WEB-S.KZ

 - Восстановление отступа HERO
 - HEADER поверх фонового изображения
 - Независимость от класса com_gridbox
 - Сохранение выпадающих списков
 - Сохранение мобильного меню
 - Адаптивность от 320px
========================================================== */


/* 01. DESKTOP */

html:has(#lv-header) {
    --lv-layout-header-height: 102px;
    --lv-layout-content-gap: 16px;
}


/* 02. HERO CONTENT OFFSET */

html:has(#lv-header)
body:has(#lv-hero)
#lv-hero.lv-hero > .lv-hero__container,

body.com_gridbox:has(#lv-header):has(#lv-hero)
#lv-hero.lv-hero > .lv-hero__container {

    padding-top: calc(
        var(--lv-layout-header-height) +
        var(--lv-layout-content-gap)
    ) !important;

}


/* 03. TABLET */

@media (max-width: 1180px) {

    html:has(#lv-header) {
        --lv-layout-content-gap: 14px;
    }

}


/* 04. MOBILE */

@media (max-width: 767px) {

    html:has(#lv-header) {
        --lv-layout-header-height: 78px;
        --lv-layout-content-gap: 12px;
    }

}


/* ==========================================================
 END | LINGVOERA HERO HEADER OFFSET v1.0
========================================================== */