/**
 * Affiliate Catalog - Consolidated Frontend Styles
 * Modern, Responsive, AI-Driven UI with Dark Mode
 *
 * @version 2.0.0
 * @author Affiliate Catalog Team
 */

/* ============================================
   DESIGN TOKENS (CSS Variables)
   ============================================ */

:root {
    /* Primary Colors */
    --aff-primary: #6366f1;
    --aff-primary-hover: #4f46e5;
    --aff-primary-50: #eef2ff;
    --aff-primary-100: #e0e7ff;
    --aff-primary-200: #c7d2fe;
    --aff-primary-300: #a5b4fc;
    --aff-primary-400: #818cf8;
    --aff-primary-500: #6366f1;
    --aff-primary-600: #4f46e5;
    --aff-primary-700: #4338ca;
    --aff-primary-800: #3730a3;
    --aff-primary-900: #312e81;

    /* Secondary Colors */
    --aff-secondary: #06b6d4;

    /* Accent Colors */
    --aff-accent: #f59e0b;
    --aff-accent-50: #fdf4ff;
    --aff-accent-100: #fae8ff;
    --aff-accent-200: #f5d0fe;
    --aff-accent-300: #f0abfc;
    --aff-accent-400: #e879f9;
    --aff-accent-500: #d946ef;
    --aff-accent-600: #c026d3;
    --aff-accent-700: #a21caf;
    --aff-accent-800: #86198f;
    --aff-accent-900: #701a75;

    /* Success Colors */
    --aff-success-50: #f0fdf4;
    --aff-success-100: #dcfce7;
    --aff-success-200: #bbf7d0;
    --aff-success-300: #86efac;
    --aff-success-400: #4ade80;
    --aff-success-500: #22c55e;
    --aff-success-600: #16a34a;
    --aff-success-700: #15803d;
    --aff-success-800: #166534;
    --aff-success-900: #14532d;

    /* Warning Colors */
    --aff-warning-50: #fffbeb;
    --aff-warning-100: #fef3c7;
    --aff-warning-200: #fde68a;
    --aff-warning-300: #fcd34d;
    --aff-warning-400: #fbbf24;
    --aff-warning-500: #f59e0b;
    --aff-warning-600: #d97706;
    --aff-warning-700: #b45309;
    --aff-warning-800: #92400e;
    --aff-warning-900: #78350f;

    /* Error Colors */
    --aff-error-50: #fef2f2;
    --aff-error-100: #fee2e2;
    --aff-error-200: #fecaca;
    --aff-error-300: #fca5a5;
    --aff-error-400: #f87171;
    --aff-error-500: #ef4444;
    --aff-error-600: #dc2626;
    --aff-error-700: #b91c1c;
    --aff-error-800: #991b1b;
    --aff-error-900: #7f1d1d;

    /* Neutral Colors - Light Mode */
    --aff-neutral-50: #fafafa;
    --aff-neutral-100: #f5f5f5;
    --aff-neutral-200: #e5e5e5;
    --aff-neutral-300: #d4d4d4;
    --aff-neutral-400: #a3a3a3;
    --aff-neutral-500: #737373;
    --aff-neutral-600: #525252;
    --aff-neutral-700: #404040;
    --aff-neutral-800: #262626;
    --aff-neutral-900: #171717;

    /* Surface Colors */
    --aff-bg-surface: #ffffff;
    --aff-bg-subtle: #f8fafc;
    --aff-surface-1: #ffffff;
    --aff-surface-2: #fafafa;
    --aff-surface-3: #f5f5f5;

    /* Text Colors */
    --aff-text-main: #0f172a;
    --aff-text-muted: #64748b;
    --aff-text-primary: #171717;
    --aff-text-secondary: #525252;
    --aff-text-tertiary: #a3a3a3;
    --aff-text-inverse: #ffffff;

    /* Border Colors */
    --aff-border-light: #e5e5e5;
    --aff-border-medium: #d4d4d4;
    --aff-border-dark: #a3a3a3;

    /* Modern Glassmorphism & Elevation */
    --aff-glass-bg: rgba(255, 255, 255, 0.75);
    --aff-glass-border: rgba(255, 255, 255, 0.4);
    --aff-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --aff-shadow-md: 0 4px 20px -2px rgba(15, 23, 42, 0.12);
    --aff-shadow-hover: 0 12px 30px -4px rgba(99, 102, 241, 0.2);
    --aff-shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --aff-shadow-sm-var: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --aff-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --aff-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --aff-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);

    /* Gradients */
    --aff-gradient-primary: linear-gradient(135deg, var(--aff-primary-500) 0%, var(--aff-primary-600) 100%);
    --aff-gradient-accent: linear-gradient(135deg, var(--aff-accent-500) 0%, var(--aff-accent-600) 100%);
    --aff-gradient-success: linear-gradient(135deg, var(--aff-success-500) 0%, var(--aff-success-600) 100%);
    --aff-gradient-dark: linear-gradient(135deg, var(--aff-neutral-800) 0%, var(--aff-neutral-900) 100%);

    /* Border Radius & Motion */
    --aff-radius-md: 12px;
    --aff-radius-lg: 18px;
    --aff-radius-none: 0;
    --aff-radius-sm: 0.25rem;
    --aff-radius-md-var: 0.375rem;
    --aff-radius-lg-var: 0.5rem;
    --aff-radius-xl: 0.75rem;
    --aff-radius-2xl: 1rem;
    --aff-radius-3xl: 1.5rem;
    --aff-radius-full: 9999px;
    --aff-transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --aff-transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --aff-transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --aff-transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    --aff-transition-slower: 700ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Typography */
    --aff-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --aff-font-mono: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, monospace;

    /* Font Sizes */
    --aff-text-xs: 0.75rem;
    --aff-text-sm: 0.875rem;
    --aff-text-base: 1rem;
    --aff-text-lg: 1.125rem;
    --aff-text-xl: 1.25rem;
    --aff-text-2xl: 1.5rem;
    --aff-text-3xl: 1.875rem;
    --aff-text-4xl: 2.25rem;
    --aff-text-5xl: 3rem;
    --aff-text-6xl: 3.75rem;

    /* Font Weights */
    --aff-font-light: 300;
    --aff-font-normal: 400;
    --aff-font-medium: 500;
    --aff-font-semibold: 600;
    --aff-font-bold: 700;
    --aff-font-extrabold: 800;

    /* Line Heights */
    --aff-leading-tight: 1.25;
    --aff-leading-snug: 1.375;
    --aff-leading-normal: 1.5;
    --aff-leading-relaxed: 1.625;
    --aff-leading-loose: 2;

    /* Spacing */
    --aff-space-1: 0.25rem;
    --aff-space-2: 0.5rem;
    --aff-space-3: 0.75rem;
    --aff-space-4: 1rem;
    --aff-space-5: 1.25rem;
    --aff-space-6: 1.5rem;
    --aff-space-8: 2rem;
    --aff-space-10: 2.5rem;
    --aff-space-12: 3rem;
    --aff-space-16: 4rem;
    --aff-space-20: 5rem;
    --aff-space-24: 6rem;

    /* Z-Index */
    --aff-z-dropdown: 1000;
    --aff-z-sticky: 1020;
    --aff-z-fixed: 1030;
    --aff-z-modal-backdrop: 1040;
    --aff-z-modal: 1050;
    --aff-z-popover: 1060;
    --aff-z-tooltip: 1070;
}

