/* ============================================
   UNIFIED PRODUCT CARD COMPONENT
   Premium E-commerce Design
   ============================================ */

/* Product Grid - Responsive */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* Tablet */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* Small tablet */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* Product Card - Premium Hover */
.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.product-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    transition: box-shadow 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.product-card:hover {
    transform: translateY(-8px);
    border-color: transparent;
    box-shadow: 
        0 20px 40px -12px rgba(0, 0, 0, 0.15),
        0 8px 16px -8px rgba(0, 0, 0, 0.1);
}

.product-card:hover::before {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}

/* Product Image - Zoom Effect */
.product-image {
    position: relative;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    overflow: hidden;
}

.product-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 60%,
        rgba(0, 0, 0, 0.02) 100%
    );
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-image::after {
    opacity: 0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* Product Badges - Staggered Animation */
.product-badges {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2;
}

.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: badgeSlideIn 0.3s ease forwards;
    transform: translateX(-10px);
    opacity: 0;
}

.badge:nth-child(1) { animation-delay: 0.05s; }
.badge:nth-child(2) { animation-delay: 0.1s; }
.badge:nth-child(3) { animation-delay: 0.15s; }

@keyframes badgeSlideIn {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.product-card:hover .badge {
    animation: badgeSlideIn 0.3s ease forwards;
}

.badge-sale {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.badge-new {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.badge-stock {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    font-size: 10px;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
}

.product-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* Product Quick Actions - Slide In */
.product-actions {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    transform: translateX(16px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 2;
}

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

.action-btn,
.product-action-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.1),
        0 2px 4px rgba(0, 0, 0, 0.06);
    color: var(--gray-700);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(8px);
}

.action-btn:hover,
.product-action-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1) translateY(-2px);
    box-shadow: 
        0 8px 20px rgba(37, 99, 235, 0.3),
        0 4px 8px rgba(37, 99, 235, 0.2);
}

.action-btn:active,
.product-action-btn:active {
    transform: scale(1.05);
}

/* Product Info */
.product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    background: var(--white);
    position: relative;
    z-index: 1;
}

.product-category {
    font-size: 11px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 600;
}

.product-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    min-height: 45px;
    transition: color 0.2s ease;
}

.product-name:hover {
    color: var(--primary);
}

/* Product Price Row */
.product-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 16px;
    gap: 12px;
    border-top: 1px solid var(--gray-100);
}

.product-price {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.current-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.5px;
}

.original-price {
    font-size: 14px;
    color: var(--gray-400);
    text-decoration: line-through;
    font-weight: 500;
}

/* Add to Cart Button - Premium */
.product-add-btn,
.add-cart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--gray-900);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.product-add-btn::before,
.add-cart-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.2) 0%,
        transparent 50%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-add-btn:hover,
.add-cart-btn:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 20px rgba(37, 99, 235, 0.3),
        0 4px 8px rgba(37, 99, 235, 0.2);
}

.product-add-btn:hover::before,
.add-cart-btn:hover::before {
    opacity: 1;
}

.product-add-btn:active,
.add-cart-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* Product Stock */
.product-stock {
    font-size: 12px;
    font-weight: 500;
    margin-top: 8px;
}

.in-stock {
    color: var(--success);
}

.out-of-stock {
    color: var(--danger);
}

/* No Image Placeholder */
.no-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: var(--gray-400);
    font-size: 48px;
}

/* ============================================
   MOBILE-SPECIFIC OVERRIDES
   ============================================ */

@media (max-width: 768px) {
    .products-grid {
        gap: 16px;
    }

    .product-card {
        border-radius: var(--radius);
    }

    .product-card:hover {
        transform: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .product-actions {
        opacity: 1;
        transform: none;
        flex-direction: row;
        top: auto;
        bottom: 140px;
        right: 12px;
    }

    .action-btn,
    .product-action-btn {
        width: 40px;
        height: 40px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .product-price-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .product-price {
        align-items: center;
    }

    .product-add-btn,
    .add-cart-btn {
        width: 100%;
        padding: 14px;
    }

    .product-info {
        padding: 16px;
    }

    .product-name {
        font-size: 14px;
        min-height: 42px;
    }

    .current-price {
        font-size: 18px;
    }

    .product-badges {
        top: 12px;
        left: 12px;
    }

    .product-badge {
        top: 12px;
        left: 12px;
    }

    .badge {
        padding: 4px 10px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        gap: 12px;
    }

    .product-info {
        padding: 14px;
    }

    .product-name {
        font-size: 13px;
        min-height: 39px;
        margin-bottom: 10px;
    }

    .current-price {
        font-size: 16px;
    }

    .original-price {
        font-size: 12px;
    }

    .product-add-btn,
    .add-cart-btn {
        padding: 12px;
        font-size: 12px;
    }

    .action-btn,
    .product-action-btn {
        width: 36px;
        height: 36px;
    }

    .product-actions {
        bottom: 130px;
        gap: 8px;
    }

    .badge {
        padding: 4px 8px;
        font-size: 9px;
    }

    .product-badge {
        padding: 4px 8px;
        font-size: 9px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) {
    .product-card:active {
        transform: scale(0.98);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .product-card:active .product-image img {
        transform: scale(1.02);
    }

    .product-actions {
        opacity: 1;
        transform: none;
    }

    .product-add-btn:active,
    .add-cart-btn:active {
        transform: scale(0.98);
    }
}
