/*
===========================================
FACTORZ PRODUCT COMPARISON STYLE GUIDE
===========================================

Based on 2025 e-commerce and comparison website design trends
Research-driven design system for modern product comparison experiences

===========================================
TABLE OF CONTENTS
===========================================
1. Color Palette
2. Typography
3. Spacing & Layout
4. Component Library
5. Card Systems
6. Interactive Elements
7. Responsive Grid
8. Animation & Transitions
===========================================
*/

/* ===========================================
   1. COLOR PALETTE
   =========================================== */

:root {
    /* Primary Brand Colors */
    --color-primary: #6366f1;           /* Modern indigo */
    --color-primary-light: #a5b4fc;     /* Light indigo */
    --color-primary-dark: #4338ca;      /* Dark indigo */
    --color-primary-50: #eef2ff;        /* Very light indigo */
    --color-primary-100: #e0e7ff;       /* Ultra light indigo */
    
    /* Secondary Colors */
    --color-secondary: #f59e0b;         /* Amber accent */
    --color-secondary-light: #fbbf24;   /* Light amber */
    --color-secondary-dark: #d97706;    /* Dark amber */
    
    /* Success & Status Colors */
    --color-success: #10b981;           /* Emerald green */
    --color-warning: #f59e0b;           /* Amber */
    --color-error: #ef4444;             /* Red */
    --color-info: #3b82f6;              /* Blue */
    
    /* Neutral Grays */
    --color-gray-50: #f9fafb;           /* Very light gray */
    --color-gray-100: #f3f4f6;          /* Light gray */
    --color-gray-200: #e5e7eb;          /* Medium light gray */
    --color-gray-300: #d1d5db;          /* Medium gray */
    --color-gray-400: #9ca3af;          /* Dark medium gray */
    --color-gray-500: #6b7280;          /* Dark gray */
    --color-gray-600: #4b5563;          /* Very dark gray */
    --color-gray-700: #374151;          /* Almost black */
    --color-gray-800: #1f2937;          /* Near black */
    --color-gray-900: #111827;          /* Black */
    
    /* Text Colors */
    --color-text-primary: #111827;      /* Main text */
    --color-text-secondary: #6b7280;    /* Secondary text */
    --color-text-muted: #9ca3af;        /* Muted text */
    --color-text-inverse: #ffffff;      /* White text */
    
    /* Background Colors */
    --color-bg-primary: #ffffff;        /* Main background */
    --color-bg-secondary: #f9fafb;      /* Secondary background */
    --color-bg-accent: #eef2ff;         /* Accent background */
    --color-bg-dark: #1f2937;           /* Dark background */
    
    /* Border Colors */
    --color-border-light: #e5e7eb;      /* Light borders */
    --color-border-medium: #d1d5db;     /* Medium borders */
    --color-border-dark: #6b7280;       /* Dark borders */
    
    /* Shadow Colors */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 0px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

/* ===========================================
   2. TYPOGRAPHY
   =========================================== */

/* Font Stack */
:root {
    --font-family-sans: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-family-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

/* Font Sizes */
:root {
    --text-xs: 0.75rem;     /* 12px */
    --text-sm: 0.875rem;    /* 14px */
    --text-base: 1rem;      /* 16px */
    --text-lg: 1.125rem;    /* 18px */
    --text-xl: 1.25rem;     /* 20px */
    --text-2xl: 1.5rem;     /* 24px */
    --text-3xl: 1.875rem;   /* 30px */
    --text-4xl: 2.25rem;    /* 36px */
    --text-5xl: 3rem;       /* 48px */
}

/* Font Weights */
:root {
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;
}

/* Line Heights */
:root {
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;
}

/* ===========================================
   3. SPACING & LAYOUT
   =========================================== */

:root {
    /* Spacing Scale */
    --space-0: 0;
    --space-1: 0.25rem;     /* 4px */
    --space-2: 0.5rem;      /* 8px */
    --space-3: 0.75rem;     /* 12px */
    --space-4: 1rem;        /* 16px */
    --space-5: 1.25rem;     /* 20px */
    --space-6: 1.5rem;      /* 24px */
    --space-8: 2rem;        /* 32px */
    --space-10: 2.5rem;     /* 40px */
    --space-12: 3rem;       /* 48px */
    --space-16: 4rem;       /* 64px */
    --space-20: 5rem;       /* 80px */
    --space-24: 6rem;       /* 96px */
    
    /* Border Radius */
    --radius-sm: 0.125rem;  /* 2px */
    --radius-md: 0.375rem;  /* 6px */
    --radius-lg: 0.5rem;    /* 8px */
    --radius-xl: 0.75rem;   /* 12px */
    --radius-2xl: 1rem;     /* 16px */
    --radius-full: 9999px;  /* Full rounded */
    
    /* Max Widths */
    --max-width-xs: 20rem;    /* 320px */
    --max-width-sm: 24rem;    /* 384px */
    --max-width-md: 28rem;    /* 448px */
    --max-width-lg: 32rem;    /* 512px */
    --max-width-xl: 36rem;    /* 576px */
    --max-width-2xl: 42rem;   /* 672px */
    --max-width-3xl: 48rem;   /* 768px */
    --max-width-4xl: 56rem;   /* 896px */
    --max-width-5xl: 64rem;   /* 1024px */
    --max-width-6xl: 72rem;   /* 1152px */
    --max-width-7xl: 80rem;   /* 1280px */
}

/* ===========================================
   4. COMPONENT LIBRARY
   =========================================== */

/* Modern Card Component */
.sg-card {
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease-in-out;
    overflow: hidden;
}

.sg-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--color-primary-light);
}

