/* Modern CeliacSavings Styles - Clean Professional Design v4.0 */
/* Updated: 2025-08-17 - Aligned product details */

/* New aligned product detail rows */
.product-info-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 12px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #f3f4f6;
}

.product-details-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.detail-label {
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 4px;
    font-weight: 500;
}

.detail-value {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.detail-value.missing {
    color: #9ca3af;
    font-weight: 400;
}

.category-value {
    font-size: 14px;
    font-weight: 600;
    color: #4f46e5;
    cursor: pointer;
}

.category-value:hover {
    text-decoration: underline;
}

.regular-product-header {
    padding: 12px 20px 8px 20px;
    background: #ffffff;
}

.regular-name {
    font-size: 15px;
    font-weight: 500;
    color: #374151;
    line-height: 1.4;
    cursor: pointer;
}

/* Clean FSA checkbox control */
.fsa-controls {
    display: flex;
    align-items: center;
}

.fsa-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.fsa-checkbox input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    accent-color: #10b981;
}

.fsa-text {
    margin-right: 12px;
}

.fsa-amount {
    font-size: 16px;
    font-weight: 600;
    color: #15803d;
    background: #f0fdf4;
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

:root {
    /* Color System */
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --primary-light: #818CF8;
    --success: #10B981;
    --success-light: #34D399;
    --warning: #F59E0B;
    --error: #EF4444;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    
    /* Animations */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: linear-gradient(to bottom, #FFFFFF, #F9FAFB);
    color: var(--gray-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navigation */
.nav-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-100);
    z-index: 100;
    transition: var(--transition-base);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative; /* Anchor for mobile .nav-links dropdown positioning. */
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--gray-900);
}

.logo-icon {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    gap: var(--space-xl);
}

.nav-link {
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
}

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

/* Hero Section */
.hero {
    padding-top: 120px;
    padding-bottom: var(--space-3xl);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    text-align: center;
}

.hero-badge {
    display: inline-block;
    background: var(--success-light);
    color: white;
    padding: var(--space-xs) var(--space-md);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
}

.beta-badge {
    display: inline-block;
    background: #f59e0b;
    color: white;
    padding: var(--space-xs) var(--space-md);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--space-lg);
    color: var(--gray-900);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.purple-text {
    color: #8b5cf6;
    font-weight: 800;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray-600);
    max-width: 600px;
    margin: 0 auto var(--space-2xl);
    line-height: 1.6;
}

.highlight-amount {
    color: var(--success);
    font-weight: 700;
}

/* Savings Preview */
.savings-preview {
    display: flex;
    justify-content: center;
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
    flex-wrap: wrap;
}

.savings-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
}

#savings-counter {
    color: var(--success);
}

/* Upload Zone */
.upload-zone {
    max-width: 600px;
    margin: 0 auto var(--space-2xl);
    background: white;
    border: 2px dashed var(--gray-300);
    border-radius: 16px;
    padding: var(--space-2xl);
    transition: var(--transition-base);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-zone:hover {
    border-color: var(--primary);
    background: var(--gray-50);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.upload-zone.dragging {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(129, 140, 248, 0.05));
}

.upload-icon {
    color: var(--gray-400);
    margin-bottom: var(--space-md);
}

.upload-text {
    color: var(--gray-700);
    margin-bottom: var(--space-xs);
}

.upload-text strong {
    color: var(--gray-900);
}

.upload-formats {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Upload Processing */
.upload-processing {
    text-align: center;
}

.processing-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-md);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.processing-text {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-lg);
}

.processing-steps {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
}

.processing-steps .step {
    padding: var(--space-xs) var(--space-md);
    background: var(--gray-100);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--gray-500);
    transition: var(--transition-base);
}

.processing-steps .step.active {
    background: var(--primary);
    color: white;
}

/* IRS Disclaimer */
.irs-disclaimer {
    margin-top: var(--space-lg);
    text-align: center;
}

