/* --- SEMANTIC DESIGN SYSTEM --- */
:root {
    --radius-container: 1rem;
    --radius-button: 0.5rem;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-blur: 8px;
    --glass-border: rgba(0, 0, 0, 0.1);
    --nav-height: 80px;

    --motion-reveal: cubic-bezier(0.16, 1, 0.3, 1);
    --motion-speed: 0.6s;
    --logo-filter: none;

    /* Bridge Variables Defaults */
    --theme-bg: var(--color-bg, #ffffff);
    --theme-bg-light: var(--color-bg-light, #f8f9fa);
    --theme-text: var(--color-text, #1a1a1a);
    --theme-text-light: var(--color-text-light, #6c757d);
    --theme-primary: var(--color-primary, #2563eb);
    --theme-border: var(--color-border, #dee2e6);
}

/* --- THEME: LUXURY OBSIDIAN --- */
[data-theme='luxury'] {
    --color-primary: #D4AF37;
    --color-primary-rgb: 212, 175, 55;
    --color-secondary: #050505;
    --color-accent: #FFD700;
    --color-bg: #0A0A0A;
    --color-bg-light: #151515;
    --color-text: #FFFFFF;
    --color-text-light: #B8B8B8;
    --color-border: #2A2A2A;
    --color-on-primary: #050505;
    /* testo leggibile SOPRA il colore primario (nero su oro) */

    /* Bridge Mapping for Components */
    --theme-primary: var(--color-primary);
    --theme-bg: var(--color-bg);
    --theme-bg-light: var(--color-bg-light);
    --theme-text: var(--color-text);
    --theme-text-light: var(--color-text-light);
    --theme-border: var(--color-border);

    --radius-container: 0px;
    /* Sharp corners for luxury */
    --radius-button: 0px;
    --glass-bg: rgba(10, 10, 10, 0.75);
    --glass-blur: 25px;
    --glass-border: rgba(212, 175, 55, 0.15);
    --shadow-lg: 0 40px 100px rgba(0, 0, 0, 0.9);
    --logo-filter: brightness(0) invert(1);

    /* Advanced Textures */
    --metallic-gold: linear-gradient(135deg, #D4AF37 0%, #FFF3B0 25%, #D4AF37 50%, #C5A028 100%);
    --obsidian-gradient: radial-gradient(circle at 50% 0%, #1a1a1a 0%, #050505 100%);
}

[data-theme='luxury'] body {
    background-color: var(--color-bg);
    background-image: var(--obsidian-gradient);
}

/* --- THEME: CORPORATE (chiaro, blu — studi professionali/commercialisti) --- */
[data-theme='corporate'] {
    --color-primary: #1e40af;
    --color-primary-rgb: 30, 64, 175;
    --color-secondary: #0f172a;
    --color-accent: #3b82f6;
    --color-bg: #ffffff;
    --color-bg-light: #f1f5f9;
    --color-text: #0f172a;
    --color-text-light: #64748b;
    --color-border: #e2e8f0;
    --color-on-primary: #ffffff;
    /* testo su fondo blu */

    --theme-primary: var(--color-primary);
    --theme-bg: var(--color-bg);
    --theme-bg-light: var(--color-bg-light);
    --theme-text: var(--color-text);
    --theme-text-light: var(--color-text-light);
    --theme-border: var(--color-border);

    --radius-container: 0.75rem;
    --radius-button: 0.5rem;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-blur: 12px;
    --glass-border: rgba(30, 64, 175, 0.12);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.08);
    --logo-filter: none;

    /* Il "gradiente primario" diventa blu (i widget che usano --metallic-gold per l'accento lo seguono) */
    --metallic-gold: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #1e40af 100%);
    --obsidian-gradient: radial-gradient(circle at 50% 0%, #f8fafc 0%, #ffffff 60%);
}

[data-theme='corporate'] body {
    background-color: var(--color-bg);
    background-image: var(--obsidian-gradient);
}

/* --- THEME: MINIMAL (chiaro, neutro/mono) --- */
[data-theme='minimal'] {
    --color-primary: #111827;
    --color-primary-rgb: 17, 24, 39;
    --color-secondary: #374151;
    --color-accent: #4b5563;
    --color-bg: #ffffff;
    --color-bg-light: #f9fafb;
    --color-text: #111827;
    --color-text-light: #6b7280;
    --color-border: #e5e7eb;
    --color-on-primary: #ffffff;
    /* testo su fondo scuro/neutro */

    --theme-primary: var(--color-primary);
    --theme-bg: var(--color-bg);
    --theme-bg-light: var(--color-bg-light);
    --theme-text: var(--color-text);
    --theme-text-light: var(--color-text-light);
    --theme-border: var(--color-border);

    --radius-container: 0.5rem;
    --radius-button: 0.375rem;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-blur: 10px;
    --glass-border: rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.06);
    --logo-filter: none;

    --metallic-gold: linear-gradient(135deg, #111827 0%, #374151 50%, #111827 100%);
    --obsidian-gradient: radial-gradient(circle at 50% 0%, #ffffff 0%, #f9fafb 100%);
}

[data-theme='minimal'] body {
    background-color: var(--color-bg);
    background-image: var(--obsidian-gradient);
}

/* ═══ IL VELO SOPRA UNA FOTO — .wf-velo (7/9/2026) ═══════════════════════════════════
   Il velo che rende leggibile un testo sopra una foto si disegna A TUTTA LARGHEZZA, con
   le fermate del gradiente ANCORATE ALLA COLONNA del testo (calc da metà schermo), mai
   con `background-size` ridotta né sul contenitore che ha `max-width`. Il difetto, visto
   due volte: a 1440px sembra perfetto, su uno schermo 4K diventa una FASCIA scura al
   centro con la foto coi colori normali ai lati. Controllo: `node scripts/qa-velo.js`.
   Uso: <div class="wf-velo wf-velo--sx"></div> dentro la sezione (position:relative),
   sopra la foto e sotto il testo. Variabili, con i loro default:
     --wf-velo-rgb: 0,0,0     il colore del velo (tre numeri, senza rgba)
     --wf-max: 1440px         la larghezza della colonna del testo
     --wf-velo-base: .42      quanto resta velato FUORI dalla colonna (mai 0: è lì che
                              si vedeva la foto «coi colori normali») */
.wf-velo { position: absolute; inset: 0; pointer-events: none; }
.wf-velo--sx {
    background: linear-gradient(90deg,
        rgba(var(--wf-velo-rgb, 0,0,0), .94) 0,
        rgba(var(--wf-velo-rgb, 0,0,0), .94) calc(50% - var(--wf-max, 1440px) / 2 + var(--wf-max, 1440px) * .20),
        rgba(var(--wf-velo-rgb, 0,0,0), .82) calc(50% - var(--wf-max, 1440px) / 2 + var(--wf-max, 1440px) * .42),
        rgba(var(--wf-velo-rgb, 0,0,0), var(--wf-velo-base, .42)) calc(50% - var(--wf-max, 1440px) / 2 + var(--wf-max, 1440px) * .78),
        rgba(var(--wf-velo-rgb, 0,0,0), var(--wf-velo-base, .42)) 100%);
}
.wf-velo--dx {
    background: linear-gradient(270deg,
        rgba(var(--wf-velo-rgb, 0,0,0), .94) 0,
        rgba(var(--wf-velo-rgb, 0,0,0), .94) calc(50% - var(--wf-max, 1440px) / 2 + var(--wf-max, 1440px) * .20),
        rgba(var(--wf-velo-rgb, 0,0,0), .82) calc(50% - var(--wf-max, 1440px) / 2 + var(--wf-max, 1440px) * .42),
        rgba(var(--wf-velo-rgb, 0,0,0), var(--wf-velo-base, .42)) calc(50% - var(--wf-max, 1440px) / 2 + var(--wf-max, 1440px) * .78),
        rgba(var(--wf-velo-rgb, 0,0,0), var(--wf-velo-base, .42)) 100%);
}
.wf-velo--basso { background: linear-gradient(180deg, rgba(var(--wf-velo-rgb, 0,0,0), .25) 0, transparent 30%, transparent 55%, rgba(var(--wf-velo-rgb, 0,0,0), .88) 100%); }
.wf-velo--pieno { background: rgba(var(--wf-velo-rgb, 0,0,0), var(--wf-velo-base, .55)); }
@media (max-width: 960px) {
    /* sotto la colonna il testo occupa tutta la larghezza: il velo diventa verticale */
    .wf-velo--sx, .wf-velo--dx { background: linear-gradient(180deg, rgba(var(--wf-velo-rgb, 0,0,0), .70) 0, rgba(var(--wf-velo-rgb, 0,0,0), .55) 45%, rgba(var(--wf-velo-rgb, 0,0,0), .90) 100%); }
}

/* Testo su media/overlay scuri (HERO): SEMPRE bianco, in ogni tema (non segue il bridge tema) */
.text-on-media {
    color: #ffffff !important;
}

.text-on-media-soft {
    color: rgba(255, 255, 255, 0.75) !important;
}

/* --- TYPOGRAPHY ENHANCEMENTS --- */
.text-shadow-premium {
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.25), 0 10px 30px rgba(0, 0, 0, 0.15);
}

.text-shadow-deep {
    text-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 2px 10px rgba(0, 0, 0, 0.2);
}

.text-shadow-gold {
    text-shadow: 0 0 20px rgba(var(--color-primary-rgb), 0.4), 0 0 40px rgba(var(--color-primary-rgb), 0.15);
}

/* --- THEME BRIDGE CLASSES --- */
.theme-nav {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    height: var(--nav-height);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-nav:after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--metallic-gold);
    opacity: 0.3;
}

.theme-card {
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    position: relative;
    overflow: hidden;
    transition: all 0.6s var(--motion-reveal);
}

.theme-card:before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to bottom right, rgba(var(--color-primary-rgb), 0.05), transparent);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.theme-card:hover {
    transform: translateY(-10px);
    border-color: var(--color-primary);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25), 0 0 20px rgba(var(--color-primary-rgb), 0.1);
}

.theme-card:hover:before {
    opacity: 1;
}

.theme-btn {
    display: inline-block;
    position: relative;
    padding: 1rem 2.5rem !important;
    background: var(--metallic-gold) !important;
    color: var(--color-on-primary, var(--color-secondary)) !important;
    font-weight: 900 !important;
    letter-spacing: 2px !important;
    overflow: hidden;
    border: none !important;
    box-shadow: 0 15px 35px rgba(var(--color-primary-rgb), 0.3) !important;
}

.theme-btn:after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: 0.6s;
}

.theme-btn:hover:after {
    left: 100%;
}

.theme-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.2);
    box-shadow: 0 10px 20px rgba(212, 175, 55, 0.2);
}

.theme-footer {
    background-color: var(--color-bg-light);
    border-top: 1px solid var(--color-border);
    color: var(--color-text);
}

.theme-input {
    background-color: var(--color-bg-light) !important;
    border: 1px solid var(--color-border) !important;
    color: var(--color-text) !important;
    border-radius: var(--radius-button) !important;
    transition: all 0.3s ease !important;
}

.theme-input:focus {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.2) !important;
    outline: none !important;
}

/* --- LUXURY TYPOGRAPHY --- */
[data-theme='luxury'] h1,
[data-theme='luxury'] h2,
[data-theme='luxury'] h3 {
    text-transform: uppercase;
    letter-spacing: -0.02em;
    font-weight: 900;
}

[data-theme='luxury'] p {
    letter-spacing: 0.01em;
    line-height: 1.8;
}

/* --- NOISE TEXTURE --- */
[data-theme='luxury']:after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    opacity: .03;
    z-index: 9999;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3%3Ffilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* --- FLOATING ANIMATION --- */
@keyframes luxuryFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.luxury-float {
    animation: luxuryFloat 4s ease-in-out infinite;
}

/* --- TYPOGRAPHY & CONTRAST FIXES --- */
[data-theme='luxury'] .text-gray-900,
[data-theme='luxury'] .text-gray-800 {
    color: var(--color-text) !important;
}

[data-theme='luxury'] .text-gray-600,
[data-theme='luxury'] .text-gray-500 {
    color: var(--color-text-light) !important;
}

[data-theme='luxury'] .bg-white {
    background-color: var(--color-bg) !important;
}

[data-theme='luxury'] .bg-gray-50 {
    background-color: var(--color-bg-light) !important;
}

[data-theme='luxury'] .border-gray-100,
[data-theme='luxury'] .border-gray-200 {
    border-color: var(--color-border) !important;
}

/* Force standard accent colors to use Theme Primary in Luxury mode */
[data-theme='luxury'] .text-indigo-600,
[data-theme='luxury'] .text-blue-600,
[data-theme='luxury'] .text-purple-600,
[data-theme='luxury'] .text-primary {
    color: var(--color-primary) !important;
}

[data-theme='luxury'] .bg-indigo-600,
[data-theme='luxury'] .bg-blue-600,
[data-theme='luxury'] .bg-purple-600,
[data-theme='luxury'] .bg-primary {
    background: var(--metallic-gold) !important;
    color: var(--color-secondary) !important;
}

[data-theme='luxury'] .bg-indigo-50,
[data-theme='luxury'] .bg-blue-50,
[data-theme='luxury'] .bg-purple-50,
[data-theme='luxury'] .bg-gray-100,
[data-theme='luxury'] .bg-gray-50 {
    background-color: var(--color-bg-light) !important;
    border: 1px solid var(--color-border) !important;
}

[data-theme='luxury'] .text-gray-900,
[data-theme='luxury'] .text-slate-900,
[data-theme='luxury'] .text-black {
    color: white !important;
}

[data-theme='luxury'] .text-gray-600,
[data-theme='luxury'] .text-gray-700,
[data-theme='luxury'] .text-slate-600 {
    color: var(--color-text-light) !important;
}

[data-theme='luxury'] .bg-white {
    background-color: var(--color-bg-light) !important;
    backdrop-filter: blur(20px);
    border: 1px solid var(--color-border);
}

[data-theme='luxury'] .shadow-xl,
[data-theme='luxury'] .shadow-2xl {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
}

/* --- MOTION & REVEALS --- */
[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--motion-speed) var(--motion-reveal),
        transform var(--motion-speed) var(--motion-reveal);
}

