/**
 * Modern Comparison Tool CSS - Premium Edition
 * Features: Glassmorphism, Gradients, Animations, Premium Design
 */

/* ==========================================
   GLOBAL STYLES & ANIMATIONS
   ========================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ==========================================
   PAGE BACKGROUND
   ========================================== */

#comparison-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}

#comparison-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 135, 135, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(99, 179, 237, 0.3) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

#comparison-page > * {
    position: relative;
    z-index: 1;
}

/* ==========================================
   HEADER BAR - GLASSMORPHISM
   ========================================== */

#comparison-page > div:first-of-type {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: none !important;
    box-shadow: 
        0 8px 32px 0 rgba(31, 38, 135, 0.15),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
    animation: slideIn 0.6s ease-out;
}

#comparison-page > div:first-of-type h1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.5px;
}

#comparison-page > div:first-of-type p {
    color: #6b7280 !important;
    font-size: 0.95rem !important;
}

#comparison-page > div:first-of-type a {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 15px 0 rgba(102, 126, 234, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

#comparison-page > div:first-of-type a::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;
}

#comparison-page > div:first-of-type a:hover::before {
    left: 100%;
}

#comparison-page > div:first-of-type a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(102, 126, 234, 0.5);
}

/* ==========================================
   ACTION BAR - GLASSMORPHISM
   ========================================== */

#comparison-page .max-w-7xl > div:first-child {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 
        0 8px 32px 0 rgba(31, 38, 135, 0.1),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

#comparison-page .max-w-7xl > div:first-child button:first-child {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    box-shadow: 0 4px 15px 0 rgba(102, 126, 234, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

#comparison-page .max-w-7xl > div:first-child button:first-child::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#comparison-page .max-w-7xl > div:first-child button:first-child:hover::after {
    width: 300px;
    height: 300px;
}

#comparison-page .max-w-7xl > div:first-child button:first-child:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(102, 126, 234, 0.5);
}

#comparison-page .max-w-7xl > div:first-child button:last-child {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 2px solid #ef4444 !important;
    color: #ef4444 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#comparison-page .max-w-7xl > div:first-child button:last-child:hover {
    background: #ef4444 !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px 0 rgba(239, 68, 68, 0.4);
}

/* ==========================================
   SEARCH SECTION - PREMIUM DESIGN
   ========================================== */

#comparison-page .max-w-7xl > div:nth-child(2) {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 
        0 8px 32px 0 rgba(31, 38, 135, 0.1),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

#comparison-page .max-w-7xl > div:nth-child(2) label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
}

#product-search-input {
    border: 2px solid rgba(102, 126, 234, 0.2) !important;
    background: white !important;
    box-shadow: 
        0 4px 15px 0 rgba(31, 38, 135, 0.08),
        inset 0 2px 4px 0 rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem !important;
}

#product-search-input:focus {
    border-color: #667eea !important;
    box-shadow: 
        0 4px 20px 0 rgba(102, 126, 234, 0.2),
        0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

#product-search-input::placeholder {
    color: #9ca3af !important;
}

/* Popular Search Tags */
#comparison-page .max-w-7xl > div:nth-child(2) button {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%) !important;
    border: 1px solid rgba(102, 126, 234, 0.2) !important;
    color: #667eea !important;
    font-weight: 600 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#comparison-page .max-w-7xl > div:nth-child(2) button:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px 0 rgba(102, 126, 234, 0.3);
}

/* Search Results */
#search-results > div {
    animation: fadeInUp 0.4s ease-out;
}

#search-results > div > div {
    background: white !important;
    border: 2px solid transparent !important;
    box-shadow: 0 4px 15px 0 rgba(31, 38, 135, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#search-results > div > div:hover {
    border-color: #667eea !important;
    box-shadow: 0 8px 25px 0 rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

#search-results > div > div button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 4px 12px 0 rgba(102, 126, 234, 0.3);
}

#search-results > div > div button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px 0 rgba(102, 126, 234, 0.4);
}

/* ==========================================
   AI INSIGHTS - GRADIENT CARD
   ========================================== */

#ai-insights {
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.95) 0%, 
        rgba(118, 75, 162, 0.95) 100%) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 
        0 20px 40px 0 rgba(102, 126, 234, 0.3),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.3);
    animation: fadeInUp 0.6s ease-out 0.3s both;
    position: relative;
    overflow: hidden;
}

