/* ==========================================================================
   1. LAYOUT GENERALE & TITOLI (reset, variabili e navbar base: vedi css/main.css)
   ========================================================================== */
html {
    scroll-behavior: smooth;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* ==========================================================================
   2. STRUTTURA LAYOUT GENERALE & TITOLI
   ========================================================================== */
section {
    min-height: 100vh;
    padding: 140px 24px 80px 24px;
    display: flex;
    align-items: center;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

section h2 {
    font-size: clamp(28px, 5vw, 38px);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 48px;
}

/* ==========================================================================
   3. NAVBAR (Stile Sottile Floating con effetto Blur)
   ========================================================================== */
/* Navbar: solo le differenze rispetto a main.css (sfondo, z-index, larghezza) */

nav button {
    border: 1px solid transparent;
    background-color: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-white);
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

nav button:hover:not(.hamburger) {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
}

/* Bottone Hamburger (Mobile) */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1100;
}

.hamburger span {
    width: 100%;
    height: 2px;
    background-color: var(--text-white);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: left center;
}

/* ==========================================================================
   4. HERO SECTION
   ========================================================================== */
.hero {
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 80% 20%, rgba(255, 71, 71, 0.08), transparent 50%);
}

.hero img {
    position: absolute;
    top: 0;
    right: 0;
    width: 70%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    opacity: 0.95;
    mask-image: linear-gradient(to left, rgba(0, 0, 0, 1) 30%, rgba(0, 0, 0, 0));
    -webkit-mask-image: linear-gradient(to left, rgba(0, 0, 0, 1) 30%, rgba(0, 0, 0, 0));
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 650px;
}

.hero-content h1 {
    font-size: clamp(36px, 7vw, 64px);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin-bottom: 24px;
    background: linear-gradient(to bottom right, #ffffff 60%, #a0a0ab);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 40px;
}

/* Pulsante principale stile Lovable */
.btn-cta {
    display: inline-flex;
    align-items: center;
    padding: 14px 28px;
    background-color: var(--accent-neon);
    color: var(--text-white);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    border-radius: 10px;
    box-shadow: 0 4px 20px var(--accent-glow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn-cta:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 71, 71, 0.3);
}

/* ==========================================================================
   5. SEZIONE CHI SIAMO (Bento Layout)
   ========================================================================== */
.about {
    border-top: 1px solid var(--border-color);
    background: radial-gradient(circle at 10% 20%, rgba(255, 71, 71, 0.02), transparent 40%);
}

.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 64px;
    align-items: center;
}

.about-lead {
    font-size: 18px;
    color: var(--text-white);
    line-height: 1.6;
    margin-bottom: 20px;
    font-weight: 500;
}

.about-text {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 40px;
}

/* Griglia delle Statistiche */
.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 24px 16px;
    border-radius: 12px;
    text-align: center;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.stat-card:hover {
    border-color: rgba(255, 71, 71, 0.3);
    transform: translateY(-2px);
}