/* Dark Mode Override */
[data-theme="dark"] {
    --aff-neutral-50: #171717;
    --aff-neutral-100: #262626;
    --aff-neutral-200: #404040;
    --aff-neutral-300: #525252;
    --aff-neutral-400: #737373;
    --aff-neutral-500: #a3a3a3;
    --aff-neutral-600: #d4d4d4;
    --aff-neutral-700: #e5e5e5;
    --aff-neutral-800: #f5f5f5;
    --aff-neutral-900: #fafafa;

    --aff-surface-1: #171717;
    --aff-surface-2: #262626;
    --aff-surface-3: #404040;

    --aff-text-primary: #fafafa;
    --aff-text-secondary: #d4d4d4;
    --aff-text-tertiary: #a3a3a3;
    --aff-text-inverse: #171717;

    --aff-border-light: #404040;
    --aff-border-medium: #525252;
    --aff-border-dark: #737373;

    --aff-shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --aff-shadow-sm-var: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
    --aff-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
    --aff-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
    --aff-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.4);
    --aff-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.5);
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS (Core Web Vitals)
   ============================================ */

/* CSS Containment for Performance */
.affc-grid,
.affc-card,
.affc-product-grid,
.affc-wishlist-grid,
.affc-categories-grid {
    contain: layout style;
}

/* Hardware Acceleration Hints */
.affc-card,
.affc-button,
.affc-chip,
.affc-theme-toggle,
.affc-wishlist-btn,
.affc-quick-view-btn,
.affc-product-card,
.affc-wishlist-item {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Image Aspect Ratio to Prevent CLS */
.affc-thumb,
.affc-gallery-stage,
.affc-product-image,
.affc-wishlist-item-image,
.affc-category-image-wrap {
    contain: layout;
}

/* ============================================
   PRODUCT CARD STYLES (from components)
   ============================================ */

.affc-product-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--aff-border-light);
    border-radius: var(--aff-radius-lg);
    overflow: hidden;
    background: var(--aff-bg-surface);
    box-shadow: var(--aff-shadow-md);
    height: 100%;
    transition: var(--aff-transition-smooth);
    will-change: transform;
    backface-visibility: hidden;
    contain: layout style;
}

.affc-product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--aff-shadow-hover);
}

.affc-product-card:active {
    transform: translateY(-2px);
}

.affc-product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--aff-border-light);
    contain: layout;
}

.affc-product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--aff-transition-smooth);
    will-change: transform;
}

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

.affc-product-content {
    padding: 18px;
}

.affc-product-merchant {
    font-size: .82rem;
    color: var(--aff-text-muted);
    font-weight: 600;
    padding: 4px 8px;
    background: var(--aff-bg-subtle);
    border-radius: 6px;
    margin-bottom: 8px;
}

.affc-product-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--aff-text-main);
    margin-bottom: 8px;
}

.affc-product-title a {
    color: var(--aff-text-main);
    text-decoration: none;
    transition: color .15s;
}

.affc-product-card:hover .affc-product-title a {
    color: var(--aff-primary-600);
}

.affc-product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--aff-success-600);
    margin-bottom: 12px;
}

.affc-product-action {
    margin-top: auto;
}

.affc-product-action .btn {
    width: 100%;
}

.affc-product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 9999px;
    background: var(--aff-gradient-primary);
    color: var(--aff-text-inverse);
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
    box-shadow: var(--aff-shadow-md);
}

.affc-wishlist-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--aff-glass-bg);
    border: 1px solid var(--aff-glass-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: var(--aff-transition-fast);
    will-change: transform;
    z-index: 10;
}

.affc-wishlist-btn:hover {
    transform: scale(1.1);
    background: var(--aff-bg-surface);
}

.affc-wishlist-btn:active {
    transform: scale(0.96);
}

.affc-wishlist-btn.is-active {
    color: var(--aff-error-500);
}

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

.affc-product-card.skeleton .affc-product-image,
.affc-product-card.skeleton .affc-product-title,
.affc-product-card.skeleton .affc-product-price {
    background: linear-gradient(
        90deg,
        var(--aff-surface-2) 0%,
        var(--aff-surface-3) 50%,
        var(--aff-surface-2) 100%
    );
    background-size: 200% 100%;
    animation: affc-shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}

.affc-product-card.skeleton .affc-product-image {
    height: 100%;
}

.affc-product-card.skeleton .affc-product-title {
    height: 24px;
    width: 80%;
}

.affc-product-card.skeleton .affc-product-price {
    height: 32px;
    width: 40%;
}

/* ============================================
   HERO SECTION STYLES (from components)
   ============================================ */

.affc-hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

.affc-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--aff-primary-400);
    border-radius: 9999px;
    opacity: 0.3;
    animation: particle-float 20s linear infinite;
    will-change: transform, opacity;
}

.affc-particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.affc-particle:nth-child(2) { left: 20%; animation-delay: 2s; }
.affc-particle:nth-child(3) { left: 30%; animation-delay: 4s; }
.affc-particle:nth-child(4) { left: 40%; animation-delay: 6s; }
.affc-particle:nth-child(5) { left: 50%; animation-delay: 8s; }
.affc-particle:nth-child(6) { left: 60%; animation-delay: 10s; }
.affc-particle:nth-child(7) { left: 70%; animation-delay: 12s; }
.affc-particle:nth-child(8) { left: 80%; animation-delay: 14s; }
.affc-particle:nth-child(9) { left: 90%; animation-delay: 16s; }
.affc-particle:nth-child(10) { left: 95%; animation-delay: 18s; }

@keyframes particle-float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

.affc-hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 900px;
    padding: var(--aff-space-8);
}

.affc-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--aff-space-2);
    padding: var(--aff-space-2) var(--aff-space-4);
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 9999px;
    color: var(--aff-primary-400);
    font-size: var(--aff-text-sm);
    font-weight: var(--aff-font-semibold);
    margin-bottom: var(--aff-space-6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.3);
}

.affc-hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: var(--aff-font-extrabold);
    line-height: var(--aff-leading-tight);
    color: var(--aff-text-main) !important;
    margin-bottom: var(--aff-space-6);
}

.affc-hero-description {
    font-size: var(--aff-text-lg);
    color: var(--aff-text-muted);
    margin-bottom: var(--aff-space-8);
}

.affc-hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--aff-space-12);
    margin-bottom: var(--aff-space-8);
}

.affc-hero-stat {
    text-align: center;
}

.affc-hero-stat-value {
    font-size: var(--aff-text-4xl);
    font-weight: var(--aff-font-bold);
    color: var(--aff-text-main);
    margin-bottom: var(--aff-space-1);
}