.irs-disclaimer p {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin: 0;
    line-height: 1.4;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Store Support Note */
.store-support-note {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin: var(--space-md) auto 0;
    text-align: center;
}

.request-stores-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.request-stores-link:hover {
    text-decoration: underline;
}

/* Store Request Modal Styles */
.store-selector {
    position: relative;
}

.selected-stores {
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    padding: 12px;
    min-height: 50px;
    cursor: pointer;
    background: white;
    transition: border-color 0.2s;
}

.selected-stores:hover {
    border-color: var(--primary);
}

.selected-stores.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.placeholder-text {
    color: var(--gray-400);
    font-style: italic;
}

.selected-store-tag {
    display: inline-flex;
    align-items: center;
    background: var(--primary-light);
    color: var(--primary);
    padding: 4px 8px;
    border-radius: 4px;
    margin: 2px;
    font-size: 0.875rem;
    font-weight: 500;
}

.remove-store {
    margin-left: 6px;
    cursor: pointer;
    color: var(--primary);
    font-weight: bold;
}

.remove-store:hover {
    color: var(--error);
}

.store-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--gray-200);
    border-top: none;
    border-radius: 0 0 8px 8px;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.store-search {
    padding: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.store-options {
    max-height: 250px;
    overflow-y: auto;
}

.store-option {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: background-color 0.2s;
}

.store-option:hover {
    background: var(--gray-50);
}

.store-option.selected {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
}

.add-custom-store {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.add-custom-store .form-input {
    flex: 1;
    margin: 0;
}

.modal-description {
    color: var(--gray-600);
    margin-bottom: var(--space-lg);
    line-height: 1.6;
}

/* How It Works Section */
.how-it-works {
    padding: var(--space-3xl) 0;
    background: white;
    border-top: 1px solid var(--gray-100);
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: var(--space-sm);
}

.section-subtitle {
    text-align: center;
    color: var(--gray-600);
    margin-bottom: var(--space-2xl);
}

.steps-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: center;
    gap: var(--space-lg);
}

.step-card {
    background: var(--gray-50);
    padding: var(--space-xl);
    border-radius: 16px;
    text-align: center;
    position: relative;
    transition: var(--transition-base);
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.step-number {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.step-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.step-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
}

.step-card p {
    color: var(--gray-600);
    font-size: 0.875rem;
}

.step-arrow {
    color: var(--gray-400);
    font-size: 1.5rem;
}

/* Social Proof */
.social-proof {
    padding: var(--space-3xl) 0;
    background: var(--gray-50);
}

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.testimonial-card {
    background: white;
    padding: var(--space-lg);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

.stars {
    color: #FFC107;
    margin-bottom: var(--space-md);
}

.testimonial-text {
    color: var(--gray-700);
    margin-bottom: var(--space-md);
    font-style: italic;
}

.testimonial-author strong {
    display: block;
    color: var(--gray-900);
    font-weight: 600;
}

.testimonial-author span {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Simple Review Layer */
.simple-header {
    background: white;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.simple-title h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    color: var(--gray-900);
}

.simple-subtitle {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.review-button {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-lg);
    border-radius: 8px;
    border: none;
    background: var(--primary);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
}

.review-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Simple Summary */
.simple-summary {
    padding: var(--space-xl);
    background: var(--gray-50);
    display: flex;
    gap: var(--space-xl);
    align-items: center;
}

.simple-summary-card {
    background: linear-gradient(135deg, var(--success), var(--success-light));
    color: white;
    padding: var(--space-xl);
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    box-shadow: var(--shadow-lg);
    flex: 1;
}

.simple-summary-card .summary-icon {
    font-size: 3rem;
}

.simple-summary-card .summary-content {
    display: flex;
    flex-direction: column;
}

.simple-summary-card .summary-label {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.simple-summary-card .summary-value {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.simple-summary-card .summary-detail {
    font-size: 0.875rem;
    opacity: 0.9;
}

.simple-stats {
    display: flex;
    gap: var(--space-xl);
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Simple Products List */
.simple-products {
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.simple-product-card {
    background: white;
    border-radius: 12px;
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-base);
}

.simple-product-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.simple-product-card.eligible {
    border-color: var(--success);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(52, 211, 153, 0.05));
}

.simple-product-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.simple-product-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.simple-product-details h4 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
    color: var(--gray-900);
}

.simple-product-meta {
    display: flex;
    gap: var(--space-md);
    color: var(--gray-500);
    font-size: 0.875rem;
}

.simple-product-price {
    font-weight: 600;
    color: var(--gray-900);
}

.simple-product-actions {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.simple-savings-display {
    text-align: right;
    min-width: 100px;
}

.simple-savings-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 0.125rem;
}

.simple-savings-label {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.simple-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.simple-toggle-switch {
    display: none;
}

.simple-toggle-label {
    position: relative;
    width: 56px;
    height: 32px;
    background: var(--gray-300);
    border-radius: 16px;
    cursor: pointer;
    transition: background var(--transition-base);
}

.simple-toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 28px;
    height: 28px;
    background: white;
    border-radius: 50%;
    transition: transform var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.simple-toggle-switch:checked + .simple-toggle-label {
    background: var(--success);
}

.simple-toggle-switch:checked + .simple-toggle-label .simple-toggle-slider {
    transform: translateX(24px);
}

.simple-toggle-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
}

.simple-toggle-switch:checked ~ .simple-toggle-text {
    color: var(--success);
}

.simple-title h2 {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-xs);
}

.simple-subtitle {
    color: var(--gray-600);
    font-size: 0.875rem;
}

.simple-summary {
    padding: var(--space-lg);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.simple-summary-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.summary-icon {
    font-size: 2rem;
    opacity: 0.9;
}

.summary-content {
    flex: 1;
}

.summary-label {
    display: block;
    font-size: 0.875rem;
    opacity: 0.8;
    margin-bottom: var(--space-xs);
}

.summary-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: var(--space-xs);
}

.summary-detail {
    display: block;
    font-size: 0.875rem;
    opacity: 0.7;
}


.simple-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.8;
}

.simple-products {
    padding: var(--space-lg);
    max-width: 800px;
    margin: 0 auto;
}

.simple-section-header {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: var(--space-xl) 0 var(--space-md) 0;
    padding: var(--space-sm) 0;
    border-bottom: 2px solid var(--gray-200);
}

.simple-product-card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-sm);
    padding: var(--space-md);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.simple-product-card.eligible {
    border-color: var(--success);
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.simple-product-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.simple-product-info {
    display: flex;
    align-items: center;
    flex: 1;
    gap: var(--space-lg);
}

.simple-product-main {
    flex: 1;
}

.simple-product-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

/* Force lowercase for product names in detailed view */
.product-name {
    text-transform: lowercase !important;
}

.product-name.regular-name {
    text-transform: lowercase !important;
}

.product-brand {
    text-transform: lowercase !important;
}

.simple-product-brand {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.simple-product-badges {
    display: flex;
    gap: var(--space-xs);
}

.simple-gf-badge {
    background: var(--success);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.simple-product-value {
    text-align: right;
    min-width: 100px;
}

.simple-savings-amount,
.simple-no-savings {
    display: block;
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.125rem;
    line-height: 1.2;
}

.simple-savings-amount {
    color: var(--success);
}

.simple-no-savings {
    color: var(--gray-400);
}

.simple-savings-label,
.simple-no-savings-label {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.simple-toggle-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 80px;
    padding: 0.5rem;
}

.simple-toggle-label {
    display: block;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.simple-toggle {
    appearance: none;
    width: 52px;
    height: 28px;
    background: var(--gray-300);
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    transition: all var(--transition-base);
    border: 2px solid transparent;
    margin: 0;
}

.simple-toggle:checked {
    background: var(--success);
}

.simple-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.simple-toggle:hover {
    background: var(--gray-400);
}

.simple-toggle:checked:hover {
    background: var(--success);
}

.simple-toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: all var(--transition-base);
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.simple-toggle:checked + .simple-toggle-slider {
    transform: translateX(24px);
}

.simple-toggle-text {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-600);
    text-align: center;
    margin-top: 0.25rem;
    line-height: 1;
}

@media (max-width: 768px) {
    .simple-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-md);
    }
    
    .simple-product-card {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-md);
        padding: var(--space-lg);
    }
    
    .simple-product-info {
        flex-direction: row;
        align-items: flex-start;
    }
    
    .simple-product-value {
        text-align: left;
        min-width: auto;
    }
    
    .simple-toggle-wrapper {
        flex-direction: row;
        justify-content: center;
        margin-left: 0;
        gap: var(--space-sm);
    }
    
    .simple-toggle-text {
        font-size: 0.875rem;
    }
}

/* Regular Equivalent Section */
.regular-equivalent-section {
    background: var(--gray-50);
    border-radius: 8px;
    padding: var(--space-md);
    margin: var(--space-sm) 0;
    border-left: 3px solid var(--primary);
}

.regular-equivalent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.regular-product-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-800);
    flex: 1;
    margin-right: var(--space-sm);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: var(--transition-base);
}

.regular-product-name:hover {
    background: var(--gray-100);
}

.regular-price {
    color: var(--gray-700);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: var(--transition-base);
}

.regular-price:hover {
    background: var(--gray-100);
}

.regular-status {
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.regular-status.premium-found {
    background: var(--danger);
    color: white;
}

.regular-status.savings-found {
    background: var(--success);
    color: white;
}

.regular-status.price-match {
    background: var(--primary);
    color: white;
}

.price-comparison-simple {
    margin: var(--space-sm) 0;
}

.price-pair {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
}

.gf-price {
    color: var(--gray-700);
}

.vs-arrow {
    color: var(--gray-400);
    font-size: 0.9rem;
}


.premium-badge {
    background: var(--danger);
    color: white;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.savings-badge {
    background: var(--success);
    color: white;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.per-oz-comparison {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.comparison-actions {
    display: flex;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
}

.btn-alternatives, .btn-edit-comparison {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-base);
    flex: 1;
}

.btn-alternatives:hover, .btn-edit-comparison:hover {
    background: var(--primary-dark);
}

.btn-edit-comparison {
    background: var(--gray-600);
}

.btn-edit-comparison:hover {
    background: var(--gray-700);
}

.regular-equivalent-message {
    text-align: center;
    padding: var(--space-md);
    color: var(--gray-600);
    font-size: 0.85rem;
}

.price-comparison-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
    gap: var(--space-md);
    align-items: center;
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: white;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
}

.price-comparison-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.price-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
}

.price-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
}

