/**
 * HHPF Bridge - Vehicle Bar
 * Site-wide vehicle selector bar + modal
 */

/* ===== Vehicle Bar ===== */
.hhpfb-vehicle-bar {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 99990;
    pointer-events: none;
}

.hhpfb-vb-inner {
    pointer-events: auto;
    position: fixed;
    top: 12px;
    right: 16px;
    background: #111;
    border-radius: 6px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    white-space: nowrap;
}

/* Adjust for WP admin bar */
.admin-bar .hhpfb-vb-inner {
    top: 44px;
}

@media screen and (max-width: 782px) {
    .admin-bar .hhpfb-vb-inner {
        top: 58px;
    }
}

.hhpfb-vb-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hhpfb-vb-icon {
    font-size: 15px;
    line-height: 1;
}

.hhpfb-vb-text {
    color: #fff;
    font-weight: 500;
}

.hhpfb-vb-bed {
    color: #FEDD00;
    font-weight: 400;
    margin-left: 2px;
}

.hhpfb-vb-bed::before {
    content: "\00b7 ";
    color: #666;
}

.hhpfb-vb-change,
.hhpfb-vb-select {
    color: #FEDD00;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: color 0.15s;
    cursor: pointer;
}

.hhpfb-vb-change:hover,
.hhpfb-vb-select:hover {
    color: #ffe94a;
    text-decoration: none;
}

/* ===== Modal Overlay ===== */
.hhpfb-vb-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.hhpfb-vb-modal-content {
    background: #fff;
    border-radius: 10px;
    padding: 28px 32px 24px;
    width: 420px;
    max-width: 92vw;
    position: relative;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.hhpfb-vb-modal-content h3 {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 700;
    color: #111;
}

.hhpfb-vb-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.15s;
}

.hhpfb-vb-modal-close:hover {
    color: #333;
}

/* ===== Dropdowns ===== */
.hhpfb-vb-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.hhpfb-vb-fields select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: #fff;
    appearance: auto;
    cursor: pointer;
    transition: border-color 0.15s;
}

.hhpfb-vb-fields select:focus {
    outline: none;
    border-color: #FEDD00;
    box-shadow: 0 0 0 3px rgba(254,221,0,0.15);
}

.hhpfb-vb-fields select:disabled {
    background: #f5f5f5;
    color: #aaa;
    cursor: not-allowed;
}

/* ===== Action Buttons ===== */
.hhpfb-vb-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.hhpfb-vb-btn-save {
    background: #FEDD00;
    color: #111;
    border: none;
    border-radius: 6px;
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.hhpfb-vb-btn-save:hover:not(:disabled) {
    background: #ffe94a;
}

.hhpfb-vb-btn-save:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.hhpfb-vb-btn-clear {
    background: none;
    border: 2px solid #ddd;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.hhpfb-vb-btn-clear:hover {
    border-color: #c00;
    color: #c00;
}

/* ===== Mobile Responsive ===== */
@media screen and (max-width: 600px) {
    .hhpfb-vb-inner {
        top: 8px;
        right: 8px;
        padding: 5px 10px;
        font-size: 12px;
    }

    .admin-bar .hhpfb-vb-inner {
        top: 50px;
    }

    /* Collapse to icon + short label on small screens */
    .hhpfb-vehicle-bar.has-vehicle .hhpfb-vb-text {
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .hhpfb-vb-bed {
        display: none;
    }

    .hhpfb-vb-modal-content {
        padding: 20px;
        margin: 12px;
    }

    .hhpfb-vb-fields {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 400px) {
    .hhpfb-vehicle-bar.no-vehicle .hhpfb-vb-icon {
        font-size: 14px;
    }

    .hhpfb-vehicle-bar.no-vehicle .hhpfb-vb-select {
        font-size: 11px;
    }

    .hhpfb-vehicle-bar.has-vehicle .hhpfb-vb-text {
        max-width: 100px;
    }
}
