@charset "UTF-8";

/* ==========================================================================
   1. VARIABILI E RESET
   ========================================================================== */
:root {
    /* Palette Colori */
    --bg-body: #f3f4f6;
    --text-main: #1f2937;
    --text-muted: #4b5563;
    --c-brand: #2563eb;       /* Blu principale */
    --c-brand-dark: #1e40af;  /* Blu scuro */
    --c-accent: #f59e0b;      /* Arancione VIP */
    --c-danger: #dc2626;      /* Rosso */
    
    /* UI Settings */
    --radius: 12px;
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Reset pulito – nessun overflow-x su html/body */
*, *::before, *::after {
    box-sizing: border-box;
}

body, h1, h2, h3, h4, p, ul, ol, figure {
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   RESET IMMAGINI (Zero CLS, Max Fluidità) – PASSO 2
   ========================================================================== */
img, picture, video, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

picture {
    width: 100%;
}

.product-image-main img,
.card-img-wrapper img {
    width: 100%;
    max-height: 800px;
    object-fit: cover;
    border-radius: var(--radius);
}

/* ==========================================================================
   2. TIPOGRAFIA E BASE
   ========================================================================== */
a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease, transform 0.2s ease;
}

ul {
    list-style: none;
}

/* ==========================================================================
   3. COMPONENTI UI (Bottoni, Badge, Divider)
   ========================================================================== */
.btn-primary {
    background: var(--c-brand);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

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

.btn-secondary {
    display: inline-block;
    background: transparent;
    border: 2px solid var(--c-brand);
    color: var(--c-brand);
    padding: 10px 30px;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--c-brand);
    color: white;
}

.btn-large {
    display: inline-block;
    background: var(--c-accent);
    color: white;
    padding: 15px 40px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.btn-large:hover { transform: scale(1.05); }

.badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 700;
}

.badge-offer { background: #fee2e2; color: #991b1b; }
.badge-new { background: #dbeafe; color: #1e40af; }

.elegant-divider {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #e5e7eb, transparent);
    margin: 30px 0;
}

/* ==========================================================================
   4. LAYOUT STRUTTURALI (Header, Footer, Container)
   ========================================================================== */
.container {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 20px;
    border-left: 5px solid var(--c-brand);
    padding-left: 15px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.98);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    backdrop-filter: blur(8px); 
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo { font-size: 1.5rem; font-weight: 900; color: var(--c-brand); letter-spacing: -1px; }
.nav-menu { display: flex; gap: 20px; align-items: center; }
.nav-list { display: flex; gap: 20px; font-weight: 600; }
.nav-list a:hover { color: var(--c-brand); }

.nav-phone {
    font-weight: 700;
    color: var(--c-brand-dark);
    background: #e0e7ff;
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hamburger { display: none; background: transparent; border: none; cursor: pointer; padding: 0; z-index: 1001; }
.hamburger .bar { display: block; width: 25px; height: 3px; margin: 5px auto; background-color: var(--text-main); transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1); }

/* Footer */
.footer {
    background: #111827;
    color: #9ca3af;
    padding: 60px 20px 20px;
    margin-top: 80px;
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer h4 { color: white; font-size: 1.1rem; margin-bottom: 20px; }
.footer li { border: none; }
.footer a { display: inline-block; padding: 5px 0; }
.footer a:hover { color: white; }
.footer-copy { text-align: center; margin-top: 60px; padding-top: 20px; border-top: 1px solid #374151; font-size: 0.85rem; }

/* ==========================================================================
   5. SEZIONI HOME PAGE
   ========================================================================== */
/* Hero Base (Mobile Fallback) */
.hero {
    background: linear-gradient(135deg, #111827 0%, #1e3a8a 100%);
    padding: 80px 20px;
    color: white;
    text-align: center;
}

.hero-content { max-width: 800px; margin: 0 auto; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); font-weight: 800; margin-bottom: 15px; line-height: 1.1; letter-spacing: -0.5px; }
.hero p { font-size: clamp(1rem, 2vw, 1.25rem); opacity: 0.9; font-weight: 500; }

.trust-strip {
    background: var(--c-brand);
    color: white;
    padding: 10px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Banner Parallasse Break (Mobile Fallback) */
.parallax-break {
    margin: 60px 0;
    padding: 60px 20px;
    text-align: center;
    color: white;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}
.glass-box { padding: 20px; }

/* Box Informativi & Social */
.info-box-white { background: white; padding: 40px; border-radius: var(--radius); text-align: center; box-shadow: var(--shadow-card); border: 1px solid #e5e7eb; }
.info-footer-box { background: #111827; color: white; border-radius: var(--radius); padding: 40px; text-align: center; box-shadow: var(--shadow-hover); }
.info-footer-box a { color: var(--c-accent); text-decoration: underline; }

.social-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; margin-top: 20px; }
.social-card { background: white; border-radius: var(--radius); padding: 20px; text-align: center; box-shadow: var(--shadow-card); border: 1px solid #e5e7eb; transition: transform 0.2s; }
.social-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.social-card img { width: 80px; height: 80px; border-radius: 50%; margin-bottom: 15px; object-fit: cover; }

/* ==========================================================================
   6. SISTEMA CARD & ACCORDION
   ========================================================================== */
.card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e5e7eb;
    will-change: transform;
}

.card-highlight { border: 2px solid var(--c-brand); }
.card-header { padding: 20px; background: #f9fafb; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; gap: 15px; }
.card-icon { font-size: 1.8rem; background: white; width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.highlight-icon { color: var(--c-brand); }
.card-title { font-size: 1.2rem; font-weight: 700; margin: 0; }
.card-body { padding: 20px; }

/* Accordions */
details { margin-bottom: 10px; border-radius: 8px; border: 1px solid #e5e7eb; }
summary { padding: 12px 15px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; font-weight: 600; color: var(--text-muted); background: #fff; transition: background 0.2s, color 0.2s; border-radius: 8px; }
summary::-webkit-details-marker { display: none; }
summary:hover { background: #f3f4f6; color: var(--c-brand); }
details[open] summary { background: #f3f4f6; border-bottom: 1px solid #e5e7eb; color: var(--c-brand-dark); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
details[open] > :not(summary) {
    padding-left: 1.25rem;
}
.toggle-icon { font-size: 0.8rem; transition: transform 0.3s ease; }
details[open] .toggle-icon { transform: rotate(-180deg); }

/* Liste interne */
li { border-bottom: 1px dashed #e5e7eb; }
li:last-child { border: none; }
.prod-link { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; font-size: 0.95rem; color: var(--text-main); transition: padding-left 0.2s ease, color 0.2s ease, background 0.2s ease; }
.prod-link:hover { color: var(--c-brand); background: #fafafa; padding-left: 20px; }
.link-all { display: inline-block; margin-top: 15px; font-size: 0.9rem; font-weight: 700; color: var(--c-brand); }
.link-all:hover { text-decoration: underline; }

/* ==========================================================================
   7. LAYOUT PRODOTTO (Lead Generation)
   ========================================================================== */
.product-page { max-width: 1200px; margin: 60px auto; padding: 0 20px; }
.product-header { text-align: center; margin-bottom: 50px; }
.product-title { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 900; color: var(--c-brand-dark); margin: 15px 0 10px; line-height: 1.1; letter-spacing: -1px; }
.product-subtitle { font-size: 1.25rem; color: var(--text-muted); max-width: 800px; margin: 0 auto; }

.product-grid { display: grid; grid-template-columns: 1fr 380px; gap: 40px; align-items: start; }

/* Contenuto Sinistra */
.product-content { background: white; padding: 50px; border-radius: var(--radius); box-shadow: var(--shadow-card); border: 1px solid #e5e7eb; }
.rich-text-content h2 { color: var(--c-brand); font-size: 1.8rem; margin: 40px 0 20px; font-weight: 800; letter-spacing: -0.5px; }
.rich-text-content h2:first-child { margin-top: 0; }
.rich-text-content h3 { color: var(--text-main); font-size: 1.3rem; margin: 30px 0 15px; }
.rich-text-content p { margin-bottom: 15px; font-size: 1.05rem; line-height: 1.8; color: #374151; }
.rich-text-content ul, .rich-text-content ol { padding-left: 20px; margin-bottom: 25px; }
.rich-text-content li { margin-bottom: 12px; font-size: 1.05rem; border: none; padding: 0; color: #4b5563; }
.rich-text-content strong { color: var(--text-main); }

/* Sidebar Destra (Sticky Lead Gen) */
.lead-sidebar { position: sticky; top: 100px; }
.lead-box { background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%); color: white; padding: 40px 30px; border-radius: var(--radius); box-shadow: var(--shadow-hover); text-align: center; }
.lead-box h3 { font-size: 1.8rem; margin-bottom: 10px; color: white; font-weight: 800; }
.lead-box p { opacity: 0.9; margin-bottom: 30px; font-size: 1rem; }

.phone-cta { background: white; padding: 25px 20px; border-radius: 12px; margin-bottom: 25px; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); transition: transform 0.2s; }
.phone-cta:hover { transform: scale(1.03); }
.phone-cta span { display: block; font-size: 0.85rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 5px; }
.phone-cta a { font-size: 2.2rem; font-weight: 900; color: var(--c-brand); text-decoration: none; letter-spacing: -1px; }

.lead-divider { display: flex; align-items: center; text-align: center; margin: 25px 0; color: rgba(255,255,255,0.6); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 2px; }
.lead-divider::before, .lead-divider::after { content: ''; flex: 1; border-bottom: 1px solid rgba(255,255,255,0.2); }
.lead-divider::before { margin-right: 1em; }
.lead-divider::after { margin-left: 1em; }

.form-placeholder { background: rgba(255,255,255,0.05); border: 2px dashed rgba(255,255,255,0.3); padding: 50px 20px; border-radius: 12px; color: rgba(255,255,255,0.9); font-size: 0.95rem; }

/* ==========================================================================
   8. LAYOUT PAGINE STATICHE E ARTICOLI (Chi Siamo, Privacy)
   ========================================================================== */
.static-wrapper { background-color: #f9fafb; padding: 60px 20px; }
.static-container { max-width: 800px; margin: 0 auto; background: white; padding: 50px; border-radius: var(--radius); box-shadow: var(--shadow-card); border: 1px solid #e5e7eb; }
.static-container h1 { color: var(--c-brand-dark); font-size: 2.5rem; margin-bottom: 30px; border-bottom: 2px solid #eff6ff; padding-bottom: 15px; }
.static-container h2 { color: var(--c-brand); font-size: 1.6rem; margin: 30px 0 15px; }
.static-container p { font-size: 1.1rem; line-height: 1.8; color: var(--text-muted); margin-bottom: 20px; }
.static-container ul, .static-container ol { padding-left: 20px; margin-bottom: 20px; }
.static-container li { font-size: 1.1rem; line-height: 1.8; color: var(--text-muted); margin-bottom: 10px; border: none; }

/* Form e Moduli interni agli articoli */
.static-container input, .static-container textarea { width: 100%; padding: 12px; border: 1px solid #d1d5db; border-radius: 8px; margin-top: 5px; font-family: inherit; }
.static-container label { font-weight: 600; color: var(--text-main); }
.static-container button[type="submit"] { background: var(--c-brand); color: white; border: none; padding: 12px 30px; font-size: 1.1rem; border-radius: 8px; cursor: pointer; font-weight: bold; margin-top: 15px; }
.static-container button[type="submit"]:hover { background: var(--c-brand-dark); }

/* ==========================================================================
   9. COOKIE BANNER (Zero Reflow)
   ========================================================================== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #1f2937;
    color: white;
    padding: 15px 20px;
    z-index: 9999;
    box-shadow: 0 -10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, visibility 0.4s;
}

.cookie-banner.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
}

/* ==========================================================================
   10. RESPONSIVE MOBILE (Max-Width Overrides)
   ========================================================================== */
@media (max-width: 992px) {
    /* Product Page */
    .product-grid { grid-template-columns: 1fr; }
    .lead-sidebar { position: static; margin-top: 30px; }
    .product-content { padding: 30px 20px; }
}

/* PASSO 3: Menu Mobile Zero-Reflow – sostituito con opacity/visibility GPU */
@media (max-width: 768px) {
    .hamburger { display: block; z-index: 1001; }
    
    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        /* Performance: gestito dalla GPU, zero ricalcoli layout */
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }

    .nav-menu.active {
        opacity: 1;
        visibility: visible;
    }

    .nav-list { flex-direction: column; text-align: center; font-size: 1.2rem; }
    
    /* Animazione Hamburger */
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    /* Altre regole già presenti (mantenute) */
    .cookie-content { flex-direction: column; text-align: center; }
    .static-container { padding: 30px 20px; }
}

/* ==========================================================================
   11. PROGRESSIVE ENHANCEMENT DESKTOP (Min-Width)
   ========================================================================== */
@media (min-width: 992px) {
    
    /* Hero Parallax */
    .hero {
        background-image: 
            linear-gradient(to bottom, rgba(17, 24, 39, 0.7), rgba(30, 58, 138, 0.9)),
            url('/images/hero/desktop-hero.webp'); 
        background-size: cover;
        background-position: center;
        background-attachment: fixed;
        padding: 150px 20px;
        border-bottom: 5px solid var(--c-accent);
    }
    
    .hero h1 { font-size: 4.5rem; text-shadow: 0 4px 20px rgba(0,0,0,0.5); }
    .hero p { font-size: 1.5rem; }

    /* Glassmorphism su Hover Card (Evitiamo su mobile per risparmiare GPU) */
    .card:hover {
        transform: translateY(-12px) scale(1.02);
        box-shadow: 0 30px 40px -10px rgba(37, 99, 235, 0.15);
        z-index: 10;
    }

    /* Parallax Break (Banner a metà pagina) */
    .parallax-break {
        margin: 100px 0;
        padding: 120px 20px;
        background-image: 
            linear-gradient(to right, rgba(0,0,0,0.8), rgba(0,0,0,0.4)),
            url('/images/hero/desktop-break.webp');
        background-size: cover;
        background-position: center;
        background-attachment: fixed;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: inset 0 0 50px rgba(0,0,0,0.5);
    }

    /* Box in vetro smerigliato */
    .glass-box {
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        padding: 50px;
        border-radius: 24px;
        text-align: center;
        max-width: 700px;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    }
    
    .glass-box h2 { font-size: 2.5rem; margin-bottom: 15px; font-weight: 900; }
    .glass-box p { font-size: 1.2rem; opacity: 0.9; margin-bottom: 25px; }
}
/* ==========================================================================
   LAYOUT A GRIGLIA SEMPLICE E VELOCE (ZERO REFLOW)
   ========================================================================== */
.area-section { margin: 60px auto; max-width: 1200px; padding: 0 20px; }
.area-header-main { margin-bottom: 30px; border-bottom: 3px solid var(--c-brand); padding-bottom: 15px; display: flex; align-items: center; gap: 15px; }
.area-header-icon { font-size: 2.5rem; line-height: 1; }
.area-header-text h2 { font-size: 2rem; font-weight: 900; color: var(--c-brand-dark); margin: 0; text-transform: uppercase; letter-spacing: -1px; }

/* Card Prodotto Semplice (Non Cliccabile interamente) */
.card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.card-header { padding: 20px; background: #f9fafb; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; gap: 15px; }
.card-icon { font-size: 1.8rem; background: white; width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.card-title { font-size: 1.25rem; font-weight: 800; margin: 0; color: var(--text-main); }
.card-body { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.card-desc { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 20px; flex-grow: 1; line-height: 1.5; }

/* Pulsante SEO Ottimizzato */
.card-action { margin-top: auto; padding-top: 15px; border-top: 1px dashed #e5e7eb; text-align: center; }

/* ==========================================================================
   PWA APPLE PROMPT (iOS INSTALLATION)
   ========================================================================== */
.ios-pwa-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    width: 90%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease, visibility 0.5s;
    border: 1px solid rgba(0,0,0,0.05);
}

.ios-pwa-prompt.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.ios-pwa-content {
    position: relative;
    padding: 25px 20px;
    text-align: center;
}

.ios-pwa-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: #f3f4f6;
    border: none;
    color: #9ca3af;
    font-size: 1.5rem;
    line-height: 1;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.ios-pwa-close:hover {
    background: #e5e7eb;
    color: #4b5563;
}