[data-reveal].reveal-active {
    opacity: 1;
    transform: translateY(0);
}

/* Delay modifiers */
[data-reveal][data-delay="1"] {
    transition-delay: 0.1s;
}

[data-reveal][data-delay="2"] {
    transition-delay: 0.2s;
}

[data-reveal][data-delay="3"] {
    transition-delay: 0.3s;
}

/* --- ADVANCED LUXURY UTILITIES --- */
.theme-card-spotlight {
    position: relative;
    overflow: hidden;
}

.theme-card-spotlight:after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(var(--color-primary-rgb), 0.1) 0%, transparent 80%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.theme-card-spotlight:hover:after {
    opacity: 1;
}

.metallic-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
}

.metallic-frame:before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--metallic-gold);
    z-index: -1;
    opacity: 0.3;
}

/* --- ATELIER SHOWROOM COMPONENTS --- */
.atelier-card {
    background: linear-gradient(180deg, var(--color-bg-light) 0%, var(--color-bg) 100%);
    border: 1px solid var(--color-border);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.atelier-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-15px);
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.25), 0 0 30px rgba(var(--color-primary-rgb), 0.12);
}

.atelier-frame {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--color-border);
}

.atelier-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s ease;
    filter: brightness(0.8) grayscale(0.2);
}