.sg-card-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--color-border-light);
    background: var(--color-bg-secondary);
}

.sg-card-body {
    padding: var(--space-6);
}

.sg-card-footer {
    padding: var(--space-6);
    border-top: 1px solid var(--color-border-light);
    background: var(--color-bg-secondary);
}

/* Product Card Specific */
.sg-product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    transition: all 0.3s ease;
}

.sg-product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.sg-product-image {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--color-bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.sg-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.sg-product-card:hover .sg-product-image img {
    transform: scale(1.05);
}

.sg-product-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-6);
    gap: var(--space-3);
}

.sg-product-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    line-height: var(--leading-tight);
    margin: 0;
}

.sg-product-description {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
    margin: 0;
}

.sg-product-price {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--color-primary);
    margin: var(--space-2) 0;
}

.sg-product-badge {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    background: var(--color-primary);
    color: var(--color-text-inverse);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    z-index: 10;
}

/* Score/Rating Component */
.sg-score {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.sg-score-badge {
    background: var(--color-primary);
    color: var(--color-text-inverse);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    min-width: 3rem;
    text-align: center;
}

.sg-score-bar {
    flex: 1;
    height: 6px;
    background: var(--color-gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.sg-score-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
    border-radius: var(--radius-full);
    transition: width 1s ease-out;
}

/* ===========================================
   5. MODERN BUTTON SYSTEM
   =========================================== */

.sg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
    box-sizing: border-box;
}

.sg-btn-primary {
    background: var(--color-primary);
    color: var(--color-text-inverse);
    border-color: var(--color-primary);
}

.sg-btn-primary:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.sg-btn-secondary {
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    border-color: var(--color-border-medium);
}

.sg-btn-secondary:hover {
    background: var(--color-bg-secondary);
    border-color: var(--color-border-dark);
}

.sg-btn-outline {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.sg-btn-outline:hover {
    background: var(--color-primary);
    color: var(--color-text-inverse);
}

/* Button Sizes */
.sg-btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
}

.sg-btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
}

/* ===========================================
   6. COMPARISON TABLE STYLES
   =========================================== */

.sg-comparison-grid {
    display: grid;
    gap: var(--space-6);
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.sg-comparison-feature {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border-light);
}

.sg-comparison-feature:last-child {
    border-bottom: none;
}

.sg-feature-label {
    font-weight: var(--font-medium);
    color: var(--color-text-primary);
}

.sg-feature-value {
    color: var(--color-text-secondary);
    text-align: right;
}

