/* =========================================
   1. RESET E VARIABILI GLOBALI
   ========================================= */
:root {
    --primary: #27A3BD; /* Turchese */
    --black: #111111;   /* Nero */
    --white: #FFFFFF;
    --gray: #F4F4F4;
}

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

body {
    font-family: Arial, sans-serif;
    color: var(--black);
    background-color: var(--white);
    line-height: 1.6;
    /* Spazio in fondo per la sticky bar mobile */
    padding-bottom: 80px;
}

a { text-decoration: none; color: inherit; }

/* UTILITY */
.container { max-width: 1100px; margin: 0 auto; padding: 20px; }

/* =========================================
   2. HEADER E NAVIGAZIONE
   ========================================= */
.site-header {
    background: var(--white);
    border-bottom: 1px solid #ddd;
    position: sticky; top: 0; z-index: 1000;
    padding: 10px 0;
}

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

.logo { display: flex; align-items: center; font-weight: 800; font-size: 1.2rem; color: var(--primary); }
.logo img { height: 40px; margin-right: 10px; }

/* NAVIGAZIONE DESKTOP */
.desktop-nav { display: none; }
.desktop-nav ul { list-style: none; display: flex; align-items: center; gap: 20px; }
.desktop-nav a { font-weight: 600; font-size: 0.95rem; }
.desktop-nav a:hover { color: var(--primary); }
.desktop-nav a.active { color: var(--primary); }

.btn-header {
    background: var(--primary); color: var(--white) !important;
    padding: 8px 15px; border-radius: 4px;
}

/* MENU A TENDINA (Dropdown) */
.dropdown-parent { position: relative; height: 100%; display: flex; align-items: center; }
.dropdown-menu {
    display: none !important; 
    position: absolute; top: 100%; left: 0;
    background: var(--white); min-width: 220px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    border-top: 4px solid var(--primary);
    list-style: none; z-index: 9999;
}
.dropdown-parent:hover .dropdown-menu { display: block !important; }
.dropdown-menu li { display: block; width: 100%; border-bottom: 1px solid #eee; }
.dropdown-menu li a {
    display: block; padding: 12px 20px;
    color: var(--black); font-weight: normal; text-align: left;
    white-space: nowrap; width: 100%;
}
.dropdown-menu li a:hover { background-color: var(--gray); color: var(--primary); }

/* MENU MOBILE */
.hamburger-btn { background: none; border: none; cursor: pointer; display: block; }

.mobile-menu-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--white); z-index: 2000;
    transform: translateX(-100%); transition: transform 0.3s ease;
    padding: 60px 20px; overflow-y: auto;
}
.mobile-menu-overlay.active { transform: translateX(0); }
.mobile-menu-overlay nav a {
    display: block; font-size: 1.4rem; font-weight: bold;
    padding: 15px 0; border-bottom: 1px solid #eee;
}
.mobile-menu-overlay nav a.active { color: var(--primary); }

.close-menu-btn { position: absolute; top: 20px; right: 20px; font-size: 3rem; background: none; border: none; cursor: pointer; }
.menu-divider { margin-top: 20px; color: var(--primary); font-weight: bold; font-size: 0.9rem; letter-spacing: 1px; }

/* =========================================
   3. SEZIONI PRINCIPALI (Hero, Intro, Works)
   ========================================= */
.hero-section {
    background: #222 url('hero-bg.webp') no-repeat center center/cover;
    color: var(--white); text-align: center; padding: 80px 20px;
}
.hero-section h1 { font-size: 2.5rem; margin-bottom: 15px; }