.price-per-oz {
    font-size: 0.675rem;
    color: var(--gray-400);
}

.price-comparison-arrow {
    font-size: 0.875rem;
    color: var(--gray-400);
    font-weight: 500;
}

/* Results Dashboard */
.results-header {
    background: white;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.back-button, .export-button {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border-radius: 8px;
    border: 1px solid var(--gray-300);
    background: white;
    color: var(--gray-700);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
}

.back-button:hover, .export-button:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.export-button {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.export-button:hover {
    background: var(--primary-dark);
}

.results-title h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.receipt-date {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Savings Summary */
.savings-summary {
    padding: var(--space-xl);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    background: var(--gray-50);
}

.summary-card {
    background: white;
    padding: var(--space-lg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    box-shadow: var(--shadow-sm);
}

.summary-card.primary {
    background: linear-gradient(135deg, var(--success), var(--success-light));
    color: white;
    grid-column: span 2;
}

.summary-icon {
    font-size: 2rem;
}

.summary-content {
    display: flex;
    flex-direction: column;
}

.summary-label {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.summary-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.summary-detail {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Filter Bar */
.filter-bar {
    padding: var(--space-md) var(--space-xl);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.filter-tabs {
    display: flex;
    gap: var(--space-xs);
}

.filter-tab {
    padding: var(--space-sm) var(--space-md);
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition-base);
}

.filter-tab:hover {
    background: var(--gray-100);
}

.filter-tab.active {
    background: var(--primary);
    color: white;
}

/* FSA Tab - Important/Official Styling */
.filter-tab.fsa-tab {
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--gray-700);
}

.filter-tab.fsa-tab:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.filter-tab.fsa-tab.active {
    background: var(--primary);
    color: white;
    font-weight: 700;
}

/* Not FSA Tab - Casual/Informational Styling */
.filter-tab.not-fsa-tab {
    font-weight: 400;
    text-transform: lowercase;
    color: var(--gray-500);
    letter-spacing: normal;
}

.filter-tab.not-fsa-tab:hover {
    background: var(--gray-50);
    color: var(--gray-600);
}

.filter-tab.not-fsa-tab.active {
    background: var(--gray-600);
    color: white;
    font-weight: 500;
}

.sort-control {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.sort-control label {
    font-size: 0.875rem;
    color: var(--gray-600);
}

#sort-select {
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: white;
    font-size: 0.875rem;
}

/* Products Grid */
.products-grid {
    padding: var(--space-xl);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-lg);
}

.product-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s ease;
    position: relative;
    border: 1px solid #e5e7eb;
    margin-bottom: 20px;
    overflow: hidden;
}

.product-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.product-card.fsa-eligible {
    border-color: #10b981;
    background: #ffffff;
    position: relative;
}

.product-card.fsa-eligible::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #10b981;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: var(--space-md);
}

.product-info h4 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
    color: var(--gray-900);
}

.product-brand {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.product-badges {
    display: flex;
    gap: var(--space-xs);
}

.badge-gf, .badge-fsa {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-gf {
    background: var(--warning);
    color: white;
}

.badge-fsa {
    background: var(--success);
    color: white;
}

.product-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--gray-100);
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 0.125rem;
}

.detail-value {
    font-weight: 600;
    color: var(--gray-900);
}

.product-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--gray-100);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-bottom: var(--space-md);
}

.product-savings {
    background: #10b981;
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin: 16px 0;
    text-align: center;
}

