/* ==========================================================================
   Titty Pizza - Super Tech Stylesheet (Optimized 2026)
   ========================================================================== */

/* --- 1. CARICAMENTO FONT LOCALI (Ottimizzazione Performance) --- */

/* pacifico-regular - latin */
@font-face {
  font-display: swap;
  font-family: 'Pacifico';
  font-style: normal;
  font-weight: 400;
  src: url('assets/fonts/pacifico-v23-latin-regular.woff2') format('woff2');
}

/* inter-300 - latin */
@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300;
  src: url('assets/fonts/inter-v20-latin-300.woff2') format('woff2');
}

/* inter-regular - latin */
@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  src: url('assets/fonts/inter-v20-latin-regular.woff2') format('woff2');
}

/* inter-600 - latin */
@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  src: url('assets/fonts/inter-v20-latin-600.woff2') format('woff2');
}

/* inter-800 - latin */
@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  src: url('assets/fonts/inter-v20-latin-800.woff2') format('woff2');
}

/* --- 2. VARIABILI E CONFIGURAZIONE GLOBALE --- */
:root {
    --color-bg: #0a0a0a;
    --color-bg-light: #161616;
    --color-text: #e0e0e0;
    --color-primary: #ffcc00; /* Tweety Yellow */
    --color-primary-glow: rgba(255, 204, 0, 0.6);
    --color-secondary: #e63946; /* Tomato Red */
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Pacifico', cursive;
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Protezione totale anti-sfasamento orizzontale */
html, body {
    max-width: 100%;
    overflow-x: hidden;
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-main);
    line-height: 1.6;
    scroll-behavior: smooth;
}

/* Fluidità strutturale per i blocchi */
.container, .hero-section, .featured-section, .menu-section, .gallery-section, .contact-section {
    width: 100%;
    max-width: 100vw;
    overflow: hidden; /* Corretto refuso dei due punti */
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

h1, h2, h3, h4, .logo-text {
    font-family: var(--font-heading);
    font-weight: normal;
}

.highlight {
    color: var(--color-primary);
    text-shadow: 0 0 10px var(--color-primary-glow);
}

.text-center {
    text-align: center;
}

.section-title {
    font-size: clamp(2rem, 6vw, 3rem); /* Fluido per mobile */
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

section {
    padding: clamp(3rem, 10vw, 6rem) 0; /* Riduce il vuoto verticale su mobile */
    position: relative;
}
/* --- 3. NAVBAR E NAVIGAZIONE --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
    transition: var(--transition-smooth);
}

.logo-text {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin: 0;
    text-shadow: 0 0 8px var(--color-primary-glow);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--color-primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: width 0.3s ease;
    box-shadow: 0 0 5px var(--color-primary-glow);
}

.nav-links a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    font-size: 2rem;
    color: var(--color-primary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.menu-toggle:hover {
    color: #fff;
    text-shadow: 0 0 10px var(--color-primary-glow);
}

/* --- 4. HERO SECTION (Ottimizzazione fluidità caratteri) --- */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    position: relative;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%; /* Spazio extra per effetto parallax */
    background: url('assets/images/bg1.webp') center/cover no-repeat;
    z-index: 0;
    filter: brightness(0.4);
    will-change: transform;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 0 1rem;
}

.hero-title {
    font-size: clamp(2.3rem, 7vw, 5rem); /* Dimensione dinamica per mobile */
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 4vw, 1.5rem); /* Sottotitolo fluido */
    font-weight: 300;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-inline: auto;
}

.btn-primary {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.2);
}

.btn-primary:hover {
    background: var(--color-primary);
    color: var(--color-bg);
    box-shadow: 0 0 25px var(--color-primary-glow);
}

/* Elementi fluttuanti nella Hero */
.floating-ingredient {
    position: absolute;
    font-size: 3rem;
    z-index: 1;
    opacity: 0.8;
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.5));
}
.leaf1 { top: 20%; left: 15%; animation: float 6s ease-in-out infinite; }
.leaf2 { bottom: 25%; right: 10%; animation: float 8s ease-in-out infinite reverse; font-size: 2.5rem; }
.tomato { top: 30%; right: 20%; animation: float 7s ease-in-out infinite 1s; }
.cheese { bottom: 20%; left: 25%; animation: float 5s ease-in-out infinite 2s; font-size: 2rem;}