.atelier-card:hover .atelier-frame img {
    transform: scale(1.1);
    filter: brightness(1) grayscale(0);
}

.atelier-frame:after {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.6);
}

.atelier-content {
    padding: 2.5rem;
    text-align: center;
}

.atelier-btn {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(var(--color-primary-rgb), 0.15);
    width: 100%;
}

/* --- GILDED TYPOGRAPHY UTILITIES --- */
.text-metallic {
    /* THEME-AWARE: segue il gradiente primario del tema/brand (oro solo su luxury).
       Hardcoded, faceva apparire "oro" i titoli su qualsiasi tema. */
    background: var(--metallic-gold, linear-gradient(135deg, #BF953F, #FCF6BA, #B38728, #FBF5B7, #AA771C));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 10px 20px rgba(var(--color-primary-rgb, 0, 0, 0), 0.25));
    display: inline-block;
    padding: 0.4em 0.8em;
    margin: -0.4em -0.8em;
}

@keyframes textShine {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}

.text-shine {
    /* THEME-AWARE: segue il gradiente primario del tema/brand (oro solo su luxury).
       Hardcoded, faceva apparire "oro" i titoli su qualsiasi tema (es. "Parliamone"
       sulla demo Bar Macchiaioli, rossa). Fallback oro = luxury invariato. */
    background: var(--metallic-gold, linear-gradient(135deg, #BF953F, #FCF6BA, #B38728, #FBF5B7, #AA771C));
    background-size: 100% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    /* Ombra stretta che abbraccia le lettere per leggibilità, agganciata al primario
       (niente alone nero su temi chiari). */
    filter: drop-shadow(0 1px 3px rgba(var(--color-primary-rgb, 0, 0, 0), 0.22));
    display: inline-block;
    padding: 0.4em 0.8em;
    margin: -0.4em -0.8em;
}

/* Fix mobile titolo hero: su schermi piccoli il padding/margine di .text-shine
   (inline-block w-full) faceva sforare e tagliare l'ultima parola del titolo,
   perché la sezione hero ha overflow-hidden. Qui rendiamo lo span un blocco
   senza padding orizzontale e fissiamo una dimensione che va a capo pulita. */
@media (max-width: 640px) {
    .hero-immersive-title {
        font-size: clamp(2.9rem, 13vw, 4.2rem) !important;
        line-height: 0.95 !important;
    }
    .hero-immersive-title .text-shine {
        display: block;
        width: auto;
        padding: 0.1em 0;
        margin: 0;
    }
}

/* --- HERO AURORA (gradiente iridescente animato) --- */
.hero-aurora {
    position: absolute;
    inset: -15%;
    z-index: 0;
    pointer-events: none;
    /* Monocromatica sul brand: fondo scuro (secondary) + bagliori del primario.
       Coerente con qualsiasi tema (oro su nero per luxury, blu su navy per corporate…). */
    background-color: var(--color-secondary, #0a0a0a);
    background-image:
        radial-gradient(45% 55% at 22% 30%, rgba(var(--color-primary-rgb, 212, 175, 55), 0.55), transparent 62%),
        radial-gradient(42% 52% at 80% 32%, rgba(var(--color-primary-rgb, 212, 175, 55), 0.30), transparent 60%),
        radial-gradient(58% 62% at 62% 82%, rgba(var(--color-primary-rgb, 212, 175, 55), 0.18), transparent 66%);
    filter: blur(46px) saturate(1.1);
    animation: heroDrift 18s ease-in-out infinite alternate;
    will-change: transform;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes heroDrift {
    0% { transform: scale(1.05) translate(0, 0) rotate(0deg); }
    100% { transform: scale(1.18) translate(-3%, -2%) rotate(4deg); }
}

/* Velo scuro sopra l'aurora per garantire leggibilità del titolo */
.hero-aurora-veil {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.20) 40%, rgba(0, 0, 0, 0.92) 100%);
}

@media (prefers-reduced-motion: reduce) {
    .hero-aurora { animation: none; }
}

.gold-gradient-bg {
    background: var(--metallic-gold);
}

.border-metallic {
    border-image: var(--metallic-gold) 1;
}

[data-theme='luxury'] .highlight {
    color: var(--color-primary);
}

/* --- DYNAMIC COMPONENT VARIANTS (Luxury Phased Approach) --- */

/* Base Filter Button (Standard - Flat Style) */
/* ===== CATALOG FILTER BAR — Editorial Underline Tabs (Luxury) ===== */
/* Tutto agganciato a #catalogFilters per non dipendere da utility Tailwind
   e per non toccare il JS: restano .filter-btn / .active / .cat-label e data-cat. */

/* --- Container: riga singola con scroller orizzontale + fade ai bordi --- */
#catalogFilters {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    gap: 0.25rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
            mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
    padding: 0.5rem 1rem 1rem;
    scrollbar-color: transparent transparent;
}
#catalogFilters::-webkit-scrollbar { display: none; height: 0; }

@media (min-width: 768px) {
    #catalogFilters {
        flex-wrap: wrap;
        justify-content: center;
        overflow: visible;
        gap: 0.5rem 0.75rem;
        -webkit-mask-image: none;
                mask-image: none;
    }
}

/* --- Tab: niente pill, underline oro editoriale --- */
#catalogFilters .filter-btn {
    flex: 0 0 auto;
    position: relative;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0.75rem 1.1rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    line-height: 1;
    box-shadow: none;
    transition: color 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

#catalogFilters .filter-btn::after {
    content: '';
    position: absolute;
    left: 1.1rem;
    right: 1.1rem;
    bottom: 0.15rem;
    height: 2px;
    background: var(--color-primary);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
}

#catalogFilters .filter-btn:hover {
    color: #fff;
}
#catalogFilters .filter-btn:hover::after {
    transform: scaleX(0.55);
    box-shadow: 0 0 10px rgba(255, 217, 39, 0.45);
}