.savings-amount {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.savings-description {
    font-size: 13px;
    opacity: 0.95;
}

.product-actions {
    display: flex;
    gap: var(--space-sm);
}

.btn-edit, .btn-toggle {
    flex: 1;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: white;
    color: #4b5563;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-edit:hover {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

.btn-toggle.active {
    background: #10b981;
    color: white;
    border-color: #10b981;
    font-weight: 500;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--gray-100);
    color: var(--gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
}

.modal-close:hover {
    background: var(--gray-200);
}

.modal-body {
    padding: var(--space-lg);
    min-height: 350px; /* Ensure enough space for dropdowns */
}

.comparison-view {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.product-panel {
    background: var(--gray-50);
    padding: var(--space-lg);
    border-radius: 12px;
}

.product-panel h4 {
    margin-bottom: var(--space-md);
    color: var(--gray-900);
}

/* Enhanced Product Card Sections */
.product-header-clean {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--gray-100);
}

.product-main-info h4 {
    margin: 0 0 var(--space-xs) 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.3;
}

.product-brand {
    color: var(--gray-600);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-fsa-small {
    background: var(--success);
    color: white;
    padding: var(--space-xs) var(--space-sm);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.product-quick-info {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: var(--gray-50);
    border-radius: 12px;
}

.category-tag, .price-tag, .size-tag, .per-oz-tag {
    padding: var(--space-xs) var(--space-sm);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-base);
}

.category-tag {
    background: var(--primary);
    color: white;
    cursor: pointer;
}

.category-tag:hover {
    background: var(--primary-dark);
}

.price-tag {
    background: var(--gray-200);
    color: var(--gray-800);
    cursor: pointer;
}

.price-tag:hover {
    background: var(--gray-300);
}

.size-tag {
    background: var(--gray-200);
    color: var(--gray-800);
    cursor: pointer;
}

.size-tag:hover {
    background: var(--gray-300);
}

.per-oz-tag {
    background: var(--warning);
    color: white;
    font-weight: 600;
}

.per-oz-tag.missing {
    background: var(--gray-300);
    color: var(--gray-600);
}

/* Enhanced Comparison Section */
.comparison-section {
    background: var(--gray-50);
    border-radius: 12px;
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    border-left: 4px solid var(--primary);
}

.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.comparison-label {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 1rem;
}

.edit-icon {
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: 6px;
    transition: var(--transition-base);
}

.edit-icon:hover {
    background: var(--gray-200);
}

.regular-product-info {
    margin-bottom: var(--space-md);
}

.regular-name {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--space-xs);
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: 6px;
    transition: var(--transition-base);
}

.regular-name:hover {
    background: var(--gray-100);
}

.regular-details {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    flex-wrap: wrap;
}

.regular-price {
    background: var(--gray-200);
    padding: var(--space-xs) var(--space-sm);
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
}

.regular-price:hover {
    background: var(--gray-300);
}

.regular-size, .regular-per-oz {
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* Enhanced Premium Math Section */
.premium-math {
    background: white;
    border-radius: 10px;
    padding: var(--space-md);
    border: 1px solid var(--gray-200);
}

.math-step {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
    padding: var(--space-xs) 0;
}

.math-label {
    color: var(--gray-700);
    font-size: 0.9rem;
}

.math-calc {
    font-family: var(--font-mono);
    background: var(--gray-100);
    padding: var(--space-xs) var(--space-sm);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--gray-800);
}

.premium-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: #f9fafb;
    border-radius: 6px;
    margin-top: 8px;
}

.result-label {
    font-weight: 600;
    color: var(--gray-800);
}

.result-amount {
    font-size: 1.1rem;
    font-weight: 700;
}

.result-amount.premium {
    color: var(--error);
}

.result-amount.savings {
    color: var(--success);
}

.fsa-eligible {
    background: var(--success);
    color: white;
    padding: var(--space-xs) var(--space-sm);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* No Match Found Status */
.regular-status.no-match {
    background: var(--gray-300);
    color: var(--gray-700);
    padding: var(--space-xs) var(--space-sm);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.btn-find-alternatives {
    background: var(--primary);
    color: white;
    border: none;
    padding: var(--space-sm) var(--space-md);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition-base);
}

.btn-find-alternatives:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Enhanced FSA Amount Section */
.product-savings {
    background: linear-gradient(135deg, var(--success), var(--success-light));
    color: white;
    padding: var(--space-lg);
    border-radius: 12px;
    text-align: center;
    margin-bottom: var(--space-md);
    position: relative;
    overflow: hidden;
}

.product-savings::before {
    content: '💰';
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    font-size: 1.5rem;
    opacity: 0.3;
}

.savings-amount {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.savings-description {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Enhanced Action Buttons */
.product-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.btn-toggle {
    flex: 1;
    padding: var(--space-md);
    border: 2px solid var(--gray-300);
    background: white;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
}

.btn-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-toggle.active {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

/* Enhanced Editable Field Indicators */
.editable-field {
    position: relative;
    transition: var(--transition-base);
    border-radius: 4px;
    padding: 2px 4px;
    border: 1px solid transparent;
    cursor: text;
}

.editable-field:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.editable-field:focus {
    background: white;
    border-color: var(--primary);
    outline: 2px solid var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Edit Icon Indicators */
.editable-field::after {
    content: '✏️';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    opacity: 0;
    transition: var(--transition-base);
    pointer-events: none;
}

.editable-field:hover::after {
    opacity: 0.6;
}

/* Enhanced tooltips for mobile */
@media (max-width: 768px) {
    .editable-field::after {
        display: none;
    }
    
    .editable-field:hover {
        border-color: var(--primary);
        background: var(--primary-light);
        color: white;
    }
}

.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-input, .form-select {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.875rem;
    transition: var(--transition-base);
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.size-input {
    display: flex;
    gap: var(--space-xs);
}

.size-input input {
    flex: 1;
}

.size-input select {
    width: 80px;
}

.comparison-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
}

.vs-badge {
    background: var(--gray-900);
    color: white;
    padding: var(--space-xs) var(--space-sm);
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.875rem;
}

.comparison-loading {
    text-align: center;
    padding: var(--space-xl);
}

.spinner-small {
    width: 32px;
    height: 32px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-sm);
}

/* Price Analysis */
.price-analysis {
    background: var(--gray-50);
    padding: var(--space-lg);
    border-radius: 12px;
}

.price-analysis h4 {
    margin-bottom: var(--space-md);
}

.price-bars {
    margin-bottom: var(--space-lg);
}

.price-bar {
    display: grid;
    grid-template-columns: 100px 1fr 80px;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.bar-label {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.bar-track {
    height: 24px;
    background: var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    transition: width var(--transition-slow);
}

.gf-bar .bar-fill {
    background: linear-gradient(135deg, var(--warning), #FBBF24);
}

.regular-bar .bar-fill {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.bar-value {
    font-weight: 700;
    text-align: right;
}

.savings-calculation {
    background: white;
    padding: var(--space-md);
    border-radius: 8px;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--gray-100);
}

.calc-row:last-child {
    border-bottom: none;
}

.calc-row.total {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--success);
    padding-top: var(--space-md);
}

/* Modal Footer */
.modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
}

.btn-secondary, .btn-primary {
    padding: var(--space-sm) var(--space-lg);
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
    border: none;
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

/* Header Buttons */
.header-buttons {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.add-custom-button {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: var(--success);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
}

.add-custom-button:hover {
    background: var(--success-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.add-custom-button svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

/* Custom Product Modal Specific Styles */
.form-textarea {
    width: 100%;
    padding: var(--space-sm);
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.875rem;
    resize: vertical;
    transition: var(--transition-base);
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 0.9rem;
}

.form-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.checkbox-text {
    color: var(--gray-700);
}

.required {
    color: var(--error);
    font-weight: 600;
}

/* User Override Indicators */
.product-badges {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    display: flex;
    gap: var(--space-xs);
    z-index: 10;
}

.product-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-badge {
    background: var(--info);
    color: white;
}

.override-badge {
    background: var(--warning);
    color: var(--warning-dark);
}

.product-card.custom-product {
    border-left: 4px solid var(--info);
}

.product-card.has-overrides {
    border-left: 4px solid var(--warning);
}

.product-card.custom-product.has-overrides {
    border-left: 4px solid var(--info);
    border-image: linear-gradient(to bottom, var(--info), var(--warning)) 1;
}

.override-indicator {
    margin-left: 4px;
    font-size: 0.8em;
    opacity: 0.7;
    transition: var(--transition-base);
}

.override-indicator:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Enhanced product card for overrides */
.product-card {
    position: relative; /* For absolute positioned badges */
}

/* Product card that needs attention */
.product-card.needs-attention {
    animation: pulse-border 2s ease-in-out infinite;
    border: 2px solid var(--error);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

/* Product card that needs size information */
.product-card.needs-size .stat-cell[data-field="size_oz"],
.product-card.needs-size .editable-size {
    background-color: #fee2e2 !important;
    border: 2px solid #ef4444 !important;
    animation: pulse-border 2s ease-in-out infinite;
}

/* Visual indicator for missing size */
.stat-cell.missing-size {
    background-color: #fef2f2;
    border: 1px solid #fca5a5;
    position: relative;
}

.stat-cell.missing-size::after {
    content: "Required";
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

@keyframes pulse-border {
    0%, 100% {
        border-color: var(--error);
        box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
    }
    50% {
        border-color: var(--error-dark);
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
    }
}

/* Category section that needs attention */
.product-card.needs-attention .category-display {
    border-color: var(--error);
    background: rgba(254, 202, 202, 0.1);
}

/* Toast */
.toast {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    background: var(--gray-900);
    color: white;
    padding: var(--space-md) var(--space-lg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    box-shadow: var(--shadow-xl);
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition-base);
    z-index: 2000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    width: 20px;
    height: 20px;
    color: var(--success);
}

/* Hamburger toggle — hidden on desktop, shown on mobile via media query below.
   Tied to JS in index-modern.html that toggles .nav-links-open. */
.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    padding: 0;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.nav-toggle:focus-visible {
    outline: 2px solid var(--primary, #4F46E5);
    outline-offset: 2px;
}
.nav-toggle svg { width: 20px; height: 20px; color: var(--gray-700, #374151); }

/* Responsive Design */
@media (max-width: 768px) {
    /* Show the hamburger; collapse the link list into a dropdown panel that's
       hidden by default and revealed via .nav-links-open. */
    .nav-toggle { display: inline-flex; }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        right: 16px;
        margin-top: 8px;
        background: white;
        border: 1px solid var(--gray-200, #e5e7eb);
        border-radius: 12px;
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
        padding: 8px;
        min-width: 200px;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        z-index: 50;
    }
    .nav-links.nav-links-open { display: flex; }
    .nav-links a, .nav-links .lmn-pill {
        padding: 10px 12px;
        border-radius: 8px;
        font-size: 0.95rem;
        text-align: left;
        white-space: nowrap;
    }
    .nav-links a:hover, .nav-links .lmn-pill:hover { background: #f9fafb; }
    #auth-links { display: flex; flex-direction: column; gap: 2px; align-items: stretch; }

    .hero-title {
        font-size: 2rem;
    }
    
    .savings-preview {
        gap: var(--space-lg);
    }
    
    .steps-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
    
    .step-arrow {
        display: none;
    }
    
    .testimonial-grid {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-md);
    }
    
    .summary-card.primary {
        grid-column: span 1;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        padding: var(--space-md);
    }
    
    .comparison-view {
        grid-template-columns: 1fr;
    }
    
    .comparison-arrow {
        transform: rotate(90deg);
    }
    
    .modal-container {
        border-radius: 0;
        max-height: 100vh;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.focus-visible:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.high-contrast {
    --primary: #000000;
    --success: #006600;
    --error: #CC0000;
}

/* Performance Optimizations */
.lazy-image {
    opacity: 0;
    transition: opacity var(--transition-base);
}

.lazy-image.loaded {
    opacity: 1;
}

.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

/* Print Styles */
@media print {
    .nav-container,
    .upload-zone,
    .filter-bar,
    .product-actions,
    .modal-overlay,
    .toast {
        display: none !important;
    }
    
    .page {
        box-shadow: none !important;
    }
    
    .product-card {
        break-inside: avoid;
    }
}

/* Enhanced Mobile Responsive for Product Cards */
@media (max-width: 768px) {
    /* Enhanced Mobile Product Cards */
    .product-card {
        padding: var(--space-lg);
        margin-bottom: var(--space-lg);
        border-radius: 12px;
    }
    
    .product-header-clean {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-sm);
    }
    
    .product-main-info h4 {
        font-size: 1.1rem;
        line-height: 1.4;
    }
    
    .product-quick-info {
        flex-direction: column;
        gap: var(--space-xs);
    }
    
    .category-tag, .price-tag, .size-tag, .per-oz-tag {
        display: block;
        text-align: center;
        padding: var(--space-sm);
    }
    
    /* Mobile Comparison Section */
    .comparison-section {
        padding: var(--space-md);
    }
    
    .comparison-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-sm);
        text-align: center;
    }
    
    .regular-details {
        flex-direction: column;
        gap: var(--space-xs);
        align-items: stretch;
    }
    
    .regular-price, .regular-size, .regular-per-oz {
        display: block;
        text-align: center;
        padding: var(--space-xs);
        background: var(--gray-100);
        border-radius: 6px;
    }
    
    /* Mobile Math Section */
    .math-step {
        flex-direction: column;
        gap: var(--space-xs);
        text-align: center;
    }
    
    .math-calc {
        word-break: break-all;
    }
    
    .premium-result {
        flex-direction: column;
        gap: var(--space-xs);
        text-align: center;
    }
    
    /* Mobile FSA Amount */
    .product-savings {
        padding: var(--space-md);
    }
    
    .savings-amount {
        font-size: 1.5rem;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary: #0000CC;
        --success: #006600;
        --error: #CC0000;
        --gray-100: #FFFFFF;
        --gray-900: #000000;
    }
}

/* Utility Classes */
.page {
    min-height: 100vh;
}

.page.active {
    display: block;
    animation: fadeIn var(--transition-base);
}

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }

.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }

/* Clean Product Card Styles */
.product-header-clean {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    background: #ffffff;
}

.product-main-info h4 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.product-main-info .product-brand {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-fsa-small {
    background: #10b981;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Product Quick Info Tags */
.product-quick-info {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.category-tag {
    background: #eef2ff;
    color: #4f46e5;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    border: 1px solid #c7d2fe;
}

.category-tag:hover {
    background: #e0e7ff;
    border-color: #a5b4fc;
}

.price-tag {
    background: #f9fafb;
    color: #111827;
    padding: 6px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
}

.size-tag {
    background: #f9fafb;
    color: #6b7280;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.per-oz-tag {
    background: #fef3c7;
    color: #92400e;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #fde68a;
}

.per-oz-tag.missing {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: pointer;
    border-color: #e5e7eb;
}

/* Clean Regular Equivalent Section */
.regular-equivalent-section-clean {
    background: var(--gray-50);
    border-radius: 6px;
    padding: var(--space-sm);
    margin: var(--space-sm) 0;
}

.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xs);
}

.comparison-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    font-weight: 500;
}

.edit-icon {
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0.6;
    transition: var(--transition-base);
}

.edit-icon:hover {
    opacity: 1;
}

.comparison-product {
    font-size: 0.9rem;
    color: var(--gray-800);
    margin-bottom: var(--space-sm);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: var(--transition-base);
}

.comparison-product:hover {
    background: var(--gray-100);
}

.comparison-prices {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
    gap: var(--space-sm);
    align-items: center;
}

.price-gf, .price-regular {
    text-align: center;
}

.price-label-small {
    display: block;
    font-size: 0.65rem;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.price-value-large {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    cursor: pointer;
}

.price-value-large:hover {
    color: var(--primary);
}

.per-oz-small {
    display: block;
    font-size: 0.65rem;
    color: var(--gray-400);
    margin-top: 0.125rem;
}

.price-divider {
    color: var(--gray-300);
    font-size: 0.75rem;
}

.price-difference-display {
    text-align: center;
    padding: 0.25rem;
    background: white;
    border-radius: 4px;
}

.difference-label {
    display: block;
    font-size: 0.65rem;
    color: var(--gray-500);
    margin-bottom: 0.125rem;
    text-transform: uppercase;
}

.difference-amount {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
}

.difference-amount.premium {
    color: var(--danger);
}

.difference-amount.savings {
    color: var(--success);
}

/* Searchable dropdown styles */
.searchable-dropdown {
    position: relative;
    width: 100%;
}

.dropdown-input {
    width: 100%;
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: white;
    font-size: 0.875rem;
    transition: var(--transition-base);
}

.dropdown-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.dropdown-input.loading {
    background-image: url("data:image/svg+xml,%3csvg width='16' height='16' fill='%23666' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 0a8 8 0 0 1 8 8h-2a6 6 0 0 0-6-6V0z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    animation: spin 1s linear infinite;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--gray-300);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1001;
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.15);
    display: none;
    scrollbar-width: thin;
    scrollbar-color: var(--gray-400) var(--gray-100);
}

.dropdown-menu::-webkit-scrollbar {
    width: 8px;
}

.dropdown-menu::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

.dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

.dropdown-menu.show {
    display: block;
}

.dropdown-option {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition-base);
    border-bottom: 1px solid var(--gray-100);
    line-height: 1.4;
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option:hover,
.dropdown-option.highlighted {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.dropdown-option.selected {
    background: var(--primary);
    color: white;
}

.dropdown-option-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.dropdown-option-main {
    font-weight: 500;
    line-height: 1.3;
    flex: 1;
}

.dropdown-option-meta {
    font-size: 0.75rem;
    color: var(--gray-600);
    font-weight: 500;
    margin-left: 8px;
    white-space: nowrap;
}

.dropdown-option-meta.fsa-eligible {
    color: #059669;
    font-weight: 500;
}

.dropdown-option-meta.fsa-not-eligible {
    color: #dc2626;
    font-weight: 500;
}

/* FSA badge style for category dropdown */
.dropdown-option-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 8px;
    flex-shrink: 0;
}

.dropdown-option-badge.fsa-eligible {
    background: #dcfce7;
    color: #166534;
}

.dropdown-option-badge.fsa-not-eligible {
    background: #fee2e2;
    color: #991b1b;
}

.no-results {
    padding: var(--space-sm);
    color: var(--gray-500);
    font-style: italic;
    text-align: center;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Streamlined Product Comparison Styles */
.comparison-section {
    background: #ffffff;
    padding: 0;
    border-top: 2px solid #e5e7eb;
    margin-top: 0;
}

.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.comparison-label {
    font-size: 16px;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.comparison-section .edit-icon {
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: 4px;
    transition: background-color var(--transition-fast);
    font-size: 1rem;
}

.comparison-section .edit-icon:hover {
    background-color: var(--gray-200);
}

/* Regular Product Info */
.regular-product-info {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}

.regular-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-xs);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background-color var(--transition-fast);
    line-height: 1.4;
}

.regular-name:hover {
    background-color: var(--gray-100);
}

.regular-details {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    flex-wrap: wrap;
}

.regular-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
}

.regular-price:hover {
    background-color: var(--gray-100);
    border-color: var(--gray-300);
}

.regular-price:focus {
    outline: none;
    background-color: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgb(99 102 241 / 0.1);
}

.regular-size, .regular-per-oz {
    font-size: 0.825rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* Premium Math */
.premium-math {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: var(--space-md);
}

.math-step {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding: var(--space-xs);
    background: var(--gray-50);
    border-radius: 4px;
}

.math-label {
    font-size: 0.825rem;
    color: var(--gray-700);
    font-weight: 500;
}

.math-calc {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--gray-900);
    font-weight: 600;
}

.premium-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--gray-50);
    border-radius: 6px;
    border: 2px solid transparent;
}

.premium-result.premium {
    background: #fef2f2;
    border-color: #fecaca;
}

.premium-result.savings {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.result-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
}

.result-amount {
    font-size: 1.25rem;
    font-weight: 800;
}

.result-amount.premium {
    color: #dc2626;
}

.result-amount.savings {
    color: #059669;
}

.fsa-eligible {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    background: rgba(99, 102, 241, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Custom Product Modal Comparison Section */
.comparison-section {
    border-top: 1px solid var(--gray-200);
    padding-top: var(--space-lg);
    margin-top: var(--space-lg);
}

/* Comparison Product Selector */
.comparison-product-selector {
    position: relative;
}

.comparison-dropdown-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: var(--gray-400);
    transition: all 0.2s;
    z-index: 10;
}

.comparison-dropdown-btn:hover {
    color: var(--primary);
    background: var(--gray-100);
}

.comparison-dropdown-btn svg {
    transition: transform 0.2s;
}

.comparison-dropdown-btn.active svg {
    transform: rotate(180deg);
}

.comparison-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 300px;
    padding-bottom: 8px;
    overflow-y: auto;
}

.dropdown-loading {
    padding: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--gray-600);
}

.dropdown-results {
    max-height: 250px;
    overflow-y: auto;
    padding-bottom: 4px;
}

.comparison-result-item {
    padding: var(--space-sm);
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background-color 0.2s;
}

.comparison-result-item:last-child {
    border-bottom: none;
    margin-bottom: 4px;
}

.comparison-result-item:hover {
    background-color: var(--gray-50);
}

.comparison-result-item:last-child {
    border-bottom: none;
}

.comparison-result-name {
    font-weight: 500;
    color: var(--gray-800);
    margin-bottom: 2px;
}

.comparison-result-details {
    font-size: 0.85rem;
    color: var(--gray-600);
}

.comparison-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0 0 var(--space-sm) 0;
}

.section-note {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: var(--space-md);
    padding: var(--space-sm);
    background: var(--gray-50);
    border-radius: 6px;
    border-left: 3px solid var(--primary);
}

/* Auto-populated comparison fields styling */
.comparison-section .form-input[value]:not([value=""]) {
    background: rgba(99, 102, 241, 0.05);
    border-color: var(--primary-light);
}

.comparison-section .form-input:focus {
    background: white;
}

/* FSA Eligible Category Styling */
.fsa-eligible-option {
    color: var(--success);
    font-weight: 600;
}

.fsa-eligible-option::after {
    content: " ✓ FSA Eligible";
    font-size: 0.8rem;
    color: var(--success);
    font-weight: 500;
}

.not-fsa-eligible-option {
    color: var(--gray-600);
}

.not-fsa-eligible-option::after {
    content: " ✗ Not FSA Eligible";
    font-size: 0.8rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .regular-details {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
    }
    
    .math-step {
        flex-direction: column;
        text-align: center;
        gap: var(--space-xs);
    }
    
    .premium-result {
        flex-direction: column;
        gap: var(--space-xs);
        text-align: center;
    }
}

/* Modern Product Comparison Section */
.modern-comparison-section {
    margin: 24px 0;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 20px;
}

.comparison-section-title {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.comparison-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.metric-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    border: 2px solid #f1f5f9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
}

.metric-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-values {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: stretch;
}

.receipt-value, .comparison-value {
    display: flex;
    flex-direction: column;
    text-align: center;
    padding: 18px 14px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    min-height: 75px;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.receipt-value {
    border-left: 4px solid #6366f1;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    box-shadow: 0 1px 2px rgba(99, 102, 241, 0.1);
}

.comparison-value {
    border-left: 4px solid #10b981;
    background: linear-gradient(135deg, #f0fdf9 0%, #dcfce7 100%);
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.1);
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: #cbd5e1;
}

.receipt-value:hover, .comparison-value:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.value-label {
    display: block;
    font-size: 10px;
    color: #9ca3af;
    margin-bottom: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.value-amount {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: #111827;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    line-height: 1.2;
}

.value-amount.editable {
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px;
    padding: 4px 8px;
    background: #fbfcfd;
    border: 1px solid #f1f3f5;
}

.value-amount.editable:hover {
    background: #f3f4f6;
    border-color: #e5e7eb;
}

.value-amount.editable:focus {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    outline: none;
}

/* Modern FSA Premium Section */
.fsa-premium-section {
    margin: 24px 0;
    background: linear-gradient(135deg, #f8fafc 0%, #f0f9ff 100%);
    border-radius: 14px;
    border: 1px solid #cbd5e1;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.fsa-premium-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fsa-premium-header:hover {
    background: rgba(59, 130, 246, 0.04);
}

.fsa-premium-header.disabled {
    cursor: default;
    opacity: 0.6;
}

.fsa-premium-header.disabled:hover {
    background: none;
}

.premium-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex: 1;
}

.premium-content {
    flex: 1;
}

.premium-title {
    margin: 0 0 2px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e40af;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.premium-amount-inline {
    color: #059669;
    font-weight: 800;
    font-size: 22px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-variant-numeric: tabular-nums;
}

.premium-subtitle {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    opacity: 0.8;
}

.expand-icon {
    display: flex;
    align-items: center;
    color: #94a3b8;
    transition: all 0.2s ease;
}

.expand-icon svg {
    transition: transform 0.2s ease;
}

.premium-amount {
    font-size: 18px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 8px;
    background: white;
    border: 2px solid #0ea5e9;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    min-width: 100px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(14, 165, 233, 0.2);
}

.premium-amount.positive {
    color: #059669;
    border-color: #059669;
    background: #ecfdf5;
}

.premium-amount.neutral {
    color: #6b7280;
    border-color: #d1d5db;
    background: #f9fafb;
}

.expand-icon {
    transition: transform 0.3s ease;
    color: #3b82f6;
    padding: 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.expand-icon svg {
    display: block;
    width: 16px;
    height: 16px;
}

/* FSA Calculation Details */
.fsa-calculation-details {
    background: white;
    padding: 24px 20px 20px;
    border-top: 1px solid rgba(59, 130, 246, 0.08);
}

/* Simple, friendly breakdown */
.simple-breakdown {
    margin-bottom: 20px;
}

.breakdown-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 12px 0;
}

.breakdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 120px;
}

.item-label {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 6px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.item-value {
    font-size: 20px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    color: #1e293b;
    line-height: 1.1;
    margin-bottom: 4px;
}

.item-detail {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    letter-spacing: -0.01em;
}

.breakdown-minus, .breakdown-equals {
    font-size: 28px;
    font-weight: 300;
    color: #94a3b8;
    margin: 0 12px;
    display: flex;
    align-items: center;
    height: 40px;
}

.breakdown-item.highlight {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border: 2px solid #16a34a;
    border-radius: 12px;
    padding: 16px 12px;
}

.breakdown-item.highlight .item-label {
    color: #166534;
    font-weight: 600;
}

.breakdown-item.highlight .item-value {
    color: #15803d;
    font-weight: 800;
}
.breakdown-item.highlight .item-detail {
    color: #166534;
    font-weight: 600;
}

/* Clean FSA breakdown */
.sequential-card .fsa-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fsa-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.breakdown-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
}

.line-label {
    font-size: 15px;
    color: #64748b;
    font-weight: 500;
}

.line-value {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    font-variant-numeric: tabular-nums;
}

.breakdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 8px 0;
}

.sequential-card .breakdown-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #dcfce7 0%, #d1fae5 100%);
    border-radius: 10px;
    padding: 12px 16px;
    margin: 0 -2px;
}

.breakdown-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #dcfce7 0%, #d1fae5 100%);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 0 -4px;
}

.result-label {
    font-size: 16px;
    color: #166534;
    font-weight: 600;
}

.result-value {
    font-size: 22px;
    font-weight: 800;
    color: #15803d;
    font-variant-numeric: tabular-nums;
}

.sequential-card .breakdown-detail {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    text-align: right;
    margin-top: -6px;
    margin-bottom: 2px;
    letter-spacing: -0.01em;
}

.breakdown-detail {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    text-align: right;
    margin-top: -8px;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.breakdown-detail.result-detail {
    text-align: right;
    margin-top: 4px;
    color: #15803d;
    opacity: 0.8;
}

/* Sequential Review Flow - Compact Styling Applied to Existing Components */
.sequential-product-compact .product-comparison-header {
    margin-bottom: 12px;
    padding: 12px;
}

.sequential-product-compact .comparison-metrics-grid {
    gap: 10px;
    margin-bottom: 12px;
}

.sequential-product-compact .metric-card {
    padding: 10px;
}

.sequential-product-compact .metric-label {
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.sequential-product-compact .category-section-modern {
    margin-bottom: 12px;
    padding: 10px;
}

.sequential-product-compact .fsa-premium-section {
    margin: 12px 0;
}

.sequential-product-compact .fsa-premium-header {
    padding: 14px;
}

.sequential-product-compact .fsa-calculation-details {
    padding: 14px 14px 12px;
}

.sequential-product-compact .fsa-breakdown {
    gap: 8px;
}

.sequential-product-compact .breakdown-result {
    padding: 10px 14px;
    border-radius: 8px;
}

.sequential-product-compact .breakdown-detail {
    font-size: 11px;
    margin-top: -4px;
    margin-bottom: 2px;
}

.sequential-product-compact .premium-title {
    font-size: 16px;
}

.sequential-product-compact .premium-subtitle {
    font-size: 12px;
}

/* Sequential Review Flow - Compact Version */
.sequential-card-compact {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.sequential-card-compact .product-card {
    background: #f9fafb;
    border-radius: 10px;
    padding: 14px;
    margin: 16px 0;
    border: 1px solid #e5e7eb;
}

/* Keep only the review progress and actions styling */

.review-progress-compact {
    margin-bottom: 16px;
    text-align: center;
}

.progress-bar-mini {
    height: 4px;
    background: #f3f4f6;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 6px;
}

.product-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 16px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.product-info-compact h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 6px 0;
    line-height: 1.2;
}

.product-brand-compact {
    font-size: 14px;
    color: #6b7280;
    display: block;
    margin-bottom: 8px;
}

.product-category-compact {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-text {
    font-size: 13px;
    color: #374151;
    font-weight: 500;
}

.fsa-badge-mini {
    background: #dcfce7;
    color: #166534;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.comparison-compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.price-row, .fsa-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.price-row .label, .fsa-row .label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.price-row .value, .fsa-row .value {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.price-row .detail {
    font-size: 12px;
    color: #9ca3af;
    font-family: 'SF Mono', monospace;
}

.fsa-row {
    background: #dcfce7;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 4px 0;
}

.fsa-row .label {
    color: #166534;
    font-weight: 600;
}

.fsa-value {
    font-size: 16px;
    font-weight: 700;
    color: #15803d;
}

.no-comparison {
    font-size: 13px;
    color: #9ca3af;
    font-style: italic;
    text-align: center;
    padding: 12px;
}

.review-actions-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px;
    background: #f0f9ff;
    border-radius: 10px;
}

.review-text {
    font-size: 14px;
    color: #1e40af;
    font-weight: 500;
    flex: 1;
    text-align: center;
}

.btn-skip-compact, .btn-confirm-compact {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-skip-compact {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.btn-skip-compact:hover {
    background: #e5e7eb;
}

.btn-confirm-compact {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.btn-confirm-compact:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-1px);
}

.btn-back-compact {
    position: absolute;
    top: 12px;
    left: 12px;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 13px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-back-compact:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Sequential Review Flow */
.sequential-review {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.sequential-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.sequential-card .product-card {
    background: #f9fafb;
    border-radius: 10px;
    padding: 16px;
    margin: 20px 0;
    border: 1px solid #e5e7eb;
}

.review-progress {
    margin-bottom: 20px;
}

.progress-text {
    display: block;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
    text-align: center;
    font-weight: 500;
}

.progress-bar {
    height: 6px;
    background: #f3f4f6;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Removed old product-review styles - now using full product card */

.review-question {
    text-align: center;
    margin: 20px 0;
    padding: 16px;
    background: #f0f9ff;
    border-radius: 10px;
    border: 1px solid #bae6fd;
}

.review-question h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1e40af;
    margin: 0 0 4px 0;
}

.review-question p {
    font-size: 13px;
    color: #475569;
    margin: 0;
}

.review-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.btn-skip, .btn-confirm {
    padding: 12px 28px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.btn-skip {
    background: #f9fafb;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.btn-skip:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.btn-confirm {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.btn-confirm:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-1px);
}

.btn-back {
    position: absolute;
    top: 20px;
    left: 20px;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-back:hover {
    background: #f3f4f6;
    color: #374151;
}

.review-complete {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
}

.complete-card {
    background: white;
    border-radius: 16px;
    padding: 48px 32px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.complete-icon {
    font-size: 64px;
    margin-bottom: 24px;
    display: block;
}

.complete-card h3 {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 12px 0;
}

.complete-card p {
    font-size: 16px;
    color: #6b7280;
    margin: 0 0 32px 0;
}

.final-summary {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-bottom: 32px;
    padding: 24px 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.summary-stat {
    text-align: center;
}

.summary-stat .stat-value {
    display: block;
    font-size: 32px;
    font-weight: 800;
    color: #059669;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}

.summary-stat .stat-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.complete-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.btn-secondary, .btn-primary {
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.btn-secondary {
    background: #f9fafb;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.btn-primary {
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #047857, #065f46);
    transform: translateY(-1px);
}

.no-items-card {
    background: white;
    border-radius: 16px;
    padding: 48px 32px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    max-width: 500px;
    margin: 0 auto;
}

.no-items-icon {
    font-size: 64px;
    margin-bottom: 24px;
    display: block;
}

.no-items-card h3 {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 12px 0;
}

.no-items-card p {
    font-size: 16px;
    color: #6b7280;
    margin: 0 0 32px 0;
    line-height: 1.5;
}

.no-items-actions {
    display: flex;
    justify-content: center;
}

/* Friendly info section */
.fsa-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(240, 249, 255, 0.6);
    border-radius: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(186, 230, 253, 0.5);
    margin-top: 0;
}

.info-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 1px;
    color: #3b82f6;
}

.fsa-info p {
    margin: 0;
    font-size: 13px;
    color: #1e40af;
    line-height: 1.4;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.no-calculation-message {
    padding: 20px;
    text-align: center;
    background: white;
}

.no-calculation-message p {
    margin: 0;
    color: #6b7280;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .comparison-metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .metric-values {
        flex-direction: column;
        gap: 12px;
    }
    
    .calc-row {
        grid-template-columns: 1fr;
        gap: 8px;
        text-align: left;
    }
    
    .calc-amount, .calc-formula {
        text-align: left;
    }
    
    .premium-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* Gamification Animations - Fintech Style */
@keyframes floatUp {
    0% {
        transform: translate(-50%, -50%) translateY(0);
        opacity: 1;
        scale: 1;
    }
    70% {
        transform: translate(-50%, -50%) translateY(-60px);
        opacity: 0.7;
        scale: 1.1;
    }
    100% {
        transform: translate(-50%, -50%) translateY(-100px);
        opacity: 0;
        scale: 0.8;
    }
}

@keyframes sparkleAnimation {
    0% {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
    25% {
        transform: rotate(90deg) scale(1.2);
        opacity: 0.8;
    }
    50% {
        transform: rotate(180deg) scale(0.8);
        opacity: 0.6;
    }
    75% {
        transform: rotate(270deg) scale(1.1);
        opacity: 0.4;
    }
    100% {
        transform: rotate(360deg) scale(0.5);
        opacity: 0;
    }
}

@keyframes moneyPulse {
    0% {
        transform: scale(1);
        color: inherit;
    }
    50% {
        transform: scale(1.1);
        color: #22c55e;
    }
    100% {
        transform: scale(1);
        color: inherit;
    }
}

@keyframes slideInUp {
    0% {
        transform: translateY(30px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutDown {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-30px);
        opacity: 0;
    }
}

@keyframes flashEffect {
    0% {
        opacity: 0;
    }
    15% {
        opacity: 0.3;
    }
    30% {
        opacity: 0.1;
    }
    100% {
        opacity: 0;
    }
}

/* Success feedback styles */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 9999;
}

.money-counter-celebration {
    animation: moneyPulse 0.6s ease-out;
    transform-origin: center;
}

/* Enhanced transition effects */
.sequential-review {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sequential-card-compact {
    animation: slideInUp 0.4s ease-out;
}

/* Button hover effects for gamification */
.btn-primary:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

.btn-secondary:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Enhanced gamified savings display */
.gamified-total {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0) !important;
    border: 2px solid #e2e8f0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.gamified-total:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12) !important;
}

.gamified-total .summary-value {
    font-size: 2.5em !important;
    font-weight: 800 !important;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: all 0.3s ease;
}

.gamified-total .summary-label {
    font-size: 0.9em !important;
    color: #64748b !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.gamified-total .summary-icon {
    font-size: 2em;
    filter: drop-shadow(0 2px 4px rgba(34, 197, 94, 0.3));
}

/* Enhanced gamified progress bar */
.review-progress-gamified {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-text-minimal {
    font-size: 0.9em;
    color: #64748b;
    font-weight: 600;
}

.motivational-text {
    font-size: 0.85em;
    color: #22c55e;
    font-weight: 600;
    animation: pulse 2s ease-in-out infinite;
}

.progress-bar-gamified {
    position: relative;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill-animated {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a, #22c55e);
    background-size: 200% 100%;
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: shimmer 2s ease-in-out infinite;
    position: relative;
}

.progress-glow {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.4), transparent);
    border-radius: 6px;
    opacity: 0;
    animation: progressGlow 3s ease-in-out infinite;
}

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

@keyframes progressGlow {
    0%, 100% {
        opacity: 0;
        transform: scaleX(0.8);
    }
    50% {
        opacity: 1;
        transform: scaleX(1);
    }
}

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

/* Cross-category matching indicator and selector */
.product-type-label-with-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.category-selector-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.category-selector-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.category-selector-btn svg {
    color: #6b7280;
}

.cross-category-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 3px 8px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 12px;
    font-size: 11px;
    color: #92400e;
}

.cross-category-indicator .indicator-text {
    font-weight: 500;
}

/* Category selector modal */
.category-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.category-selector-content {
    background: white;
    border-radius: 12px;
    padding: 20px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.category-selector-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 16px;
}

.category-option {
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 14px;
    color: #374151;
}

.category-option:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.category-option.active {
    background: #eef2ff;
    border-color: #6366f1;
    color: #4338ca;
}

.category-option .category-name {
    font-weight: 500;
}

.category-option .product-count {
    font-size: 12px;
    color: #6b7280;
    margin-left: 8px;
}

