/* ============================================
   ANIMACIONES - NEÓN Y TECNOLÓGICAS
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes neonPulse {
    0%, 100% {
        text-shadow: 0 0 5px var(--neon-cyan), 0 0 10px var(--neon-cyan);
    }
    50% {
        text-shadow: 0 0 15px var(--neon-cyan), 0 0 25px var(--neon-cyan), 0 0 35px var(--neon-purple);
    }
}

@keyframes borderGlow {
    0%, 100% {
        border-color: rgba(0, 243, 255, 0.3);
        box-shadow: 0 0 5px rgba(0, 243, 255, 0.2);
    }
    50% {
        border-color: rgba(0, 243, 255, 0.8);
        box-shadow: 0 0 20px rgba(0, 243, 255, 0.5);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Clases de animación */
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.6s ease-out forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.5s ease-out forwards;
}

.animate-neon-pulse {
    animation: neonPulse 2s ease-in-out infinite;
}

.animate-border-glow {
    animation: borderGlow 2s ease-in-out infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-spin-slow {
    animation: spin-slow 8s linear infinite;
}

/* Clase para shimmer en texto */
.shimmer-text {
    background: linear-gradient(90deg, 
        var(--neon-cyan) 0%, 
        var(--neon-pink) 50%, 
        var(--neon-cyan) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shimmer 3s linear infinite;
}

/* Transiciones generales */
.transition-smooth {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 30px -15px rgba(0, 243, 255, 0.3);
}

/* Loading spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 243, 255, 0.2);
    border-top-color: var(--neon-cyan);
    border-radius: 50%;
    animation: spin-slow 1s linear infinite;
}

/* Pulse animation */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ============================================
   IMÁGENES UNIFORMES Y BORDES PARA TARJETAS
   ============================================ */

/* 1. Contenedor de imágenes con aspecto fijo y fondo de respaldo */
.card .relative,
.product-card .product-image,
.bebida-card .relative,
.drink-promo-card .relative,
[onclick*="openProductDetail"] {
    position: relative;
    background: linear-gradient(135deg, #1a1a1f, #0a0a0f);
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

/* Imágenes dentro de tarjetas - relación 4:3 */
.card img,
.product-card img,
.bebida-card img,
.drink-promo-card img,
[onclick*="openProductDetail"] img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    background: linear-gradient(135deg, #2a2a2f, #1a1a1f);
}

/* Fallback visual mientras carga la imagen */
.card img[src=""],
.card img:not([src]),
.card img[src*="undefined"],
.bebida-card img[src=""],
.bebida-card img:not([src]) {
    opacity: 0.6;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2345A29E"><path d="M3 3h18v18H3V3zm2 2v14h14V5H5zm2 2h10v2H7V7zm0 4h10v2H7v-2zm0 4h7v2H7v-2z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 48px;
}

/* 2. TARJETAS CON BORDE Y FONDO UNIFORME */
.card,
.product-card,
.bebida-card,
.drink-promo-card,
.bg-metal-900\/50 {
    background: linear-gradient(145deg, rgba(26, 30, 38, 0.95), rgba(18, 22, 28, 0.95)) !important;
    border: 1px solid rgba(69, 162, 158, 0.25) !important;
    border-radius: 16px !important;
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

/* Borde más notorio en hover */
.card:hover,
.product-card:hover,
.bebida-card:hover,
.drink-promo-card:hover {
    border-color: rgba(102, 252, 241, 0.5) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(102, 252, 241, 0.1) !important;
    transform: translateY(-3px);
}

/* 3. Ajuste para modo claro */
body.light-mode .card,
body.light-mode .product-card,
body.light-mode .bebida-card,
body.light-mode .drink-promo-card {
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

body.light-mode .card:hover,
body.light-mode .product-card:hover,
body.light-mode .bebida-card:hover {
    border-color: #2E7D64 !important;
    box-shadow: 0 8px 20px rgba(46, 125, 100, 0.1) !important;
}

/* 4. Títulos dentro de tarjetas con mejor contraste */
.card h3,
.product-card .product-title,
.bebida-card h3,
.drink-promo-card h3 {
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

/* Descripciones */
.card p,
.product-card .product-desc,
.bebida-card p {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 5. Precios destacados */
.card .text-neon-blue,
.product-card .product-price,
.bebida-card .text-neon-blue {
    font-family: 'Orbitron', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #45A29E, #66FCF1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

body.light-mode .card .text-neon-blue,
body.light-mode .product-card .product-price {
    background: linear-gradient(135deg, #2E7D64, #1A5D4A);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* 6. Botón de agregar al carrito dentro de tarjetas */
.card button,
.product-card .add-btn,
.bebida-card button {
    background: linear-gradient(135deg, #45A29E, #2E7D64);
    border: none;
    border-radius: 40px;
    padding: 6px 14px;
    font-family: 'Orbitron', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.card button:hover,
.product-card .add-btn:hover,
.bebida-card button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(69, 162, 158, 0.5);
}

/* 7. IMAGEN DE FALLBACK GLOBAL (JavaScript) */
/* En caso de que la imagen falle, se aplica este estilo via JS */
img.errored {
    content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2345A29E"><path d="M3 3h18v18H3V3zm2 2v14h14V5H5zm2 2h10v2H7V7zm0 4h10v2H7v-2zm0 4h7v2H7v-2z"/></svg>');
    object-fit: contain;
    background: #1a1a1f;
}

/* 8. Ajuste responsivo para móvil */
@media (max-width: 640px) {
    .card img,
    .product-card img,
    .bebida-card img {
        aspect-ratio: 16 / 11;
    }
    
    .card h3,
    .product-card .product-title,
    .bebida-card h3 {
        font-size: 0.85rem;
    }
    
    .card .text-neon-blue,
    .product-card .product-price {
        font-size: 1rem;
    }
    
    .card button,
    .bebida-card button {
        padding: 5px 12px;
        font-size: 0.65rem;
    }
}

/* 9. Sombra de imagen para dar profundidad */
.card img,
.bebida-card img {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* 10. Efecto de brillo sutil en bordes de tarjeta */
.card::after,
.product-card::after,
.bebida-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 16px;
    pointer-events: none;
    transition: opacity 0.3s;
    opacity: 0;
}

.card:hover::after,
.product-card:hover::after,
.bebida-card:hover::after {
    opacity: 1;
}