/* --- Stato ATTIVO: oro chiarissimo, underline pieno + glow --- */
#catalogFilters .filter-btn.active {
    color: var(--color-primary);
    font-weight: 800;
}
#catalogFilters .filter-btn.active::after {
    transform: scaleX(1);
    height: 3px;
    box-shadow: 0 0 16px rgba(255, 217, 39, 0.6), 0 0 28px rgba(255, 217, 39, 0.3);
}

.filter-btn.active .cat-label { color: inherit; }

/* --- Mobile fine-tuning: leggibilità e tap target adeguati --- */
@media (max-width: 480px) {
    #catalogFilters { gap: 0.1rem; padding: 0.4rem 0.75rem 0.85rem; }
    #catalogFilters .filter-btn {
        padding: 0.7rem 0.85rem;
        font-size: 0.72rem;
        letter-spacing: 0.07em;
    }
    #catalogFilters .filter-btn::after { left: 0.85rem; right: 0.85rem; }
}

/* 1. Minimalist Luxury Style */
.cat-menu-minimalist .filter-btn {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0.5rem 1.5rem !important;
    letter-spacing: 0.15em !important;
    font-weight: 300 !important;
    color: rgba(255,255,255,0.5) !important;
    position: relative;
    transition: all 0.5s var(--motion-reveal);
    box-shadow: none !important;
}