/* ===========================================
   7. FILTER & SEARCH COMPONENTS
   =========================================== */

.sg-filter-bar {
    background: var(--color-bg-secondary);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: center;
}

.sg-search-input {
    flex: 1;
    min-width: 250px;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border-medium);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    background: var(--color-bg-primary);
    transition: border-color 0.2s ease;
}

.sg-search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-50);
}

.sg-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    background: var(--color-primary-100);
    color: var(--color-primary-dark);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
}

.sg-filter-remove {
    background: none;
    border: none;
    color: var(--color-primary-dark);
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sg-filter-remove:hover {
    background: var(--color-primary-dark);
    color: var(--color-text-inverse);
}

/* ===========================================
   8. RESPONSIVE GRID SYSTEM
   =========================================== */

.sg-container {
    width: 100%;
    max-width: var(--max-width-7xl);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.sg-grid {
    display: grid;
    gap: var(--space-6);
}

.sg-grid-1 { grid-template-columns: 1fr; }
.sg-grid-2 { grid-template-columns: repeat(2, 1fr); }
.sg-grid-3 { grid-template-columns: repeat(3, 1fr); }
.sg-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Responsive Grid */
@media (max-width: 768px) {
    .sg-grid-2,
    .sg-grid-3,
    .sg-grid-4 {
        grid-template-columns: 1fr;
    }
    
    .sg-comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .sg-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sg-search-input {
        min-width: auto;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .sg-grid-3,
    .sg-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===========================================
   9. ANIMATIONS & TRANSITIONS
   =========================================== */

.sg-fade-in {
    animation: fadeIn 0.5s ease-out;
}

.sg-slide-up {
    animation: slideUp 0.5s ease-out;
}

.sg-scale-in {
    animation: scaleIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===========================================
   10. UTILITY CLASSES
   =========================================== */

/* Text Utilities */
.sg-text-center { text-align: center; }
.sg-text-left { text-align: left; }
.sg-text-right { text-align: right; }

.sg-font-light { font-weight: var(--font-light); }
.sg-font-normal { font-weight: var(--font-normal); }
.sg-font-medium { font-weight: var(--font-medium); }
.sg-font-semibold { font-weight: var(--font-semibold); }
.sg-font-bold { font-weight: var(--font-bold); }

/* Spacing Utilities */
.sg-m-0 { margin: 0; }
.sg-m-1 { margin: var(--space-1); }
.sg-m-2 { margin: var(--space-2); }
.sg-m-3 { margin: var(--space-3); }
.sg-m-4 { margin: var(--space-4); }
.sg-m-6 { margin: var(--space-6); }
.sg-m-8 { margin: var(--space-8); }

.sg-p-0 { padding: 0; }
.sg-p-1 { padding: var(--space-1); }
.sg-p-2 { padding: var(--space-2); }
.sg-p-3 { padding: var(--space-3); }
.sg-p-4 { padding: var(--space-4); }
.sg-p-6 { padding: var(--space-6); }
.sg-p-8 { padding: var(--space-8); }

/* Margin/Padding directions */
.sg-mt-4 { margin-top: var(--space-4); }
.sg-mb-4 { margin-bottom: var(--space-4); }
.sg-ml-4 { margin-left: var(--space-4); }
.sg-mr-4 { margin-right: var(--space-4); }

.sg-pt-4 { padding-top: var(--space-4); }
.sg-pb-4 { padding-bottom: var(--space-4); }
.sg-pl-4 { padding-left: var(--space-4); }
.sg-pr-4 { padding-right: var(--space-4); }

/* Display Utilities */
.sg-hidden { display: none; }
.sg-block { display: block; }
.sg-inline { display: inline; }
.sg-inline-block { display: inline-block; }
.sg-flex { display: flex; }
.sg-grid { display: grid; }

/* Flex Utilities */
.sg-flex-col { flex-direction: column; }
.sg-flex-row { flex-direction: row; }
.sg-justify-center { justify-content: center; }
.sg-justify-between { justify-content: space-between; }
.sg-items-center { align-items: center; }
.sg-items-start { align-items: flex-start; }
.sg-items-end { align-items: flex-end; }

/* Background Utilities */
.sg-bg-white { background-color: var(--color-bg-primary); }
.sg-bg-gray { background-color: var(--color-bg-secondary); }
.sg-bg-primary { background-color: var(--color-primary); }

/* Border Utilities */
.sg-rounded { border-radius: var(--radius-md); }
.sg-rounded-lg { border-radius: var(--radius-lg); }
.sg-rounded-xl { border-radius: var(--radius-xl); }
.sg-rounded-full { border-radius: var(--radius-full); }

/* Shadow Utilities */
.sg-shadow { box-shadow: var(--shadow-md); }
.sg-shadow-lg { box-shadow: var(--shadow-lg); }
.sg-shadow-xl { box-shadow: var(--shadow-xl); }

/* ===========================================
   END OF STYLE GUIDE
   =========================================== */

/*
===========================================
RESULTS PAGE - CONSOLIDATED STYLE OVERRIDE
===========================================
Mobile-first responsive design for Results/Details page
Based on Factorz Style Guide
Consolidates: results-override.css, results-modern-override.css, results-modern-mobile.css
===========================================
*/

/* Import Style Guide */
@import url('../style-guide.css');

/* ===========================================
   PAGE LAYOUT & STRUCTURE
   =========================================== */

main > .content {
    font-family: var(--font-family-sans);
    background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-primary) 100%);
    min-height: 100vh;
    padding: var(--space-2); /* Dense mobile: 8px */
    padding-bottom: 120px; /* Space for fixed compare bar on mobile */
}

.results {
    font-family: var(--font-family-sans);
    max-width: 100%;
}

.results .item-content .alter-sku{
}

.group {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 5px;
}

.group-content {
    padding: 0;
}

/* ===========================================
   HEADER & TITLE STYLING
   =========================================== */

.box.fs.mid {
    background: var(--color-bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-3); /* Dense: 12px */
    margin-bottom: var(--space-3);
    /* border: 1px solid var(--color-border-light); */
    /* Mobile: Row layout with h1 and sort on same row */
    display: flex;
    flex-direction: row;
    gap: var(--space-3);
    align-items: flex-start;
    justify-content: space-between;
}



.group-content .group-head{
    display: block;
    flex: 1;
}

/* Sort dropdown container - auto width on mobile */
.box.fs.mid .sort-by {
    width: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-1);
    flex-shrink: 0;
    align-self: flex-start;
}

.box.fs.mid .sort-by label {
    /* font-size: var(--text-sm); */
    font-weight: var(--font-medium);
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.box.fs.mid .sort-by select {
    width: auto;
    /* min-width: 150px; */
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--color-border-medium);
    border-radius: var(--radius-md);
    background: var(--color-bg-primary);
    /* font-size: var(--text-sm); */
    color: var(--color-text-primary);
}

.group-head h1 {
    font-size: var(--text-xl); /* Dense: 20px on mobile */
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
    margin: 0;
    line-height: var(--leading-tight);
}

.group-head span {
    font-size: var(--text-sm); /* Dense: 14px */
    color: var(--color-text-secondary);
    font-weight: var(--font-medium);
    display: block;
    margin-top: var(--space-1);
}

/* ===========================================
   PRODUCT CARDS (ALTER) - MOBILE FIRST
   =========================================== */

.results .alter {
    background: var(--color-bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid transparent;
    transition: all 0.2s ease;
    /* padding: var(--space-3); */ /* Dense: 12px */
    margin-bottom: var(--space-4);
    position: relative;
}

.results .alter:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    border-color: var(--color-primary-light);
}

.results .alter.active {
    background: linear-gradient(90deg, var(--color-primary-100) 16%, var(--color-bg-primary));
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}
.results .alter.selected{
    margin-top: 2rem;
}
.results .alter.selected.TopRecomand {
   
    border-color: var(--color-secondary-dark);
}

/* Base Recomand Style Update */
.results .alter .recomand {
    border-radius: var(--radius-md);
    line-height: 1.4;
    display: inline-block;
    width: auto;
}

/* Premium Header Override */
.results .alter .recomand.TopRecomand {
    background: linear-gradient(to bottom right, var(--color-secondary) 0%, var(--color-secondary-dark) 100%) !important;
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Best in Budget Override */
.results .alter .recomand.Best {
    background: linear-gradient(to bottom right, var(--color-primary-light) 0%, var(--color-primary) 100%) !important;
    color: white !important;
    text-shadow: none !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

/* Best */
.results .alter.selected.Best {
    border-color: var(--color-accent);
    margin-top: 2rem;
}


.results .alter.in-compare {
    border-left: 3px solid var(--color-secondary);
}

.results .alter.fav {
    border-color: var(--color-warning);
    background: var(--color-warning-50);
}

/* ===========================================
   ITEM CARD INTERNAL STRUCTURE
   =========================================== */

   .item-inner > .card-actions {
    grid-area: buttons;
}

.item-inner > [data-id] {
    grid-area: none;
}

.item-inner {
    /* display: flex; */
    flex-direction: column;
    gap: var(--space-3) var(--space-1); /* Dense: 8px */
    grid-template-areas:
        "image title"
        "factors factors"
        "vendors vendors"
        "buttons buttons";
    grid-template-rows: auto auto;
    padding: 0.25rem .75rem;
}

/* Card Side (Image) - Compact Mobile */
.card-side {
    width: 100%;
    /* margin-bottom: var(--space-2); */
}

.card-side img,
.results .alter .card-img img {
    width: 100%;
    /* max-width: 120px; */ /* Compact image on mobile */
    height: auto;
    border-radius: var(--radius-md);
    margin: 0 auto;
    display: block;
    object-fit: contain;
    background: var(--color-bg-secondary);
    /* padding: var(--space-2); */
    transition: transform 0.3s ease;
}

.results .alter:hover .card-side img,
.results .alter:hover .card-img img {
    transform: scale(1.05);
}

/* Item Content */
.item-content {
    flex: 1;
}

.item-content h2 {
    font-size: var(--text-base); /* Dense: 16px */
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    margin: 0 0 var(--space-1) 0;
    line-height: var(--leading-tight);
}

.item-content h2 a {
    color: var(--color-text-primary);
    text-decoration: none;
}

.item-content h2 a:hover {
    color: var(--color-primary);
}

.altr-name {
    /* font-size: var(--text-base); */
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    line-height: var(--leading-tight);
}

/* Card Actions - Bottom Buttons */
.card-actions {
    display: flex;
    gap: var(--space-2);
    /* margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border-light); */
    padding:  var(--space-1) 0 var(--space-3);
}

.btn-details {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-3);
    background: var(--color-primary);
    color: var(--color-text-inverse);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    transition: all 0.2s ease;
}

.btn-details:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
}

.btn-details i {
    font-size: var(--text-base);
}

/* Compare Button - Bottom */
.btn-compare {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-3);
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border-medium);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-compare:hover {
    background: var(--color-bg-secondary);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.results .add-to-com.selected {
    background: var(--color-link);
    color: var(--color-text-inverse);
    border-color: var(--color-link);
}

.btn-compare i {
    font-size: var(--text-base);
}

/* ===========================================
   MODERN VENDOR CARDS
   =========================================== */

   .card-vendors-modern {
    /* margin-top: var(--space-3); */
    /* padding-top: var(--space-3);
    border-top: 1px solid var(--color-border-light); */
    display: block;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.card-vendors-modern:hover {
    opacity: 0.8;
}

.vendor-pricing-modern {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
}

.price-main-modern {
    display: flex;
    align-items: baseline;
    gap: var(--space-1);
}

.price-label {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    font-weight: var(--font-medium);
    white-space: nowrap;
}

.price-value {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--color-primary);
}

.price-comparison-modern {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    flex-wrap: wrap;
}

.vendors-count {
    color: var(--color-text-secondary);
}

.price-comparison-text {
    color: var(--color-success);
    font-weight: var(--font-medium);
}

@media (max-width: 768px) {
    .vendor-pricing-modern {
        align-items: flex-start;
    }
    
    .price-value {
        font-size: var(--text-xl);
    }
}


/* ===========================================
   VARIANTS TAGS
   =========================================== */
   .variants-tags{
    margin-top: var(--space-1);
   }
   .variants-tags > *{
    /* background: var(--color-primary-100); */
    /* color: var(--color-primary) !important; */
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-md);
   
    /* font-size: var(--text-xs); */
    /* font-weight: var(--font-medium); */
   }

   .variants-tags > *.s{
    /* background: black; */
    color: black !important;
    font-weight: 500;
   }

/* ===========================================
   VENDORS & PRICING
   =========================================== */

.results .alter .vendors,
.results .alter .card-vendors {
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid var(--color-border-light);
}

.results .alter .card-vendors .box.fs {
    margin-bottom: var(--space-2);
    padding: 0;
}

.results .alter .card-vendors h4 {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    margin: 0 0 var(--space-2) 0;
}

.results .alter .vendor {
    display: flex;
    /* flex-direction: column; */
    gap: var(--space-2);
    padding: var(--space-2);
    margin-bottom: var(--space-2);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
}

.results .alter .vendor .link.afflt {
    color: var(--color-text-primary);
    text-decoration: none;
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
}

.results .alter .vendor .link.afflt:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.results .alter .vendor .price {
    display: flex;
    align-items: baseline;
    gap: var(--space-1);
    margin: var(--space-2) 0;
}

.results .alter .vendor .price .val {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--color-primary);
}

