/* =============== RESET BÁSICO =============== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
    color: #1f2933;
    background: radial-gradient(circle at top, #f5fafc 0%, #eef3fb 40%, #e6edf7 100%);
}

/* ================= HERO (PÁGINA PRINCIPAL) ================= */
.hero {
    position: relative;
    height: 280px;
    background-image: url("img/desierto.jpg"); /* cambia ruta a tu imagen */
    background-size: cover;
    background-position: center center;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.55),
            rgba(0, 0, 0, 0.35)
    );
}

.hero-overlay {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 3.5rem 1.5rem;
    text-align: center;
    color: #ffffff;
}

.hero-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem auto;
    border-radius: 999px;
    border: 3px solid rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(0, 0, 0, 0.25);
}

.hero-title {
    font-size: clamp(2.8rem, 5vw, 3.6rem);
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* ================= INTRO DE RUTAS (PÁGINA PRINCIPAL) ================= */
main {
    padding-bottom: 3rem;
}

.routes-intro {
    max-width: 800px;
    margin: 2.5rem auto 1.5rem auto;
    text-align: center;
    padding: 0 1.5rem;
}

.routes-intro h2 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.routes-intro p {
    font-size: 1rem;
    color: #4a5563;
}

/* ================= GRID DE TARJETAS (PÁGINA PRINCIPAL) ================= */
.routes-grid {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1rem 1.5rem 3rem 1.5rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.75rem;
}

/* En pantallas pequeñas se hace una o dos columnas */
@media (max-width: 960px) {
    .routes-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .routes-grid {
        grid-template-columns: 1fr;
    }
}

/* Tarjeta */
.route-card {
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
    display: flex;
    flex-direction: column;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.route-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 55px rgba(15, 23, 42, 0.22);
}

/* Imagen de la ruta */
.route-image {
    position: relative;
    height: 210px;
    background-size: cover;
    background-position: center center;
}

/* Cambia estas imágenes por las tuyas reales */
.route-image--gastro {
    background-image: url("img/ruta-gastronomica.jpg");
}

.route-image--miradores {
    background-image: url("img/ruta-miradores.jpg");
}

.route-image--historica {
    background-image: url("img/ruta-historica.jpg");
}

/* Chip redondo con icono */
.route-chip {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.25);
}

/* Contenido de la tarjeta */
.route-content {
    padding: 1.5rem 1.75rem 1.8rem 1.75rem;
}

.route-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.route-content p {
    font-size: 0.98rem;
    color: #4a5563;
    line-height: 1.5;
    margin-bottom: 1.4rem;
}

/* Botón naranja */
.route-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.4rem;
    border-radius: 999px;
    border: none;
    outline: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    color: #ffffff;
    background: linear-gradient(90deg, #f97316, #ea580c);
    box-shadow: 0 10px 22px rgba(234, 88, 12, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.route-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(234, 88, 12, 0.45);
    filter: brightness(1.03);
}

/* Flecha del botón */
.route-button::after {
    content: "→";
    margin-left: 0.35rem;
}

/* Responsive extra hero + cards */
@media (max-width: 600px) {
    .hero {
        height: 240px;
    }

    .hero-overlay {
        padding: 2.7rem 1rem;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .route-content {
        padding: 1.25rem 1.25rem 1.5rem 1.25rem;
    }
}

/* ================= LAYOUT DE MAPAS (PÁGINAS DE LEAFLET) ================= */

#app {
    display: flex;
    height: 100%;
    width: 100%;
}

/* PANEL LATERAL */
#sidebar {
    width: 280px;
    max-width: 40%;
    box-sizing: border-box;
    padding: 1rem;
    background: #f5f5f5;
    border-right: 1px solid #ddd;
    overflow-y: auto;
}

#sidebar h2 {
    margin-top: 0;
    font-size: 1.2rem;
}

#lista-lugares {
    list-style: none;
    padding: 0;
    margin: 0;
}

#lista-lugares li {
    margin-bottom: 0.5rem;
}

.boton-lugar {
    width: 100%;
    text-align: left;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.1s, background 0.15s;
}

.boton-lugar:hover {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
    transform: translateY(-1px);
    background: #fafafa;
}

.boton-lugar.activo {
    outline: 2px solid #0078ff;
}

.boton-lugar strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}

.boton-lugar small {
    display: block;
    font-size: 0.8rem;
    opacity: 0.75;
}

.ayuda {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.75rem;
}

/* MAPA */
#map {
    flex: 1;
}

.popup-content {
    max-width: 240px;
}

.popup-content h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
}

.popup-content p {
    margin: 0 0 6px 0;
    font-size: 13px;
}

.popup-content audio {
    width: 100%;
}

/* Ocultar panel de instrucciones del routing por defecto */
.leaflet-routing-container {
    display: none;
}

/* Responsive para celular en páginas de mapa */
@media (max-width: 768px) {
    #app {
        flex-direction: column;
    }

    #sidebar {
        width: 100%;
        max-width: none;
        border-right: none;
        border-bottom: 1px solid #ddd;
        height: 40%;
    }

    #map {
        height: 60%;
    }
}
.maps-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0.5rem 0 1rem 0;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.maps-link-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.4);
    filter: brightness(1.05);
}

