.contenedor-productos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 30px;
    background-color: #ffffff;
    flex: 1;         /* <-- esto es clave: ocupa todo el espacio restante */
    min-width: 0;
}

/* --- ANIMACIÓN DE ENTRADA --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(28px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
* {
    font-family: 'Lora', serif !important;
}

/* --- Tarjeta de Producto --- */
.tarjeta-producto {
    background-color: #ffff;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;

    /* Animación de entrada */
    opacity: 0;
    animation: fadeInUp 0.55s ease forwards;
}

/* Delays escalonados para las primeras 12 tarjetas */
.tarjeta-producto:nth-child(1)  { animation-delay: 0.05s; }
.tarjeta-producto:nth-child(2)  { animation-delay: 0.10s; }
.tarjeta-producto:nth-child(3)  { animation-delay: 0.15s; }
.tarjeta-producto:nth-child(4)  { animation-delay: 0.20s; }
.tarjeta-producto:nth-child(5)  { animation-delay: 0.25s; }
.tarjeta-producto:nth-child(6)  { animation-delay: 0.30s; }
.tarjeta-producto:nth-child(7)  { animation-delay: 0.35s; }
.tarjeta-producto:nth-child(8)  { animation-delay: 0.40s; }
.tarjeta-producto:nth-child(9)  { animation-delay: 0.45s; }
.tarjeta-producto:nth-child(10) { animation-delay: 0.50s; }
.tarjeta-producto:nth-child(11) { animation-delay: 0.55s; }
.tarjeta-producto:nth-child(12) { animation-delay: 0.60s; }
/* Las que pasen de 12 aparecen todas juntas sin delay extra */
.tarjeta-producto:nth-child(n+13) { animation-delay: 0.60s; }

/* --- EFECTO HOVER DE LA TARJETA --- */
.tarjeta-producto:hover {
    border-color: #d4af37;
    box-shadow: 0 10px 20px rgba(255, 0, 255, 0.1);
}

.tarjeta-producto:hover .btn-detalles {
    background-color: #e600e6;
}

/* --- CONTENEDOR DE IMAGEN (necesario para posicionar el carrito) --- */
.imagen-wrapper {
    position: relative;
    width: 100%;
    height: 350px;
    overflow: hidden;
    flex-shrink: 0;
}

/* --- LÓGICA DE LAS IMÁGENES (CAMBIO GRADUAL) --- */
.img-principal, .img-hover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.6s ease-in-out;
}

.img-hover {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    opacity: 0;
}

.img-principal {
    position: relative;
    z-index: 1;
    opacity: 1;
}

.tarjeta-producto:hover .img-hover {
    opacity: 1;
}

.tarjeta-producto:hover .img-principal {
    opacity: 0;
}

/* --- BOTÓN CARRITO FLOTANTE --- */
.btn-carrito {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 10;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: #e600e6;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    transition: background-color 0.3s ease, transform 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    opacity: 0;
    transform: scale(0.8);
}

/* El carrito aparece suavemente al hacer hover en la tarjeta */
.tarjeta-producto:hover .btn-carrito {
    opacity: 1;
    transform: scale(1);
}

.btn-carrito:hover {
    background-color: #d4af37;
    transform: scale(1.1);
}

.btn-carrito svg {
    width: 20px;
    height: 20px;
    fill: #ffffff;
    pointer-events: none;
}

/* --- BLOQUE DE INFORMACIÓN (Texto) --- */
.tarjeta-producto h3, .tarjeta-producto p {
    pointer-events: none;
}

.tarjeta-producto > :not(.imagen-wrapper) {
    padding: 15px 15px 0 15px;
}

