/* ─────────────────────────────────────────────────────────────────────────
   inv_picker.css
   Styles for the live inventory picker form field.
   Loaded lazily by class.forms.php only when an inv_picker field is present.
───────────────────────────────────────────────────────────────────────── */

/* ── Alignment guard ─────────────────────────────────────────────────────── */
/* Dealer themes and page-builder sections sometimes center text on the
   container holding the form (same guard the history widgets carry); pin the
   field label and the picker's own content back to the left so the label
   sits over its input and result rows read normally. */
.gbuc-inv-picker-label,
.gbuc-inv-picker-wrap {
    text-align: left;
}
.gbuc-inv-picker-label {
    display: block;
}

/* ── Wrapper ─────────────────────────────────────────────────────────────── */
.gbuc-inv-picker-wrap {
    position: relative;
}

/* ── Search input group ──────────────────────────────────────────────────── */
.gbuc-inv-picker-wrap .gbuc-inv-picker-search {
    border-radius: 0.375rem !important;
}
.gbuc-inv-picker-wrap .gbuc-inv-picker-search:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* ── Dropdown results panel ──────────────────────────────────────────────── */
.gbuc-inv-picker-results {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 1055;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ── Individual result row ───────────────────────────────────────────────── */
.gbuc-inv-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.12s ease;
}
.gbuc-inv-result-item:last-child {
    border-bottom: none;
}
.gbuc-inv-result-item:hover,
.gbuc-inv-result-item:focus {
    background: #f0f6ff;
    outline: none;
}

/* ── Thumbnail ────────────────────────────────────────────────────────────── */
.gbuc-inv-result-thumb {
    width: 120px;
    height: 84px;
    object-fit: cover;
    border-radius: 0.4rem;
    flex-shrink: 0;
    background: #e9ecef;
}
.gbuc-inv-result-thumb-placeholder {
    width: 120px;
    height: 84px;
    border-radius: 0.4rem;
    flex-shrink: 0;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 2rem;
}

/* ── Result text block ───────────────────────────────────────────────────── */
.gbuc-inv-result-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.gbuc-inv-result-title {
    font-weight: 700;
    font-size: 1rem;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gbuc-inv-result-sub {
    font-size: 0.825rem;
    color: #6c757d;
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Empty / loading states ──────────────────────────────────────────────── */
.gbuc-inv-no-results,
.gbuc-inv-loading {
    padding: 1.25rem 1rem;
    font-size: 0.9rem;
    color: #6c757d;
    text-align: center;
}

/* ── Selected vehicle card ───────────────────────────────────────────────── */
.gbuc-inv-picker-selected-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-top: 0.5rem;
    padding: 0.65rem 0.9rem;
    background: #f0f6ff;
    border: 1px solid #cde0ff;
    border-left: 4px solid #0d6efd;
    border-radius: 0.5rem;
}
.gbuc-inv-picker-selected-thumb {
    width: 80px;
    height: 56px;
    object-fit: cover;
    border-radius: 0.3rem;
    flex-shrink: 0;
    background: #dee2e6;
}
.gbuc-inv-picker-selected-thumb-placeholder {
    width: 80px;
    height: 56px;
    border-radius: 0.3rem;
    flex-shrink: 0;
    background: #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 1.5rem;
}
.gbuc-inv-picker-selected-info {
    flex: 1;
    min-width: 0;
}
.gbuc-inv-picker-selected-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #0d1b2a;
}
.gbuc-inv-picker-selected-meta {
    font-size: 0.775rem;
    color: #495057;
    margin-top: 0.15rem;
}
.gbuc-inv-picker-change-btn {
    font-size: 0.78rem;
    flex-shrink: 0;
    white-space: nowrap;
}