.affc-hero-stat-label {
    font-size: var(--aff-text-sm);
    color: var(--aff-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   FILTERS SECTION STYLES (from components)
   ============================================ */

.affc-filters-section {
    background: var(--aff-bg-surface);
    border: 1px solid var(--aff-border-light);
    border-radius: var(--aff-radius-2xl);
    padding: var(--aff-space-6);
    margin-bottom: var(--aff-space-8);
    box-shadow: var(--aff-shadow-sm);
    contain: layout style;
}

.affc-search-bar {
    position: relative;
    margin-bottom: var(--aff-space-6);
}

.affc-search-input {
    width: 100%;
    padding: var(--aff-space-4) var(--aff-space-5);
    padding-left: var(--aff-space-14);
    font-size: var(--aff-text-base);
    font-family: var(--aff-font-sans);
    color: var(--aff-text-main);
    background: var(--aff-surface-2);
    border: 2px solid var(--aff-border-light);
    border-radius: 9999px;
    transition: var(--aff-transition-fast);
}

.affc-search-input:focus {
    outline: none;
    border-color: var(--aff-primary-500);
    background: var(--aff-bg-surface);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 0 20px rgba(99, 102, 241, 0.2);
}

.affc-search-input::placeholder {
    color: var(--aff-text-tertiary);
}

.affc-search-icon {
    position: absolute;
    left: var(--aff-space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--aff-text-tertiary);
    pointer-events: none;
}

.affc-search-clear {
    position: absolute;
    right: var(--aff-space-4);
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    background: var(--aff-surface-3);
    border: none;
    color: var(--aff-text-tertiary);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: var(--aff-transition-fast);
}

.affc-search-clear:hover {
    background: var(--aff-error-100);
    color: var(--aff-error-600);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

.affc-search-clear.visible {
    display: flex;
}

.affc-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--aff-space-6);
}

.affc-filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--aff-space-3);
}

.affc-filter-label {
    font-size: var(--aff-text-sm);
    font-weight: var(--aff-font-semibold);
    color: var(--aff-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.affc-filter-select {
    width: 100%;
    padding: var(--aff-space-3) var(--aff-space-4);
    font-size: var(--aff-text-base);
    font-family: var(--aff-font-sans);
    color: var(--aff-text-main);
    background: var(--aff-surface-2);
    border: 1px solid var(--aff-border-light);
    border-radius: 9999px;
    cursor: pointer;
    transition: var(--aff-transition-fast);
}

.affc-filter-select:focus {
    outline: none;
    border-color: var(--aff-primary-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15), 0 0 16px rgba(99, 102, 241, 0.2);
}

.affc-filters-results {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--aff-space-6);
}

.affc-filters-results-count {
    font-size: var(--aff-text-base);
    color: var(--aff-text-secondary);
}

.affc-filters-results-count strong {
    color: var(--aff-text-main);
    font-weight: var(--aff-font-semibold);
}

@media (max-width: 768px) {
    .affc-filters-grid {
        grid-template-columns: 1fr;
    }
    
    .affc-filters-results {
        flex-direction: column;
        gap: var(--aff-space-3);
        align-items: flex-start;
    }
}

/* ============================================
   BUTTON STYLES (Modern & Interactive)
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--aff-space-2);
    padding: var(--aff-space-3) var(--aff-space-6);
    font-family: var(--aff-font-sans);
    font-size: var(--aff-text-sm);
    font-weight: var(--aff-font-semibold);
    line-height: var(--aff-leading-tight);
    border: none;
    border-radius: var(--aff-radius-lg);
    cursor: pointer;
    transition: var(--aff-transition-fast);
    text-decoration: none;
    white-space: nowrap;
    will-change: transform;
    backface-visibility: hidden;
}

.btn-primary {
    background: var(--aff-gradient-primary);
    color: var(--aff-text-inverse);
    box-shadow: var(--aff-shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--aff-shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--aff-surface-2);
    color: var(--aff-text-main);
    border: 1px solid var(--aff-border-light);
}

.btn-secondary:hover {
    background: var(--aff-surface-3);
    border-color: var(--aff-border-medium);
}

.btn:active {
    transform: scale(0.96);
}

/* ============================================
   PAGINATION STYLES
   ============================================ */

.affc-pagination {
    display: flex;
    justify-content: center;
    gap: var(--aff-space-4);
    margin-top: var(--aff-space-8);
    padding: var(--aff-space-6) 0;
}

.affc-pagination .page-numbers {
    display: flex;
    gap: var(--aff-space-2);
}

.affc-pagination a,
.affc-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--aff-space-3);
    border-radius: var(--aff-radius-lg);
    background: var(--aff-bg-surface);
    border: 1px solid var(--aff-border-light);
    color: var(--aff-text-main);
    text-decoration: none;
    transition: var(--aff-transition-fast);
    will-change: transform;
}

.affc-pagination a:hover {
    background: var(--aff-primary-500);
    color: var(--aff-text-inverse);
    border-color: var(--aff-primary-500);
    transform: translateY(-2px);
}

.affc-pagination a:active {
    transform: translateY(0);
}

.affc-pagination .current {
    background: var(--aff-primary-500);
    color: var(--aff-text-inverse);
    border-color: var(--aff-primary-500);
}

/* ============================================
   EMPTY STATE STYLES
   ============================================ */

.affc-products-empty {
    text-align: center;
    padding: var(--aff-space-16) var(--aff-space-4);
}

.affc-products-empty svg {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--aff-space-6);
    color: var(--aff-neutral-300);
}

.affc-products-empty h3 {
    font-size: var(--aff-text-2xl);
    margin-bottom: var(--aff-space-3);
    color: var(--aff-text-main);
}

.affc-products-empty p {
    color: var(--aff-text-secondary);
    margin-bottom: var(--aff-space-6);
}

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

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

@keyframes affc-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* ============================================
   PRODUCT GRID LAYOUT
   ============================================ */

.affc-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--aff-space-6);
    contain: layout;
}

@media (max-width: 1024px) {
    .affc-product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--aff-space-5);
    }
}

@media (max-width: 768px) {
    .affc-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--aff-space-4);
    }
}

@media (max-width: 480px) {
    .affc-product-grid {
        grid-template-columns: 1fr;
        gap: var(--aff-space-4);
    }
}

/* ============================================
   PRICE STYLES
   ============================================ */

.affc-price-current {
    font-size: var(--aff-text-3xl);
    font-weight: var(--aff-font-extrabold);
    color: var(--aff-success-600);
    line-height: var(--aff-leading-tight);
}

.affc-price-old {
    font-size: var(--aff-text-base);
    font-weight: var(--aff-font-semibold);
    color: var(--aff-error-600);
    text-decoration: line-through;
    text-decoration-color: var(--aff-error-600);
    text-decoration-thickness: 2px;
    margin-left: var(--aff-space-2);
}

.affc-product-footer {
    margin-top: var(--aff-space-4);
    padding-top: var(--aff-space-4);
    border-top: 1px solid var(--aff-border-light);
}

/* ============================================
   CONTAINER & ARCHIVE LAYOUT
   ============================================ */

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

.affc-archive-content {
    padding: var(--aff-space-8) 0;
}

.affc-archive-page {
    background: #f0f4ff !important;
    min-height: 100vh;
}