.stat-number {
    display: block;
    font-size: 32px;
    font-weight: 800;
    color: var(--accent-neon);
    letter-spacing: -1px;
    margin-bottom: 4px;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Immagine Chi Siamo */
.about-image-wrapper {
    position: relative;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(135deg, var(--border-color), transparent);
}

.about-img {
    width: 100%;
    height: 480px;
    object-fit: cover;
    border-radius: 19px;
    display: block;
    filter: brightness(0.85) contrast(1.05);
    border: 1px solid var(--border-color);
}

.about-image-glow {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    background-color: var(--accent-neon);
    filter: blur(80px);
    opacity: 0.15;
    z-index: -1;
    pointer-events: none;
}

/* ==========================================================================
   6. SEZIONE SERVIZI (Bento Box Grid)
   ========================================================================== */
.services {
    border-top: 1px solid var(--border-color);
    background: radial-gradient(circle at 10% 90%, rgba(255, 255, 255, 0.02), transparent 40%);
}

.services-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.services-list li {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 32px;
    border-radius: 16px;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.services-list li:hover {
    border-color: rgba(255, 71, 71, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.services-list li .service-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--accent-neon);
}

.services-list li h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.services-list li p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ==========================================================================
   7. SEZIONE CONTATTI & MAPPA
   ========================================================================== */
.contact {
    border-top: 1px solid var(--border-color);
    background: radial-gradient(circle at 90% 10%, rgba(255, 71, 71, 0.03), transparent 40%);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.contact-description {
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 32px;
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.contact-item .contact-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.contact-item .label {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.contact-item .value {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-white);
    line-height: 1.4;
}

.contact-item .value a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.contact-item .value a:hover {
    color: var(--accent-neon);
}

/* Pannello Contenitore Mappa */
.contact-map-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    height: 380px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    transition: border-color 0.2s ease;
}

.contact-map-container:hover {
    border-color: rgba(255, 71, 71, 0.3);
}

.contact-map-container iframe {
    filter: grayscale(1) invert(0.92) contrast(1.2);
    /* Mappa Dark elegante */
    opacity: 0.85;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.contact-map-container:hover iframe {
    filter: grayscale(0) invert(0) contrast(1);
    /* Torna normale all'hover */
    opacity: 1;
}

/* ==========================================================================
8. MEDIA QUERIES (Ottimizzazione Mobile-First)
========================================================================== */
@media (max-width: 992px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-img {
        height: 350px;
    }
}

@media (max-width: 768px) {

    /* Navbar Mobile ed Hamburger */
    .hamburger {
        display: flex;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translateY(0) translateX(0);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
        transform: scale(0);
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translateY(0) translateX(0);
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background-color: rgba(11, 11, 15, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 24px;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1050;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links button {
        font-size: 22px;
        font-weight: 600;
        color: var(--text-white);
        width: 100%;
        text-align: center;
        padding: 16px;
    }

    /* Struttura sezioni mobile */
    section {
        padding: 100px 20px 60px 20px;
    }

    .hero {
        padding-bottom: 60px;
    }

    .hero img {
        width: 100%;
        opacity: 0.12;
        /* Scurisce ulteriormente l'immagine per far leggere il testo */
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .contact-map-container {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .about-stats {
        grid-template-columns: 1fr;
        /* Incolonna le statistiche sui telefoni piccoli */
    }
}


/* ==========================================================================
   FOOTER SITO
   ========================================================================== */
.site-footer {
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-card);
    padding: 32px 24px;
}

.footer-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-brand .logo {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.footer-brand .logo span {
    color: var(--accent-neon);
}

.footer-brand p {
    font-size: 13px;
    color: var(--text-muted);
}

.btn-footer-admin {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-white);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 10px;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-footer-admin:hover {
    background-color: rgba(255, 71, 71, 0.1);
    border-color: var(--accent-neon);
    color: var(--accent-neon);
}

@media (max-width: 600px) {
    .footer-container {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* ==========================================================================
   OTTIMIZZAZIONE MOBILE (touch, notch, tastiera, altezze dinamiche)
   Base condivisa (text-size-adjust, touch-action, focus-visible): vedi css/main.css
   ========================================================================== */
@media (max-width: 768px) {
    /* Rispetta il notch / le barre di sistema */
    .nav-container {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }

    /* Le sezioni non devono occupare un'intera schermata ciascuna */
    section {
        min-height: auto;
        padding: 96px 20px 56px 20px;
    }

    .hero {
        min-height: 88svh;
        align-items: center;
    }

    /* Menu a tutto schermo con altezza dinamica (barra indirizzi iOS/Android) */
    .nav-links {
        height: 100vh;
        height: 100dvh;
        padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
    }

    .nav-links button {
        min-height: 56px;
    }

    /* Area di tocco del hamburger ≥ 44px senza cambiare l'aspetto */
    .hamburger {
        position: relative;
    }

    .hamburger::before {
        content: '';
        position: absolute;
        inset: -14px;
    }

    .btn-cta {
        width: 100%;
        justify-content: center;
        min-height: 52px;
    }

    .contact-item .value a {
        display: inline-block;
        padding: 0;
    }

    .contact-map-container {
        height: 260px;
    }

    .about-img {
        height: 280px;
    }
}

@media (max-width: 600px) {
    .site-footer {
        padding: 28px 20px calc(28px + env(safe-area-inset-bottom));
    }

    .footer-container {
        gap: 16px;
    }

    .btn-footer-admin {
        width: 100%;
        justify-content: center;
        min-height: 48px;
    }
}
