/* ==================== ERRORI DI PREZZO - UNIFIED PREMIUM DESIGN SYSTEM ==================== */
/* Sistema di design unificato per Web e Mobile - Glassmorphism + Modern UI */

/* ==================== CSS CUSTOM PROPERTIES - LIGHT THEME ==================== */
:root {
    /* Brand Colors - Vibrant Orange Palette */
    --brand-primary: #E2620A;
    --brand-primary-hover: #D54D00;
    --brand-secondary: #F4A236;
    --brand-tertiary: #FAA307;
    --brand-light: #FFBE0B;
    --brand-gradient: linear-gradient(135deg, #E2620A 0%, #F4A236 100%);
    --brand-gradient-hover: linear-gradient(135deg, #D54D00 0%, #E85D04 50%, #F48C06 100%);
    --brand-gradient-soft: linear-gradient(135deg, rgba(226, 98, 10, 0.1) 0%, rgba(244, 162, 54, 0.1) 100%);
    --brand-glow: 0 0 40px rgba(226, 98, 10, 0.3);
    --brand-soft: #FFF4EB;

    /* Surface Colors - Clean Whites */
    --surface-0: #FFFFFF;
    --surface-1: #FAFBFC;
    --surface-2: #F4F6F8;
    --surface-3: #EEF1F4;
    --surface-4: #E3E8ED;
    --surface-elevated: #FFFFFF;
    --surface-glass: rgba(255, 255, 255, 0.8);
    --surface-glass-hover: rgba(255, 255, 255, 0.95);

    /* Background */
    --bg-body: #F0F2F5;
    --bg-page: linear-gradient(180deg, #F8FAFC 0%, #EEF2F6 100%);
    --bg-hero: linear-gradient(135deg, #E85D04 0%, #F48C06 40%, #FAA307 100%);
    --bg-pattern: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23E85D04' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");

    /* Text Colors */
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-tertiary: #64748B;
    /* Scurito per WCAG AA (era #9CA3AF: 2,26:1 su --bg-body, 2,54:1 su --surface-0).
       Ora 4,81:1 su --bg-body e 5,40:1 su --surface-0; peggior fondo reale --surface-3 = 4,76:1.
       Stessa tinta dell'originale (hue 218), abbassata solo in luminosita'. */
    --text-muted: #616B7A;

    /* Border */
    --border-default: #E5E7EB;
    --text-inverse: #FFFFFF;
    --text-brand: var(--brand-primary);
    --text-link: var(--brand-primary);
    --text-link-hover: var(--brand-primary-hover);

    /* Semantic Colors */
    --success: #10B981;
    --success-light: #D1FAE5;
    --success-dark: #059669;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --danger-dark: #DC2626;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --warning-dark: #D97706;
    --info: #3B82F6;
    --info-light: #DBEAFE;
    --info-dark: #2563EB;

    /* Section Accent Colors */
    --accent-deals: #E2620A;
    --accent-deals-light: rgba(226, 98, 10, 0.1);
    --accent-deals-soft: #FFF4EB;
    --accent-deals-gradient: linear-gradient(135deg, #E2620A 0%, #F4A236 100%);

    --accent-travel: #0B8FD0;
    --accent-travel-light: rgba(11, 143, 208, 0.1);
    --accent-travel-soft: #EBF6FF;
    --accent-travel-gradient: linear-gradient(135deg, #0B8FD0 0%, #38BDF8 100%);

    --accent-vouchers: #0D9668;
    --accent-vouchers-light: rgba(13, 150, 104, 0.1);
    --accent-vouchers-soft: #EDFAF4;
    --accent-vouchers-gradient: linear-gradient(135deg, #0D9668 0%, #34D399 100%);

    --accent-realestate: #7C3AED;
    --accent-realestate-light: rgba(124, 58, 237, 0.1);
    --accent-realestate-soft: #F5F0FF;
    --accent-realestate-gradient: linear-gradient(135deg, #7C3AED 0%, #A78BFA 100%);

    --accent-automotive: #DC2626;
    --accent-automotive-light: rgba(220, 38, 38, 0.1);
    --accent-automotive-soft: #FEF2F2;
    --accent-automotive-gradient: linear-gradient(135deg, #DC2626 0%, #F87171 100%);

    --accent-danger: #DC3545;
    --accent-danger-soft: #FFF0F1;
    --accent-flash: #D97706;
    --accent-flash-soft: #FFFBEB;

    /* Sidebar */
    --sidebar-bg: #111827;
    --sidebar-bg-dark: #0F1629;
    --sidebar-text: #9CA3AF;
    --sidebar-text-active: #F4A236;
    --sidebar-active-bg: rgba(226, 98, 10, 0.12);
    --sidebar-border: rgba(255, 255, 255, 0.08);

    /* Border Colors */
    --border-light: rgba(0, 0, 0, 0.06);
    --border-medium: rgba(0, 0, 0, 0.1);
    --border-strong: rgba(0, 0, 0, 0.15);
    --border-focus: var(--brand-primary);

    /* Shadows - Layered Depth System */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.04), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.06), 0 4px 8px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.08), 0 12px 24px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 32px 64px rgba(0, 0, 0, 0.12), 0 16px 32px rgba(0, 0, 0, 0.06);
    --shadow-brand: 0 8px 24px rgba(232, 93, 4, 0.25);
    --shadow-brand-lg: 0 16px 40px rgba(232, 93, 4, 0.3);
    --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.08);

    /* Border Radius - Rounded System */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-3xl: 32px;
    --radius-full: 9999px;

    /* Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;

    /* Layout */
    --sidebar-width: 280px;
    --sidebar-collapsed: 72px;
    --header-height: 64px;
    --bottom-nav-height: 64px;
    --content-max-width: 1440px;
    --card-min-width: 300px;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --font-display: 'Plus Jakarta Sans', var(--font-sans);

    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;

    /* Enhanced Typography - Display Scale */
    --text-display-sm: 1.875rem;   /* 30px - section titles */
    --text-display-md: 2.25rem;    /* 36px - page titles */
    --text-display-lg: 3rem;       /* 48px - hero headlines */
    --text-display-xl: 3.75rem;    /* 60px - large hero */

    /* Price Typography */
    --text-price-sm: 0.875rem;     /* original price */
    --text-price-md: 1.25rem;      /* current price default */
    --text-price-lg: 1.5rem;       /* current price featured */
    --text-price-xl: 2rem;         /* current price hero */

    /* Letter Spacing */
    --tracking-tighter: -0.05em;
    --tracking-tight: -0.025em;
    --tracking-normal: 0;
    --tracking-wide: 0.025em;
    --tracking-wider: 0.05em;

    /* Line Heights */
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;

    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms;
    --duration-normal: 200ms;
    --duration-slow: 300ms;
    --duration-slower: 400ms;
    --transition-base: all var(--duration-normal) var(--ease-out);
    --transition-fast: all var(--duration-fast) var(--ease-out);
    --transition-slow: all var(--duration-slow) var(--ease-out);
    --transition-spring: all var(--duration-slow) var(--ease-spring);

    /* Z-Index Scale */
    --z-base: 0;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
    --z-toast: 800;

    /* Blur */
    --blur-sm: 4px;
    --blur-md: 8px;
    --blur-lg: 16px;
    --blur-xl: 24px;
}

/* ==================== DARK THEME ==================== */
[data-theme="dark"] {
    /* Surface Colors - Rich Dark */
    --surface-0: #1A2332;
    --surface-1: #1E293B;
    --surface-2: #181D26;
    --surface-3: #1E242F;
    --surface-4: #252D3A;
    --surface-elevated: #1A2332;
    --surface-glass: rgba(18, 22, 29, 0.85);
    --surface-glass-hover: rgba(24, 29, 38, 0.95);

    /* Background */
    --bg-body: #111827;
    --bg-page: linear-gradient(180deg, #111827 0%, #1A2332 100%);

    /* Text Colors */
    --text-primary: #E5E7EB;
    --text-secondary: #D1D5DB;
    --text-tertiary: #94A3B8;
    /* Schiarito per WCAG AA (era #6B7280: 3,67:1 su --bg-body, 3,27:1 su --surface-0).
       Ora 5,88:1 su --bg-body e 5,23:1 su --surface-0; peggior fondo --surface-4 = 4,59:1.
       Tenuto sotto --text-tertiary (#94A3B8) per non invertire la gerarchia nel tema scuro. */
    --text-muted: #8D95A3;
    --text-inverse: #0F172A;

    /* Border Colors */
    --border-default: #2D3748;
    --border-light: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.15);

    --brand-soft: #2A1E0E;

    /* Sidebar */
    --sidebar-bg: #0F1629;
    --sidebar-bg-dark: #0A0F1D;

    /* Shadows - Dark Mode Optimized */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.25), 0 4px 8px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.3), 0 12px 24px rgba(0, 0, 0, 0.2);
    --shadow-2xl: 0 32px 64px rgba(0, 0, 0, 0.4), 0 16px 32px rgba(0, 0, 0, 0.25);
    --shadow-brand: 0 8px 24px rgba(226, 98, 10, 0.3);
    --shadow-brand-lg: 0 16px 40px rgba(226, 98, 10, 0.35);
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.3);

    /* Semantic - Slightly Brighter for Dark Mode */
    --success-light: rgba(16, 185, 129, 0.15);
    --danger-light: rgba(239, 68, 68, 0.15);
    --warning-light: rgba(245, 158, 11, 0.15);
    --info-light: rgba(59, 130, 246, 0.15);

    /* Section Accent Colors - Dark Mode */
    --accent-deals-light: rgba(226, 98, 10, 0.15);
    --accent-deals-soft: #2A1E0E;
    --accent-travel-light: rgba(11, 143, 208, 0.15);
    --accent-travel-soft: #152535;
    --accent-travel-price: #38BDF8;
    --accent-vouchers-light: rgba(13, 150, 104, 0.15);
    --accent-vouchers-soft: #0E2318;
    --accent-realestate-light: rgba(124, 58, 237, 0.18);
    --accent-realestate-soft: #1E1633;
    --accent-automotive-light: rgba(220, 38, 38, 0.16);
    --accent-automotive-soft: #2A1414;
    --accent-automotive-price: #F87171;
    --accent-danger-soft: #3D1520;
    --accent-flash-soft: #2D2515;

    /* Hero gradient muted for dark */
    --brand-gradient: linear-gradient(135deg, #B84D08 0%, #D98A2B 100%);

    /* Error card dark accents */
    --error-card-bg: #1F1520;
    --error-card-border: #4A2028;
}

/* ==================== RESET & BASE ==================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background: var(--bg-body);
    background-image: var(--bg-pattern);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--duration-slow), color var(--duration-slow);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==================== TYPOGRAPHY ==================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

h1 { font-size: var(--text-4xl); margin-bottom: var(--space-4); }
h2 { font-size: var(--text-3xl); margin-bottom: var(--space-3); }
h3 { font-size: var(--text-2xl); margin-bottom: var(--space-3); }
h4 { font-size: var(--text-xl); margin-bottom: var(--space-2); }
h5 { font-size: var(--text-lg); margin-bottom: var(--space-2); }
h6 { font-size: var(--text-base); margin-bottom: var(--space-2); }

p {
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--text-link-hover);
}

strong, b {
    font-weight: var(--font-semibold);
}

small {
    font-size: var(--text-sm);
}

/* ==================== SELECTION ==================== */
::selection {
    background: rgba(232, 93, 4, 0.2);
    color: var(--text-primary);
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface-2);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ==================== FOCUS STYLES ==================== */
:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    line-height: 1;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-base);
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--brand-gradient);
    color: var(--text-inverse);
    box-shadow: var(--shadow-brand);
}

