/* Reusable LUMA select: single, multi-select, searchable, and mobile-safe. */
.luma-select {
    position: relative;
    width: 100%;
    min-width: 0;
}

.luma-select.is-external > .luma-select__control {
    display: none;
}

.luma-select__control {
    position: relative;
    width: 100%;
    min-width: 0;
}

.luma-select__native {
    position: absolute !important;
    width: 1px !important;
    min-width: 0 !important;
    max-width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    border: 0 !important;
    opacity: 0 !important;
    white-space: nowrap !important;
    pointer-events: none !important;
}

.luma-select__trigger {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    padding-inline-end: 50px;
    border: 1px solid #e1d8eb;
    border-radius: 13px;
    outline: 0;
    color: #30203f;
    background: #f8f6fb;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
    text-align: start;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.luma-select__control.has-clear .luma-select__trigger {
    padding-inline-end: 82px;
}

.luma-select__clear {
    position: absolute;
    top: 50%;
    inset-inline-end: 42px;
    z-index: 1;
    display: grid;
    width: 28px;
    height: 28px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 8px;
    outline: 0;
    color: #6f6080;
    background: #f1ecf8;
    font: inherit;
    font-size: 0;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
}

.luma-select__clear::before,
.luma-select__clear::after {
    position: absolute;
    width: 10px;
    height: 1.5px;
    border-radius: 999px;
    background: currentColor;
    content: '';
}

.luma-select__clear::before { transform: rotate(45deg); }
.luma-select__clear::after { transform: rotate(-45deg); }

.luma-select__clear:hover,
.luma-select__clear:focus-visible {
    color: #6336b3;
    background: #eee7fa;
}

.luma-select__clear[hidden] {
    display: none !important;
}

.luma-select__trigger:hover:not(:disabled) {
    border-color: #c8b4e2;
    background: #fff;
}

.luma-select__trigger:focus-visible,
.luma-select.is-open .luma-select__trigger {
    border-color: #8050cf;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(113, 66, 202, .11);
}

.luma-select__trigger:disabled {
    color: #a59baa;
    background: #f1eef4;
    cursor: not-allowed;
    opacity: .78;
}

.luma-select__value {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.luma-select__value.is-placeholder { color: #9b91a3; }

.luma-select.is-multiple .luma-select__value {
    display: flex;
    align-items: center;
    gap: 5px;
}

.luma-select__chip,
.luma-select__count {
    display: inline-block;
    max-width: 42%;
    padding: 3px 7px;
    overflow: hidden;
    border-radius: 7px;
    color: #6336b3;
    background: #eee7fa;
    font-size: 11px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.luma-select__count {
    flex: 0 0 auto;
    max-width: none;
}

.luma-select__chevron {
    position: absolute;
    top: 50%;
    inset-inline-end: 10px;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 8px;
    color: #7444c7;
    background: #eee7fa;
    pointer-events: none;
    transform: translateY(-50%);
}

.luma-select__chevron::before {
    position: absolute;
    top: 8px;
    left: 9px;
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    content: '';
    transform: rotate(45deg);
    transition: transform .2s ease, top .2s ease;
}

.luma-select.is-open .luma-select__chevron::before {
    top: 11px;
    transform: rotate(225deg);
}

.luma-select__menu {
    position: fixed;
    z-index: 4200;
    min-width: 220px;
    max-width: calc(100vw - 24px);
    max-height: min(420px, calc(100vh - 24px));
    padding: 8px;
    overflow: hidden;
    border: 1px solid #ded3e9;
    border-radius: 16px;
    color: #30203f;
    background: rgba(255, 255, 255, .985);
    box-shadow: 0 22px 64px rgba(45, 26, 64, .22);
    opacity: 0;
    transform: translateY(-5px) scale(.985);
    transform-origin: top center;
    transition: opacity .16s ease, transform .16s ease;
    backdrop-filter: blur(16px);
}

.luma-select__menu[hidden] { display: none !important; }

.luma-select__menu.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.luma-select__menu.is-above {
    transform-origin: bottom center;
}

.luma-select__mobile-head { display: none; }

.luma-select__search-wrap {
    position: relative;
    margin-bottom: 6px;
}

.luma-select__search-wrap[hidden] {
    display: none !important;
}

.luma-select__search-icon {
    position: absolute;
    top: 50%;
    inset-inline-start: 12px;
    color: #8662bf;
    font-size: 14px;
    line-height: 1;
    transform: translateY(-50%);
    pointer-events: none;
}

.luma-select__search {
    width: 100%;
    min-height: 42px;
    padding: 8px 36px 8px 12px;
    border: 1px solid #e4dced;
    border-radius: 11px;
    outline: 0;
    color: #30203f;
    background: #f8f6fb;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
}

[dir="ltr"] .luma-select__search { padding: 8px 12px 8px 36px; }

.luma-select__search:focus {
    border-color: #8a5bd2;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(113, 66, 202, .09);
}

.luma-select__options {
    max-height: 290px;
    padding: 2px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #c6b2df transparent;
}

.luma-select__option {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 40px;
    align-items: center;
    gap: 10px;
    margin: 2px 0;
    padding: 9px 12px;
    border: 0;
    border-radius: 10px;
    outline: 0;
    color: #40314e;
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    text-align: start;
    cursor: pointer;
}

.luma-select__option[hidden] {
    display: none !important;
}

.luma-select__option:hover,
.luma-select__option:focus-visible {
    color: #6534b6;
    background: #f2ecfb;
}

.luma-select__option[aria-selected="true"] {
    padding-inline-end: 38px;
    color: #fff;
    background: linear-gradient(135deg, #7040c7, #8b50d5);
    box-shadow: 0 7px 18px rgba(104, 55, 190, .18);
    font-weight: 900;
}

.luma-select__option[aria-selected="true"]::after {
    position: absolute;
    inset-inline-end: 13px;
    color: #fff;
    content: '\2713';
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 900;
}

.luma-select__option:disabled {
    color: #aaa1b0;
    cursor: not-allowed;
    opacity: .65;
}

.luma-select__group {
    padding: 9px 10px 4px;
    color: #8c8097;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.luma-select__group[hidden] {
    display: none !important;
}

.luma-select__empty {
    padding: 22px 12px;
    color: #8b8094;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.luma-select__empty[hidden] { display: none; }

.luma-select__loading {
    padding: 22px 12px;
    color: #6f4dab;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.luma-select__loading::before {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-inline-end: 8px;
    border: 2px solid #d8cbed;
    border-top-color: #7545c5;
    border-radius: 50%;
    content: '';
    vertical-align: -3px;
    animation: luma-select-spin .7s linear infinite;
}

.luma-select__loading[hidden] {
    display: none !important;
}

.luma-select__footer {
    padding: 8px 2px 1px;
    border-top: 1px solid #eee8f4;
}

.luma-select__footer[hidden] {
    display: none !important;
}

.luma-select__done {
    width: 100%;
    min-height: 38px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, #7040c7, #8b50d5);
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.luma-select.has-error .luma-select__trigger,
.luma-select__native.is-invalid + .luma-select__control .luma-select__trigger,
.has-error .luma-select__trigger {
    border-color: #d94d67;
    box-shadow: 0 0 0 3px rgba(217, 77, 103, .1);
}

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

.luma-select__backdrop {
    position: fixed;
    z-index: 4190;
    inset: 0;
    display: none;
    background: rgba(31, 18, 46, .42);
    backdrop-filter: blur(3px);
}

.luma-select__backdrop[hidden] { display: none !important; }

@media (max-width: 600px) {
    body.luma-select-is-open { overflow: hidden !important; }

    .luma-select__backdrop:not([hidden]) { display: block; }

    .luma-select__menu {
        top: var(--luma-select-visual-top, 10px) !important;
        right: 10px !important;
        bottom: auto !important;
        left: 10px !important;
        display: flex;
        flex-direction: column;
        width: auto !important;
        min-width: 0;
        max-width: none;
        max-height: var(--luma-select-visual-height, min(76dvh, 560px));
        padding: 10px;
        border-radius: 20px;
        transform: translateY(6px) scale(.99);
        transform-origin: bottom center;
    }

    .luma-select__menu.is-visible { transform: translateY(0) scale(1); }

    .luma-select__mobile-head {
        display: flex;
        flex: 0 0 auto;
        min-height: 42px;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 2px 3px 9px;
    }

    .luma-select__mobile-title {
        overflow: hidden;
        color: #2f1d43;
        font-size: 14px;
        font-weight: 900;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .luma-select__close {
        display: grid;
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
        place-items: center;
        border: 0;
        border-radius: 10px;
        color: #6540a6;
        background: #f1ebfa;
        font-size: 14px;
        cursor: pointer;
    }

    .luma-select__search-wrap {
        position: sticky;
        top: 0;
        z-index: 3;
        flex: 0 0 auto;
        background: rgba(255, 255, 255, .98);
    }

    .luma-select__options {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
    }

    .luma-select__footer { flex: 0 0 auto; }
    .luma-select__search { font-size: 16px; }
    .luma-select__option { min-height: 45px; padding-block: 11px; font-size: 13px; }
}

@media (max-width: 420px) {
    .luma-select__trigger {
        min-height: 48px;
        padding-inline-start: 12px;
        padding-inline-end: 50px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .luma-select__trigger,
    .luma-select__chevron::before,
    .luma-select__menu { transition: none !important; }
}
