/* ============================================
   NEXT-GENERATION PRODUCT CARD STYLES
   Modern, smooth, delightful interactions
   ============================================ */

:root {
    /* Colors from header */
    --primary: #1a73e8;
    --primary-hover: #1557b0;
    --secondary: #febd69;
    --secondary-hover: #f0b454;
    --success: #34a853;
    --dark: #232f3e;
    --gray: #5f6368;
    --gray-light: #e7e7e7;
    --white: #ffffff;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 12px 24px rgba(0,0,0,0.15);
    
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   PRODUCT CARD CONTAINER
   ============================================ */

.nextgen-product-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.nextgen-product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   PRODUCT IMAGE
   ============================================ */

.product-image-container {
    position: relative;
    padding-top: 100%; /* 1:1 aspect ratio */
    overflow: hidden;
    background: #f8f9fa;
}

.product-image-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: transform var(--transition-base);
}

.nextgen-product-card:hover .product-image {
    transform: scale(1.08);
}

/* ============================================
   BADGES
   ============================================ */

.product-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.badge-discount {
    background: linear-gradient(135deg, #ea4335 0%, #d32f2f 100%);
    color: white;
}

.badge-new {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
}

.badge-hot {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ============================================
   QUICK ACTIONS OVERLAY
   ============================================ */

.product-quick-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateX(10px);
    transition: all var(--transition-base);
}

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

.quick-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.quick-action-btn:hover {
    transform: scale(1.1);
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.quick-action-btn i {
    font-size: 18px;
    color: var(--dark);
}

.wishlist-btn:hover i {
    color: #ea4335;
}

.wishlist-btn.active i {
    color: #ea4335;
    font-weight: 900;
}

.quick-view-btn:hover i {
    color: var(--primary);
}

.share-btn:hover i {
    color: var(--success);
}

/* ============================================
   SHIPPING BADGE
   ============================================ */

.shipping-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: linear-gradient(135deg, var(--success) 0%, #2d8e47 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(52, 168, 83, 0.3);
}

.shipping-badge i {
    font-size: 14px;
}

/* ============================================
   PRODUCT INFO
   ============================================ */

.product-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-name-link {
    text-decoration: none;
    color: inherit;
}

.product-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--dark);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--transition-fast);
}

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

/* ============================================
   RATING
   ============================================ */

.product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stars {
    display: flex;
    gap: 2px;
}

.stars i {
    font-size: 14px;
    color: #ffa41c;
}

.rating-count {
    font-size: 12px;
    color: var(--gray);
}

/* ============================================
   PRICE
   ============================================ */

.product-price {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.current-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
}

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

/* ============================================
   STOCK WARNING
   ============================================ */

.stock-warning {
    font-size: 12px;
    color: #ea4335;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.stock-warning i {
    font-size: 14px;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */

.product-actions {
    padding: 0 16px 16px;
    display: flex;
    gap: 8px;
}

.btn-add-to-cart {
    flex: 1;
    height: 44px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

/* Add to Cart Button */
.btn-add-to-cart {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-add-to-cart:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-add-to-cart:active {
    background: var(--primary);
    transform: translateY(0);
}



/* Button States */
.btn-loading,
.btn-success {
    display: none;
}

.btn-add-to-cart.loading .btn-text,
.btn-add-to-cart.loading .btn-icon {
    display: none;
}

.btn-add-to-cart.loading .btn-loading {
    display: inline-flex;
}

.btn-add-to-cart.success {
    background: var(--success);
    color: white;
}

.btn-add-to-cart.success .btn-text,
.btn-add-to-cart.success .btn-icon {
    display: none;
}

.btn-add-to-cart.success .btn-success {
    display: inline-flex;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Ripple Effect */
.btn-add-to-cart::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-add-to-cart:active::after {
    width: 300px;
    height: 300px;
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */

@media (max-width: 767px) {
    .nextgen-product-card {
        border-radius: 8px;
    }
    
    .product-quick-actions {
        opacity: 1;
        transform: translateX(0);
    }
    
    .quick-action-btn {
        width: 36px;
        height: 36px;
    }
    
    .quick-action-btn i {
        font-size: 16px;
    }
    
    .product-info {
        padding: 12px;
    }
    
    .product-name {
        font-size: 13px;
    }
    
    .current-price {
        font-size: 18px;
    }
    
    .product-actions {
        padding: 0 12px 12px;
        flex-direction: column;
    }
    
    .btn-add-to-cart {
        width: 100%;
    }
}

/* ============================================
   LOADING SKELETON
   ============================================ */

.product-skeleton {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.skeleton-image {
    padding-top: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-text {
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin: 8px 16px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.long {
    width: 100%;
}

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

/* ============================================
   ACCESSIBILITY
   ============================================ */

.nextgen-product-card:focus-within {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn-add-to-cart:focus,
.quick-action-btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
