/* Cabecera simple de la página */
.page-header {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 60px 20px;
}

.distancias-container {
    max-width: 1000px;
    margin: -30px auto 50px; /* Sube un poco sobre el header */
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden; /* Para que los bordes redondeados funcionen */
    position: relative;
    z-index: 10;
}

/* 1. MENÚ DE PESTAÑAS */
.tabs-menu {
    display: flex;
    background-color: #f0f0f0;
    /* Truco para móvil: Scroll horizontal si no caben */
    overflow-x: auto; 
    white-space: nowrap;
    -webkit-overflow-scrolling: touch; /* Suavidad en iPhone */
}

.tab-btn {
    flex: 1; /* En PC ocupan el mismo ancho */
    padding: 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    color: #666;
    transition: 0.3s;
    border-bottom: 4px solid transparent;
    min-width: 100px; /* Mínimo ancho en móvil */
}

.tab-sub {
    display: block;
    font-size: 0.7rem;
    font-weight: normal;
    margin-top: 5px;
}

.tab-btn:hover {
    background-color: #e9e9e9;
}

/* Cuando la pestaña está activa (El color del borde se pone vía JS, aquí un default) */
.tab-btn.active {
    background-color: white;
    color: #222;
}

/* 2. BARRA DE ESTADÍSTICAS */
.stats-bar {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    color: white;
    transition: background-color 0.5s ease; /* Transición suave de color */
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    opacity: 0.9;
    text-transform: uppercase;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
}

/* 3. CONTENIDO */
.tab-content-wrapper {
    padding: 40px;
}

.tab-content {
    display: none; /* Ocultos por defecto */
    animation: fadeIn 0.5s;
}

.tab-content.active {
    display: block; /* Solo se muestra el activo */
}

.route-details h2 {
    margin-bottom: 1rem;
    color: #333;
}

.route-specs {
    margin: 20px 0;
    padding-left: 20px;
    border-left: 4px solid #eee;
}

.route-specs li {
    margin-bottom: 10px;
}

.route-map-placeholder {
    background-color: #eee;
    /* height: 300px;  <--- ¡BORRA O COMENTA ESTA LÍNEA! */
    min-height: 200px; /* Opcional: Altura mínima por si no carga la imagen */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 2px dashed #ccc; /* Puedes quitar este borde si ya pones la imagen final */
    color: #777;
    margin-top: 20px;
    overflow: hidden;
    padding: 10px; /* Agrega un poco de aire interno */
}

.route-map-placeholder img {
    /* Esto hace la magia: */
    max-width: 100%;   /* Nunca más ancha que el contenedor */
    height: auto;      /* Mantener la proporción original (no se deforma) */
    
    /* Opcionales para que se vea mejor */
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); /* Sombra suave */
    display: block;    /* Quita espacios raros abajo */
    margin: 0 auto;    /* Centrarla si es más chica que el contenedor */
} /* <--- OJO: Tenías un punto y coma (;) extra aquí, bórralo. */

/* Animación suave */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* RESPONSIVE */
@media (max-width: 600px) {
    .distancias-container {
        margin: 0; /* Quitamos el margen negativo en móvil */
        border-radius: 0;
    }
    
    .tabs-menu {
        justify-content: flex-start; /* Alinear al inicio para scroll */
    }
    
    .tab-content-wrapper {
        padding: 20px;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
}