﻿/* ── PICKER LIGHTBOX ── */
.picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: background 0.3s ease, opacity 0.3s ease;
}

    .picker-overlay.active {
        opacity: 1;
        visibility: visible;
        background: rgba(0, 0, 0, 0.55);
    }

.picker-modal {
    position: relative;
    background: var(--white);
    border-radius: 20px;
    width: 560px;
    max-width: 94vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transform: scale(0.85) translateY(20px);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    overflow: hidden;
}

.picker-overlay.active .picker-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.picker-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
}

    .picker-header-title i {
        color: var(--teal);
    }

.picker-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg);
    border: none;
    color: var(--text-soft);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}

    .picker-close:hover {
        background: var(--red);
        color: #fff;
    }

/* Geolocation Detect Button */
.picker-geolocation {
    padding: 12px 20px 0;
    flex-shrink: 0;
}

.geolocation-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #eff9ff, #e8f8ee);
    border: 1.5px solid #c5e3f6;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--teal);
    transition: all 0.25s;
}

    .geolocation-btn:hover {
        background: linear-gradient(135deg, #dbeef8, #d4f0de);
        border-color: var(--teal);
    }

    .geolocation-btn.detecting {
        opacity: 0.7;
        pointer-events: none;
    }

    .geolocation-btn.detected {
        background: linear-gradient(135deg, #d4f0de, #c5ebd4);
        border-color: var(--green);
        color: var(--green-dark);
    }

    .geolocation-btn i {
        font-size: 16px;
        animation: none;
    }

    .geolocation-btn.detecting i {
        animation: spin 1s linear infinite;
    }

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.geolocation-btn .geo-status {
    font-weight: 400;
    font-size: 11px;
    color: var(--text-soft);
    margin-right: auto;
}

.geolocation-btn.detected .geo-status {
    color: var(--green-dark);
}

/* Picker Breadcrumb */
.picker-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;
    direction: rtl;
}

    .picker-nav::-webkit-scrollbar {
        display: none;
    }

.picker-nav-item {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    color: var(--teal);
    cursor: pointer;
    background: #eff9ff;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    transition: all 0.2s;
}

    .picker-nav-item:hover {
        background: var(--green-light);
        color: var(--green-dark);
    }

    .picker-nav-item i {
        font-size: 10px;
    }

.picker-nav-sep {
    color: var(--text-light);
    font-size: 10px;
}

/* Picker Search */
.picker-search {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.picker-search-input {
    width: 100%;
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-dark);
    background: var(--bg);
    outline: none;
    text-align: right;
    transition: border-color 0.2s;
}

    .picker-search-input::placeholder {
        color: var(--text-light);
    }

    .picker-search-input:focus {
        border-color: var(--teal);
        background: var(--white);
    }

/* Picker Items List */
.picker-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    scrollbar-width: thin;
}

    .picker-body::-webkit-scrollbar {
        width: 5px;
    }

    .picker-body::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 4px;
    }

.picker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    user-select: none;
}

    .picker-item:hover {
        background: #f0fafb;
    }

    .picker-item:active {
        transform: scale(0.98);
    }

    .picker-item.selected {
        background: var(--green-light);
        border: 1px solid #c3ebd4;
    }

.picker-item-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.picker-item-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--green-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .picker-item-icon i {
        font-size: 16px;
        color: var(--teal);
    }

.picker-item-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
}

.picker-item-count {
    font-size: 11px;
    color: var(--text-soft);
    margin-right: 4px;
    font-weight: 400;
}

.picker-item-arrow {
    color: var(--text-light);
    font-size: 12px;
}

.picker-item.has-children:hover .picker-item-arrow {
    color: var(--teal);
}

.picker-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-soft);
    font-size: 13px;
}

    .picker-empty i {
        font-size: 36px;
        display: block;
        margin-bottom: 10px;
        color: var(--border);
    }

/* Picker Footer */
.picker-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    background: #fafbfc;
}

.picker-selected-info {
    font-size: 12px;
    color: var(--text-soft);
}

    .picker-selected-info strong {
        color: var(--teal);
    }

.picker-footer-actions {
    display: flex;
    gap: 8px;
}

.picker-btn {
    padding: 9px 20px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.picker-btn-cancel {
    background: var(--bg);
    color: var(--text-soft);
    border: 1.5px solid var(--border);
}

    .picker-btn-cancel:hover {
        background: var(--border);
        color: var(--text-mid);
    }

.picker-btn-confirm {
    background: linear-gradient(135deg, var(--teal), var(--green));
    color: #fff;
    box-shadow: 0 4px 15px rgba(1, 144, 182, 0.3);
}

    .picker-btn-confirm:hover {
        box-shadow: 0 6px 20px rgba(1, 144, 182, 0.4);
        transform: translateY(-1px);
    }

/* Header search clickable styles */
.header-search {
    cursor: pointer;
}

    .header-search .city {
        cursor: pointer;
        transition: color 0.2s;
    }

        .header-search .city:hover {
            color: var(--teal);
        }

/* Responsive */
@media (max-width: 768px) {
    .picker-modal {
        max-width: 96vw;
        max-height: 85vh;
        border-radius: 16px;
    }

    .picker-header {
        padding: 14px 16px 12px;
    }

    .picker-header-title {
        font-size: 14px;
    }

    .picker-search {
        padding: 10px 16px;
    }

    .picker-body {
        padding: 8px 10px;
    }

    .picker-item {
        padding: 10px 12px;
    }

    .picker-item-icon {
        width: 34px;
        height: 34px;
    }

    .picker-item-label {
        font-size: 12px;
    }

    .picker-footer {
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .picker-modal {
        max-width: 100vw;
        max-height: 90vh;
        border-radius: 14px 14px 0 0;
    }

    .picker-footer {
        flex-direction: column;
        gap: 8px;
    }

    .picker-footer-actions {
        width: 100%;
    }

    .picker-btn {
        flex: 1;
        text-align: center;
    }

    .geolocation-btn {
        font-size: 12px;
        padding: 10px 14px;
    }
}
