/* 
Modern Product Card Component - Enhanced with Category Color Coding
Following Material Design principles with category-specific themes
============================================================== */

/* CSS Custom Properties for Category Colors */
:root {
    /* Primary Brand Colors */
    --primary-blue: #0078d4;
    --primary-blue-light: #106ebe;
    --primary-blue-dark: #005a9e;
    
    /* Category Color System */
    --windows-primary: #00bcf2;
    --windows-secondary: #0078d4;
    --windows-accent: #40e0d0;
    
    --office-primary: #d83b01;
    --office-secondary: #e74c3c;
    --office-accent: #ff6b35;
    
    --adobe-primary: #ff0000;
    --adobe-secondary: #cc0000;
    --adobe-accent: #ff3333;
    
    --autodesk-primary: #0696d7;
    --autodesk-secondary: #0e7db8;
    --autodesk-accent: #4db8e8;
    
    --server-primary: #107c10;
    --server-secondary: #008a00;
    --server-accent: #4caf50;
    
    --antivirus-primary: #ff8c00;
    --antivirus-secondary: #ff7700;
    --antivirus-accent: #ffa500;
    
    /* Neutral Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-light: #e5e7eb;
    --border-hover: #d1d5db;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.15);
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced Products Grid Layout */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 0.5rem;
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
        padding: 0.25rem;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0;
    }
}

/* Base Product Card - Enhanced Modern Design */
.product-card.modern-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 520px;
    max-width: 100%;
    margin: 0 auto;
    backdrop-filter: blur(10px);
    --category-color: var(--primary-blue);
    --category-light: rgba(0, 120, 212, 0.1);
    --category-gradient: linear-gradient(135deg, var(--category-light) 0%, transparent 100%);
}

/* Enhanced Hover Effects */
.product-card.modern-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--category-color);
    z-index: 10;
}

.product-card.modern-card:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--category-gradient);
    z-index: 1;
    opacity: 0.7;
    transition: opacity var(--transition-normal);
}

.product-card.modern-card:focus {
    outline: 3px solid var(--category-color);
    outline-offset: 4px;
}

/* Category-Specific Color Theming */
.product-card.modern-card[data-category="windows"] {
    --category-color: var(--windows-primary);
    --category-light: rgba(0, 188, 242, 0.1);
    --category-gradient: linear-gradient(135deg, var(--category-light) 0%, rgba(0, 120, 212, 0.05) 100%);
}

.product-card.modern-card[data-category="office"] {
    --category-color: var(--office-primary);
    --category-light: rgba(216, 59, 1, 0.1);
    --category-gradient: linear-gradient(135deg, var(--category-light) 0%, rgba(231, 76, 60, 0.05) 100%);
}

.product-card.modern-card[data-category="adobe"] {
    --category-color: var(--adobe-primary);
    --category-light: rgba(255, 0, 0, 0.1);
    --category-gradient: linear-gradient(135deg, var(--category-light) 0%, rgba(204, 0, 0, 0.05) 100%);
}

.product-card.modern-card[data-category="autodesk"] {
    --category-color: var(--autodesk-primary);
    --category-light: rgba(6, 150, 215, 0.1);
    --category-gradient: linear-gradient(135deg, var(--category-light) 0%, rgba(14, 125, 184, 0.05) 100%);
}

.product-card.modern-card[data-category="server"] {
    --category-color: var(--server-primary);
    --category-light: rgba(16, 124, 16, 0.1);
    --category-gradient: linear-gradient(135deg, var(--category-light) 0%, rgba(0, 138, 0, 0.05) 100%);
}

.product-card.modern-card[data-category="antivirus"] {
    --category-color: var(--antivirus-primary);
    --category-light: rgba(255, 140, 0, 0.1);
    --category-gradient: linear-gradient(135deg, var(--category-light) 0%, rgba(255, 119, 0, 0.05) 100%);
}

/* Enhanced Product Image Container */
.product-header {
    position: relative;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    z-index: 2;
}

.product-image-container {
    position: relative;
    height: 260px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--border-light);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform var(--transition-normal);
    padding: 1.5rem;
    z-index: 2;
}

.product-card.modern-card:hover .product-image {
    transform: scale(1.05);
}

.product-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 6rem;
    color: var(--category-color);
    background: var(--category-gradient);
    transition: all var(--transition-normal);
}