#ai-insights::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

#ai-insights > div {
    position: relative;
    z-index: 1;
}

#ai-insights .flex-shrink-0 {
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 20px 0 rgba(0, 0, 0, 0.1);
}

#ai-insights h3 {
    color: white !important;
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#ai-insights #ai-recommendation {
    color: rgba(255, 255, 255, 0.95) !important;
    font-size: 1.05rem !important;
    line-height: 1.7 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#ai-insights #ai-differences > div {
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#ai-insights #ai-differences svg {
    color: #fbbf24 !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

#ai-insights #ai-differences span {
    color: white !important;
    font-weight: 500;
}

/* ==========================================
   PRODUCT CARDS - PREMIUM DESIGN
   ========================================== */

#products-grid {
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

#products-grid > div {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 
        0 10px 40px 0 rgba(31, 38, 135, 0.15),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

#products-grid > div::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#products-grid > div:hover::before {
    transform: scaleX(1);
}

#products-grid > div:hover {
    transform: translateY(-8px) !important;
    box-shadow: 
        0 20px 60px 0 rgba(102, 126, 234, 0.25),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
}

/* Best Value Glow Effect */
#products-grid > div.ring-4 {
    border: none !important;
    box-shadow: 
        0 0 0 4px rgba(16, 185, 129, 0.3),
        0 15px 50px 0 rgba(16, 185, 129, 0.2),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Remove Button */
#products-grid > div button {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    box-shadow: 0 4px 12px 0 rgba(239, 68, 68, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.5rem;
    font-weight: 700;
}

#products-grid > div button:hover {
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 6px 16px 0 rgba(239, 68, 68, 0.5);
}

/* Product Image */
#products-grid > div img {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#products-grid > div:hover img {
    transform: scale(1.05);
}

/* Rating Stars */
#products-grid > div .flex.text-yellow-400 svg {
    filter: drop-shadow(0 1px 2px rgba(251, 191, 36, 0.3));
}

/* Price */
#products-grid > div .text-3xl.font-bold.text-green-600 {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* CTA Button */
#products-grid > div a[href*="amazon"],
#products-grid > div a[href*="walmart"],
#products-grid > div a[href*="target"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 4px 15px 0 rgba(102, 126, 234, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

#products-grid > div a[href*="amazon"]::before,
#products-grid > div a[href*="walmart"]::before,
#products-grid > div a[href*="target"]::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.6s;
}

#products-grid > div a[href*="amazon"]:hover::before,
#products-grid > div a[href*="walmart"]:hover::before,
#products-grid > div a[href*="target"]:hover::before {
    left: 100%;
}

#products-grid > div a[href*="amazon"]:hover,
#products-grid > div a[href*="walmart"]:hover,
#products-grid > div a[href*="target"]:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 6px 25px 0 rgba(102, 126, 234, 0.5);
}

/* ==========================================
   COMPARISON TABLE - MODERN DESIGN
   ========================================== */

#comparison-details {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 
        0 10px 40px 0 rgba(31, 38, 135, 0.15),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

#comparison-details > div:first-child {
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.05) 0%, 
        rgba(118, 75, 162, 0.05) 100%) !important;
}

#comparison-details h2 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800 !important;
}

#comparison-details table {
    border-collapse: separate;
    border-spacing: 0;
}

#comparison-details thead {
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.08) 0%, 
        rgba(118, 75, 162, 0.08) 100%) !important;
}

#comparison-details thead th {
    position: relative;
}

#comparison-details thead th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

#comparison-details tbody tr {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#comparison-details tbody tr:hover {
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.03) 0%, 
        rgba(118, 75, 162, 0.03) 100%) !important;
    transform: scale(1.01);
}

#comparison-details tbody td {
    border-color: rgba(102, 126, 234, 0.1) !important;
}

/* Table Images */
#comparison-details thead img {
    border: 2px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#comparison-details thead img:hover {
    transform: scale(1.1);
    border-color: #667eea;
    box-shadow: 0 4px 12px 0 rgba(102, 126, 234, 0.3);
}

/* ==========================================
   EMPTY STATE - ENGAGING DESIGN
   ========================================== */