@keyframes float {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
    100% { transform: translateY(0) rotate(0deg); }
}
/* --- 5. INTERACTIVE CHARACTER (TWEETY) --- */
.interactive-tweety {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 120px;
    height: 120px;
    z-index: 99;
    cursor: pointer;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(5px);
    border: 2px solid var(--color-primary);
    box-shadow: 0 0 20px var(--color-primary-glow);
    display: flex;
    justify-content: center;
    align-items: center;
    transform-style: preserve-3d;
}

.interactive-tweety img.tweety-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transform: translateZ(20px);
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

.speech-bubble {
    position: absolute;
    top: -50px;
    left: 50px;
    background: var(--color-primary);
    color: var(--color-bg);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(10px) translateZ(30px);
    transition: var(--transition-smooth);
    pointer-events: none;
    white-space: nowrap;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 20px;
    border-width: 10px 10px 0 0;
    border-style: solid;
    border-color: var(--color-primary) transparent transparent transparent;
}

.interactive-tweety:hover .speech-bubble {
    opacity: 1;
    transform: translateY(0) translateZ(30px);
}

/* --- 6. FEATURED SLIDER --- */
.featured-section {
    background: var(--color-bg);
}

.featured-swiper {
    padding: 2rem 0 4rem 0;
}

.product-slide {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 16/9;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    cursor: grab;
}

.product-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.product-slide:hover img {
    transform: scale(1.05);
}

.product-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    transform: translateY(20px);
    opacity: 0;
    transition: var(--transition-smooth);
}

.product-slide:hover .product-info {
    transform: translateY(0);
    opacity: 1;
}

.product-info h3 {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

/* --- 7. SERVIZI E MENU (Sfondo Avif e griglia ottimizzata) --- */
.menu-section {
    background-color: var(--color-bg-light);
    position: relative;
    overflow: hidden;
}

.menu-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('assets/images/bg-menu.avif') center/cover no-repeat fixed; /* Ottimizzato in .avif */
    opacity: 0.1;
    filter: blur(5px);
    z-index: 0;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Ottimizzato per display mobile più stretti */
    gap: 2rem;
}

.menu-item {
    background: rgba(10, 10, 10, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 15px;
    position: relative;
    backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
    overflow: hidden;
}

.menu-item:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.15);
    transform: translateY(-5px);
}

