/* ============================================
   MODERN PRODUCT CARD REDESIGN
   Premium E-Commerce Card Design
   ============================================ */

:root {
    --card-primary: #667eea;
    --card-primary-dark: #5568d3;
    --card-success: #10b981;
    --card-danger: #ef4444;
    --card-warning: #f59e0b;
    --card-info: #3b82f6;
    --card-gray-50: #f9fafb;
    --card-gray-100: #f3f4f6;
    --card-gray-200: #e5e7eb;
    --card-gray-300: #d1d5db;
    --card-gray-600: #4b5563;
    --card-gray-700: #374151;
    --card-gray-900: #111827;
    --card-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --card-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --card-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ============================================
   MAIN CARD CONTAINER
   ============================================ */

.modern-product-card {
    position: relative;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--card-transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--card-gray-200);
}

.modern-product-card:hover {
    box-shadow: var(--card-shadow-xl);
    transform: translateY(-8px);
    border-color: var(--card-primary);
}

/* ============================================
   IMAGE SECTION
   ============================================ */

.modern-product-card__image-wrapper {
    position: relative;
    background: var(--card-gray-50);
    overflow: hidden;
}

.modern-product-card__image-link {
    display: block;
    text-decoration: none;
}

.modern-product-card__image-container {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    overflow: hidden;
}

.modern-product-card__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 16px;
}

.modern-product-card:hover .modern-product-card__image {
    transform: scale(1.1);
}

/* Image Overlay */
.modern-product-card__image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--card-transition);
    z-index: 2;
}

.modern-product-card:hover .modern-product-card__image-overlay {
    opacity: 1;
    visibility: visible;
}

.modern-product-card__view-details {
    color: white;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    backdrop-filter: blur(10px);
    transform: translateY(10px);
    transition: var(--card-transition);
}

.modern-product-card:hover .modern-product-card__view-details {
    transform: translateY(0);
}

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

.modern-product-card__badges {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: calc(100% - 80px); /* Leave space for quick actions */
}

.modern-product-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    animation: badge-appear 0.4s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes badge-appear {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.modern-product-card__badge--discount {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
}

.modern-product-card__badge--new {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modern-product-card__badge--out-of-stock {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

.modern-product-card__badge--low-stock {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    color: white;
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.85;
        transform: scale(1.02);
    }
}

/* ============================================
   QUICK ACTIONS (Wishlist, Quick View, Compare)
   ============================================ */

.modern-product-card__quick-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateX(10px);
    transition: var(--card-transition);
}

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

.modern-product-card__action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: white;
    color: var(--card-gray-700);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--card-transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 16px;
}

.modern-product-card__action-btn:hover {
    transform: scale(1.1);
    background: var(--card-primary);
    color: white;
}

.modern-product-card__action-btn--wishlist.active {
    background: #ff6b6b;
    color: white;
}

.modern-product-card__action-btn--wishlist.active:hover {
    background: #ee5a6f;
}

/* ============================================
   CONTENT SECTION
   ============================================ */

.modern-product-card__content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

/* Meta (Category/Brand + Seller Badge) */
.modern-product-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.modern-product-card__brand,
.modern-product-card__category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--card-primary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--card-transition);
    padding: 4px 10px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
}

.modern-product-card__brand:hover,
.modern-product-card__category:hover {
    background: var(--card-primary);
    color: white;
}

.modern-product-card__seller-badge {
    font-size: 16px;
    color: var(--card-gray-600);
    transition: var(--card-transition);
}

.modern-product-card__seller-badge:hover {
    color: var(--card-primary);
    transform: scale(1.1);
}

/* Title */
.modern-product-card__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    min-height: 44px;
}

.modern-product-card__title a {
    color: var(--card-gray-900);
    text-decoration: none;
    transition: var(--card-transition);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.modern-product-card__title a:hover {
    color: var(--card-primary);
}

/* Rating */
.modern-product-card__rating {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.modern-product-card__stars {
    display: flex;
    gap: 2px;
}

.modern-product-card__stars i {
    font-size: 14px;
    color: #fbbf24;
}

.modern-product-card__stars i.far {
    color: var(--card-gray-300);
}

.modern-product-card__rating-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--card-gray-900);
}

.modern-product-card__rating-count,
.modern-product-card__rating-text {
    font-size: 12px;
    color: var(--card-gray-600);
}