.btn-primary:hover:not(:disabled) {
    background: var(--brand-gradient-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-brand-lg);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--surface-2);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--surface-3);
    border-color: var(--border-medium);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.btn-outline:hover:not(:disabled) {
    background: var(--surface-2);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--surface-2);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: var(--danger-dark);
}

.btn-telegram {
    background: linear-gradient(135deg, #0088CC 0%, #00A8E8 100%);
    color: white;
    box-shadow: 0 8px 24px rgba(0, 136, 204, 0.25);
    /* «Canale Telegram» nel pie' del menu laterale misurava 38,3 px: l'altezza veniva solo dal
       padding di .btn (poche righe sopra). Il testo resta centrato, .btn e' gia' inline-flex.
       La regola sta qui, nel file che possiede la classe, e non in components.css: scriverla
       altrove funzionerebbe solo finche' nessuno aggiunge un height a questa regola, e il
       giorno che succedesse smetterebbe di mordere senza alcun errore. */
    min-height: 44px;
}

.btn-telegram:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 136, 204, 0.35);
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    border-radius: var(--radius);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
    border-radius: var(--radius-lg);
}

.btn-xl {
    padding: var(--space-5) var(--space-10);
    font-size: var(--text-lg);
    border-radius: var(--radius-xl);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
}