.results .alter .vendor .price .unit {
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
}

/* .results .group-content .alter .card-img{
    font-size: 2.3rem;
} */

.results .alter .vendor .btns {
    margin-top: var(--space-2);
    width: 100%;
}

.results .alter .vendor .btns .btn,
.results .alter .vendor .btns a,
.results .alter .vendor .btns button,
.results .alter .vendor .btns app-link-button,
.results .alter .vendor .btns app-link-button * {
    font-size: var(--text-xs);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-weight: var(--font-medium);
    border: 1px solid var(--color-primary);
    background: transparent;
    color: var(--color-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
    width: auto;
}

.results .alter .vendor .btns .btn:hover,
.results .alter .vendor .btns a:hover,
.results .alter .vendor .btns button:hover {
    background: var(--color-primary);
    color: var(--color-text-inverse);
    border-color: var(--color-primary);
}

/* ===========================================
   SCORES & FACTORS
   =========================================== */

.results .alter .item-factors,
.results .alter .factors {
    margin-top: var(--space-2);
    font-size: var(--text-xs);
}

.results .alter .factor-item {
    padding: var(--space-1);
    margin-bottom: var(--space-1);
}

.results .alter .scores-wrap {
  
    padding-top: var(--space-2);
    /* border-top: 1px solid var(--color-border-light); */
    background: #f4f8fd;
    border-radius: var(--radius-md);
    padding: var(--space-2);
    margin-top: 0;
}

.results .alter .scores-wrap .prec.kpi {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-2);
    background: var(--color-primary-100);
    border-radius: var(--radius-md);
    text-decoration: none;
    /* margin-bottom: var(--space-2); */
    min-width: 60px;
}

