/* custom-select.css - Ultra High-End Liquid Glass Custom Select Component */

.shop-toolbar {
    position: relative;
    z-index: 50 !important; /* Ensure dropdown stays on top of product grid */
}

.shop-toolbar-actions {
    min-width: 0;
    flex-shrink: 1;
}

#custom-sort-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.9;
}

.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 240px;
    min-width: 220px;
    max-width: 260px;
    flex-shrink: 0;
    z-index: 60;
}

.custom-select-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    box-sizing: border-box;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.9;
    white-space: nowrap;
    color: #ffffff;
    background: rgba(22, 22, 32, 0.95);
    backdrop-filter: var(--glass-blur-heavy);
    -webkit-backdrop-filter: var(--glass-blur-heavy);
    border: 1px solid var(--glass-border-light);
    border-radius: var(--border-radius-pill);
    cursor: pointer;
    transition: all var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    direction: rtl;
}

.custom-select-trigger:hover {
    border-color: var(--color-accent);
    box-shadow: 0 0 15px var(--color-accent-glow);
}

.custom-select-trigger i {
    color: var(--color-accent);
    font-size: 14px;
    transition: transform var(--transition-fast);
}

.custom-select-wrapper.open .custom-select-trigger i {
    transform: rotate(180deg);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    background: rgba(16, 16, 24, 0.98);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(153, 0, 0, 0.4);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000 !important; /* Stays strictly above everything */
    overflow: hidden;
    padding: 8px;
    direction: rtl;
}

.custom-select-wrapper.open .custom-select-options {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.custom-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.custom-option:hover {
    background: rgba(153, 0, 0, 0.18);
    color: #ffffff;
    padding-right: 18px;
}

.custom-option.selected {
    background: rgba(153, 0, 0, 0.3);
    color: #ffffff;
    border: 1px solid rgba(153, 0, 0, 0.4);
}

.custom-option.selected::after {
    content: '✓';
    color: #990000;
    font-weight: 900;
}
