/* General */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.5)), 
                url('https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1920&q=80') no-repeat center center fixed;
    background-size: cover;
    color: #fff;
    padding: 2rem;
}

/* Título */
h1 {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* Filtros */
.filtros {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.searchContainer {
    position: relative;
    width: 300px;
}

.searchContainer input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border-radius: 30px;
    border: none;
    outline: none;
    font-size: 1rem;
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
}

.searchContainer i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #555;
}

#filtro-cp {
    padding: 0.75rem 1rem;
    border-radius: 30px;
    border: none;
    font-size: 1rem;
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    padding: 1rem;
    max-width: 1600px; /* ancho máximo del grid */
    margin: 0 auto;     /* centrado */
}

/* Cards */
.card {
    background: #ffffff;
    color: #333;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%; /* asegura que el contenido crezca proporcionalmente */
    max-width: 800px; /* evita que se estire más de la columna */
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.card img {
    width: 100%;
    aspect-ratio: 16 / 9; /* mantiene proporción horizontal estándar */
    object-fit: cover;
    flex-shrink: 0;
}

/* Imagen no disponible */
.no-image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background-color: #e0f7fa;
    padding: 1rem;
}

.card-content {
    padding: 1rem;
}

.card-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #007b9c;
}

.card-content .direccion {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.card-content p {
    font-size: 0.95rem;
    color: #444;
}



/* Mensajes de error */
.error {
    text-align: center;
    font-size: 1.2rem;
    background-color: rgba(255, 0, 0, 0.2);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    grid-column: 1 / -1;
}

/* Responsive */
@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }

    .searchContainer input,
    #filtro-cp {
        width: 100%;
    }
}