.product-card.modern-card:hover .product-image-placeholder {
    color: var(--category-color);
    transform: scale(1.1) rotate(5deg);
}

/* Enhanced Product Overlay */
.product-overlay {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 0.75rem;
    z-index: 4;
}

/* Enhanced Category Badge */
.category-badge {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    color: var(--category-color);
    padding: 0.6rem 1rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--category-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all var(--transition-normal);
}

.product-card.modern-card:hover .category-badge {
    background: var(--category-color);
    color: white;
    transform: scale(1.05);
}

/* Category-Specific Badge Styling */
.category-badge.category-windows { 
    border-color: var(--windows-primary);
    color: var(--windows-primary);
}

.category-badge.category-office { 
    border-color: var(--office-primary);
    color: var(--office-primary);
}

.category-badge.category-adobe { 
    border-color: var(--adobe-primary);
    color: var(--adobe-primary);
}

.category-badge.category-autodesk { 
    border-color: var(--autodesk-primary);
    color: var(--autodesk-primary);
}

.category-badge.category-server { 
    border-color: var(--server-primary);
    color: var(--server-primary);
}

.category-badge.category-antivirus { 
    border-color: var(--antivirus-primary);
    color: var(--antivirus-primary);
}

/* Enhanced Stock Badge */
.stock-badge {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    padding: 0.5rem 0.875rem;
    border-radius: 24px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-md);
    border: 2px solid;
    transition: all var(--transition-normal);
}

.stock-badge.in-stock {
    border-color: var(--server-primary);
    color: var(--server-primary);
}

.stock-badge.low-stock {
    border-color: var(--antivirus-primary);
    color: var(--antivirus-primary);
}

.stock-badge.out-of-stock {
    border-color: #dc2626;
    color: #dc2626;
}

.product-card.modern-card:hover .stock-badge.in-stock {
    background: var(--server-primary);
    color: white;
}

.product-card.modern-card:hover .stock-badge.low-stock {
    background: var(--antivirus-primary);
    color: white;
}

.product-card.modern-card:hover .stock-badge.out-of-stock {
    background: #dc2626;
    color: white;
}

/* Enhanced Version Badge */
.version-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--category-color);
    color: white;
    padding: 0.5rem 0.875rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-md);
    z-index: 4;
    transition: all var(--transition-normal);
}

.product-card.modern-card:hover .version-badge {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

/* Enhanced Product Body */
.product-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex-grow: 1;
    z-index: 2;
    position: relative;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

/* Enhanced Product Title */
.product-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--transition-normal);
}

.product-card.modern-card:hover .product-title {
    color: var(--category-color);
}

/* Enhanced Product Meta */
.product-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.license-type {
    background: var(--category-light);
    color: var(--category-color);
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--category-color);
    transition: all var(--transition-normal);
}

.product-card.modern-card:hover .license-type {
    background: var(--category-color);
    color: white;
    transform: scale(1.05);
}

/* Enhanced Feature Tags */
.feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.feature-tag {
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid;
    transition: all var(--transition-normal);
    cursor: default;
    backdrop-filter: blur(10px);
}

.feature-tag:hover {
    transform: scale(1.05);
}

.feature-tag.genuine,
.feature-tag.lifetime {
    background: rgba(16, 124, 16, 0.1);
    color: var(--server-primary);
    border-color: var(--server-primary);
}

.feature-tag.apps,
.feature-tag.cloud {
    background: rgba(0, 120, 212, 0.1);
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.feature-tag.creative,
.feature-tag.design {
    background: rgba(255, 0, 0, 0.1);
    color: var(--adobe-primary);
    border-color: var(--adobe-primary);
}

.feature-tag.professional,
.feature-tag.business {
    background: rgba(216, 59, 1, 0.1);
    color: var(--office-primary);
    border-color: var(--office-primary);
}

.feature-tag.enterprise,
.feature-tag.datacenter {
    background: rgba(6, 150, 215, 0.1);
    color: var(--autodesk-primary);
    border-color: var(--autodesk-primary);
}

.feature-tag.protection,
.feature-tag.security {
    background: rgba(255, 140, 0, 0.1);
    color: var(--antivirus-primary);
    border-color: var(--antivirus-primary);
}

/* Enhanced Product Description */
.product-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: auto;
    transition: color var(--transition-normal);
}

