/* ========================================
   PRODUCT CARDS ENHANCEMENT - MOTOPARTES TRICICLO
   Mejoras específicas para las cards de productos
   ======================================== */

/* ===== MEJORAS PARA CARDS DE PRODUCTOS ===== */

/* Mantener layout original de Bootstrap - Solo agregar espaciado */
.isotope-grid {
    margin: 2rem 0;
}

.isotope-grid .col-sm-6,
.isotope-grid .col-md-4,
.isotope-grid .col-lg-3 {
    margin-bottom: 2rem;
}

/* Card principal del producto */
.block2 {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    
    /* Animación de entrada */
    opacity: 0;
    transform: translateY(30px);
    animation: cardFadeIn 0.6s ease-out forwards;
}

/* Animación de entrada escalonada */
.block2:nth-child(1) { animation-delay: 0.1s; }
.block2:nth-child(2) { animation-delay: 0.2s; }
.block2:nth-child(3) { animation-delay: 0.3s; }
.block2:nth-child(4) { animation-delay: 0.4s; }
.block2:nth-child(5) { animation-delay: 0.5s; }
.block2:nth-child(6) { animation-delay: 0.6s; }
.block2:nth-child(7) { animation-delay: 0.7s; }
.block2:nth-child(8) { animation-delay: 0.8s; }

@keyframes cardFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover effect para la card */
.block2:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #717fe0;
}

/* Contenedor de imagen */
.block2-pic {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
}

/* Imagen del producto */
.block2-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.block2:hover .block2-pic img {
    transform: scale(1.05);
}

/* Botón "Ver producto" */
.block2-btn {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #717fe0 !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(113, 127, 224, 0.4);
    z-index: 10;
}

.block2:hover .block2-btn {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.block2-btn:hover {
    background: #5a6fd8 !important;
    color: white !important;
    transform: translateX(-50%) translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(113, 127, 224, 0.6);
}

/* Contenedor de información del producto */
.block2-txt {
    padding: 1.5rem;
    background: white;
}

/* Nombre del producto */
.block2-txt .stext-104 {
    color: #333 !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
    line-height: 1.4;
    transition: color 0.3s ease;
    text-decoration: none;
}

.block2-txt .stext-104:hover {
    color: #717fe0 !important;
}

/* Precio del producto */
.block2-txt .stext-105 {
    color: #717fe0 !important;
    font-weight: 700 !important;
    font-size: 1.3rem !important;
}

/* Botón agregar al carrito */
.block2-txt .js-addcart-detail {
    background: #f8f9fa !important;
    color: #717fe0 !important;
    border: 2px solid #e9ecef !important;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.block2-txt .js-addcart-detail:hover {
    background: #717fe0 !important;
    color: white !important;
    border-color: #717fe0 !important;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(113, 127, 224, 0.3);
}

/* Efecto de click */
.block2-txt .js-addcart-detail:active {
    transform: scale(0.95);
}

/* ===== OVERLAY CON INFORMACIÓN ADICIONAL ===== */
.block2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(113, 127, 224, 0.9), rgba(90, 111, 216, 0.9));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5;
    pointer-events: none;
}

.block2:hover::before {
    opacity: 0; /* Mantenemos el overlay desactivado para un diseño más limpio */
}

/* ===== RESPONSIVE DESIGN ADICIONAL ===== */
@media (max-width: 768px) {
    .block2 {
        height: 380px;
    }
    
    .block2-pic {
        height: 220px;
    }
    
    .block2-txt {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .block2 {
        height: 360px;
        margin: 0 auto;
        max-width: 320px;
    }
    
    .block2-pic {
        height: 200px;
    }
}

/* ===== ANIMACIONES ADICIONALES ===== */

/* Animación de pulso para el botón de carrito */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Aplicar pulso cuando se agrega al carrito */
.block2-txt .js-addcart-detail.added {
    animation: pulse 0.6s ease;
}

/* Animación de shimmer para loading */
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.block2.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* ===== MEJORAS DE ACCESIBILIDAD ===== */
.block2:focus-within {
    outline: 2px solid #717fe0;
    outline-offset: 4px;
}

.block2-txt .stext-104:focus,
.block2-btn:focus,
.block2-txt .js-addcart-detail:focus {
    outline: 2px solid #717fe0;
    outline-offset: 2px;
}

/* ===== ESTADOS DE PRODUCTO ===== */

/* Producto agotado */
.block2.out-of-stock {
    opacity: 0.7;
}

.block2.out-of-stock::after {
    content: 'AGOTADO';
    position: absolute;
    top: 15px;
    right: 15px;
    background: #dc3545;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
}

/* Producto en oferta */
.block2.on-sale::after {
    content: 'OFERTA';
    position: absolute;
    top: 15px;
    right: 15px;
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
}

/* Producto nuevo */
.block2.new-product::after {
    content: 'NUEVO';
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ffc107;
    color: #212529;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
}

/* ===== FEEDBACK VISUAL ===== */

/* Feedback para agregar al carrito */
.cart-feedback {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #28a745;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    z-index: 20;
    pointer-events: none;
    transition: all 0.3s ease;
}

.cart-feedback.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

/* ===== LOADING STATES ===== */
.block2-pic.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

.block2-pic img[src=""], 
.block2-pic img:not([src]) {
    opacity: 0;
}

/* ===== HOVER EFFECTS MEJORADOS ===== */
.block2 {
    cursor: pointer;
}

.block2:hover .block2-txt .stext-104 {
    color: #717fe0 !important;
}

.block2:hover .block2-txt .stext-105 {
    transform: scale(1.05);
}

/* ===== TRANSICIONES SUAVES ===== */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.block2 * {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