/* Price Section */
.modern-product-card__price-section {
    padding: 12px 0;
    border-top: 1px solid var(--card-gray-200);
    border-bottom: 1px solid var(--card-gray-200);
}

.modern-product-card__price-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modern-product-card__price-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.modern-product-card__price {
    font-size: 24px;
    font-weight: 800;
    color: var(--card-primary);
    line-height: 1;
}

.modern-product-card__price--sale {
    font-size: 28px;
    background: linear-gradient(135deg, var(--card-primary) 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modern-product-card__price--original {
    font-size: 16px;
    font-weight: 500;
    color: var(--card-gray-600);
    text-decoration: line-through;
}

.modern-product-card__savings {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    width: fit-content;
    animation: shine 2s ease-in-out infinite;
}

@keyframes shine {
    0%, 100% {
        box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
    }
}

/* Features */
.modern-product-card__features {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.modern-product-card__feature {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--card-gray-600);
    padding: 6px 12px;
    background: var(--card-gray-100);
    border-radius: 20px;
    font-weight: 500;
}

.modern-product-card__feature i {
    color: var(--card-primary);
    font-size: 14px;
}

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

.modern-product-card__actions {
    margin-top: auto;
    padding-top: 12px;
}

.modern-product-card__actions form {
    width: 100%;
    margin: 0;
}

.modern-product-card__btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--card-transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modern-product-card__btn--primary {
    background: linear-gradient(135deg, var(--card-primary) 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(102, 126, 234, 0.4);
}

.modern-product-card__btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(102, 126, 234, 0.5);
}

.modern-product-card__btn--primary:active {
    transform: translateY(0);
}

.modern-product-card__btn--disabled {
    background: var(--card-gray-300);
    color: var(--card-gray-600);
    cursor: not-allowed;
    opacity: 0.7;
}

.modern-product-card__btn i {
    font-size: 18px;
}

/* ============================================
   LIST VIEW SUPPORT
   ============================================ */

.products-view-container[data-view="list"] .modern-product-card {
    flex-direction: row;
    max-width: 100%;
}

.products-view-container[data-view="list"] .modern-product-card__image-wrapper {
    flex: 0 0 280px;
    max-width: 280px;
}

.products-view-container[data-view="list"] .modern-product-card__image-container {
    padding-top: 100%;
}

.products-view-container[data-view="list"] .modern-product-card__content {
    flex: 1;
    padding: 24px;
}

.products-view-container[data-view="list"] .modern-product-card__title {
    font-size: 20px;
    min-height: auto;
}

.products-view-container[data-view="list"] .modern-product-card__actions {
    padding-left: 24px;
    border-left: 2px solid var(--card-gray-200);
    display: flex;
    align-items: center;
}

/* ============================================
   LOADING STATE
   ============================================ */

.modern-product-card.loading {
    pointer-events: none;
    opacity: 0.6;
}

.modern-product-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid var(--card-gray-200);
    border-top-color: var(--card-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    z-index: 10;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 992px) {
    .products-view-container[data-view="list"] .modern-product-card {
        flex-direction: column;
    }
    
    .products-view-container[data-view="list"] .modern-product-card__image-wrapper {
        flex: 1;
        max-width: 100%;
    }
    
    .products-view-container[data-view="list"] .modern-product-card__actions {
        padding-left: 0;
        padding-top: 12px;
        border-left: none;
        border-top: 2px solid var(--card-gray-200);
    }
}

@media (max-width: 576px) {
    .modern-product-card__content {
        padding: 16px;
        gap: 10px;
    }
    
    .modern-product-card__title {
        font-size: 14px;
        min-height: 40px;
    }
    
    .modern-product-card__price {
        font-size: 20px;
    }
    
    .modern-product-card__price--sale {
        font-size: 22px;
    }
    
    .modern-product-card__btn {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .modern-product-card__badge {
        font-size: 10px;
        padding: 5px 10px;
    }
    
    .modern-product-card__action-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

/* Removed fade in on scroll animation to prevent cards from hiding */
/* Cards are now always visible with full opacity */

/* Success animation when added to cart */
.modern-product-card.add-to-cart-success {
    animation: success-pulse 0.6s ease;
}

@keyframes success-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0.2);
    }
}

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

.modern-product-card__action-btn:focus,
.modern-product-card__btn:focus {
    outline: 2px solid var(--card-primary);
    outline-offset: 2px;
}

.modern-product-card__title a:focus {
    outline: 2px dashed var(--card-primary);
    outline-offset: 4px;
}

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