.menu-item h3 {
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.price {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 1rem;
    color: var(--color-secondary);
}

.hover-ingredients {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.hover-ingredients span {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0;
    transform: scale(0) rotate(0deg);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.menu-item:hover .hover-ingredients .ing1 { top: 10%; right: 10%; opacity: 0.7; transform: scale(1) rotate(15deg); }
.menu-item:hover .hover-ingredients .ing2 { bottom: 10%; right: 20%; opacity: 0.7; transform: scale(1) rotate(-20deg); }
.menu-item:hover .hover-ingredients .ing3 { top: 40%; left: 10%; opacity: 0.7; transform: scale(1) rotate(45deg); }

.menu-item-content {
    position: relative;
    z-index: 1;
}
/* --- 8. ABOUT SECTION & TEAM --- */
.about-section {
    background: var(--color-bg);
}

.about-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 4rem auto;
    font-size: 1.2rem;
    padding: 0 1rem;
}

.subsection-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.team-member {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    aspect-ratio: 3/4;
}

.team-member img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(80%);
    transition: var(--transition-smooth);
}

.team-member:hover img {
    filter: grayscale(0%);
    transform: scale(1.05);
}

.member-overlay {
    position: absolute;
    bottom: -100%;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    background: rgba(230, 57, 70, 0.9); /* Red overlay */
    backdrop-filter: blur(5px);
    transition: var(--transition-smooth);
}

.team-member:hover .member-overlay {
    bottom: 0;
}

.member-overlay h4 {
    font-size: 1.8rem;
    margin-bottom: 0.2rem;
}

.member-overlay span {
    font-weight: 600;
    color: var(--color-primary);
    display: block;
    margin-bottom: 0.5rem;
}

/* --- 9. GALLERY SECTION & LIGHTBOX --- */
.gallery-section {
    background: var(--color-bg-light);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 15px;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.gallery-item:hover img {
    transform: scale(1.1);
    filter: brightness(0.6);
}

.gallery-zoom {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: var(--color-primary);
    font-size: 3rem;
    opacity: 0;
    transition: var(--transition-smooth);
}

.gallery-item:hover .gallery-zoom {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* Lightbox Modal */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.lightbox-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.lightbox-content {
    position: relative;
    max-width: 80%;
    max-height: 80%;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 0 30px var(--color-primary-glow);
}

.lightbox-caption {
    color: #fff;
    text-align: center;
    margin-top: 1rem;
    font-size: 1.2rem;
    font-family: var(--font-heading);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.lightbox-close:hover {
    color: var(--color-primary);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- 10. CONTACT SECTION & FORM --- */
.contact-section {
    background: var(--color-bg);
}

.form-wrapper {
    max-width: 600px;
    margin: 0 auto;
    background: rgba(22, 22, 22, 0.8);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid rgba(255,204,0,0.2);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}

.input-group {
    position: relative;
    margin-bottom: 2rem;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid #333;
    color: var(--color-text);
    font-size: 1rem;
    font-family: var(--font-main);
    transition: var(--transition-smooth);
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-bottom-color: var(--color-primary);
}

.input-group label {
    position: absolute;
    top: 1rem;
    left: 3rem;
    color: #888;
    transition: var(--transition-smooth);
    pointer-events: none;
}

.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label,
.input-group textarea:focus ~ label,
.input-group textarea:not(:placeholder-shown) ~ label {
    top: -0.5rem;
    font-size: 0.8rem;
    color: var(--color-primary);
}

.input-group .icon {
    position: absolute;
    top: 1.2rem;
    left: 0.5rem;
    color: #888;
    transition: var(--transition-smooth);
}

.input-group input:focus ~ .icon,
.input-group textarea:focus ~ .icon {
    color: var(--color-primary);
}

.btn-submit {
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-submit:hover {
    background: var(--color-primary);
    color: var(--color-bg);
    box-shadow: 0 0 20px var(--color-primary-glow);
}

.success-message {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(22, 22, 22, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.success-message.hidden {
    opacity: 0;
    pointer-events: none;
}

.success-message i {
    font-size: 4rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.animate-bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

/* --- 11. STICKY WIDGETS & SOCIAL SIDEBAR (Ottimizzazione UX Mobile) --- */
.sticky-whatsapp {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 99;
}

.social-sidebar {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px; /* Leggermente aumentato il distacco */
    z-index: 99;
    padding-right: 15px;
}

.social-icon {
    width: 48px; /* Portato a un minimo di 48px per conformità Google UX */
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    font-size: 1.3rem;
    backdrop-filter: blur(5px);
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.social-icon.fb:hover { background: #1877F2; border-color: #1877F2; box-shadow: 0 0 15px #1877F2; }
.social-icon.ig:hover { background: #E1306C; border-color: #E1306C; box-shadow: 0 0 15px #E1306C; }

.whatsapp-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25D366;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    text-decoration: none;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
}

.whatsapp-btn:hover {
    transform: scale(1.1);
}

.whatsapp-btn .ping {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #25D366;
    z-index: -1;
    animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
    75%, 100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* --- 12. FOOTER --- */
footer {
    background: #050505;
    text-align: center;
    padding: 2rem;
    border-top: 1px solid #222;
}

/* --- 13. RESPONSIVE MEDIA QUERIES (Correzioni finali UX Mobile) --- */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-links {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(10px);
        padding: 2rem 0;
        clip-path: circle(0% at 100% 0%);
        transition: clip-path 0.5s ease-in-out;
        box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    }

    .nav-links.active {
        clip-path: circle(150% at 100% 0%);
    }

    .nav-links li {
        text-align: center;
        margin: 0; /* Rimosso il margine esterno rigido */
    }
    
    .nav-links a {
        font-size: 1.5rem;
        display: block;
        padding: 15px 20px; /* Aumentata l'area touch interna a 48px+ */
        min-height: 48px;
    }
    
    .interactive-tweety {
        width: 80px;
        height: 80px;
        bottom: 1rem;
        left: 1rem;
    }
    
    .interactive-tweety .speech-bubble {
        display: none; /* Nasconde per risparmiare spazio mobile */
    }

    .sticky-whatsapp {
        bottom: 1rem;
        right: 1rem;
    }
    
    /* Impedisce ai pulsanti social laterali di ridursi e fallire il test UX */
    .social-sidebar {
        padding-right: 8px;
        transform: translateY(-50%) scale(1); /* Rimosso lo scale(0.8) dannoso */
        gap: 15px;
    }

    /* Spostamento di sicurezza e aumento area clic del pulsante chiusura galleria */
    .lightbox-close {
        top: 15px;
        right: 15px;
        font-size: 36px;
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 50%;
    }
    
    .lightbox-content {
        max-width: 95%;
    }

    /* Ottimizzazione del contenitore del form */
    .form-wrapper {
        padding: 1.5rem;
    }
}
