/**
 * Overlay de selección de autoescuela
 * Obligatorio para guests - no se puede cerrar sin elegir
 */

.autoescuela-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: opacity 0.3s ease;
}

.autoescuela-overlay__backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
}

.autoescuela-overlay__modal {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    max-width: 480px;
    width: calc(100% - 40px);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.autoescuela-overlay__content {
    padding: 28px 24px 24px;
}

.autoescuela-overlay__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--thm-primary-color, #1e73be) 0%, #155a9e 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.autoescuela-overlay__icon i {
    font-size: 24px;
    color: #fff;
}

.autoescuela-overlay__title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a2b4a;
    text-align: center;
    margin: 0 0 8px;
}

.autoescuela-overlay__text {
    font-size: 0.95rem;
    color: #666;
    text-align: center;
    margin: 0 0 20px;
    line-height: 1.4;
}

.autoescuela-overlay__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    padding: 8px 0;
    border: none;
    background: none;
    color: var(--thm-primary-color, #1e73be);
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
}

.autoescuela-overlay__back:hover {
    text-decoration: underline;
}

.autoescuela-overlay__back:focus {
    outline: none;
}

.autoescuela-overlay__step {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Mapa con zonas */
.autoescuela-overlay__map {
    height: 340px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
}

/* 3 botones en fila: Área Alumno, Test Online, Notas Examen */
.autoescuela-overlay__quick-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 16px;
    width: 100%;
    flex-shrink: 0;
}

.autoescuela-overlay__quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    min-height: 56px;
    background: var(--thm-primary-color, #a8e063);
    color: #fff !important;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.75rem;
    line-height: 1.2;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    -webkit-tap-highlight-color: transparent;
}

.autoescuela-overlay__quick-btn i {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.autoescuela-overlay__quick-btn:hover {
    background: #8bc952;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.autoescuela-overlay__quick-btn:active {
    transform: translateY(0);
}

.autoescuela-overlay__zone-marker {
    background: none !important;
    border: none !important;
}

.autoescuela-overlay__map-zone-btn {
    padding: 5px 11px;
    border-radius: 6px;
    border: 2px solid var(--thm-primary-color, #1e73be);
    background: #fff;
    color: var(--thm-primary-color, #1e73be);
    font-weight: 600;
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
}

.autoescuela-overlay__map-zone-btn:hover {
    background: var(--thm-primary-color, #1e73be);
    color: #fff;
    transform: scale(1.04);
}

.autoescuela-overlay__zones-fallback {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.autoescuela-overlay__zones-fallback .autoescuela-overlay__zone {
    text-align: center;
}

.autoescuela-overlay__zones .autoescuela-overlay__item {
    text-align: center;
    align-items: center;
}

.autoescuela-overlay__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.autoescuela-overlay__item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-family: inherit;
}

.autoescuela-overlay__item:hover {
    border-color: var(--thm-primary-color, #1e73be);
    background: #f8fbff;
}

.autoescuela-overlay__item:focus {
    outline: none;
    border-color: var(--thm-primary-color, #1e73be);
}

.autoescuela-overlay__item.loading {
    opacity: 0.7;
    pointer-events: none;
}

.autoescuela-overlay__item-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
}

.autoescuela-overlay__item-city {
    font-size: 0.8rem;
    color: #888;
    margin-top: 4px;
}

/* Mobile */
@media (max-width: 575px) {
    .autoescuela-overlay {
        padding: 12px;
    }
    .autoescuela-overlay__content {
        padding: 20px 16px 16px;
    }
    .autoescuela-overlay__title {
        font-size: 1.15rem;
    }
    .autoescuela-overlay__item {
        padding: 12px 14px;
    }
    /* 3 botones más compactos en móvil */
    .autoescuela-overlay__quick-links {
        gap: 6px;
        margin-top: 14px;
    }
    .autoescuela-overlay__quick-btn {
        min-height: 48px;
        padding: 8px 6px;
        font-size: 0.7rem;
    }
    .autoescuela-overlay__quick-btn i {
        font-size: 1rem;
        margin-bottom: 2px;
    }
}