#empty-state {
    animation: fadeInUp 0.6s ease-out;
}

#empty-state > div:first-child {
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.1) 0%, 
        rgba(118, 75, 162, 0.1) 100%);
    border: 2px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 4px 15px 0 rgba(102, 126, 234, 0.1);
}

#empty-state h2 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#empty-state button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 4px 15px 0 rgba(102, 126, 234, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#empty-state button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(102, 126, 234, 0.5);
}

#empty-state a {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: #667eea !important;
    color: #667eea !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#empty-state a:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    transform: translateY(-2px);
}

/* ==========================================
   DECISION MODAL - GLASSMORPHISM
   ========================================== */

#decision-modal {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#decision-modal > div {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 25px 60px 0 rgba(31, 38, 135, 0.3);
    animation: fadeInUp 0.4s ease-out;
}

#decision-modal h3 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800 !important;
}

#progress-bar {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 2px 8px 0 rgba(102, 126, 234, 0.3);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#decision-content button {
    background: white !important;
    border: 2px solid rgba(102, 126, 234, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#decision-content button:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-color: transparent !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(102, 126, 234, 0.3);
}

/* ==========================================
   FLOATING COMPARE BUTTON
   ========================================== */

#pc-floating-compare {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 8px 30px 0 rgba(102, 126, 234, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.6s ease-out;
}

#pc-floating-compare:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px 0 rgba(102, 126, 234, 0.6);
}

#pc-floating-compare .pc-compare-count {
    background: rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1);
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ==========================================
   RESPONSIVE ADJUSTMENTS
   ========================================== */

@media (max-width: 768px) {
    #comparison-page::before {
        background-size: 200% 200%;
    }
    
    #products-grid > div:hover {
        transform: translateY(-4px) !important;
    }
    
    #comparison-details {
        border-radius: 1rem !important;
    }
}

/* ==========================================
   LOADING STATES
   ========================================== */

.loading-shimmer {
    background: linear-gradient(
        90deg,
        rgba(102, 126, 234, 0.1) 0%,
        rgba(118, 75, 162, 0.2) 50%,
        rgba(102, 126, 234, 0.1) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ==========================================
   PRINT STYLES
   ========================================== */

@media print {
    #comparison-page {
        background: white !important;
    }
    
    #comparison-page::before {
        display: none;
    }
    
    #products-grid > div,
    #comparison-details {
        box-shadow: none !important;
        border: 1px solid #e5e7eb !important;
    }
}

/* ==========================================
   4-COLUMN LAYOUT OPTIMIZATION
   Add this to your comparison-tool.css
   ========================================== */

/* Ensure product cards scale properly with 4 columns */
@media (min-width: 1280px) {
    /* XL screens - 4 columns */
    #products-grid > div {
        min-width: 0; /* Prevent flex items from overflowing */
    }
    
    /* Slightly reduce font sizes for better fit */
    #products-grid > div h3 {
        font-size: 1rem !important;
        line-height: 1.4 !important;
        height: 3.5rem !important;
    }
    
    /* Optimize image size for 4 columns */
    #products-grid > div img {
        height: 12rem !important;
    }
    
    /* Compact pros/cons for 4-column view */
    #products-grid > div ul {
        padding: 0.5rem !important;
    }
    
    #products-grid > div ul li {
        font-size: 0.8125rem !important;
    }
    
    /* Ensure CTA buttons remain visible */
    #products-grid > div a[href*="amazon"],
    #products-grid > div a[href*="walmart"],
    #products-grid > div a[href*="target"] {
        padding: 0.625rem 1rem !important;
        font-size: 0.875rem !important;
    }
}

/* For ultra-wide screens (1536px+) - give more breathing room */
@media (min-width: 1536px) {
    /* 2XL screens - restore larger sizes */
    #products-grid {
        gap: 2rem !important;
    }
    
    #products-grid > div h3 {
        font-size: 1.125rem !important;
        height: 3.5rem !important;
    }
    
    #products-grid > div img {
        height: 14rem !important;
    }
    
    #products-grid > div ul li {
        font-size: 0.875rem !important;
    }
    
    #products-grid > div a[href*="amazon"],
    #products-grid > div a[href*="walmart"],
    #products-grid > div a[href*="target"] {
        padding: 0.75rem 1rem !important;
        font-size: 1rem !important;
    }
}

