/**
 * ════════════════════════════════════════════════════════════════
 * GARAGE AUTO SELECTOR - STYLES (Style Otobox.ca)
 * ════════════════════════════════════════════════════════════════
 */

/* ============================================================
   AFFICHAGE DU GARAGE SÉLECTIONNÉ
   ============================================================ */

.garage-selector-modern {
    margin: 0;
    padding: 0;
}

.garage-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.garage-display:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.garage-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    flex-shrink: 0;
}

.garage-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

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

.garage-name {
    font-size: 16px;
    font-weight: 700;
    color: white;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.garage-address {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.garage-distance {
    display: inline-block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 6px;
    margin-top: 4px;
}

.garage-change-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.garage-change-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
}

.garage-change-btn:active {
    transform: scale(0.98);
}

.garage-change-btn svg {
    width: 16px;
    height: 16px;
}

/* ============================================================
   MENU DE SÉLECTION (OVERLAY)
   ============================================================ */

.garage-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    opacity: 0;
    transition: all 0.3s ease;
}

.garage-menu-overlay.active {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 1;
}

.garage-menu-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.garage-menu-overlay.active .garage-menu-modal {
    transform: scale(1) translateY(0);
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
    .garage-menu-modal {
        background: #1e1e1e;
        color: #e0e0e0;
    }
}

.garage-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid #e0e0e0;
}

@media (prefers-color-scheme: dark) {
    .garage-menu-header {
        border-bottom-color: #333;
    }
}

.garage-menu-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
}

@media (prefers-color-scheme: dark) {
    .garage-menu-header h2 {
        color: #e0e0e0;
    }
}

.garage-menu-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    font-size: 24px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (prefers-color-scheme: dark) {
    .garage-menu-close {
        background: #333;
        color: #ccc;
    }
}

.garage-menu-close:hover {
    background: #e0e0e0;
    color: #333;
    transform: scale(1.1);
}

@media (prefers-color-scheme: dark) {
    .garage-menu-close:hover {
        background: #444;
        color: #fff;
    }
}

.garage-menu-list {
    overflow-y: auto;
    padding: 8px;
}

/* ============================================================
   ITEMS DE GARAGE
   ============================================================ */

.garage-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    margin-bottom: 8px;
    border-radius: 12px;
    background: #f8f9fa;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (prefers-color-scheme: dark) {
    .garage-menu-item {
        background: #2a2a2a;
    }
}

.garage-menu-item:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: translateX(4px);
}

@media (prefers-color-scheme: dark) {
    .garage-menu-item:hover {
        background: #333;
        border-color: #764ba2;
    }
}

.garage-menu-item.selected {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: #667eea;
}

@media (prefers-color-scheme: dark) {
    .garage-menu-item.selected {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
        border-color: #764ba2;
    }
}

.item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    flex-shrink: 0;
}

.item-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

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

.item-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
}

@media (prefers-color-scheme: dark) {
    .item-name {
        color: #e0e0e0;
    }
}

.item-address {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

@media (prefers-color-scheme: dark) {
    .item-address {
        color: #999;
    }
}

.item-distance {
    display: inline-block;
    font-size: 12px;
    color: #667eea;
    font-weight: 600;
}

.item-checkmark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
    flex-shrink: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .garage-display {
        padding: 10px 12px;
    }

    .garage-icon {
        width: 40px;
        height: 40px;
    }

    .garage-name {
        font-size: 14px;
    }

    .garage-address {
        font-size: 12px;
    }

    .garage-change-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .garage-menu-overlay {
        padding: 12px;
    }

    .garage-menu-header {
        padding: 20px 16px 12px 16px;
    }

    .garage-menu-header h2 {
        font-size: 18px;
    }

    .garage-menu-item {
        padding: 12px;
    }

    .item-icon {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .garage-display {
        flex-wrap: wrap;
    }

    .garage-change-btn {
        width: 100%;
        margin-top: 8px;
        justify-content: center;
    }

    .garage-address {
        display: none;
    }
}

/* ============================================================
   MODAL DE DÉTAILS DU GARAGE
   ============================================================ */

.garage-details-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 550px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.garage-menu-overlay.active .garage-details-modal {
    transform: scale(1) translateY(0);
}

@media (prefers-color-scheme: dark) {
    .garage-details-modal {
        background: #1e1e1e;
        color: #e0e0e0;
    }
}

.garage-details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 16px 24px;
    border-bottom: 2px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px 16px 0 0;
}

@media (prefers-color-scheme: dark) {
    .garage-details-header {
        border-bottom-color: #333;
    }
}

.garage-details-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: white;
}

.garage-details-header .garage-menu-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.garage-details-header .garage-menu-close:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.garage-details-content {
    overflow-y: auto;
    padding: 24px;
    flex: 1;
}

.garage-details-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.garage-details-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

@media (prefers-color-scheme: dark) {
    .garage-details-section {
        border-bottom-color: #333;
    }
}

.garage-details-section h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (prefers-color-scheme: dark) {
    .garage-details-section h3 {
        color: #e0e0e0;
    }
}

.garage-details-section p {
    margin: 4px 0;
    font-size: 15px;
    color: #495057;
    line-height: 1.6;
}

@media (prefers-color-scheme: dark) {
    .garage-details-section p {
        color: #b0b0b0;
    }
}

.garage-phone-link,
.garage-email-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.garage-phone-link:hover,
.garage-email-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Heures d'ouverture */
.opening-hours {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 10px;
}

@media (prefers-color-scheme: dark) {
    .opening-hours {
        background: #2a2a2a;
    }
}

.hours-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.hours-row:last-child {
    border-bottom: none;
}

@media (prefers-color-scheme: dark) {
    .hours-row {
        border-bottom-color: #333;
    }
}

.hours-day {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

@media (prefers-color-scheme: dark) {
    .hours-day {
        color: #b0b0b0;
    }
}

.hours-time {
    color: #667eea;
    font-weight: 600;
    font-size: 14px;
}

/* Footer avec bouton "Autres garages" */
.garage-details-footer {
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 0 0 16px 16px;
}

@media (prefers-color-scheme: dark) {
    .garage-details-footer {
        border-top-color: #333;
        background: #2a2a2a;
    }
}

.btn-show-other-garages {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-show-other-garages:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-show-other-garages:active {
    transform: translateY(0);
}

.btn-show-other-garages svg {
    width: 20px;
    height: 20px;
}

/* Responsive pour la modal de détails */
@media (max-width: 768px) {
    .garage-details-modal {
        max-height: 90vh;
    }

    .garage-details-header {
        padding: 20px 16px 12px 16px;
    }

    .garage-details-header h2 {
        font-size: 20px;
    }

    .garage-details-content {
        padding: 20px 16px;
    }

    .garage-details-section {
        margin-bottom: 20px;
        padding-bottom: 16px;
    }

    .garage-details-section h3 {
        font-size: 15px;
    }

    .garage-details-section p {
        font-size: 14px;
    }

    .garage-details-footer {
        padding: 12px 16px;
    }
}
