/* =====================================================
   Jayda Vehicle Checker — Modal chrome, tabs, layout
   Depends on: style.css (CSS token defaults)
   Continued in: style-form.css (fields, inputs, custom select)
                 style-result.css (result card, CTA, responsive)
   ===================================================== */

/* ── Modal ───────────────────────────────────────── */
/* z-index 9999300 > Elementor Pro popup (9999001) */
#jvc-modal {
    position: fixed !important;
    z-index: 9999300;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(.96);
    width: min(var(--jvc-modal-max-width), calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    overflow: hidden;
    background: #ffffff;
    border-radius: var(--jvc-modal-radius);
    box-shadow: 0 24px 64px rgba(30,37,56,.22);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    font-family: var(--jvc-font-family);
    color: var(--jvc-body-color);
    font-size: var(--jvc-body-font-size);
}

#jvc-modal.jvc-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

/* ── Modal header ────────────────────────────────── */
.jvc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
    background: #ffffff;
}

.jvc-modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--jvc-title-font-size);
    font-weight: var(--jvc-title-weight);
    color: var(--jvc-body-color);
    margin: 0;
}

#jvc-close {
    background: none !important;
    border: none !important;
    cursor: pointer;
    color: var(--jvc-label-color);
    font-size: 22px;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color .1s, background .1s;
    box-shadow: none !important;
}

#jvc-close:hover {
    color: var(--jvc-body-color);
    background: #E9EEF9 !important;
}

/* ── Tabs ────────────────────────────────────────── */
.jvc-tabs {
    display: flex;
    gap: 4px;
    margin: 14px 24px 0;
    padding: 4px;
    background: var(--jvc-primary);
    border-radius: 10px;
}

#jvc-modal .jvc-tab,
.jvc-inline-widget .jvc-tab {
    flex: 1;
    min-width: 0;
    padding: 6px 10px !important;
    background: transparent;
    border: none !important;
    border-radius: 7px !important;
    font-family: var(--jvc-font-family) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    color: rgba(255,255,255,.75);
    cursor: pointer;
    transition: background .15s, color .15s;
    box-shadow: none !important;
    letter-spacing: .02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#jvc-modal .jvc-tab.active,
.jvc-inline-widget .jvc-tab.active {
    background: #ffffff;
    color: var(--jvc-primary);
}

#jvc-modal .jvc-tab:not(.active):hover,
.jvc-inline-widget .jvc-tab:not(.active):hover {
    background: rgba(255,255,255,.15);
    color: #ffffff;
}

/* ── Body ────────────────────────────────────────── */
.jvc-modal-body {
    padding: 18px 24px 24px;
    width: 100%; /* ensures both tab panels have identical width */
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── Panels ──────────────────────────────────────── */
.jvc-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Select grid ─────────────────────────────────── */
.jvc-select-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.jvc-field-full { grid-column: 1 / -1; }

/* ── Inline widget refresh button (mirrors #jvc-close) ── */
.jvc-refresh-btn {
    background: none !important;
    border: none !important;
    cursor: pointer;
    color: var(--jvc-label-color);
    font-size: 22px;       /* same as #jvc-close */
    line-height: 1;
    padding: 4px 6px !important; /* same as #jvc-close — fixes .elementor-kit-6 override */
    border-radius: 4px;
    transition: color .1s, background .1s;
    box-shadow: none !important;
}

.jvc-refresh-btn:hover {
    color: var(--jvc-body-color);
    background: #E9EEF9 !important;
}

/* Reserve layout space when [hidden] — prevents header height jump.
   Specificity (0,3,0) beats .jvc-inline-widget button[hidden] (0,2,1) in style-result.css */
.jvc-inline-widget .jvc-refresh-btn[hidden] {
    display: inline-flex !important;
    visibility: hidden !important;
    pointer-events: none;
}
