/* ============================================================
   GARAGE WIDGET - garage.css
   ============================================================ */

/* ===== OVERLAY / DRAWER ===== */
.garage-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
    justify-content: flex-end;
}

.garage-overlay.active {
    display: flex;
}

.garage-drawer {
    width: 380px;
    max-width: 92vw;
    height: 100%;
    background: #fff;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    animation: slideInGarage 0.25s ease;
}

@keyframes slideInGarage { 
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #eee;
}

.drawer-head h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.drawer-x {
    background: #f1f1f1;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drawer-x:hover {
    background: #e6e6e6;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
}

.drawer-sep {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #999;
    margin: 4px 0 10px;
    letter-spacing: 0.5px;
}

/* ===== BULLE FLOTTANTE GARAGE ===== */
.garage-bubble {
    position: fixed;
    top: 50%;
    right: 22px;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9998;
    border: 2px solid #1a8917;
    transition: transform 0.2s ease;
}

.garage-bubble:hover {
    transform: translateY(-50%) scale(1.06);
}

.garage-bubble-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #1a8917;
    overflow: hidden;
}

.garage-bubble-fallback {
    font-weight: 800;
    font-size: 20px;
    color: #1a8917;
    text-transform: uppercase;
}

.garage-bubble-ping {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 14px;
    height: 14px;
    background: #e74c3c;
    border-radius: 50%;
    border: 2px solid #fff;
    animation: garagePing 1.6s infinite;
}

@keyframes garagePing {
    0% { transform: scale(1); opacity: 1; }
    70% { transform: scale(1.8); opacity: 0; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* Version mobile : bulle plus petite, marge réduite */
@media (max-width: 576px) {
    .garage-bubble {
        width: 50px;
        height: 50px;
        right: 14px;
        border-width: 1.5px;
    }

    .garage-bubble-inner {
        font-size: 18px;
    }

    .garage-bubble-fallback {
        font-size: 16px;
    }

    .garage-bubble-ping {
        width: 12px;
        height: 12px;
    }
}

/* ===== SEPARATEUR "OU" DANS LE BLOC DE RECHERCHE HERO ===== */
.hero-search-sep {
    display: flex;
    align-items: center;
    text-align: center;
    color: #999;
    font-size: 12px;
    font-weight: 600;
    margin: 4px 0;
}

.hero-search-sep::before,
.hero-search-sep::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e5e5;
}

.hero-search-sep span {
    padding: 0 10px;
    text-transform: uppercase;
}

/* ===== MODAL VIN ===== */
.vin-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.vin-overlay.active {
    display: flex;
}

.vin-modal {

    max-width: 92vw;
    max-height: 86vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    animation: popInVin 0.2s ease;
}

@keyframes popInVin {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.vin-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #eee;
}

.vin-modal-head h5 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vin-modal-body {
    padding: 16px 18px;
    overflow-y: auto;
}

.vin-modal-hint {
    font-size: 12.5px;
    color: #888;
    margin: 0 0 12px;
}

.vin-loading {
    font-size: 12.5px;
    color: #999;
    text-align: center;
    padding: 14px;
    grid-column: 1 / -1;
}

.vin-generations-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.vin-generation-card {
    border: 2px solid #eee;
    border-radius: 12px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: 0.15s ease;
}

.vin-generation-card:hover {
    border-color: #c8e6c9;
}

.vin-generation-card.selected {
    border-color: #1a8917;
    background: #eafaea;
}

.vin-generation-card img {
    width: 100%;
    height: 56px;
    object-fit: contain;
    margin-bottom: 6px;
}

.vin-generation-card span {
    font-size: 11.5px;
    font-weight: 600;
    color: #333;
    display: block;
}

.vin-engines-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    max-height: 160px;
    overflow-y: auto;
}

.vin-engine-item {
    padding: 9px 12px;
    border: 1px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    background: #f9f9f9;
    transition: 0.15s ease;
}

.vin-engine-item:hover {
    background: #f1f1f1;
}

.vin-engine-item.selected {
    border-color: #1a8917;
    background: #eafaea;
    font-weight: 700;
}

@media (max-width: 576px) {
    .vin-generations-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .vin-modal {
        width: 94vw;
    }
}
/* ===== MESSAGE CONTEXTUEL ===== */
.garage-context-msg {
    background: #fff4e5;
    border: 1px solid #ffe0b3;
    color: #8a5a00;
    font-size: 12.5px;
    font-weight: 600;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 14px;
}

/* ===== LISTE VEHICULES ENREGISTRES ===== */
.saved-cars-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.saved-car-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #eee;
    background: #f9f9f9;
    cursor: pointer;
    transition: 0.15s ease;
    gap: 10px;
}

.saved-car-thumb {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #eee;
}

.saved-car-thumb-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: #1a8917;
    text-transform: uppercase;
}

.saved-car-item:hover {
    background: #f1f1f1;
}

.saved-car-item.active {
    border-color: #1a8917;
    background: #eafaea;
}

.saved-car-info {
    flex: 1;
    min-width: 0;
}

.saved-car-info h6 {
    margin: 0 0 2px;
    font-size: 13.5px;
    font-weight: 700;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-car-info span {
    font-size: 11.5px;
    color: #777;
}

.saved-car-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.saved-car-actions .active-badge {
    font-size: 10px;
    font-weight: 700;
    color: #1a8917;
    text-transform: uppercase;
}

.saved-car-actions .vh-delete {
    color: #c0392b;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 4px;
}

/* ===== FORMULAIRE D'AJOUT ===== */
.drawer-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
}

.drawer-form label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

.drawer-form select {
    width: 100%;
    padding: 9px 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 13px;
    background: #fff;
}

.drawer-form select:disabled {
    background: #f5f5f5;
    color: #aaa;
}

.btn-add-car {
    width: 100%;
    padding: 11px;
    border-radius: 10px;
    border: none;
    background: #1a8917;
    color: #fff;
    font-weight: 700;
    font-size: 13.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: 0.15s ease;
}

.btn-add-car:hover {
    background: #157012;
}

.btn-add-car:disabled {
    background: #ccc;
    cursor: not-allowed;
}