body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    
}

header {
    background-color: #f8f9fa;
    padding: 1rem;
    text-align: center;
    position: relative;
}

/* 🔥 FILTROS MEJORADOS */
.filters {
    border:2px solid #6d1401;
    margin-top: 1rem;
    background-image: url('https://images.unsplash.com/photo-1499762524203-b47f7b1b26a5?q=80&w=1931&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D');
    background-size: cover;
    background-position: center;
    padding: 1rem;
    border-radius: 10px;
    position: relative;
    z-index: 1;
    color: #ff5733;
    font-style: italic;
    font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;

    /* 👇 agregado */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.filters::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    border-radius: 10px;
}

/* 🔥 inputs mejorados */
.filters select,
.filters input,
.filters button {
    margin-right: 0.5rem;
    padding: 0.6rem;
    border-radius: 6px;
    border: 1px solid #ccc;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

/* efecto focus */
.filters input:focus,
.filters select:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0,123,255,0.3);
}

/* botón mejorado */
.filters button {
    background-color: #007bff;
    color: white;
    cursor: pointer;
    border: none;
}

.filters button:hover {
    background-color: #0056b3;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1rem;
}

.card {
    border:2px solid #6d1401;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 350px;
    position: relative;
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 0.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-content h3 {
    margin: 0;
    font-size: 1rem;
}

.card-content p {
    margin: 0;
    font-size: 0.875rem;
    color: #555;
}

.view-more {
    display: block;
    margin: 0.5rem auto;
    padding: 0.5rem;
    text-align: center;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.view-more.disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.pagination {
    text-align: center;
    margin: 1rem;
}

.pagination button {
    margin: 0 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    background-color: #007bff;
    color: white;
    cursor: pointer;
}

.pagination button.disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.busy {
    cursor: wait;
    position: relative;
}

.busy:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    transform: translate(-50%, -50%);
}

/* Estilos para el spinner */
.spinner {
    width: 200px;
    height: 200px;
    border: 5px solid blue;
    border-radius: 50%;
    border-top-color: red;
    animation: spin 1s linear infinite;
    position: fixed;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;

    
}


/* Asegurarse que la galería tenga posición relativa para posicionar el spinner */
#gallery {
    position: relative;
    min-height: 300px;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* 📱 MOBILE */
@media (max-width: 600px) {

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filters select,
    .filters input,
    .filters button {
        width: 100%;
        margin-right: 0;
      
    }

    .filters h1 {
        font-size: 20px;
        text-align: center;
    }

    .gallery {
        grid-template-columns: 1fr;
        padding: 0.5rem;
    }

    .card {
        height: auto;
    }

    .card img {
        height: 150px;
    }
}