* {
    box-sizing: border-box;
}


body {
    margin: 0;
    font-family: 'Inter', Arial, Helvetica, sans-serif;
    background: transparent;
    color: #1a202c;
    overflow-x: hidden;
    width: 100%;
}


.catalogo {
    width: 100%;
    margin: 0 auto;
    padding: 30px 20px 60px;
    background: transparent;
    overflow-x: hidden;
}

/* Limitar ancho en pantallas grandes */
@media (min-width: 1400px) {
    .catalogo {
        max-width: 1100px;
    }
    
    /* Aumentar ligeramente el tamaño de textos en pantallas grandes */
    body {
        font-size: 1.05rem;
    }
    
    .buscador input {
        font-size: 17px;
    }
    
    #ordenar {
        font-size: 16px;
    }
    
    .categorias-select {
        font-size: 16px;
    }
    
    .producto h2 {
        font-size: 17px;
    }
    
    .producto-descripcion {
        font-size: 14px;
    }
    
    .producto-precio {
        font-size: 19px;
    }
    
    .producto-categoria {
        font-size: 13px;
    }
}


/* =========================
   ENCABEZADO
========================= */

.catalogo-header {
    margin-bottom: 20px;
}


.catalogo-header h1 {
    margin: 0 0 20px;
    font-size: 32px;
}


/* =========================
   CONTROLES
========================= */

.catalogo-controles {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.filtros-grupo {
    display: flex;
    gap: 12px;
    align-items: center;
}


.buscador {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;

    background: white;

    border: 1px solid #ddd;
    border-radius: 10px;

    padding: 0 14px;
}


.buscador input {
    width: 100%;

    border: 0;
    outline: 0;

    padding: 14px 0;

    font-size: 16px;

    background: transparent;
}


#ordenar {
    min-width: 220px;

    padding: 14px;

    border: 1px solid #ddd;
    border-radius: 10px;

    background: white;

    font-size: 15px;
}


/* =========================
   CATEGORIAS
========================= */