/* Ensure table is scrollable on smaller screens when 4 products */
#comparison-details .overflow-x-auto {
    -webkit-overflow-scrolling: touch;
}

/* Make table header sticky on scroll for 4 products */
@media (min-width: 1280px) {
    #comparison-details thead th:first-child {
        position: sticky;
        left: 0;
        z-index: 20;
        box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
    }
    
    #comparison-details tbody td:first-child {
        position: sticky;
        left: 0;
        z-index: 10;
        box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
    }
}

/* Grid gap adjustments for different screen sizes */
@media (min-width: 768px) and (max-width: 1023px) {
    /* MD screens - 2 columns */
    #products-grid {
        gap: 1.5rem !important;
    }
}

@media (min-width: 1024px) and (max-width: 1279px) {
    /* LG screens - 3 columns */
    #products-grid {
        gap: 1.5rem !important;
    }
}

@media (min-width: 1280px) and (max-width: 1535px) {
    /* XL screens - 4 columns */
    #products-grid {
        gap: 1.25rem !important;
    }
}

/* Ensure best value badge scales properly */
@media (min-width: 1280px) {
    #products-grid > div > div:first-child {
        font-size: 0.8125rem !important;
        padding: 0.375rem 0 !important;
    }
}

/* Optimize badges for 4-column layout */
@media (min-width: 1280px) {
    #products-grid > div .absolute.top-4.left-4 > div {
        font-size: 0.6875rem !important;
        padding: 0.375rem 0.625rem !important;
    }
}

/* Responsive table adjustments for 4 products */
@media (max-width: 1279px) {
    /* On smaller screens, make table scroll horizontally */
    #comparison-details table {
        min-width: 800px;
    }
}

@media (min-width: 1280px) {
    /* On XL screens, allow table to fit 4 products */
    #comparison-details table {
        table-layout: fixed;
    }
    
    #comparison-details thead th:not(:first-child),
    #comparison-details tbody td:not(:first-child) {
        width: calc((100% - 200px) / 4); /* 200px for feature column, rest divided by 4 */
    }
    
    #comparison-details thead th:first-child,
    #comparison-details tbody td:first-child {
        width: 200px;
    }
}

/* Print optimization for 4 products */
@media print {
    #products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        page-break-inside: avoid;
    }
    
    #products-grid > div {
        page-break-inside: avoid;
    }
}
/* ===== PROFESSIONAL CARD ENHANCEMENTS ===== */

/* Better card depth and shadows */
#cards-view > div {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

#cards-view > div:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 
              0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: rgba(59, 130, 246, 0.1);
}

/* Premium Best Value styling */
.best-value-glow {
  border: 2px solid #10b981 !important;
  position: relative;
}

.best-value-glow::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: 1rem;
  z-index: -1;
  opacity: 0.1;
}

/* Better product image container */
#cards-view img {
  padding: 2rem !important;
  background: linear-gradient(to bottom, #f9fafb, #ffffff);
  transition: transform 0.4s ease;
}

#cards-view > div:hover img {
  transform: scale(1.08);
}

/* Refined gradient buttons */
#cards-view a[class*="gradient"] {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
  position: relative;
  overflow: hidden;
}

#cards-view a[class*="gradient"]::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 0.5s;
}

#cards-view a[class*="gradient"]:hover::before {
  left: 100%;
}

/* Better typography */
#cards-view h3 {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #111827;
}

/* Improved pricing */
#cards-view [class*="text-3xl"] {
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Professional badge styling */
#cards-view [class*="bg-red-500"] {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  padding: 0.35rem 0.75rem !important;
}

#cards-view [class*="bg-purple-500"] {
  background: linear-gradient(135deg, #a855f7, #9333ea) !important;
  font-size: 0.65rem;
  letter-spacing: 0.5px;
}

/* Better spacing in card content */
#cards-view > div > div:last-child {
  padding: 1.75rem !important;
}

/* Refined stars */
#cards-view svg[class*="text-yellow"] {
  filter: drop-shadow(0 1px 2px rgba(251, 191, 36, 0.3));
}

/* Better feature list */
#cards-view [class*="items-start"] svg {
  filter: drop-shadow(0 1px 2px rgba(16, 185, 129, 0.3));
}