/* ============================================================================
   💎 BrandDropdown (jala-select) — دراپ‌داون سفارشی برند جلا
   جایگزین کاملاً div-based استایل پیش‌فرض <select> بومی مرورگر/سیستم‌عامل.
   دو حالت اندازه: jala-select-default (فرم رزرو، محاسبه‌گر کامل) و
   jala-select-compact (محاسبه‌گر سبک‌شده‌ی صفحات محله).
   فقط از رنگ‌های موجود برند استفاده شده: Obsidian، Champagne Gold،
   Silk Gold، Off-White. ساختار DOM توسط brand-dropdown.js ساخته می‌شود.
============================================================================ */

.jala-select {
    position: relative;
}

/* select اصلی: بصری کاملاً مخفی اما در DOM حاضر و کاربردی (نه display:none)
   تا هیچ منطق موجودی که با .value/change کار می‌کند تغییر نکند */
.jala-select-native-source {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.jala-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    background: #070A13;
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s var(--bezier-apple, cubic-bezier(0.16,1,0.3,1));
}

.jala-select-trigger:hover {
    border-color: rgba(212, 175, 55, 0.5);
}

.jala-select-trigger:focus {
    outline: none;
    border-color: #D4AF37;
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.15);
}

.jala-select-trigger-value {
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 400;
    color: #F5F5F7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jala-select-chevron {
    display: inline-flex;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: #D4AF37;
    transition: transform 0.2s var(--bezier-apple);
}

.jala-select-chevron svg {
    width: 100%;
    height: 100%;
}

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

/* اندازه‌ی پیش‌فرض: فرم رزرو، محاسبه‌گر کامل صفحه‌ی اصلی */
.jala-select-default .jala-select-trigger {
    padding: 12px 14px;
}
.jala-select-default .jala-select-trigger-value {
    font-size: 14px;
}
.jala-select-default .jala-select-option {
    padding: 12px 34px 12px 14px;
    font-size: 14px;
}
@media (min-width: 768px) {
    .jala-select-default .jala-select-trigger {
        padding: 14px 16px;
    }
    .jala-select-default .jala-select-trigger-value {
        font-size: 15px;
    }
    .jala-select-default .jala-select-option {
        font-size: 15px;
    }
}

/* اندازه‌ی فشرده: محاسبه‌گر سبک‌شده‌ی صفحات محله */
.jala-select-compact .jala-select-trigger {
    padding: 10px 12px;
}
.jala-select-compact .jala-select-trigger-value {
    font-size: 14px;
}
.jala-select-compact .jala-select-option {
    padding: 9px 30px 9px 12px;
    font-size: 14px;
}

/* پنل بازشده */
.jala-select-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 40;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #070A12;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    max-height: 280px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.12s var(--bezier-apple), transform 0.12s var(--bezier-apple), visibility 0s linear 0.12s;
}

.jala-select.is-open .jala-select-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.18s var(--bezier-apple), transform 0.18s var(--bezier-apple), visibility 0s linear 0s;
}

.jala-select-option {
    position: relative;
    display: block;
    border-radius: 3px;
    cursor: pointer;
    color: #F5F5F7;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 400;
    transition: background-color 0.15s var(--bezier-apple, cubic-bezier(0.16,1,0.3,1));
}

.jala-select-option + .jala-select-option {
    margin-top: 2px;
}

.jala-select-option:hover,
.jala-select-option.is-highlighted {
    background: rgba(212, 175, 55, 0.08);
}

.jala-select-option.is-selected {
    background: rgba(212, 175, 55, 0.15);
    color: #F3E5AB;
}

.jala-select-option-check {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: #D4AF37;
    opacity: 0;
}

.jala-select-compact .jala-select-option-check {
    right: 12px;
}

.jala-select-option.is-selected .jala-select-option-check {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .jala-select-trigger,
    .jala-select-chevron,
    .jala-select-panel,
    .jala-select-option {
        transition: none !important;
    }
}
