/* css/product-card.css */
/* ===== Product Card Component ===== */
.product-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    text-decoration: none;
    border: 1px solid rgba(var(--primary-color-rgb), 0.08);
    box-shadow: 0 4px 16px rgba(var(--primary-color-rgb), 0.04);
    will-change: transform;
}

.product-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 40px rgba(var(--primary-color-rgb), 0.12);
    border-color: rgba(var(--primary-color-rgb), 0.15);
}

.product-card:hover .product-info h3 {
    color: var(--primary-color);
}

/* ===== Badges ===== */
.product-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 10;
    animation: fadeInDown 0.6s ease-out;
}

.product-badge span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all var(--transition-base);
}

.product-badge span i {
    font-size: 0.75rem;
}

.badge-top span {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a1a;
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.4);
}

.badge-popular span {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.badge-best span {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(17, 153, 142, 0.4);
}

.badge-featured span {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: #1a1a1a;
    box-shadow: 0 4px 16px rgba(250, 112, 154, 0.4);
}

.product-badge:hover span {
    transform: scale(1.08) rotate(-2deg);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Imagen con efecto halo ===== */
.product-image {
    position: relative;
    height: 350px;
    overflow: hidden;
    background: radial-gradient(circle at center, #fafbfc 0%, #f1f3f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    contain: layout;
}

.product-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70%;
    height: 70%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(var(--primary-color-rgb), 0.15) 0%, transparent 70%);
    filter: blur(40px);
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
    z-index: 1;
}

.product-card:hover .product-glow {
    opacity: 1;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: 24px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
    will-change: transform;
}

.product-card:hover .primary-img {
    transform: scale(1.08) translateZ(0);
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.15));
}

/* ===== Botón de carrito ===== */
.product-actions {
    position: absolute;
    bottom: 20px;
    right: 20px;
    left: 20px;
    display: flex;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateY(0);
}

.product-actions .action-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: var(--white);
    border: none;
    padding: 14px 32px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 20px rgba(var(--primary-color-rgb), 0.3);
    position: relative;
    overflow: hidden;
    min-width: 180px;
}

.product-actions .action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.product-actions .action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(var(--primary-color-rgb), 0.4);
}

.product-actions .action-btn:hover::before {
    left: 100%;
}

.product-actions .action-btn:active {
    transform: translateY(-1px);
}

.product-actions .action-btn i {
    font-size: 1.1rem;
    transition: transform var(--transition-fast);
}

.product-actions .action-btn:hover i {
    transform: scale(1.15);
    animation: cartBounce 0.6s ease-in-out;
}

.product-actions .btn-text {
    font-family: 'Poppins', sans-serif;
    letter-spacing: 0.02em;
}

.product-actions .action-btn.adding {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    pointer-events: none;
}

.product-actions .action-btn.adding i {
    animation: spin 0.6s linear infinite;
}

@keyframes cartBounce {
    0%, 100% { transform: scale(1.15); }
    50% { transform: scale(1.25) translateY(-2px); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== Información del producto ===== */
.product-info {
    padding: var(--spacing-lg);
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.8));
}

.product-info h3 {
    font-size: 0.9rem;
    margin-bottom: var(--spacing-sm);
    color: var(--gray-800);
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    transition: color var(--transition-base);
}

.product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-info .price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin: 0;
    font-family: 'Poppins', sans-serif;
}

.product-info .price .currency {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary-color);
}

.product-info .price .amount {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: -0.01em;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .product-image {
        height: 240px;
    }
}

@media (max-width: 767px) {
    .product-card {
        border-radius: 16px;
    }

    .product-image {
        height: 180px;
    }
    
    .product-image img {
        padding: 16px;
    }
    
    .product-glow {
        width: 60%;
        height: 60%;
    }
    
    .product-badge {
        top: 12px;
        left: 12px;
    }
    
    .product-badge span {
        padding: 6px 12px;
        font-size: 0.65rem;
        gap: 4px;
    }
    
    .product-badge span i {
        font-size: 0.7rem;
    }
    
    .product-info {
        padding: var(--spacing-sm);
    }
    
    .product-info h3 {
        font-size: 0.8rem;
        margin-bottom: var(--spacing-xs);
        -webkit-line-clamp: 2;
    }

    .product-info .price .currency {
        font-size: 0.75rem;
    }

    .product-info .price .amount {
        font-size: 1.1rem;
    }
    
    .product-actions {
        bottom: 12px;
        right: 12px;
        left: 12px;
    }
    
    .product-actions .action-btn {
        padding: 12px 24px;
        font-size: 0.85rem;
        min-width: 140px;
        gap: 8px;
        box-shadow: 0 6px 16px rgba(var(--primary-color-rgb), 0.25);
    }
    
    .product-actions .action-btn i {
        font-size: 1rem;
    }
    
    .product-actions .btn-text {
        font-size: 0.85rem;
    }
}

@media (max-width: 575px) {
    .product-card {
        max-width: 400px;
        margin: 0 auto;
    }

    .product-image {
        height: 200px;
    }
    
    .product-info h3 {
        font-size: 0.85rem;
    }

    .product-info .price .amount {
        font-size: 1.15rem;
    }
    
    .product-actions .action-btn {
        min-width: 160px;
        padding: 14px 28px;
        font-size: 0.9rem;
    }
}

/* ===== Accesibilidad ===== */
.product-card:focus,
.product-actions .action-btn:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 4px;
}