/* Hero Buttons */
.hero-actions { 
    display: flex; gap: 20px; justify-content: center; align-items: center;
    margin-top: 35px; flex-wrap: wrap;
}
.btn-hero {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary); color: var(--white);
    border: 2px solid var(--primary);
    padding: 14px 30px; font-weight: bold; border-radius: 5px;
    text-transform: uppercase; font-size: 0.95rem; cursor: pointer;
    transition: all 0.3s ease; min-width: 220px;
}
.btn-hero:hover { background-color: #1b8a9e; border-color: #1b8a9e; transform: translateY(-2px); }

.btn-hero-secondary {
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 2px solid var(--white); color: var(--white);
    padding: 14px 30px; font-weight: bold; border-radius: 5px;
    text-transform: uppercase; font-size: 0.95rem; cursor: pointer;
    transition: all 0.3s ease; min-width: 220px;
}
.btn-hero-secondary:hover { background: var(--white); color: var(--black); transform: translateY(-2px); }

/* Intro & Texts */
.intro-section { padding: 60px 20px; text-align: center; }
.text-center-box { max-width: 800px; margin: 0 auto; }
.lead-text { font-size: 1.2rem; margin-bottom: 20px; color: #444; }

/* Methods Grid */
.methods-section { background-color: var(--gray); padding: 60px 0; }
.section-title { text-align: center; margin-bottom: 10px; color: var(--black); }
.section-subtitle { text-align: center; margin-bottom: 40px; color: #666; }

.methods-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
.method-card {
    background: var(--white); padding: 30px; border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); transition: transform 0.3s;
    border-bottom: 4px solid transparent;
}
.method-card:hover { transform: translateY(-5px); border-bottom-color: var(--primary); }
.method-card h3 { color: var(--primary); margin-bottom: 15px; font-size: 1.3rem; }
.method-card p { font-size: 0.95rem; color: #555; margin-bottom: 15px; }
.tag { font-size: 0.8rem; background: #e0f7fa; color: #006064; padding: 5px 10px; border-radius: 20px; font-weight: bold; }

/* Works Grid */
.works-section { padding: 60px 0; }
.works-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.work-item { text-align: center; }
.work-img-box { position: relative; overflow: hidden; border-radius: 8px; margin-bottom: 15px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.work-img-box img { width: 100%; height: auto; display: block; transition: transform 0.3s; }
.work-img-box:hover img { transform: scale(1.05); }
.work-badge {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: rgba(0,0,0,0.7); color: white; padding: 5px; font-size: 0.8rem; font-weight: bold;
}

/* Video & Benefits */
.video-section { padding: 60px 20px; }
.video-content-wrapper { display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.video-text, .video-placeholder { flex: 1; min-width: 300px; }
.benefit-list { list-style: none; margin-top: 20px; }
.benefit-list li { margin-bottom: 15px; font-size: 1.05rem; }

/* Locations Grid */
.locations-section { padding: 60px 20px; background: #fff; }
.locations-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-top: 30px; }
.location-card {
    display: block; background: var(--gray); padding: 25px;
    text-align: center; border-radius: 8px; border: 2px solid transparent; transition: 0.3s;
}
.location-card:hover { border-color: var(--primary); background: white; }
.location-card h3 { color: var(--black); margin-bottom: 10px; }

/* FAQ STYLES CORRETTI */
.faq-item {
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 15px 0;
    text-align: left;
    font-weight: bold;
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    /* Rimuove l'evidenziazione blu al tocco su mobile */
    -webkit-tap-highlight-color: transparent; 
}

.faq-answer {
    /* Il trucco per l'animazione: altezza 0 invece di display: none */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0; /* Padding a 0 quando è chiuso */
}

/* Applichiamo il padding al paragrafo interno per non avere scatti */
.faq-answer p {
    padding: 10px 0 20px 0;
    color: #555;
    margin: 0;
}

/* =========================================
   4. PAGINA CONTATTI
   ========================================= */
.contact-wrapper { display: flex; flex-wrap: wrap; gap: 50px; margin-top: 20px; }
.contact-info-box { flex: 1; min-width: 300px; }
.contact-form-box {
    flex: 1; min-width: 300px; background: #f9f9f9; padding: 30px;
    border-radius: 10px; border-top: 4px solid var(--primary);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}
.info-item { display: flex; align-items: flex-start; margin-bottom: 30px; }
.info-icon {
    font-size: 1.5rem; margin-right: 15px; background: #e0f7fa;
    width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; border-radius: 50%;
}
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px; border: 1px solid #ddd;
    border-radius: 5px; font-family: inherit; font-size: 1rem;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 5px rgba(39, 163, 189, 0.2);
}

/* =========================================
   5. FOOTER E BARRA MOBILE
   ========================================= */
.site-footer {
    background-color: var(--black); color: #bbbbbb;
    padding-top: 60px; border-top: 4px solid var(--primary); margin-top: 50px;
}
.footer-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px; padding-bottom: 40px;
}
.footer-col h4 {
    color: var(--white); font-size: 1.1rem; margin-bottom: 20px;
    text-transform: uppercase; letter-spacing: 1px;
    border-bottom: 1px solid #333; padding-bottom: 10px; display: inline-block;
}
.footer-logo { display: flex; align-items: center; color: var(--white); font-weight: 800; font-size: 1.3rem; margin-bottom: 15px; }
.footer-logo img { margin-right: 10px; }
.footer-desc { font-size: 0.9rem; line-height: 1.6; margin-bottom: 20px; max-width: 300px; }
.footer-links, .contact-list { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { text-decoration: none; color: #bbbbbb; transition: color 0.3s; font-size: 0.95rem; }
.footer-links a:hover { color: var(--primary); padding-left: 5px; }
.contact-list li { margin-bottom: 15px; font-size: 0.95rem; }
.contact-list strong { color: var(--white); }
.contact-list a { color: var(--primary); font-weight: bold; font-size: 1.1rem; }
.footer-bottom {
    background-color: #000; padding: 20px 0; text-align: center;
    font-size: 0.8rem; color: #666; border-top: 1px solid #222;
}

/* STICKY BAR MOBILE */
.sticky-mobile-bar {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: var(--white); padding: 10px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1); z-index: 999;
    display: flex; justify-content: center;
}
.sticky-mobile-bar a {
    background: var(--primary); color: var(--white);
    width: 100%; padding: 15px; text-align: center;
    font-weight: bold; font-size: 1.2rem; border-radius: 8px;
}

/* =========================================
   6. COOKIE BANNER
   ========================================= */
.cookie-banner {
    position: fixed; bottom: -100%; left: 0; width: 100%;
    background-color: #222; color: #fff; padding: 20px;
    z-index: 99999; box-shadow: 0 -5px 20px rgba(0,0,0,0.2);
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
    gap: 20px; transition: bottom 0.5s ease-in-out;
    font-size: 0.9rem; border-top: 3px solid var(--primary);
}
.cookie-banner p { margin: 0; max-width: 800px; line-height: 1.5; }
.cookie-banner a { color: var(--primary); text-decoration: underline; }
.cookie-banner.show { bottom: 0; }
.cookie-btn-accept {
    background-color: var(--primary); color: white; border: none;
    padding: 10px 25px; border-radius: 5px; cursor: pointer;
    font-weight: bold; font-size: 0.9rem; transition: 0.3s;
}
.cookie-btn-accept:hover { background-color: white; color: var(--primary); }

/* =========================================
   7. CHATBOT (Pagina Dedicata e Widget)
   ========================================= */

/* Stili Pagina Dedicata (chat.html) */
.chat-header-page {
    background: var(--primary); color: white; padding: 15px;
    display: flex; align-items: center; gap: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.chat-header-page .back-btn { color: white; text-decoration: none; display: flex; align-items: center; }
.chat-info { display: flex; align-items: center; gap: 10px; }
.chat-info h3 { margin: 0; font-size: 1rem; }
.status-text { font-size: 0.75rem; opacity: 0.9; }
.avatar-circle {
    width: 40px; height: 40px; background: white; border-radius: 50%;
    padding: 3px; display: flex; align-items: center; justify-content: center;
}
.avatar-circle img { width: 100%; height: auto; }

/* Corpo Chat */
.chat-body-page {
    flex: 1; overflow-y: auto; padding: 20px;
    background-color: #f0f2f5;
    background-image: radial-gradient(#ddd 1px, transparent 1px);
    background-size: 20px 20px;
    display: flex; flex-direction: column; gap: 15px;
}

/* Messaggi Chat */
.message {
    max-width: 80%; padding: 12px 16px; border-radius: 15px;
    font-size: 0.95rem; line-height: 1.4; position: relative; word-wrap: break-word;
}
.bot-msg {
    background: white; color: #333; border-bottom-left-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1); align-self: flex-start;
}
.bot-msg strong { font-weight: bold; color: var(--primary); }
.user-msg {
    background: var(--primary); color: white; border-bottom-right-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1); align-self: flex-end;
}

/* Footer Chat Page */
.chat-footer-page {
    background: white; padding: 10px 15px 20px 15px; border-top: 1px solid #eee;
}
.quick-chips {
    display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 5px;
    scrollbar-width: none;
}
.quick-chips::-webkit-scrollbar { display: none; }
.quick-chips button {
    background: #f0f2f5; border: 1px solid #ddd; color: #555;
    padding: 6px 12px; border-radius: 20px; font-size: 0.85rem;
    white-space: nowrap; cursor: pointer; transition: 0.2s;
}
.quick-chips button:hover { background: var(--primary); color: white; border-color: var(--primary); }

.input-group-page { display: flex; gap: 10px; align-items: center; }
.input-group-page input {
    flex: 1; padding: 12px 15px; border: 1px solid #ddd;
    border-radius: 25px; font-size: 1rem; outline: none; background: #f9f9f9;
}
.input-group-page input:focus { border-color: var(--primary); background: white; }
.input-group-page button {
    width: 45px; height: 45px; background: var(--primary); border: none;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.2); transition: transform 0.2s;
}
.input-group-page button:active { transform: scale(0.95); }

/* Indicatore Scrittura */
.typing-indicator {
    font-size: 0.8rem; color: #666; margin-left: 10px; margin-bottom: 5px;
    font-style: italic; display: none;
}
.typing-indicator.active { display: block; }

/* =========================================
   8. BOTTONE FLUTTUANTE (Floating Button)
   ========================================= */
.floating-chat-link {
    position: fixed; bottom: 30px; right: 30px; z-index: 9999;
    width: 60px; height: 60px; background-color: var(--primary);
    border-radius: 50%; box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; transition: transform 0.3s ease;
}
.floating-chat-link:hover { transform: scale(1.1); }
.chat-badge {
    position: absolute; top: -5px; right: -5px; width: 24px; height: 24px;
    background-color: #ff3b30; color: white; font-size: 12px;
    font-weight: bold; border-radius: 50%; border: 2px solid white;
    display: flex; align-items: center; justify-content: center;
}

/* =========================================
   9. MEDIA QUERIES (Desktop e Mobile Fix)
   ========================================= */

/* Desktop Specifici */
@media (min-width: 900px) {
    body { padding-bottom: 0; }
    .sticky-mobile-bar { display: none; }
    .hamburger-btn { display: none; }
    .desktop-nav { display: block; }
    .hero-section h1 { font-size: 4rem; }
}

/* Mobile Specifici per Floating Button */
@media (max-width: 768px) {
    .floating-chat-link {
        bottom: 90px !important; /* Per non coprire la barra CHIAMA */
        right: 20px !important;
        width: 55px; height: 55px;
    }
}