.btn-icon.btn-lg {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
}

/* ==================== CARDS ==================== */
.card {
    background: var(--surface-0);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: var(--transition-base);
}

.card:hover {
    border-color: var(--border-medium);
    box-shadow: var(--shadow-lg);
}

.card-glass {
    background: var(--surface-glass);
    backdrop-filter: blur(var(--blur-lg));
    -webkit-backdrop-filter: blur(var(--blur-lg));
    border: 1px solid var(--border-light);
}

.card-elevated {
    box-shadow: var(--shadow-md);
}

.card-interactive {
    cursor: pointer;
}

.card-interactive:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card-interactive:active {
    transform: translateY(-2px);
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    line-height: 1;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-brand {
    background: var(--brand-gradient-soft);
    color: var(--brand-primary);
}

.badge-success {
    background: var(--success-light);
    color: var(--success-dark);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger-dark);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.badge-info {
    background: var(--info-light);
    color: var(--info-dark);
}

.badge-neutral {
    background: var(--surface-3);
    color: var(--text-secondary);
}

.badge-price-error {
    background: linear-gradient(135deg, var(--danger) 0%, #FF6B6B 100%);
    color: white;
    padding: var(--space-1) var(--space-3);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.badge-flash {
    background: linear-gradient(135deg, var(--warning) 0%, #FFD93D 100%);
    color: #1a1a1a;
    padding: var(--space-1) var(--space-3);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.badge-coupon {
    background: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 100%);
    color: white;
    padding: 2px var(--space-2);
    font-size: 0.625rem;
    opacity: 0.7;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.badge-discount {
    background: linear-gradient(135deg, var(--success) 0%, #34D399 100%);
    color: white;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.hp-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.hp-badge--sponsored {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-weight: 600;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
}

/* ==================== INPUTS ==================== */
.input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    color: var(--text-primary);
    background: var(--surface-1);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: var(--transition-base);
}

.input:hover {
    border-color: var(--border-medium);
}

.input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
}

.input::placeholder {
    color: var(--text-muted);
}

.input-group {
    position: relative;
}

.input-group .input-icon {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.input-group .input {
    padding-left: calc(var(--space-4) + var(--space-6));
}

/* Search Input */
.search-input {
    background: var(--surface-glass);
    backdrop-filter: blur(var(--blur-md));
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    padding: var(--space-3) var(--space-4);
    padding-left: calc(var(--space-4) + var(--space-6));
}

.search-input:focus {
    background: var(--surface-0);
    box-shadow: var(--shadow-lg), 0 0 0 3px rgba(232, 93, 4, 0.1);
}

/* ==================== GRID SYSTEM ==================== */
.grid {
    display: grid;
    gap: var(--space-6);
}

.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-min-width), 1fr));
    gap: var(--space-6);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Erano due gradini separati (1200px e 992px): sulla scala 640/1024 cadono sulla
   stessa soglia, quindi il gradino intermedio a 3 colonne sparisce e resta solo
   la regola piu' restrittiva (2 colonne), che e' quella che vinceva anche prima
   perche' arrivava dopo in cascata. */
@media (max-width: 1023.98px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 639.98px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .grid-auto { grid-template-columns: 1fr; }
}

/* ==================== FLEX UTILITIES ==================== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ==================== SPACING UTILITIES ==================== */
.p-0 { padding: 0; }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }

.m-0 { margin: 0; }
.m-auto { margin: auto; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

/* ==================== TEXT UTILITIES ==================== */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }

.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-muted { color: var(--text-muted); }
.text-brand { color: var(--brand-primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-white { color: white; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==================== WIDTH/HEIGHT UTILITIES ==================== */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* ==================== BORDER UTILITIES ==================== */
.rounded { border-radius: var(--radius); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

/* ==================== LOADING STATES ==================== */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner.sm {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

.loading-spinner.lg {
    width: 56px;
    height: 56px;
    border-width: 4px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1em;
    margin-bottom: var(--space-2);
}

.skeleton-heading {
    height: 1.5em;
    width: 60%;
    margin-bottom: var(--space-4);
}

.skeleton-image {
    aspect-ratio: 16/9;
    width: 100%;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-fade-in { animation: fadeIn var(--duration-normal) var(--ease-out); }
.animate-fade-in-up { animation: fadeInUp var(--duration-slow) var(--ease-out); }
.animate-fade-in-down { animation: fadeInDown var(--duration-slow) var(--ease-out); }
.animate-slide-in-left { animation: slideInLeft var(--duration-slow) var(--ease-out); }
.animate-slide-in-right { animation: slideInRight var(--duration-slow) var(--ease-out); }
.animate-scale-in { animation: scaleIn var(--duration-slow) var(--ease-spring); }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-bounce { animation: bounce 1s ease-in-out infinite; }

/* Staggered animations */
.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }
.stagger-5 { animation-delay: 250ms; }
.stagger-6 { animation-delay: 300ms; }

/* ==================== HOVER EFFECTS ==================== */
.hover-lift {
    transition: var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.hover-scale {
    transition: var(--transition-base);
}

.hover-scale:hover {
    transform: scale(1.02);
}

.hover-glow {
    transition: var(--transition-base);
}

.hover-glow:hover {
    box-shadow: var(--brand-glow);
}

/* ==================== VISIBILITY ==================== */
/* .visually-hidden è il nome di Bootstrap, che Web e MAUI non caricano: usata da TravelCard, Routes e
   TelegramLoginButton, senza questa regola il testo per il lettore di schermo compariva a video (30-09) */
.sr-only,
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.hidden { display: none !important; }
.invisible { visibility: hidden; }
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-100 { opacity: 1; }

/* ==================== RESPONSIVE VISIBILITY ==================== */
@media (max-width: 639.98px) {
    .hide-mobile { display: none !important; }
}

/* Era min-width: 769px, cioe' "da tablet in su": sulla scala unificata e' la
   soglia 640px. Qui dentro c'e' unita anche la spaziatura di .container, che
   prima viveva in un blocco min-width: 768px separato (sezione CONTAINER piu'
   sotto) — stessa soglia dopo la conversione, quindi stesso blocco invece di
   due @media identici nel file. */
@media (min-width: 640px) {
    .hide-desktop { display: none !important; }
    .container { padding: 0 var(--space-6); }
}

@media (max-width: 1023.98px) {
    .hide-tablet { display: none !important; }
}

/* ==================== DIVIDERS ==================== */
.divider {
    height: 1px;
    background: var(--border-light);
    margin: var(--space-4) 0;
}

.divider-vertical {
    width: 1px;
    height: 100%;
    background: var(--border-light);
    margin: 0 var(--space-4);
}

/* ==================== OVERLAY ==================== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(var(--blur-sm));
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-base);
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ==================== CONTAINER ==================== */
.container {
    width: 100%;
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

/* La spaziatura da 640px in su e' unita al blocco @media (min-width: 640px)
   della sezione RESPONSIVE VISIBILITY, insieme a .hide-desktop: stessa soglia
   dopo la conversione, niente piu' due blocchi identici. */

/* ==================== SCROLLABLE ==================== */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

.scroll-snap-x {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.scroll-snap-x > * {
    scroll-snap-align: start;
}

/* Hide scrollbar but keep functionality */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* ==================== ASPECT RATIOS ==================== */
.aspect-square { aspect-ratio: 1 / 1; }
.aspect-video { aspect-ratio: 16 / 9; }
.aspect-photo { aspect-ratio: 4 / 3; }

/* ==================== OBJECT FIT ==================== */
.object-cover { object-fit: cover; }
.object-contain { object-fit: contain; }
.object-fill { object-fit: fill; }

/* ==================== POSITION ==================== */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }

/* ==================== CURSOR ==================== */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }

/* ==================== POINTER EVENTS ==================== */
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }

/* ==================== USER SELECT ==================== */
.select-none { user-select: none; }
.select-text { user-select: text; }
.select-all { user-select: all; }