/* ============================================
   BASE STYLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--aff-font-sans);
    font-size: var(--aff-text-base);
    line-height: var(--aff-leading-normal);
    color: var(--aff-text-primary);
    background-color: var(--aff-surface-1);
    transition: background-color var(--aff-transition-base), color var(--aff-transition-base);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--aff-surface-2);
}

::-webkit-scrollbar-thumb {
    background: var(--aff-neutral-400);
    border-radius: var(--aff-radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--aff-neutral-500);
}

/* Selection */
::selection {
    background-color: var(--aff-primary-500);
    color: var(--aff-text-inverse);
}

/* Focus Styles */
:focus-visible {
    outline: 2px solid var(--aff-primary-500);
    outline-offset: 2px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--aff-font-bold);
    line-height: var(--aff-leading-tight);
    color: var(--aff-text-primary);
}

h1 { font-size: var(--aff-text-5xl); }
h2 { font-size: var(--aff-text-4xl); }
h3 { font-size: var(--aff-text-3xl); }
h4 { font-size: var(--aff-text-2xl); }
h5 { font-size: var(--aff-text-xl); }
h6 { font-size: var(--aff-text-lg); }

p {
    margin-bottom: var(--aff-space-4);
    color: var(--aff-text-secondary);
}

a {
    color: var(--aff-primary-600);
    text-decoration: none;
    transition: color var(--aff-transition-fast);
}

a:hover {
    color: var(--aff-primary-700);
}

/* ============================================
   AFFILIATE CATALOG COMPONENT STYLES
   ============================================ */

