/* Estilos para las imágenes de productos */

.product-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.product-image img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-image:hover img {
    transform: scale(1.05);
}

/* Imágenes específicas por categoría */
.product-image.laptop {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.product-image.smartphone {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.product-image.audio {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
}

.product-image.gaming {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
}

/* Placeholder para imágenes que no se han cargado */
.product-image-placeholder {
    font-size: 3rem;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Hero image styles */
.hero-image {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.hero-image img {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.hero-image:hover img {
    transform: scale(1.02);
}

/* Responsive images */
@media (max-width: 768px) {
    .product-image {
        height: 150px;
    }
    
    .hero-image img {
        max-width: 100%;
    }
}

/* Loading animation for images */
.image-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Optimización específica para imágenes de productos */

.product-img {
  /* Asegurar que las imágenes mantengan proporción */
  object-fit: cover;
  object-position: center;
  
  /* Mejorar la calidad visual */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  
  /* Transiciones suaves */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Sombra mejorada */
  box-shadow: 
    0 4px 16px rgba(61,90,254,0.08),
    0 2px 4px rgba(0,0,0,0.04);
}

/* Efecto hover mejorado */
.product-card:hover .product-img {
  transform: scale(1.05);
  box-shadow: 
    0 8px 24px rgba(61,90,254,0.12),
    0 4px 8px rgba(0,0,0,0.06);
}

/* Fallback para imágenes que no cargan */
.product-img[src*="hero-devices.png"] {
  object-fit: contain;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border: 2px dashed #cbd5e1;
}

/* Optimización para diferentes tipos de dispositivos */
@media (min-resolution: 2dppx) {
  .product-img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Mejoras para modo oscuro */
body.dark .product-img {
  background: #1a1a1a;
  box-shadow: 
    0 4px 16px rgba(61,90,254,0.12),
    0 2px 4px rgba(0,0,0,0.08);
}

body.dark .product-img[src*="hero-devices.png"] {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border: 2px dashed #404040;
}

/* Animación de carga para imágenes */
.product-img {
  animation: imageLoad 0.3s ease-out;
}

@keyframes imageLoad {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Mejoras para grid responsivo */
.products-grid {
  /* Asegurar que las tarjetas tengan el mismo tamaño */
  grid-auto-rows: 1fr;
}

.product-card {
  /* Asegurar que el contenido se distribuya correctamente */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Optimización para pantallas de alta densidad */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .product-img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
} 