.cat-menu-minimalist .filter-btn:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 1px;
    background: var(--color-primary); /* Gold */
    transition: all 0.5s var(--motion-reveal);
    transform: translateX(-50%);
    box-shadow: 0 0 8px var(--color-primary);
}

.cat-menu-minimalist .filter-btn.active {
    color: white !important;
    font-weight: 600 !important;
}

.cat-menu-minimalist .filter-btn.active:after {
    width: 80%;
}

/* 2. Glassmorphic Modern Style (Enhanced Crystal Effect) */
.cat-menu-glass .filter-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)) !important;
    backdrop-filter: blur(25px) !important; /* Deeper blur */
    -webkit-backdrop-filter: blur(25px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 99px !important;
    padding: 0.6rem 1.8rem !important;
    color: #ccc !important;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 
        inset 0 1px 1px rgba(255,255,255,0.2), /* Top reflection highlight */
        0 10px 20px rgba(0,0,0,0.2) !important;
}

.cat-menu-glass .filter-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    color: white !important;
}

.cat-menu-glass .filter-btn.active {
    background: rgba(212, 175, 55, 0.15) !important;
    border-color: var(--color-primary) !important;
    color: white !important;
    box-shadow: 
        0 0 30px rgba(212, 175, 55, 0.2), 
        inset 0 0 15px rgba(212, 175, 55, 0.2),
        inset 0 1px 2px rgba(255,255,255,0.3) !important;
}