.scores-wrap .line.active{
    margin-bottom: 0.3rem;
}

.results .alter .scores-wrap .ellipsis{
    padding-bottom: 0;
}

.results .alter .scores-wrap .prec.kpi .val {
    font-size: var(--text-l) !important;
    font-weight: var(--font-bold);
    color: var(--color-primary);
    line-height: 1;
}

.results .alter .scores-wrap .prec.kpi .unit {
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
}

.results .alter .scores-wrap .prec.kpi .label {
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
    margin-top: var(--space-1);
}

.results .alter .scores-wrap .lines {
    max-height: 120px;
    overflow: hidden;
    position: relative;
}

.results .alter .scores-wrap .lines .line {
    padding: var(--space-1) 0;
    font-size: var(--text-xs);
    line-height: var(--leading-snug);
}

.results .alter .scores-wrap .lines .line label {
    font-weight: var(--font-medium);
    color: var(--color-text-primary);
    margin-left: var(--space-1);
}

.results .alter .scores-wrap .lines .line span {
    color: var(--color-text-secondary);
}

/* ===========================================
   SIDE MENU
   =========================================== */

.side-menu {
    font-family: var(--font-family-sans);
    background: var(--color-bg-primary);
    border-radius: var(--radius-xl);
    margin-top: 2rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--color-border-light);
}