.categorias-select {
    min-width: 180px;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: white;
    font-size: 15px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.categorias-select:hover {
    border-color: #bbb;
}

.categorias-select:focus {
    outline: none;
    border-color: #c8102e;
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

/* =========================
   LOCALIDADES
========================= */

.localidades-select {
    min-width: 180px;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: white;
    font-size: 15px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.localidades-select:hover {
    border-color: #bbb;
}

.localidades-select:focus {
    outline: none;
    border-color: #c8102e;
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}


/* =========================
   INFORMACIÓN
========================= */

.catalogo-info {
    margin: 15px 0;

    color: #666;

    font-size: 14px;
}


/* =========================
   PRODUCTOS
========================= */

.productos {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 20px;

    align-items: stretch;
}


/* =========================
   TARJETA
========================= */

.producto {
    position: relative;

    display: flex;
    flex-direction: column;

    background: white;

    border-radius: 14px;

    overflow: hidden;

    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.07);

    transition:
        transform 0.2s,
        box-shadow 0.2s;

    min-height: 380px;
    height: 100%;
}


.producto:hover {
    transform: translateY(-3px);

    box-shadow:
        0 7px 20px rgba(0, 0, 0, 0.12);
}

.producto {
    cursor: pointer;
}


/* =========================
   DESTACADO
========================= */

.producto.destacado {
    border: 2px solid #f0b400;
    animation: glow-border 2s ease-in-out infinite;
}

@keyframes glow-border {
    0%, 100% {
        box-shadow: 0 0 5px rgba(240, 180, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 15px rgba(240, 180, 0, 0.6);
    }
}


.etiqueta-destacado {
    position: absolute;

    top: 12px;
    left: 12px;

    z-index: 2;

    background: #f0b400;

    color: #111;

    padding: 6px 10px;

    border-radius: 6px;

    font-size: 12px;
    font-weight: bold;
}


/* =========================
   IMAGEN
========================= */

.producto-imagen-contenedor {
    width: 100%;

    aspect-ratio: 1 / 1;

    background: #fafafa;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;
    min-height: 200px;
}


.producto-imagen {
    width: 100%;
    height: 100%;

    object-fit: cover;
}


/* =========================
   INFORMACIÓN PRODUCTO
========================= */

.producto-info {
    display: flex;
    flex-direction: column;

    padding: 16px;

    flex: 1;
    justify-content: space-between;
    min-height: 120px;
}


.producto-categoria {
    margin-bottom: 7px;

    font-size: 12px;

    color: #777;

    text-transform: uppercase;

    letter-spacing: 0.4px;
}


.producto h2 {
    margin: 0 0 8px;

    font-size: 16px;

    line-height: 1.25;
}


.producto-direccion {
    color: #777;
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.producto-descripcion {
    color: #666;

    font-size: 13px;

    line-height: 1.5;

    margin-bottom: 15px;
    cursor: pointer;
}


/* =========================
   INFORMACIÓN DE PROPIEDAD
========================= */

.producto-info-propiedad {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.propiedad-localidad,
.propiedad-tamanio {
    display: inline-block;
    padding: 4px 8px;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

.propiedad-localidad {
    background: linear-gradient(135deg, #e8f4f8, #d1e8f0);
    color: #2c5f7c;
}

.propiedad-tamanio {
    background: linear-gradient(135deg, #fef5e7, #fdebd0);
    color: #8b4513;
}


.producto-precio {
    font-size: 18px;

    font-weight: bold;

    margin-top: auto;
}


.producto-descuento {
    display: inline-block;

    margin-top: 8px;

    color: #17823b;

    font-size: 13px;

    font-weight: bold;
}


/* =========================
   STOCK
========================= */

.producto.sin-stock {
    opacity: 0.82;
}

.producto.sin-stock h2 {
    color: #999999;
}

.producto.sin-stock .producto-boton {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
    pointer-events: none;
}

.sin-stock-text {
    display: inline-block;

    margin-top: 8px;

    color: #999999;

    font-weight: bold;

    font-size: 14px;
}


/* =========================
   WHATSAPP
========================= */

.producto-boton {
    display: flex;

    justify-content: center;
    align-items: center;

    margin-top: 16px;

    padding: 12px 15px;

    border-radius: 8px;

    background: #25D366;

    color: white;

    text-decoration: none;

    font-weight: bold;

    transition:
        opacity 0.2s;
}


.producto-boton:hover {
    opacity: 0.88;
}


/* =========================
   ANIMACIÓN DE CARGA
========================= */

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    width: 100%;
    min-height: 200px;
}

.productos:has(.loader) {
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #c8102e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loader-text {
    margin-top: 20px;
    color: #666;
    font-size: 16px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* =========================
   SIN RESULTADOS
========================= */

.sin-resultados {
    text-align: center;

    padding: 70px 20px;

    color: #666;
}


.sin-resultados-icono {
    font-size: 40px;

    margin-bottom: 10px;
}


.sin-resultados h2 {
    margin: 0 0 8px;

    color: #333;
}


.sin-resultados p {
    margin: 0;
}


.oculto {
    display: none !important;
}


/* =========================
   MODAL DE PRODUCTO
========================= */

.producto-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 100px 20px 20px;
    overflow-y: auto;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    margin: auto;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.modal-imagen {
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    min-height: 300px;
}

.modal-imagen img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.modal-imagen img:hover {
    transform: scale(1.1);
}

.modal-info {
    padding: 40px;
    display: flex;
    flex-direction: column;
}

.modal-categoria {
    font-size: 12px;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 10px;
}

.modal-info h2 {
    margin: 0 0 20px;
    font-size: 24px;
    line-height: 1.3;
}

.modal-descripcion {
    color: #666;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
}

.modal-info-propiedad {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.modal-propiedad-localidad,
.modal-propiedad-direccion,
.modal-propiedad-tamanio {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

.modal-propiedad-localidad {
    background: linear-gradient(135deg, #e8f4f8, #d1e8f0);
    color: #2c5f7c;
    border: 1px solid rgba(44, 95, 124, 0.2);
}

.modal-propiedad-direccion {
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-propiedad-tamanio {
    background: linear-gradient(135deg, #fef5e7, #fdebd0);
    color: #8b4513;
    border: 1px solid rgba(139, 69, 19, 0.2);
}

.modal-precio {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 10px;
}

.modal-stock {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 20px;
}

.modal-stock.sin-stock {
    color: #c62828;
}

.modal-stock:not(.sin-stock) {
    color: #17823b;
}

.modal-whatsapp-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 14px 20px;
    border-radius: 8px;
    background: #25D366;
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    transition: opacity 0.2s;
    border: none;
    cursor: pointer;
}

.modal-whatsapp-btn:hover {
    opacity: 0.88;
}

/* Responsive para el modal */
@media (max-width: 768px) {
    .producto-modal {
        align-items: center;
        padding: 20px;
    }

    .modal-content {
        max-height: 95vh;
    }

    .modal-body {
        grid-template-columns: 1fr;
    }

    .modal-imagen {
        padding: 30px;
        min-height: 250px;
    }

    .modal-imagen img {
        max-height: 300px;
    }

    .modal-info {
        padding: 25px;
    }

    .modal-info h2 {
        font-size: 20px;
    }

    .modal-info-vehiculo {
        gap: 8px;
    }

    .modal-vehiculo-anio,
    .modal-vehiculo-km {
        font-size: 12px;
        padding: 6px 12px;
    }

    .modal-descripcion {
        font-size: 14px;
    }

    .modal-precio {
        font-size: 24px;
    }
}



/* =========================
   TABLET
========================= */

@media (max-width: 950px) {

    .productos {
        grid-template-columns:
            repeat(4, minmax(0, 1fr));
    }

}


/* =========================
   CELULAR
========================= */

@media (max-width: 700px) {

    .catalogo {
        padding:
            20px 12px 40px;
    }


    .catalogo-header h1 {
        font-size: 26px;
    }


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


    .filtros-grupo {
        flex-direction: column;
        width: 100%;
    }

    #ordenar {
        width: 100%;
    }

    .categorias-select {
        width: 100%;
    }
    
    .localidades-select {
        width: 100%;
    }


  .productos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .producto {
        min-height: 320px;
        height: 100%;
    }

    .producto-imagen-contenedor {
        aspect-ratio: 1 / 1;
        padding: 8px;
        min-height: 100px;
        max-height: 140px;
    }

    .producto-info {
        padding: 10px;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .producto h2 {
        font-size: 13px;
        margin-bottom: 4px;
        line-height: 1.2;
    }

    .producto-categoria {
        font-size: 10px;
        margin-bottom: 4px;
    }

    .producto-descripcion {
        font-size: 11px;
        margin-bottom: 6px;
        line-height: 1.3;
    }

    .producto-info-propiedad {
        gap: 4px;
        margin-bottom: 4px;
    }

    .propiedad-localidad,
    .propiedad-tamanio {
        font-size: 10px;
        padding: 3px 6px;
    }

    .producto-precio {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .producto-boton {
        padding: 8px 10px;
        font-size: 12px;
    }

    .ver-mas-btn {
        padding: 4px 8px;
        font-size: 10px;
    }

    .producto-precio {
        font-size: 18px;
    }

    .producto-boton {
        font-size: 12px;
        padding: 9px 6px;
    }

}




/* =========================
   PAGINACIÓN
========================= */

.paginacion {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;

    margin-top: 35px;
    min-height: 42px;

    flex-wrap: wrap;
}


.pagina-btn {
    min-width: 40px;
    height: 40px;

    padding: 0 12px;

    border: 1px solid #ddd;
    border-radius: 8px;

    background: white;

    color: #222;

    cursor: pointer;

    font-size: 14px;

    transition:
        background 0.2s,
        color 0.2s,
        border-color 0.2s,
        opacity 0.2s;
}


.pagina-btn:hover:not(:disabled) {
    background: #eee;
}


.pagina-btn.activa {
    background: #222;
    color: white;
    border-color: #222;
}


.pagina-btn:disabled {
    opacity: 0.4;
    cursor: default;
}


.pagina-separador {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 40px;

    color: #777;
}


@media (max-width: 500px) {

    .paginacion {
        gap: 5px;
    }


    .pagina-btn {
        min-width: 38px;
        height: 38px;

        padding: 0 9px;
    }


    .pagina-anterior,
    .pagina-siguiente {
        font-size: 13px;
    }

}