/* =====================================================
   Weequb Vehicle Filter Widget — filter.css  v2.1
   Mobile-first. All decoration controlled by Elementor.
   ===================================================== */

/* ---------- Root Tokens ---------- */
.wvf-widget {
    --wvf-accent:      #2ecc71;
    --wvf-accent-dark: #27ae60;
    --wvf-bg:          #0f1923;
    --wvf-card-bg:     rgba(255,255,255,.06);
    --wvf-border:      rgba(255,255,255,.12);
    --wvf-text:        #ffffff;
    --wvf-muted:       rgba(255,255,255,.55);
    --wvf-radius:      14px;
    --wvf-gap:         14px;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* ---------- Outer Card ---------- */
.wvf-widget {
    padding: 24px 20px 28px;
    max-width: 520px;
    width: 100%;
    border-radius: var(--wvf-card-radius, 14px);
    box-sizing: border-box;
    position: relative;
}

/* ---------- Widget Title ---------- */
.wvf-widget .wvf-heading {
    color: var(--wvf-text);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .3px;
    margin: 0 0 18px;
    text-align: center;
}

/* ---------- Tabs ---------- */
.wvf-tabs {
    display: flex;
    gap: 8px;
    background: rgba(255,255,255,.05);
    border-radius: var(--wvf-tabs-radius, 50px);
    padding: 5px;
    margin-bottom: 22px;
}

.wvf-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: transparent;
    border: none;
    border-radius: var(--wvf-tab-radius, 50px);
    color: var(--wvf-muted);
    font-size: .82rem;
    font-weight: 600;
    padding: 10px 6px;
    cursor: pointer;
    transition: background .25s ease, color .25s ease;
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: nowrap;
    line-height: 1;
}

.wvf-tab:hover {
    color: var(--wvf-text);
}

.wvf-tab.active {
    background: var(--wvf-accent);
    color: #fff;
    /* no box-shadow: controlled by Elementor if user wants it */
}

/* Tab icon sizing — works for both SVG and Elementor icon fonts */
.wvf-tab svg,
.wvf-tab i,
.wvf-tab .eicon,
.wvf-tab [class*="fa-"] {
    width: 20px;
    height: 20px;
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1;
}

/* ---------- Panels ---------- */
.wvf-panel {
    display: none;
    flex-direction: column;
    gap: var(--wvf-gap);
}

.wvf-panel.active {
    display: flex;
}

/* ---------- Field wrapper ---------- */
.wvf-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wvf-field label {
    color: var(--wvf-muted);
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
    line-height: 1;
    display: block;
}

/* ---------- Select wrapper (arrow lives here) ---------- */
.wvf-select-wrap {
    position: relative;
    display: block;
    border-radius: var(--wvf-select-radius, 50px);
    overflow: hidden;
}

/* Custom arrow — centred vertically within the select */
.wvf-select-wrap::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 6px;
    background: var(--wvf-muted);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    pointer-events: none;
    transition: background .2s ease;
}

.wvf-select-wrap:focus-within::after {
    background: var(--wvf-accent);
}

/* Hide arrow when spinner is active */
.wvf-field.loading .wvf-select-wrap::after {
    display: none;
}

/* ---------- Select dropdown ---------- */
.wvf-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: var(--wvf-card-bg);
    border: 1.5px solid var(--wvf-border);
    border-radius: var(--wvf-select-radius, 50px);
    color: var(--wvf-text);
    font-size: .9rem;
    padding: 12px 44px 12px 18px;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease, opacity .2s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-sizing: border-box;
}

.wvf-select:focus {
    outline: none;
    border-color: var(--wvf-accent);
    box-shadow: 0 0 0 3px rgba(46,204,113,.2);
}

.wvf-select:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.wvf-select option {
    background: #1a2535;
    color: #fff;
}

/* Field-level loading */
.wvf-field.loading .wvf-select {
    opacity: .5;
    pointer-events: none;
}

/* ---------- Field spinner ---------- */
.wvf-field-spinner {
    display: none;
    position: absolute;
    right: 34px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.25);
    border-top-color: var(--wvf-accent);
    animation: wvf-spin .7s linear infinite;
}

.wvf-field.loading .wvf-field-spinner {
    display: block;
}

/* ---------- Search Button ---------- */
.wvf-search-btn {
    width: 100%;
    border: none;
    border-radius: var(--wvf-btn-radius, 50px);
    background: linear-gradient(135deg, var(--wvf-accent) 0%, var(--wvf-accent-dark) 100%);
    color: #fff;
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .6px;
    padding: 14px;
    cursor: pointer;
    text-transform: uppercase;
    margin-top: 6px;
    transition: transform .2s ease, opacity .2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
}

.wvf-search-btn:hover {
    transform: translateY(-2px);
    opacity: .92;
}

.wvf-search-btn:active {
    transform: translateY(0);
}

.wvf-search-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

/* ---------- Button spinner ---------- */
.wvf-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wvf-spin .7s linear infinite;
    flex-shrink: 0;
}

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

/* ---------- Footer ---------- */
.wvf-footer {
    text-align: center;
    margin-top: 16px;
    color: var(--wvf-muted);
    font-size: .68rem;
    letter-spacing: .4px;
    text-transform: uppercase;
}

/* ---------- Responsive ---------- */
@media (min-width: 480px) {
    .wvf-tab {
        font-size: .88rem;
        padding: 10px 14px;
    }
}

@media (max-width: 380px) {
    .wvf-widget {
        padding: 18px 14px 22px;
    }
    .wvf-tab {
        font-size: .7rem;
        gap: 4px;
    }
    .wvf-tab svg,
    .wvf-tab i {
        width: 16px;
        height: 16px;
        font-size: 16px;
    }
}