.side-menu .side-inner {
    background: var(--color-bg-primary);
    padding: var(--space-1);
}

.side-menu .tab-content {
    font-size: var(--text-sm);
}

.side-bottom {
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border-light);
    margin-top: var(--space-3);
}

/* ===========================================
   COMPARE BAR
   =========================================== */

.compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-accent);
    color: var(--color-text-inverse);
    border-top: 1px solid var(--color-border-light);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2) var(--space-3);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.compare-bar .alter-drop {
    width: 100%;
}

.compare-bar .box.fs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.compare-bar .box.fs ul {
    display: flex;
    gap: var(--space-1);
    margin: 0;
    padding: 0;
    list-style: none;
    flex: 1;
}

.compare-bar .box.fs li {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    /* background: rgba(255, 255, 255, 0.1); */
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.compare-bar .box.fs app-button {
    flex-shrink: 0;
}

.compare-bar .box.fs .btn {
    /* background: var(--color-text-inverse);
    color: var(--color-primary); */
    border: none;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    transition: all 0.2s ease;
}

.compare-bar .box.fs .btn:hover:not(:disabled) {
    background: var(--color-gray-100);
    transform: translateY(-1px);
}

/* ===========================================
   PAGER
   =========================================== */

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) 0;
    font-size: var(--text-sm);
    margin-top: var(--space-3);
}