/* Nombre del Producto */
.tarjeta-producto h3 {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #1a1a1a;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.4;
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Precio (Dorado) */
.tarjeta-producto p {
    color: #d4af37;
    font-size: 1.1rem;
    font-weight: bold;
    margin: 0 0 15px 0;
}

/* Botón "Ver detalles" (Fucsia) */
.tarjeta-producto a.btn-detalles {
    display: block;
    text-align: center;
    background-color: #e600e6;
    color: #ffffff;
    text-decoration: none;
    padding: 12px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    margin-top: auto;
    transition: background-color 0.3s ease;
}

.tarjeta-producto a.btn-detalles:hover {
    background-color: #cc00cc;
}

/* --- PRECIOS --- */
.contenedor-precio {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.precio-original-tachado {
    text-decoration: line-through;
    color: #888;
    font-size: 0.9rem;
}

.precio-descuento-rojo {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.3rem;
}

.precio-normal {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

/* --- TÍTULO DE SECCIÓN (usado en ofertas) --- */
.titulo-seccion {
    width: 100%;
    text-align: center;
    color: #1a1a1a;
    margin: 30px 0 10px 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 1.5rem;
    letter-spacing: 2px;
}

/* ========================================
   SIDEBAR FILTROS — PC
   ======================================== */
.shop-container {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    padding: 30px;
}

.sidebar-filtros {
    width: 200px;
    flex-shrink: 0;
    background-color: #fff;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    padding: 20px;
    position: sticky;
    top: 20px;
}
.filtro-grupo {
    margin-bottom: 20px;
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 16px;
}

.filtro-grupo:last-of-type {
    border-bottom: none;
}

.filtro-grupo h4 {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #1a1a1a;
    margin: 0 0 12px 0;
}

.filtro-grupo select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #1a1a1a;
    background-color: #fff;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease;
}

.filtro-grupo select:focus {
    border-color: #e600e6;
}

.filtro-grupo label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #444;
    margin-bottom: 8px;
    cursor: pointer;
}

.filtro-grupo label:hover {
    color: #e600e6;
}

.filtro-grupo input[type="radio"] {
    accent-color: #e600e6;
    cursor: pointer;
}

/* --- Filtro de colores --- */
.contenedor-colores-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.btn-color-filtro {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid #eaeaea;
    border-radius: 20px;
    font-size: 0.75rem;
    color: #444;
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.btn-color-filtro:hover,
.btn-color-filtro.activo {
    border-color: #e600e6;
    color: #e600e6;
}

/* --- Botones aplicar / limpiar --- */
.btn-aplicar {
    display: block;
    width: 100%;
    padding: 10px;
    background-color: #e600e6;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    margin-bottom: 8px;
    transition: background-color 0.3s ease;
}

.btn-aplicar:hover {
    background-color: #cc00cc;
}

.btn-limpiar {
    display: block;
    width: 100%;
    padding: 10px;
    text-align: center;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.btn-limpiar:hover {
    border-color: #e600e6;
    color: #e600e6;
}

/* Botón abrir filtros: oculto en PC */
.btn-abrir-filtros {
    display: none;
}
/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .shop-container {
        flex-direction: column;
        padding: 20px;
        gap: 16px;
    }

    .sidebar-filtros {
        width: 100%;
        position: static;
        display: none;
    }

    .sidebar-filtros.abierto {
        display: block;
    }

    .btn-abrir-filtros {
        display: block;
        width: 100%;
        padding: 10px 16px;
        background-color: #fff;
        border: 1px solid #eaeaea;
        border-radius: 4px;
        font-size: 0.85rem;
        font-weight: 700;
        text-align: left;
        cursor: pointer;
        letter-spacing: 0.5px;
        transition: border-color 0.2s ease;
    }

    .btn-abrir-filtros:hover {
        border-color: #e600e6;
    }
}

@media (max-width: 700px) {
    .shop-container {
        padding: 12px;
        gap: 12px;
    }

    .contenedor-productos {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
        padding: 15px;
    }

    .imagen-wrapper {
        height: 250px;
    }

    .tarjeta-producto h3 {
        font-size: 0.9rem;
        padding: 10px 10px 0 10px;
    }

    .tarjeta-producto p {
        font-size: 1rem;
        padding: 0 10px 10px 10px;
    }

    .tarjeta-producto a.btn-detalles {
        padding: 10px;
        font-size: 0.7rem;
    }

    .btn-carrito {
        opacity: 1;
        transform: scale(1);
        width: 36px;
        height: 36px;
    }

    .btn-carrito svg {
        width: 17px;
        height: 17px;
    }

    .filtro-grupo h4 {
        font-size: 0.75rem;
    }

    .btn-aplicar,
    .btn-limpiar {
        font-size: 0.75rem;
        padding: 9px;
    }
}

@media (max-width: 400px) {
    .contenedor-productos {
        gap: 10px;
        padding: 10px;
    }

    .imagen-wrapper {
        height: 200px;
    }
}