.product-card.modern-card:hover .product-description {
    color: var(--text-primary);
}

/* Enhanced Product Variants */
.product-variants {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}

.variants-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: block;
}

.variants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.variant-option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    border: 1px solid var(--border-light);
    transition: all var(--transition-normal);
}

.variant-option:hover {
    background: var(--category-light);
    border-color: var(--category-color);
    color: var(--category-color);
}

.variant-more {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-style: italic;
}

/* Enhanced Product Footer */
.product-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 2;
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* Enhanced Pricing Section */
.pricing-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.price-container {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.price-main {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--category-color);
    transition: all var(--transition-normal);
}

.price-original {
    font-size: 1rem;
    color: var(--text-secondary);
    text-decoration: line-through;
}

.price-discount {
    background: #ef4444;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Enhanced Rating Container */
.rating-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stars {
    display: flex;
    gap: 0.125rem;
}

.stars i {
    color: #fbbf24;
    font-size: 0.875rem;
}

.rating-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Enhanced CTA Button */
.cta-button {
    background: var(--category-color);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    filter: brightness(1.1);
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:active {
    transform: translateY(0);
}

/* Enhanced Quick Actions Overlay */
.quick-actions-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 1.5rem;
    transform: translateY(100%);
    transition: transform var(--transition-normal);
    z-index: 5;
}

.product-card.modern-card:hover .quick-actions-overlay {
    transform: translateY(0);
}

.quick-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.quick-action-btn {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    border: 2px solid var(--category-color);
    padding: 0.75rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
}

.quick-action-btn:hover {
    background: var(--category-color);
    color: white;
    transform: scale(1.1);
}

.quick-action-btn.primary {
    background: var(--category-color);
    color: white;
}

.quick-action-btn.primary:hover {
    background: white;
    color: var(--category-color);
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
    .product-card.modern-card {
        min-height: 480px;
        border-radius: 12px;
    }
    
    .product-image-container {
        height: 220px;
    }
    
    .product-body {
        padding: 1.25rem;
    }
    
    .product-footer {
        padding: 1.25rem;
    }
    
    .price-main {
        font-size: 1.375rem;
    }
    
    .product-title {
        font-size: 1.125rem;
    }
}

@media (max-width: 480px) {
    .product-card.modern-card {
        min-height: 450px;
        border-radius: 8px;
    }
    
    .product-image-container {
        height: 200px;
    }
    
    .product-body {
        padding: 1rem;
    }
    
    .product-footer {
        padding: 1rem;
    }
}

/* Skeleton Loading States */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card.modern-card {
    animation: slideUp 0.6s ease-out;
}

.product-card.skeleton {
    pointer-events: none;
}

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

.product-card.skeleton .product-title,
.product-card.skeleton .product-description,
.product-card.skeleton .price-main {
    background: #f0f0f0;
    color: transparent;
    animation: pulse 1.5s infinite;
}

.product-card.skeleton .product-title {
    height: 1.5rem;
    border-radius: 4px;
}

.product-card.skeleton .product-description {
    height: 3rem;
    border-radius: 4px;
}

.product-card.skeleton .price-main {
    height: 2rem;
    width: 100px;
    border-radius: 4px;
}

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

/* Accessibility and Performance */
@media (prefers-reduced-motion: reduce) {
    .product-card.modern-card,
    .product-image,
    .cta-button,
    .quick-action-btn {
        transition: none;
    }
    
    .product-card.modern-card:hover {
        transform: none;
    }
    
    .product-card.modern-card:hover .product-image {
        transform: none;
    }
}

@media (prefers-contrast: high) {
    .product-card.modern-card {
        border: 2px solid var(--text-primary);
    }
    
    .product-card.modern-card:hover {
        border-color: var(--category-color);
    }
    
    .category-badge {
        border-width: 3px;
    }
}

/* Print Styles */
@media print {
    .product-card.modern-card {
        border: 1px solid #000;
        border-radius: 0;
        box-shadow: none;
        break-inside: avoid;
    }
    
    .quick-actions-overlay {
        display: none;
    }
    
    .product-image-container {
        background: #fff;
    }
}

/* Legacy Support and Fallbacks */
.navbar,
.dropdown-menu,
.sidebar {
    z-index: 1000;
}

.dropdown-menu,
.mobile-menu {
    z-index: 1100;
}