.pager span {
    color: var(--color-text-secondary);
}

.pager b {
    color: var(--color-text-primary);
    font-weight: var(--font-bold);
}

/* ===========================================
   NO RESULTS
   =========================================== */

.no-results {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    color: var(--color-text-secondary);
    font-size: var(--text-lg);
    background: var(--color-bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

/* ===========================================
   TABLET STYLES (768px+)
   =========================================== */

@media (min-width: 768px) {
    main > .content {
        padding: var(--space-4); /* More spacious: 16px */
        /* padding-bottom: 100px; */
        margin-top: 1rem;
    }

    .box.fs.mid {
        padding: var(--space-4);
        margin-bottom: var(--space-4);
        flex-direction: row; /* Horizontal layout on tablet+ */
        align-items: center;
        justify-content: space-between;
    }


    .group-content .group-head{
        display: flex;
    }
    .group-head {
        width: auto; /* Auto width on tablet+ */
        margin-bottom: 0;
        flex: 1;
    }

    .group-head h1 {
        font-size: var(--text-2xl); /* Larger: 24px */
    }

    .group-head span {
        font-size: var(--text-base); /* Larger: 16px */
    }

    /* Sort dropdown - auto width on tablet+ */
    .box.fs.mid .sort-by {
        width: auto;
        flex-shrink: 0;
    }

    .results .alter {
        /* padding: var(--space-4); */
        margin-bottom: var(--space-4);
    }

    .side-menu .side-inner {
        padding: var(--space-4);
    }
    

    .card-side {
        /* width: 150px; */
        flex-shrink: 0;
    }

    .card-side img,
    .results .alter .card-img img {
        max-width: 150px;
    }

    .item-content h2 {
        font-size: var(--text-lg);
    }

    .results .alter .vendor .price .val {
        font-size: var(--text-xl);
    }

    .results .alter .scores-wrap .prec.kpi .val {
        font-size: var(--text-xl);
    }

    .results .alter .scores-wrap .lines {
        max-height: 150px;
    }

    .results .alter .scores-wrap .lines .line {
        font-size: var(--text-sm);
    }

    .compare-bar {
        flex-direction: row;
        padding: var(--space-3) var(--space-4);
    }

    .compare-bar .alter-drop {
        flex: 1;
        max-width: 300px;
    }

    .compare-bar .box.fs li {
        width: 40px;
        height: 40px;
    }

    .results .alter .recomand {
        border-radius: var(--radius-md);
    }
    
}

/* ===========================================
   DESKTOP STYLES (1024px+) - SPACIOUS
   =========================================== */

@media (min-width: 1024px) {
    .content {
        padding: var(--space-6); /* Spacious: 24px */
        padding-bottom: var(--space-6);
        max-width: var(--max-width-7xl);
        margin: 0 auto;
    }

    
    .item-inner {
        display: grid;
        grid-template-areas:
            "image title vendors"
            "image factors buttons";
        grid-template-columns: 0.25fr 1fr 0.5fr;
        grid-template-rows: auto auto;
        gap: var(--space-4);
        padding: 1.5rem;
    }

    .card-actions{
        padding: 0;
        flex-wrap: wrap;
    }
    .card-actions > *{
        white-space: nowrap;
    }


    .results {
        padding: 0;
    }

    .box.fs.mid {
        padding: var(--space-6);
        margin-bottom: var(--space-6);
        border-radius: var(--radius-xl);
        flex-direction: row; /* Maintain horizontal layout */
        align-items: center;
        justify-content: space-between;
    }

    .group-head {
        margin-bottom: 0; /* No margin, using gap */
        width: auto; /* Auto width on desktop */
        flex: 1; /* Take available space */
    }

    .group-head h1 {
        font-size: var(--text-3xl); /* Large: 30px */
    }

    .group-head span {
        font-size: var(--text-lg);
        margin-top: var(--space-2);
    }

    /* Sort dropdown - auto width on desktop */
    .box.fs.mid .sort-by {
        width: auto;
        flex-shrink: 0;
    }

    .results .alter {
        /* padding: var(--space-6); */
        margin-bottom: var(--space-4);
        border-radius: var(--radius-xl);
    }

    .item-inner {
        gap: var(--space-4);
    }

    .card-side {
        /* width: 200px; */
    }

    .card-side img,
    .results .alter .card-img img {
        max-width: 200px;
    }

    .item-content h2 {
        font-size: var(--text-xl);
        margin-bottom: var(--space-2);
    }

    .results .alter .vendor {
        font-size: var(--text-sm);
        padding: var(--space-3);
    }

    .results .alter .vendor .price .val {
        font-size: var(--text-lg);
    }

    .results .alter .scores-wrap .prec.kpi {
        padding: var(--space-3);
        min-width: 80px;
    }

    .results .alter .scores-wrap .prec.kpi .val {
        font-size: var(--text-2xl);
    }

    .results .alter .scores-wrap .lines {
        max-height: 180px;
    }

    .results .alter .scores-wrap .lines .line {
        font-size: var(--text-sm);
        padding: var(--space-2) 0;
    }

    .results .alter .item-factors,
    .results .alter .factors {
        font-size: var(--text-sm);
    }

    .compare-bar {
        padding: var(--space-4) var(--space-6);
        /* max-width: var(--max-width-7xl); */
        margin: 0 auto;
        /* left: 50%;
        transform: translateX(-50%); */
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }

    .pager {
        padding: var(--space-4) 0;
        font-size: var(--text-base);
        margin-top: var(--space-6);
    }
}

/* ===========================================
   LARGE DESKTOP (1280px+)
   =========================================== */

@media (min-width: 1280px) {
    .content {
        padding: var(--space-8);
    }

    .box.fs.mid {
        padding: var(--space-6);
        margin-bottom: var(--space-8);
    }

    .results .alter {
        /* padding: var(--space-8); */
        margin-bottom: var(--space-4);
    }

    .item-inner {
        gap: var(--space-4);
    }

    .card-side {
        /* width: 240px; */
    }

    .card-side img,
    .results .alter .card-img img {
        max-width: 240px;
    }
}

/* ===========================================
   ACCESSIBILITY
   =========================================== */

@media (prefers-reduced-motion: reduce) {
    .results .alter,
    .results .alter .card-side img,
    .results .alter .card-img img {
        transition: none;
    }
}

/* Focus styles for keyboard navigation */
.results .alter:focus,
button#toggleSideMenu:focus,
.results .add-to-com:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ===========================================
   END RESULTS OVERRIDE STYLES
   =========================================== */