.affc-shell{background:var(--aff-bg-subtle);color:var(--aff-text-main);padding-bottom:56px}.affc-container{max-width:1180px;margin:0 auto;padding:0 20px}@media (max-width:1200px){.affc-container{max-width:100%;padding:0 16px}}@media (max-width:768px){.affc-container{padding:0 12px}}@media (max-width:480px){.affc-container{padding:0 10px}}.affc-hero{padding:64px 0 28px;background:linear-gradient(180deg,var(--aff-bg-surface) 0%,var(--aff-bg-subtle) 100%);position:relative;overflow:hidden}.affc-hero::before{content:'';position:absolute;top:0;left:0;right:0;bottom:0;background:radial-gradient(circle at 20% 50%,rgba(99,102,241,0.15) 0%,transparent 50%),radial-gradient(circle at 80% 50%,rgba(217,70,239,0.15) 0%,transparent 50%);pointer-events:none}.affc-hero h1{font-size:42px;line-height:1.08;margin:8px 0 12px;color:var(--aff-text-main)}.affc-hero p{max-width:760px;color:var(--aff-text-muted);font-size:17px}.affc-eyebrow{font-size:12px;letter-spacing:.12em;text-transform:uppercase;color:var(--aff-primary-600);font-weight:700}.affc-tax-nav{padding:0 0 24px}.affc-chip-row{display:flex;flex-wrap:wrap;gap:10px}.affc-chip{display:inline-flex;padding:10px 14px;border-radius:999px;background:var(--aff-bg-surface);border:1px solid var(--aff-border-light);color:var(--aff-text-main);text-decoration:none;transition:var(--aff-transition-fast);will-change:transform}.affc-chip.active,.affc-chip:hover{border-color:var(--aff-primary-500);color:var(--aff-primary-500);transform:scale(1.05)}.affc-chip:active{transform:scale(0.98)}.affc-store-grid{padding-top:10px}.affc-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:24px;contain:layout}@media (max-width:1200px){.affc-grid{grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:20px}}@media (max-width:768px){.affc-grid{grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px}}@media (max-width:480px){.affc-grid{grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}}@media (max-width:380px){.affc-grid{grid-template-columns:1fr;gap:10px}}.affc-card{display:flex;flex-direction:column;border:1px solid var(--aff-border-light);border-radius:var(--aff-radius-lg);overflow:hidden;background:var(--aff-bg-surface);box-shadow:var(--aff-shadow-md);height:100%;transition:var(--aff-transition-smooth);will-change:transform;backface-visibility:hidden}@media (max-width:768px){.affc-card{border-radius:14px}}@media (max-width:480px){.affc-card{border-radius:12px}}.affc-card:hover{transform:translateY(-4px);box-shadow:var(--aff-shadow-hover)}.affc-card:active{transform:translateY(-2px)}.affc-thumb{display:block;background:var(--aff-border-light);aspect-ratio:4/5;overflow:hidden;contain:layout}.affc-thumb img{width:100%;height:100%;object-fit:cover;display:block}.affc-placeholder{height:100%;display:grid;place-items:center;color:var(--aff-text-muted)}.affc-card-body{padding:18px}.affc-topline{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:8px}.affc-merchant{font-size:.82rem;color:var(--aff-text-muted);font-weight:600;padding:4px 8px;background:var(--aff-bg-subtle);border-radius:6px}.affc-badge{display:inline-flex;align-items:center;gap:4px;padding:4px 8px;border-radius:999px;background:var(--aff-primary-500);color:var(--aff-text-inverse);font-size:.75rem;font-weight:700;text-transform:uppercase;letter-spacing:.02em}.affc-title{margin:0 0 8px}.affc-title a{color:var(--aff-text-main);text-decoration:none;transition:color .15s}.affc-title a:hover{color:var(--aff-primary-600)}.affc-excerpt{font-size:.9rem;color:var(--aff-text-muted);line-height:1.5;margin:0 0 12px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.affc-button{display:inline-flex;align-items:center;justify-content:center;padding:10px 16px;border-radius:999px;background:var(--aff-primary-500);color:var(--aff-text-inverse);text-decoration:none;font-weight:600;font-size:.9rem;transition:var(--aff-transition-fast);will-change:transform;backface-visibility:hidden}.affc-button:hover{background:var(--aff-primary-hover);transform:scale(1.02)}.affc-button:active{transform:scale(0.96)}.affc-card-footer{margin-top:auto;padding-top:12px}.affc-actions{display:flex;gap:8px;flex-wrap:wrap}

.affc-bottom-banner{margin-top:48px;padding:0 16px 32px}.affc-bottom-banner-wrap{max-width:1200px;margin:0 auto}.affc-bottom-banner-inner{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 22px;border-radius:16px;background:#111827;color:#fff;flex-wrap:wrap}.affc-bottom-banner-inner strong{font-size:18px}.affc-bottom-banner-inner span{opacity:.92;flex:1 1 320px}.affc-bottom-banner-inner a{display:inline-flex;align-items:center;justify-content:center;padding:10px 16px;border-radius:999px;background:#fff;color:#111827;text-decoration:none;font-weight:600}.affc-bottom-banner-inner a:hover{opacity:.92}@media (max-width:768px){.affc-bottom-banner-inner{align-items:flex-start}.affc-bottom-banner-inner a{width:100%}}

.affc-visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.affc-price-block{display:flex;flex-direction:column;gap:6px;margin:10px 0 14px}.affc-price-old-wrap{display:flex;align-items:center;gap:8px}.affc-price-old{color:#b91c1c;text-decoration:line-through;text-decoration-color:#b91c1c;text-decoration-thickness:2px;text-decoration-skip-ink:none;font-size:1rem;font-weight:600}.affc-price-current{font-size:2.15rem;font-weight:800;line-height:1;color:#15803d;letter-spacing:-0.02em}.affc-price-large-wrap .affc-price-current{font-size:3rem}.affc-price-large-wrap .affc-price-old{font-size:1.125rem}@media (max-width:767px){.affc-price-current{font-size:1.85rem}.affc-price-large-wrap .affc-price-current{font-size:2.4rem}}

.affc-sale-row{display:flex;align-items:center;gap:8px}.affc-sale-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 10px;border-radius:999px;background:#dcfce7;color:#166534;font-size:.78rem;font-weight:800;text-transform:uppercase;letter-spacing:.02em}

.affc-actions-with-seal{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.affc-actions-single{margin-top:18px}.affc-disclosure-seal{position:relative;display:inline-flex;align-items:center;justify-content:center;width:54px;height:54px;border-radius:999px;border:2px solid #111827;background:#fff;color:#111827;font-weight:900;letter-spacing:.08em;cursor:help;flex:0 0 54px}.affc-disclosure-seal-text{font-size:.8rem;line-height:1}.affc-disclosure-tooltip{position:absolute;left:calc(100% + 10px);top:50%;transform:translateY(-50%);min-width:260px;max-width:320px;padding:10px 12px;border-radius:12px;background:#111827;color:#fff;font-size:.82rem;line-height:1.45;box-shadow:0 12px 30px rgba(0,0,0,.18);opacity:0;visibility:hidden;pointer-events:none;transition:all .18s ease}.affc-disclosure-seal:hover .affc-disclosure-tooltip,.affc-disclosure-seal:focus .affc-disclosure-tooltip,.affc-disclosure-seal:focus-within .affc-disclosure-tooltip{opacity:1;visibility:visible}.affc-disclosure-tooltip:before{content:'';position:absolute;left:-6px;top:50%;transform:translateY(-50%) rotate(45deg);width:12px;height:12px;background:#111827}.affc-disclosure{margin-top:10px;font-size:.85rem;color:#4b5563}.affc-button-large{padding:16px 24px;font-size:1rem}@media (max-width:767px){.affc-price-current{font-size:2.6rem!important}.affc-price-large-wrap .affc-price-current{font-size:3.2rem!important}.affc-disclosure-tooltip{left:0;top:calc(100% + 10px);transform:none}.affc-disclosure-tooltip:before{left:20px;top:-6px;transform:rotate(45deg)}}

.affc-savings{color:#166534;font-weight:700;font-size:.9rem}.affc-trust-microcopy{margin:10px 0 0;color:#4b5563;font-size:.88rem;line-height:1.45}.affc-merchant-logo{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:999px;background:#fff;border:1px solid #e5e7eb;overflow:hidden}.affc-merchant-logo img{width:100%;height:100%;object-fit:contain}.affc-merchant-line-wrap{display:flex;align-items:center;gap:10px;margin-bottom:10px}.single-aff_catalog_item .affc-product-layout{align-items:start}.single-aff_catalog_item .affc-single-buy-box{position:sticky;top:24px;border:1px solid #e5e7eb;border-radius:18px;padding:24px;background:#fff;box-shadow:0 18px 40px rgba(17,24,39,.08)}.single-aff_catalog_item .affc-actions-single{margin-top:18px}.single-aff_catalog_item .affc-disclosure{margin-top:10px}.single-aff_catalog_item .affc-price-large-wrap .affc-price-current{font-size:4.8rem!important}.single-aff_catalog_item .affc-price-large-wrap .affc-price-old{font-size:1.2rem}@media (max-width:991px){.single-aff_catalog_item .affc-single-buy-box{position:static;padding:20px}.single-aff_catalog_item .affc-price-large-wrap .affc-price-current{font-size:3.4rem!important}}

.affc-single-layout{display:grid;grid-template-columns:1.2fr 0.8fr;gap:36px;align-items:start;max-width:1200px;margin:0 auto}.affc-single-media{grid-column:1;grid-row:1}.affc-single-buy-box{grid-column:2;grid-row:1;position:sticky;top:24px;border:1px solid #e5e7eb;border-radius:20px;padding:28px;background:#fff;box-shadow:0 18px 40px rgba(17,24,39,.08)}.affc-single-description{grid-column:1;grid-row:2}.affc-single-buy-box h1{font-size:2rem;line-height:1.05;margin:0 0 14px}.affc-single-buy-box .affc-merchant{font-size:.95rem;font-weight:700;color:#374151}.affc-single-buy-box .affc-button-large{width:100%;justify-content:center;display:inline-flex}.affc-single-buy-box .affc-disclosure{margin-top:12px}.affc-single-buy-box .affc-price-large-wrap .affc-price-current{font-size:5.2rem!important}.affc-single-buy-box .affc-price-large-wrap .affc-price-old{font-size:1.25rem}.affc-single-buy-box .affc-sale-row{gap:10px;flex-wrap:wrap}.affc-single-description{font-size:1rem;line-height:1.75}.affc-single-description > * + *{margin-top:1em}@media (max-width:1200px){.affc-single-layout{max-width:100%;padding:0 20px}}@media (max-width:991px){.affc-single-layout{grid-template-columns:1fr;gap:22px}.affc-single-media,.affc-single-buy-box,.affc-single-description{grid-column:auto;grid-row:auto}.affc-single-buy-box{position:static;padding:22px}.affc-single-buy-box .affc-price-large-wrap .affc-price-current{font-size:3.6rem!important}}@media (max-width:768px){.affc-single-layout{gap:18px}.affc-single-buy-box{padding:18px}.affc-single-buy-box h1{font-size:1.5rem}.affc-single-buy-box .affc-price-large-wrap .affc-price-current{font-size:2.8rem!important}.affc-single-buy-box .affc-price-large-wrap .affc-price-old{font-size:1rem}.affc-single-description{font-size:.95rem}}@media (max-width:480px){.affc-single-layout{gap:16px}.affc-single-buy-box{padding:16px}.affc-single-buy-box h1{font-size:1.25rem}.affc-single-buy-box .affc-price-large-wrap .affc-price-current{font-size:2.2rem!important}}

.affc-card .affc-topline{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:8px}.affc-card .affc-merchant{font-size:.82rem;color:#6b7280;font-weight:600}.affc-card .affc-price-block{margin:12px 0 14px;padding:0}.affc-price-main-row{display:flex;align-items:flex-end;justify-content:space-between;gap:14px}.affc-price-side-meta{display:flex;flex-direction:column;align-items:flex-end;gap:8px}.affc-card .affc-price-current{font-size:2.8rem!important}.affc-card .affc-price-old{font-size:.95rem}.affc-card .affc-sale-row{justify-content:flex-end;flex-wrap:wrap;gap:6px}.affc-card .affc-sale-badge{padding:3px 8px;font-size:.72rem}.affc-card .affc-savings{font-size:.82rem;white-space:nowrap}.affc-card .affc-trust-microcopy{font-size:.8rem;margin-top:8px;max-width:none}.affc-card .affc-disclosure{font-size:.78rem;line-height:1.45;margin-top:10px;color:#6b7280}.affc-card .affc-merchant-logo{width:24px;height:24px}.affc-single-buy-box .affc-price-main-row{align-items:flex-end}.affc-single-buy-box .affc-price-side-meta{align-items:flex-end}.affc-single-buy-box .affc-sale-row{justify-content:flex-end}@media (max-width:767px){.affc-price-main-row{align-items:flex-start;flex-direction:column}.affc-price-side-meta{align-items:flex-start}.affc-card .affc-price-current{font-size:2.35rem!important}.affc-single-buy-box .affc-price-large-wrap .affc-price-current{font-size:3.8rem!important}}

/* Price Drop Alert */
.affc-price-alert{background:#f0fdf4;border:1px solid #bbf7d0;border-radius:14px;padding:18px 20px;margin-top:20px}.affc-price-alert h4{margin:0 0 6px;font-size:15px;color:#14532d}.affc-price-alert-desc{margin:0 0 12px;font-size:13px;color:#166534}.affc-price-alert-form{display:flex;gap:10px;flex-wrap:wrap}.affc-price-alert-form input[type="email"]{flex:1;min-width:200px;padding:8px 12px;border:1px solid #86efac;border-radius:8px;font-size:14px}.affc-price-alert-form button{white-space:nowrap;padding:8px 16px;border-radius:8px;background:#15803d;color:#fff;border:none;cursor:pointer;font-size:14px}.affc-price-alert-form button:hover{background:#166534}.affc-price-alert-msg{margin:10px 0 0;font-size:13px;min-height:18px}.affc-price-alert-msg--success{color:#15803d}.affc-price-alert-msg--error{color:#b42318}

/* Auto-Link Keywords */
.affc-auto-link{color:#0f766e;font-weight:600;text-decoration:underline;text-decoration-color:#99f6e4;text-underline-offset:3px}.affc-auto-link:hover{color:#115e59}

/* Product Image Gallery */
.affc-gallery-stage{width:100%;border-radius:14px;overflow:hidden;background:#fff;border:1px solid #e5e7eb;margin-bottom:14px}.affc-gallery-stage img{width:100%;height:auto;display:block;aspect-ratio:4/3;object-fit:cover;cursor:zoom-in}.affc-gallery-nav{display:flex;gap:10px;flex-wrap:wrap}.affc-gallery-dot{padding:0;width:72px;height:72px;border:2px solid #e5e7eb;border-radius:10px;overflow:hidden;background:#fff;cursor:pointer;opacity:.7;transition:all .15s}.affc-gallery-dot img{width:100%;height:100%;object-fit:cover}.affc-gallery-dot:hover{opacity:1;border-color:#c3c4c7}.affc-gallery-dot.is-active{opacity:1;border-color:#111827}@media(max-width:991px){.affc-gallery-dot{width:64px;height:64px}}@media(max-width:768px){.affc-gallery-dot{width:56px;height:56px}}@media(max-width:480px){.affc-gallery-dot{width:48px;height:48px}.affc-gallery-stage{border-radius:12px}}

/* Lightbox */
.affc-lightbox{position:fixed;inset:0;z-index:9999;background:rgba(0,0,0,.92);display:none;align-items:center;justify-content:center;flex-direction:column}
.affc-lightbox.is-open{display:flex}
.affc-lightbox-stage{position:relative;max-width:90vw;max-height:80vh;display:flex;align-items:center;justify-content:center}
.affc-lightbox-stage img{max-width:90vw;max-height:80vh;border-radius:8px;object-fit:contain}
.affc-lightbox-count{position:absolute;bottom:-32px;left:50%;transform:translateX(-50%);color:#fff;font-size:13px;opacity:.7}
.affc-lightbox-close{position:absolute;top:18px;right:24px;width:44px;height:44px;border-radius:50%;border:none;background:rgba(255,255,255,.15);color:#fff;font-size:28px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s;z-index:10}
.affc-lightbox-close:hover{background:rgba(255,255,255,.3)}
.affc-lightbox-nav{position:absolute;top:50%;transform:translateY(-50%);width:50px;height:50px;border-radius:50%;border:none;background:rgba(255,255,255,.15);color:#fff;font-size:18px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s;z-index:10}
.affc-lightbox-nav:hover{background:rgba(255,255,255,.3)}
.affc-lightbox-prev{left:18px}
.affc-lightbox-next{right:18px}
@media(max-width:768px){.affc-lightbox-close{width:36px;height:36px;top:12px;right:12px;font-size:24px}.affc-lightbox-nav{width:40px;height:40px}.affc-lightbox-prev{left:12px}.affc-lightbox-next{right:12px}.affc-lightbox-stage img{max-width:95vw;max-height:85vh}}@media(max-width:480px){.affc-lightbox-close{width:32px;height:32px;top:8px;right:8px;font-size:20px}.affc-lightbox-nav{width:36px;height:36px}.affc-lightbox-prev{left:8px}.affc-lightbox-next{right:8px}.affc-lightbox-count{font-size:11px;bottom:-24px}}

/* Single Product Hero */
.affc-hero-single{padding:48px 0 20px;background:linear-gradient(180deg,#ffffff 0%,#f8fafc 100%)}.affc-hero-single h1{font-size:36px;line-height:1.1;margin:10px 0 6px;color:#0f172a}.affc-hero-merchant{font-size:14px;color:#64748b;margin:0}.affc-breadcrumb-single{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:13px;color:#64748b;margin:0 0 8px}.affc-breadcrumb-single a{color:#0f766e;text-decoration:none}.affc-breadcrumb-single a:hover{text-decoration:underline}.affc-breadcrumb-single .affc-breadcrumb-sep{color:#94a3b8}.affc-breadcrumb-single .affc-breadcrumb-current{font-weight:700;color:#0f172a}@media(max-width:991px){.affc-hero-single{padding:40px 0 18px}.affc-hero-single h1{font-size:32px}}@media(max-width:767px){.affc-hero-single{padding:32px 0 16px}.affc-hero-single h1{font-size:26px}.affc-breadcrumb-single{font-size:12px}}@media(max-width:480px){.affc-hero-single{padding:24px 0 12px}.affc-hero-single h1{font-size:22px}.affc-breadcrumb-single{font-size:11px}}

/* Categories Grid with Images */
.affc-categories-grid{display:grid;grid-template-columns:repeat(var(--columns,4),1fr);gap:20px;margin:24px 0}.affc-category-card{display:block;text-decoration:none;border-radius:16px;overflow:hidden;background:#fff;border:1px solid #e2e8f0;box-shadow:0 4px 12px rgba(15,23,42,.06);transition:transform .2s,box-shadow .2s}.affc-category-card:hover{transform:translateY(-4px);box-shadow:0 12px 28px rgba(15,23,42,.12);border-color:var(--cat-color,#3b82f6)}.affc-category-image-wrap{aspect-ratio:16/10;overflow:hidden;position:relative;background:#f1f5f9}.affc-category-image-wrap img{width:100%;height:100%;object-fit:cover;transition:transform .3s}.affc-category-card:hover .affc-category-image-wrap img{transform:scale(1.05)}.affc-category-overlay{position:absolute;inset:0}.affc-category-icon-bg{display:flex;align-items:center;justify-content:center;height:100%}.affc-category-icon-bg img{width:80px;height:80px;object-fit:contain}.affc-category-placeholder{display:flex;align-items:center;justify-content:center;height:100%}.affc-category-placeholder span{width:80px;height:80px;border-radius:50%;background:var(--cat-color,#3b82f6);color:#fff;display:flex;align-items:center;justify-content:center;font-size:32px;font-weight:700}.affc-category-info{padding:16px;display:flex;align-items:center;gap:12px}.affc-category-small-icon{width:32px;height:32px;border-radius:6px;object-fit:cover}.affc-category-name{font-size:16px;font-weight:700;color:#0f172a;margin:0;line-height:1.3}.affc-category-count{font-size:13px;color:#64748b}@media(max-width:1200px){.affc-categories-grid{grid-template-columns:repeat(3,1fr)}}@media(max-width:768px){.affc-categories-grid{grid-template-columns:repeat(2,1fr);gap:16px}}@media(max-width:480px){.affc-categories-grid{grid-template-columns:1fr;gap:12px}}

/* Category Badge in Product Cards */
.affc-category-badge{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;background:#f1f5f9;border-radius:999px;text-decoration:none;color:#475569;font-size:12px;font-weight:600;transition:background .15s}.affc-category-badge:hover{background:#e2e8f0;color:#0f172a}.affc-category-badge-icon{width:16px;height:16px;border-radius:3px;object-fit:cover}.affc-topline{gap:8px;flex-wrap:wrap}

/* Smart Hub Indicators */
.affc-smart-indicator{position:absolute;top:12px;right:12px;display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:999px;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.02em;box-shadow:0 4px 12px rgba(0,0,0,.15);z-index:10;animation:affc-pulse 2s ease-in-out infinite}.affc-smart-hot{background:linear-gradient(135deg,#ef4444 0%,#dc2626 100%);color:#fff}.affc-smart-deal{background:linear-gradient(135deg,#10b981 0%,#059669 100%);color:#fff}@keyframes affc-pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.05)}}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

/* Dark Mode Support - System Preference */
@media (prefers-color-scheme: dark) {
    .affc-shell {
        background: #0f172a;
        color: #f1f5f9;
    }
    .affc-hero {
        background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    }
    .affc-hero h1 {
        color: #f1f5f9;
    }
    .affc-hero p {
        color: #94a3b8;
    }
    .affc-chip {
        background: #1e293b;
        border-color: #334155;
        color: #f1f5f9;
    }
    .affc-chip.active,
    .affc-chip:hover {
        border-color: #0f766e;
        color: #0f766e;
    }
    .affc-card {
        background: #1e293b;
        border-color: #334155;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
    .affc-thumb {
        background: #334155;
    }
    .affc-placeholder {
        color: #64748b;
    }
    .affc-badge {
        background: #0f766e;
        color: #ccfbf1;
    }
    .affc-merchant {
        background: #334155;
        color: #cbd5e1;
    }
    .affc-title a {
        color: #f1f5f9;
    }
    .affc-excerpt {
        color: #94a3b8;
    }
    .affc-button {
        background: #0f766e;
    }
    .affc-button:hover {
        background: #115e59;
    }
    .affc-price-alert {
        background: #14532d;
        border-color: #166534;
    }
    .affc-price-alert h4 {
        color: #bbf7d0;
    }
    .affc-price-alert-desc {
        color: #86efac;
    }
    .affc-gallery-stage {
        background: #1e293b;
        border-color: #334155;
    }
    .affc-gallery-dot {
        background: #1e293b;
        border-color: #334155;
    }
    .affc-gallery-dot.is-active {
        border-color: #f1f5f9;
    }
    .affc-hero-single {
        background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    }
    .affc-hero-single h1 {
        color: #f1f5f9;
    }
    .affc-hero-merchant {
        color: #94a3b8;
    }
    .affc-breadcrumb-single {
        color: #94a3b8;
    }
    .affc-breadcrumb-single a {
        color: #0f766e;
    }
    .affc-breadcrumb-single .affc-breadcrumb-current {
        color: #f1f5f9;
    }
    .affc-category-card {
        background: #1e293b;
        border-color: #334155;
    }
    .affc-category-image-wrap {
        background: #334155;
    }
    .affc-category-name {
        color: #f1f5f9;
    }
    .affc-category-count {
        color: #94a3b8;
    }
    .affc-category-badge {
        background: #334155;
        color: #cbd5e1;
    }
    .affc-category-badge:hover {
        background: #475569;
        color: #f1f5f9;
    }
    .affc-single-buy-box {
        background: #1e293b;
        border-color: #334155;
    }
    .affc-single-buy-box h1 {
        color: #f1f5f9;
    }
    .affc-single-buy-box .affc-merchant {
        color: #cbd5e1;
    }
    .affc-disclosure {
        color: #94a3b8;
    }
    .affc-trust-microcopy {
        color: #94a3b8;
    }
    .affc-merchant-logo {
        background: #1e293b;
        border-color: #334155;
    }
}

/* Manual Dark Mode Toggle */
.affc-shell[data-theme="dark"] {
    background: #0f172a;
    color: #f1f5f9;
}
.affc-shell[data-theme="dark"] .affc-hero {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
}
.affc-shell[data-theme="dark"] .affc-hero h1 {
    color: #f1f5f9;
}
.affc-shell[data-theme="dark"] .affc-hero p {
    color: #94a3b8;
}
.affc-shell[data-theme="dark"] .affc-chip {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}
.affc-shell[data-theme="dark"] .affc-chip.active,
.affc-shell[data-theme="dark"] .affc-chip:hover {
    border-color: #0f766e;
    color: #0f766e;
}
.affc-shell[data-theme="dark"] .affc-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.affc-shell[data-theme="dark"] .affc-thumb {
    background: #334155;
}
.affc-shell[data-theme="dark"] .affc-placeholder {
    color: #64748b;
}
.affc-shell[data-theme="dark"] .affc-badge {
    background: #0f766e;
    color: #ccfbf1;
}
.affc-shell[data-theme="dark"] .affc-merchant {
    background: #334155;
    color: #cbd5e1;
}
.affc-shell[data-theme="dark"] .affc-title a {
    color: #f1f5f9;
}
.affc-shell[data-theme="dark"] .affc-excerpt {
    color: #94a3b8;
}
.affc-shell[data-theme="dark"] .affc-button {
    background: #0f766e;
}
.affc-shell[data-theme="dark"] .affc-button:hover {
    background: #115e59;
}
.affc-shell[data-theme="dark"] .affc-price-alert {
    background: #14532d;
    border-color: #166534;
}
.affc-shell[data-theme="dark"] .affc-price-alert h4 {
    color: #bbf7d0;
}
.affc-shell[data-theme="dark"] .affc-price-alert-desc {
    color: #86efac;
}
.affc-shell[data-theme="dark"] .affc-gallery-stage {
    background: #1e293b;
    border-color: #334155;
}
.affc-shell[data-theme="dark"] .affc-gallery-dot {
    background: #1e293b;
    border-color: #334155;
}
.affc-shell[data-theme="dark"] .affc-gallery-dot.is-active {
    border-color: #f1f5f9;
}
.affc-shell[data-theme="dark"] .affc-hero-single {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
}
.affc-shell[data-theme="dark"] .affc-hero-single h1 {
    color: #f1f5f9;
}
.affc-shell[data-theme="dark"] .affc-hero-merchant {
    color: #94a3b8;
}
.affc-shell[data-theme="dark"] .affc-breadcrumb-single {
    color: #94a3b8;
}
.affc-shell[data-theme="dark"] .affc-breadcrumb-single a {
    color: #0f766e;
}
.affc-shell[data-theme="dark"] .affc-breadcrumb-single .affc-breadcrumb-current {
    color: #f1f5f9;
}
.affc-shell[data-theme="dark"] .affc-category-card {
    background: #1e293b;
    border-color: #334155;
}
.affc-shell[data-theme="dark"] .affc-category-image-wrap {
    background: #334155;
}
.affc-shell[data-theme="dark"] .affc-category-name {
    color: #f1f5f9;
}
.affc-shell[data-theme="dark"] .affc-category-count {
    color: #94a3b8;
}
.affc-shell[data-theme="dark"] .affc-category-badge {
    background: #334155;
    color: #cbd5e1;
}
.affc-shell[data-theme="dark"] .affc-category-badge:hover {
    background: #475569;
    color: #f1f5f9;
}
.affc-shell[data-theme="dark"] .affc-single-buy-box {
    background: #1e293b;
    border-color: #334155;
}
.affc-shell[data-theme="dark"] .affc-single-buy-box h1 {
    color: #f1f5f9;
}
.affc-shell[data-theme="dark"] .affc-single-buy-box .affc-merchant {
    color: #cbd5e1;
}
.affc-shell[data-theme="dark"] .affc-disclosure {
    color: #94a3b8;
}
.affc-shell[data-theme="dark"] .affc-trust-microcopy {
    color: #94a3b8;
}
.affc-shell[data-theme="dark"] .affc-merchant-logo {
    background: #1e293b;
    border-color: #334155;
}

/* Glassmorphism Effects */
.affc-glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.affc-shell[data-theme="dark"] .affc-glass,
@media (prefers-color-scheme: dark) {
    .affc-glass {
        background: rgba(30, 41, 59, 0.7);
        border-color: rgba(51, 65, 85, 0.5);
    }
}

/* Modern Animations */
@keyframes affc-fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes affc-scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes affc-slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes affc-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes affc-glow {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.affc-card {
    animation: affc-fadeIn 0.5s ease-out;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
    backface-visibility: hidden;
}
.affc-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
}
.affc-card:active {
    transform: translateY(-4px);
}
.affc-shell[data-theme="dark"] .affc-card:hover,
@media (prefers-color-scheme: dark) {
    .affc-card:hover {
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    }
}

.affc-chip {
    transition: all 0.2s ease;
    will-change: transform;
}
.affc-chip:hover {
    transform: scale(1.05);
}
.affc-chip:active {
    transform: scale(0.98);
}

.affc-button {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    will-change: transform;
    backface-visibility: hidden;
}
.affc-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}
.affc-button:hover::after {
    width: 200px;
    height: 200px;
}
.affc-button:active {
    transform: scale(0.96);
}

.affc-category-card {
    animation: affc-scaleIn 0.4s ease-out;
}

/* Dark Mode Toggle Button */
.affc-theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #0f172a;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 9999;
}
.affc-theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
.affc-shell[data-theme="dark"] .affc-theme-toggle,
@media (prefers-color-scheme: dark) {
    .affc-theme-toggle {
        background: #f1f5f9;
        color: #0f172a;
    }
}

/* Skeleton Loading */
.affc-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: affc-shimmer 1.5s infinite;
}
.affc-shell[data-theme="dark"] .affc-skeleton,
@media (prefers-color-scheme: dark) {
    .affc-skeleton {
        background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
    }
}

/* Wishlist Heart Button */
.affc-wishlist-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s ease;
    z-index: 10;
}
.affc-wishlist-btn:hover {
    transform: scale(1.1);
    background: #fff;
}
.affc-wishlist-btn.is-active {
    color: #ef4444;
    animation: affc-pulse 0.3s ease;
}
.affc-shell[data-theme="dark"] .affc-wishlist-btn,
@media (prefers-color-scheme: dark) {
    .affc-wishlist-btn {
        background: rgba(30, 41, 59, 0.9);
        color: #f1f5f9;
    }
    .affc-wishlist-btn:hover {
        background: #1e293b;
    }
}

/* Quick View Button */
.affc-quick-view-btn {
    position: absolute;
    bottom: 12px;
    left: 12px;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.9);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    z-index: 10;
}
.affc-quick-view-btn:hover {
    background: #0f766e;
    transform: translateY(-2px);
}
.affc-shell[data-theme="dark"] .affc-quick-view-btn,
@media (prefers-color-scheme: dark) {
    .affc-quick-view-btn {
        background: rgba(15, 118, 110, 0.9);
    }
    .affc-quick-view-btn:hover {
        background: #0f766e;
    }
}

/* Social Proof Badge */
.affc-social-proof {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(16, 185, 129, 0.9);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    animation: affc-glow 2s infinite;
    will-change: transform, opacity;
    backface-visibility: hidden;
}
.affc-social-proof.hot {
    background: rgba(239, 68, 68, 0.9);
}
.affc-social-proof.trending {
    background: rgba(59, 130, 246, 0.9);
}

/* Responsive Improvements */
@media (max-width: 1200px) {
    .affc-container {
        max-width: 100%;
        padding: 0 16px;
    }
}
@media (max-width: 767px) {
    .affc-theme-toggle {
        bottom: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
}

/* Wishlist Grid */
.affc-wishlist-grid {
    display: grid;
    grid-template-columns: repeat(var(--columns, 4), 1fr);
    gap: 24px;
    margin: 24px 0;
}
@media (max-width: 1024px) {
    .affc-wishlist-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 768px) {
    .affc-wishlist-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}
@media (max-width: 480px) {
    .affc-wishlist-grid {
        grid-template-columns: 1fr;
    }
}

.affc-wishlist-empty {
    text-align: center;
    padding: 60px 20px;
    background: #f8fafc;
    border-radius: 16px;
    margin: 24px 0;
}
.affc-shell[data-theme="dark"] .affc-wishlist-empty,
@media (prefers-color-scheme: dark) {
    .affc-wishlist-empty {
        background: #1e293b;
    }
}
.affc-wishlist-empty p {
    font-size: 18px;
    color: #64748b;
    margin-bottom: 20px;
}
.affc-shell[data-theme="dark"] .affc-wishlist-empty p,
@media (prefers-color-scheme: dark) {
    .affc-wishlist-empty p {
        color: #94a3b8;
    }
}

/* Notification Toast */
.affc-notification {
    position: fixed;
    bottom: 80px;
    right: 20px;
    padding: 12px 20px;
    background: #0f172a;
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 10000;
}
.affc-notification.show {
    opacity: 1;
    transform: translateY(0);
}
.affc-shell[data-theme="dark"] .affc-notification,
@media (prefers-color-scheme: dark) {
    .affc-notification {
        background: #f1f5f9;
        color: #0f172a;
    }
}

/* Quick View Modal */
.affc-quick-view-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}
.affc-quick-view-modal.open {
    display: flex;
}
.affc-quick-view-modal.loading .affc-quick-view-content {
    min-height: 400px;
    display: flex;
}
