/* IranStores searchable select */

.is-searchable-select {
    position: relative;
    width: 100%;
    min-width: 0;
}

.is-searchable-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.is-searchable-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid #ddd6fe;
    border-radius: 14px;
    background: #fff;
    color: #241f31;
    font: inherit;
    text-align: right;
    cursor: pointer;
    transition:
        border-color 0.2s,
        box-shadow 0.2s,
        background 0.2s;
}

.is-searchable-trigger:hover {
    border-color: #a78bfa;
}

.is-searchable-trigger:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.13);
}

.is-searchable-trigger-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.is-searchable-chevron {
    flex: 0 0 auto;
    font-size: 18px;
    transition: transform 0.2s;
}

.is-searchable-select.is-open
.is-searchable-chevron {
    transform: rotate(180deg);
}

.is-searchable-menu {
    position: absolute;
    z-index: 1000;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    min-width: 220px;
    padding: 8px;
    border: 1px solid #e9d5ff;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 16px 38px rgba(30, 19, 57, 0.16);
}

.is-searchable-menu[hidden] {
    display: none !important;
}

.is-searchable-search {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    margin: 0 0 7px;
    padding: 9px 12px;
    border: 1px solid #ddd6fe;
    border-radius: 10px;
    background: #fff;
    color: #211a2c;
    font: inherit;
    font-size: 14px;
    direction: rtl;
    text-align: right;
}

.is-searchable-search:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.10);
}

.is-searchable-options {
    display: grid;
    gap: 3px;
    max-height: 280px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.is-searchable-option {
    width: 100%;
    min-height: 40px;
    padding: 8px 11px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #30273e;
    font: inherit;
    font-size: 14px;
    text-align: right;
    cursor: pointer;
}

.is-searchable-option:hover,
.is-searchable-option.is-selected {
    background: #f3e8ff;
    color: #6d28d9;
}

.is-searchable-option.is-selected {
    font-weight: 700;
}

.is-searchable-empty {
    padding: 14px;
    color: #7c7189;
    font-size: 13px;
    text-align: center;
}

/* حالت شب */

html[data-theme="dark"]
.is-searchable-trigger,
html[data-theme="dark"]
.is-searchable-menu,
html[data-theme="dark"]
.is-searchable-search {
    border-color: #403653;
    background: #17131f;
    color: #f4effb;
}

html[data-theme="dark"]
.is-searchable-option {
    color: #eee8f7;
}

html[data-theme="dark"]
.is-searchable-option:hover,
html[data-theme="dark"]
.is-searchable-option.is-selected {
    background: #302342;
    color: #d8b4fe;
}

/* موبایل */

@media (max-width: 640px) {
    .is-searchable-menu {
        position: fixed;
        z-index: 10000;
        top: auto;
        right: 12px;
        bottom: 12px;
        left: 12px;
        max-height: 70vh;
        padding: 10px;
        border-radius: 18px;
    }

    .is-searchable-options {
        max-height: 52vh;
    }

    .is-searchable-search {
        min-height: 48px;
        font-size: 16px;
    }

    .is-searchable-option {
        min-height: 44px;
        font-size: 14px;
    }
}