/* Estilos para la barra de navegación */

/* Efecto hover para los enlaces de navegación */
nav ul li a.active {
    color: var(--primary);              /* Cambia el color al pasar el ratón o si está activo */
}

/* La línea se expande al pasar el ratón o si el enlace está activo */
nav ul li a:hover::after,
nav ul li a.active::after {
    width: 100%;                        /* Ancho completo de la línea */
}

/* --- ESTILOS ESPECÍFICOS DE LA PÁGINA DE BÚSQUEDA --- */

/* Hero Section */
.search-hero {
    background: linear-gradient(135deg, rgba(44, 119, 68, 0.9), rgba(44, 62, 80, 0.9)), url('https://images.unsplash.com/photo-1547347298-4074fc3086f0?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') no-repeat center center/cover;
    padding: 150px 0 80px;
    color: white;
    text-align: center;
    display: flex;
    align-items: center;
    min-height: 50vh;
}

.search-hero h1 { font-size: 2.8rem; margin-bottom: 30px; line-height: 1.2; }

/* Caja de Búsqueda */
.search-box {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 30px;
    max-width: 900px;
    margin: 0 auto;
    box-shadow: var(--shadow);
}

.search-input { position: relative; margin-bottom: 20px; }
.search-input i { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: #999; font-size: 1.1rem; }
.search-input input {
    width: 100%;
    padding: 15px 15px 15px 50px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1.1rem;
}

.filters { display: flex; gap: 15px; flex-wrap: wrap; justify-content: center; }
.filters select, .filters button {
    flex: 1;
    min-width: 180px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1.05rem;
}
.filters button {
    background-color: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
}
.filters button:hover { background-color: #236133; }

/* Resultados */
.search-results { padding: 60px 0; background-color: var(--light); }
.results-container { display: flex; gap: 40px; flex-wrap: wrap; }

/* Mapa */
.map-container {
    flex: 2;
    min-width: 400px;
    position: relative;
    height: 600px;
}
#map { height: 100%; width: 100%; border-radius: 8px; box-shadow: var(--shadow); }
.map-legend {
    position: absolute; bottom: 20px; left: 20px;
    background: white; padding: 15px; border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 400;
}
.legend-item { display: flex; align-items: center; margin-bottom: 8px; font-size: 0.95rem; }
.icon { width: 18px; height: 18px; border-radius: 50%; margin-right: 10px; display: inline-block; }

/* COLORES LEYENDA */
.icon.campamento { background-color: #2c7744; }
.icon.torneo { background-color: #f9a826; }
.icon.clase { background-color: #e74c3c; }

/* Lista Actividades */
.activities-list { flex: 3; min-width: 300px; }
.results-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid #ddd;
}
.sort-options { display: flex; align-items: center; gap: 10px; }
.sort-options select { padding: 8px; border-radius: 4px; border: 1px solid #ddd; }

.activities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

/* Tarjeta Actividad */
.activity-card {
    background: white; border-radius: 10px; overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08); transition: transform 0.3s;
    cursor: pointer;
}
.activity-card:hover { transform: translateY(-8px); }
.activity-image { height: 200px; background-size: cover; background-position: center; }
.activity-info { padding: 20px; }

/* Etiquetas de colores */
.activity-type {
    display: inline-block; padding: 5px 12px; background: #95a5a6;
    color: white; font-size: 0.85rem; border-radius: 5px; margin-bottom: 12px;
    text-transform: capitalize;
}
.activity-type.campamento { background: var(--primary); }
.activity-type.torneo { background: var(--secondary); }
.activity-type.clase { background: var(--accent); }

/* Badge de Plazas (Corregido float: right;) */
.spots-badge { 
    font-size: 0.8rem; 
    padding: 2px 8px; 
    border-radius: 4px; 
    float: right; 
    font-weight: 600; 
    margin-bottom: 12px; 
}
.spots-unlimited { background-color: #e6fffa; color: #2c7a7b; border: 1px solid #b2f5ea; }
.spots-available { background-color: #f0fff4; color: #276749; border: 1px solid #c6f6d5; }
.spots-low { background-color: #fffaf0; color: #9c4221; border: 1px solid #feebc8; }
.spots-full { background-color: #fff5f5; color: #c53030; border: 1px solid #feb2b2; }

.activity-info h3 { font-size: 1.4rem; margin-bottom: 10px; color: var(--dark); }
.activity-price { font-size: 1.5rem; font-weight: bold; color: var(--primary); margin-bottom: 15px; }
.btn-view {
    display: block; width: 100%; padding: 12px; text-align: center;
    background: var(--primary); color: white; border: none; border-radius: 4px;
    cursor: pointer;
}

/* Modal Detalle */
.activity-detail-modal {
    width: 95% !important; max-width: 900px !important; padding: 0 !important;
    max-height: none !important; height: auto !important; overflow: visible !important;
    margin: 5% auto; background: white; border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); position: relative;
}
.modal-scroll-content { overflow-y: visible !important; max-height: none !important; padding: 30px; }
.modal-hero-image {
    width: 100%; height: 350px; object-fit: cover;
    margin-top: -30px; margin-left: -30px; width: calc(100% + 60px); margin-bottom: 20px; display: block;
}
.activity-detail-modal .close-modal {
    position: absolute; top: 15px; right: 15px;
    background-color: white; color: #e74c3c;
    width: 45px; height: 45px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: bold; line-height: 1; cursor: pointer; z-index: 100;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); border: none;
    transition: transform 0.2s, background-color 0.2s;
}
.activity-detail-modal .close-modal:hover {
    background-color: #f8f9fa; transform: scale(1.1);
}
.modal-meta-info {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px; margin: 20px 0; padding: 20px 0;
    border-top: 1px solid #eee; border-bottom: 1px solid #eee;
}
.modal-meta-info p { margin: 0; display: flex; align-items: center; gap: 10px; color: #555; }
.modal-meta-info i { color: var(--primary); font-size: 1.2rem; }

/* Modales Pequeños */
.modal.small-centered { align-items: center !important; padding-top: 0 !important; }
.small-modal-content { background: white; border-radius: 12px; padding: 30px !important; max-width: 400px; width: 90%; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.2); position: relative; animation: fadeInScale 0.3s ease; margin: auto; }
@keyframes fadeInScale { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.modal-icon { font-size: 4rem; margin-bottom: 20px; display: block; }
.modal-icon.warning { color: #f39c12; }
.modal-icon.success { color: #2c7744; }
.modal-icon.error { color: #e74c3c; }
.modal-title-small { font-size: 1.5rem; margin-bottom: 10px; color: var(--dark); }
.modal-message { color: #666; margin-bottom: 25px; font-size: 1rem; }
.modal-actions-row { display: flex; justify-content: center; gap: 15px; }
.btn-cancel { background-color: #e0e0e0; color: #333; display: inline-block; padding: 10px 24px; border-radius: 50px; font-weight: 600; cursor: pointer; border: none; }
.btn-cancel:hover { background-color: #d0d0d0; }

@media (max-width: 992px) {
    .results-container { flex-direction: column; }
    .map-container { height: 400px; width: 100%; }
    .search-hero { padding-top: 100px; }
}
@media (max-width: 768px) {
    .filters { flex-direction: column; }
    .activity-detail-modal { width: 95% !important; margin: 10px auto; }
    .modal-hero-image { height: 200px; }
    .modal-actions { flex-direction: column; gap: 10px; }
    .modal-actions button { width: 100%; }
    .activity-detail-modal .close-modal { width: 35px; height: 35px; font-size: 20px; }
}
/* --- MEJORAS MÓVIL BUSCADOR --- */
@media (max-width: 768px) {
    .search-hero {
        padding: 100px 20px 40px; /* Reducir padding lateral */
    }

    .search-hero h1 {
        font-size: 1.8rem;
    }

    /* Caja de búsqueda */
    .search-box {
        padding: 20px;
    }

    .filters {
        flex-direction: column;
        width: 100%;
    }

    .filters select, .filters button {
        min-width: 100% !important; /* Que ocupen el ancho disponible, no uno fijo */
        width: 100%;
        margin-bottom: 10px;
    }

    /* Contenedor de Resultados: Columna inversa (Mapa arriba o abajo) */
    .results-container, .activities-list {
        min-width: 100%;
        width: 100%;
    }

    /* Mapa: Altura fija para que no ocupe todo */
    .map-container {
        min-width: 100% !important; /* Forzamos que no sea más ancho que la pantalla */
        width: 100% !important;
        height: 300px; /* Altura fija razonable para móvil */
        order: -1; /* Mantenemos el mapa arriba si quieres */
    }

    #map {
        border-radius: 8px;
    }
    
    /* Leyenda del mapa más compacta */
    .map-legend {
        padding: 5px 10px;
        font-size: 0.8rem;
        bottom: 10px;
        left: 10px;
        right: 10px;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    /* Lista de actividades */
    .activities-list {
        width: 100%;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    /* Tarjetas */
    .activity-card {
        margin-bottom: 20px;
    }
    
    .activity-image {
        height: 180px;
    }

    /* Modal de detalle en móvil */
    .activity-detail-modal {
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
        max-width: none !important;
        display: flex;
        flex-direction: column;
    }
    
    .modal-hero-image {
        height: 200px;
        width: 100%;
        margin: 0;
    }

    .modal-scroll-content {
        padding: 15px;
    }
    
    .activity-detail-modal .close-modal {
        top: 10px;
        right: 10px;
        background: rgba(255,255,255,0.8);
    }
}