/* 3. Visual Interactive Cards Style */
.cat-menu-visual {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    gap: 1.5rem !important;
    width: 100% !important;
    padding: 1rem 1rem 3rem 1rem !important; /* Spazio per le ombre e lo zoom */
    justify-content: flex-start !important; /* Forza allineamento a sinistra per lo scroll */
}

.cat-menu-visual::-webkit-scrollbar {
    display: none; /* Chrome, Safari e Opera */
}

.cat-menu-visual .filter-btn {
    flex: 0 0 140px !important; /* Larghezza fissa per non schiacciarle */
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 1rem !important;
    height: 140px !important;
    background: linear-gradient(145deg, #111, #050505) !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
    border-radius: 1.5rem !important;
    text-transform: capitalize !important;
    letter-spacing: 0.05em !important;
    padding: 1.5rem !important;
    transition: all 0.5s var(--motion-reveal) !important;
    color: #777 !important;
}

.cat-menu-visual .filter-btn i {
    font-size: 1.8rem;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cat-menu-visual .filter-btn:hover {
    border-color: var(--color-primary) !important;
    transform: translateY(-5px);
    color: #ccc !important;
}

.cat-menu-visual .filter-btn.active {
    background: #000 !important;
    border-color: var(--color-primary) !important;
    color: var(--color-primary) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 15px rgba(212, 175, 55, 0.05) !important;
}

.cat-menu-visual .filter-btn.active i {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 0 8px var(--color-primary));
}

.cat-menu-visual .filter-btn .cat-label {
    font-size: 0.75rem;
    font-weight: 600;
}