/* VARIABLES DE COLOR */
:root {
    --color-primario: #020c1b;
    --color-secundario: #0a192f;
    --color-acento: #64ffda;
    --color-acento-secundario: #00d4ff;
    --color-plata: #ccd6f6;
    --color-gris: #8892b0;
    --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --glow-color: rgba(100, 255, 218, 0.6);
    --glow-color-secundario: rgba(0, 212, 255, 0.5);
    --glass-bg: rgba(17, 34, 64, 0.75);
    --glass-border: rgba(100, 255, 218, 0.2);
    --neon-gradient: linear-gradient(135deg, #64ffda 0%, #00d4ff 100%);
}

/* CONTENEDOR PRINCIPAL */
.productos {
    padding: 60px 8%;
    background: var(--color-primario);
    position: relative;
    overflow: hidden;
}

.productos::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 80%, rgba(100, 255, 218, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(0, 212, 255, 0.08) 0%, transparent 50%);
    animation: backgroundPulse 15s ease-in-out infinite;
    pointer-events: none;
}

@keyframes backgroundPulse {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(2%, 2%) rotate(1deg); }
    50% { transform: translate(0, 4%) rotate(0deg); }
    75% { transform: translate(-2%, 2%) rotate(-1deg); }
}

.contenedor-productos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    position: relative;
    z-index: 1;
}

/* TARJETA DE PRODUCTO */
.producto {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 24px;
    position: relative;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(15px);
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    animation: fadeInUp 0.8s ease forwards;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.producto::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--neon-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.producto::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--neon-gradient);
    border-radius: 26px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
    filter: blur(20px);
}

.producto:hover {
    transform: translateY(-20px) scale(1.03);
    border-color: var(--color-acento);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8), 
                0 0 50px var(--glow-color),
                0 0 100px var(--glow-color-secundario);
}

.producto:hover::before {
    transform: scaleX(1);
}

.producto:hover::after {
    opacity: 0.5;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* IMAGEN */
.producto img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 20px;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s ease;
    filter: brightness(0.9) saturate(1.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    position: relative;
}

.producto:hover img {
    transform: scale(1.12) rotate(1deg);
    filter: brightness(1.1) saturate(1.2);
    box-shadow: 0 16px 40px rgba(100, 255, 218, 0.3);
}

/* SKELETON LOADING */
.producto img {
    background: linear-gradient(90deg, #112240 25%, #1a2f4d 50%, #112240 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* TEXTOS Y TIPOGRAFÍA */
.producto-categoria {
    font-size: 0.9rem;
    color: var(--color-acento);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 8px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 0 20px var(--glow-color);
}

.categoria-icon {
    width: 18px;
    height: 18px;
    fill: var(--color-acento);
    filter: drop-shadow(0 0 8px var(--glow-color));
}

.producto h3 {
    font-size: 1.1rem;
    color: var(--color-plata);
    margin-bottom: 12px;
    line-height: 1.3;
    font-weight: 800;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    letter-spacing: -0.5px;
}

.producto:hover h3 {
    color: #fff;
    text-shadow: 0 0 30px var(--glow-color);
}

/* SECCIÓN DE PRECIO Y SKU */
.grid-detalles {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding: 18px 0;
    border-top: 1px solid rgba(100, 255, 218, 0.1);
    background: linear-gradient(90deg, rgba(100, 255, 218, 0.08) 0%, transparent 100%);
    border-radius: 12px;
    padding: 14px 18px;
}

.grid-detalles p {
    color: var(--color-acento);
    font-weight: 900;
    font-size: 1.1rem;
    text-shadow: 0 0 25px var(--glow-color);
    letter-spacing: -0.5px;
}

.sku {
    font-size: 0.9rem;
    color: var(--color-gris);
    background: linear-gradient(135deg, rgba(100, 255, 218, 0.15), rgba(0, 212, 255, 0.15));
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(100, 255, 218, 0.3);
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* BOTÓN DE ACCIÓN */
.btn-accion {
    width: 100%;
    padding: 18px;
    background: var(--neon-gradient);
    border: none;
    color: var(--color-primario);
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    margin-top: 16px;
    box-shadow: 0 8px 25px rgba(100, 255, 218, 0.4);
}

.btn-accion::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
}

.btn-accion::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    opacity: 0;
    transform: scale(0);
    transition: all 0.6s ease;
}

.btn-accion:hover::before {
    left: 100%;
}

.btn-accion:hover::after {
    opacity: 1;
    transform: scale(1);
}

.btn-accion:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 40px rgba(100, 255, 218, 0.6), 
                0 0 60px var(--glow-color);
}

.btn-accion:active {
    transform: translateY(-2px) scale(0.98);
}

/* DISTINTIVOS (BADGES) */
.badge-stock {
    position: absolute;
    top: 35px;
    right: 35px;
    background: var(--neon-gradient);
    color: var(--color-primario);
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 900;
    border-radius: 25px;
    border: none;
    z-index: 10;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 25px rgba(100, 255, 218, 0.5);
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { 
        box-shadow: 0 8px 25px rgba(100, 255, 218, 0.5);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 8px 35px rgba(100, 255, 218, 0.7);
        transform: scale(1.05);
    }
}

.badge-stock:hover {
    transform: scale(1.15) rotate(-3deg);
    box-shadow: 0 12px 40px rgba(100, 255, 218, 0.8);
}

/* AJUSTES PARA TABLETAS Y MÓVILES */
@media (max-width: 992px) {
    .contenedor-productos {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .producto {
        padding: 20px;
    }
    
    .producto img {
        height: 240px;
    }
}

@media (max-width: 600px) {
    .contenedor-productos {
        grid-template-columns: 1fr;
        padding: 0 15px;
        gap: 20px;
    }
    
    .producto {
        padding: 20px;
        border-radius: 20px;
    }
    
    .producto img {
        height: 220px;
        border-radius: 14px;
    }
    
    .badge-stock {
        top: 30px;
        right: 30px;
        padding: 6px 12px;
        font-size: 0.65rem;
    }
    
    .producto h3 {
        font-size: 1.15rem;
    }
    
    .grid-detalles p {
        font-size: 1.1rem;
    }
    
    .btn-accion {
        padding: 16px;
        font-size: 1rem;
    }
}

/* DELAY PARA ANIMACIÓN EN CASCADA */
.producto:nth-child(1) { animation-delay: 0.1s; }
.producto:nth-child(2) { animation-delay: 0.2s; }
.producto:nth-child(3) { animation-delay: 0.3s; }
.producto:nth-child(4) { animation-delay: 0.4s; }
.producto:nth-child(5) { animation-delay: 0.5s; }
.producto:nth-child(6) { animation-delay: 0.6s; }
.producto:nth-child(7) { animation-delay: 0.7s; }
.producto:nth-child(8) { animation-delay: 0.8s; }
.producto:nth-child(9) { animation-delay: 0.9s; }
.producto:nth-child(10) { animation-delay: 1.0s; }
.producto:nth-child(11) { animation-delay: 1.1s; }
.producto:nth-child(12) { animation-delay: 1.2s; }
.producto:nth-child(13) { animation-delay: 1.3s; }
.producto:nth-child(14) { animation-delay: 1.4s; }
.producto:nth-child(15) { animation-delay: 1.5s; }
.producto:nth-child(16) { animation-delay: 1.6s; }

/* EFECTO DE PARTÍCULAS FLOTANTES */
.producto::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(100, 255, 218, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    top: -50px;
    right: -50px;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.producto:hover::after {
    opacity: 1;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(10px, 10px); }
}
