/* Root Variables & Aesthetics */
:root {
    --primary: #2d4a22; /* Deep Forest Green */
    --primary-light: #3e6b2e;
    --secondary: #8b5e3c; /* Rustic Brown */
    --accent: #d4a373; /* Gold/Sand */
    --text: #2c2c2c;
    --text-light: #666666;
    --light: #fdfbf7;
    --white: #ffffff;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Poppins', sans-serif;
    --shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Global Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { 
    font-family: var(--font-sans); 
    color: var(--text); 
    background: var(--light); 
    line-height: 1.7; 
    overflow-x: hidden;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 25px; }
a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 700; color: var(--primary); }

/* Animations */
.fade-in { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.fade-in.visible { opacity: 1; transform: translateY(0); }
.slide-up { opacity: 0; transform: translateY(50px); transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.slide-up.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }
.delay-3 { transition-delay: 0.6s; }

/* Header & Navigation */
header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: var(--transition);
}

nav { display: flex; justify-content: space-between; align-items: center; }

/* Mobile Base Logo */
.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-serif);
    letter-spacing: -0.5px;
}
.logo span { color: var(--secondary); font-style: italic; font-weight: 400; }
.logo img { height: 32px; width: 32px; margin-right: 5px; }

/* Mobile Base Nav Links */
.nav-links {
    position: fixed; left: -100%; top: 0; gap: 0; flex-direction: column;
    background-color: var(--white); width: 100%; height: 100vh;
    text-align: center; transition: 0.3s; box-shadow: var(--shadow);
    justify-content: center; padding: 20px; z-index: 1000;
    display: flex; align-items: center;
}
.nav-links.active { left: 0; }
.nav-links li { margin: 25px 0; }
.nav-links a { font-size: 1.5rem; color: var(--primary); font-weight: 500; position: relative; }
.nav-links a::after {
    content: ''; position: absolute; width: 0; height: 2px;
    bottom: -5px; left: 0; background-color: var(--secondary);
    transition: var(--transition);
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--secondary); }

/* Mobile Base CTA */
.nav-cta {
    background: var(--accent); color: var(--primary);
    padding: 6px 12px; border-radius: 50px; font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); display: inline-block;
    font-size: 0.85rem; margin-left: auto; margin-right: 10px;
}
.nav-cta:hover { 
    background: var(--primary-light); color: var(--white);
    transform: translateY(-2px); box-shadow: 0 6px 20px rgba(45, 74, 34, 0.3);
}

/* Hamburger Menu (Mobile Base) */
.hamburger { display: block; z-index: 1001; cursor: pointer; border: none; background: none; }
.bar { display: block; width: 25px; height: 3px; margin: 5px auto; transition: all 0.3s ease-in-out; background-color: var(--primary); }
.hamburger.active .bar:nth-child(2) { opacity: 0; }
.hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Buttons */
.btn { 
    padding: 15px 40px; border-radius: 50px; font-weight: 600; 
    display: inline-block; cursor: pointer; transition: var(--transition);
    letter-spacing: 0.5px; text-transform: uppercase; font-size: 0.9rem;
}
.btn-primary { background: var(--secondary); color: var(--white); box-shadow: 0 4px 15px rgba(139, 94, 60, 0.3); }
.btn-primary:hover { background: #7a5032; transform: translateY(-3px); color: white; box-shadow: 0 8px 25px rgba(139, 94, 60, 0.4); }
.btn-outline { border: 2px solid var(--white); color: var(--white); backdrop-filter: blur(5px); }
.btn-outline:hover { background: var(--white); color: var(--primary); transform: translateY(-3px); }
.btn-outline-dark { border: 2px solid var(--primary); color: var(--primary); background: transparent; }
.btn-outline-dark:hover { background: var(--primary); color: var(--white); transform: translateY(-3px); }

/* Page Hero Components */
.home-hero {
    height: 100vh;
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.6)), url('immagini-ufficiali/img-12.jpeg') center/cover no-repeat;
    background-attachment: scroll;
    display: flex; align-items: center; color: var(--white);
    position: relative;
}
.hero-text { max-width: 800px; }
.hero-text h1 { font-size: 3rem; line-height: 1.1; margin-bottom: 25px; color: var(--white); text-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.hero-text p { font-size: 1.1rem; margin-bottom: 40px; text-shadow: 0 2px 10px rgba(0,0,0,0.3); font-weight: 300; }
.hero-btns { display: flex; gap: 20px; flex-wrap: wrap; }

.page-hero {
    background-size: cover; background-position: center; background-attachment: scroll;
    height: 50vh; display: flex; align-items: center; justify-content: center;
    text-align: center; color: var(--white); margin-top: 70px;
}
.page-hero h1 { font-size: 3rem; color: var(--white); text-shadow: 0 5px 15px rgba(0,0,0,0.3); }

#cta-home { background-attachment: scroll; }

/* Sections & Typography */
section { padding: 50px 0; background: var(--white); }
section:nth-child(even) { background: var(--light); }
.section-title { text-align: center; margin-bottom: 40px; }
.section-title h2 { font-size: 2.5rem; margin-bottom: 10px; }
.section-title p { color: var(--secondary); font-style: italic; font-size: 1.2rem; letter-spacing: 2px; text-transform: uppercase; font-weight: 600; font-family: var(--font-sans); }

/* About Grid & Contact Grid Mobile */
.about-grid { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: center; }
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: center; }
.about-text p { margin-bottom: 25px; font-size: 1.1rem; color: var(--text-light); }
.about-image-wrapper { position: relative; margin-top: 40px; }
.about-image-wrapper img { width: 100%; border-radius: 20px; box-shadow: var(--shadow); z-index: 2; position: relative; }
.about-image-wrapper::before {
    content: ''; position: absolute; top: -20px; left: -20px;
    width: 100%; height: 100%; border: 3px solid var(--accent);
    border-radius: 20px; z-index: 1;
}

/* Features Grid Mobile */
.features-grid { 
    grid-template-columns: 1fr !important; 
    gap: 20px !important; 
}
.feature-item {
    padding: 25px !important;
}

/* Menu Notice */
.menu-notice {
    background: rgba(212, 163, 115, 0.1);
    border-left: 5px solid var(--accent);
    padding: 25px;
    border-radius: 0 15px 15px 0;
    margin-bottom: 50px;
    box-shadow: var(--shadow);
}
.menu-notice p {
    color: var(--primary);
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0;
}
.menu-notice strong {
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Menu Styles Mobile */
.menu-category { margin-bottom: 60px; }
.menu-category h3 { 
    font-size: 2rem; color: var(--primary); 
    border-bottom: 3px solid var(--accent); 
    display: inline-block; margin-bottom: 30px; padding-bottom: 10px;
}
.menu-items { display: grid; grid-template-columns: 1fr; gap: 30px; padding: 0 10px; }
.menu-item {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding-bottom: 20px; border-bottom: 1px dashed rgba(0,0,0,0.1);
    transition: var(--transition);
}
.menu-item:hover { transform: translateX(10px); }
.item-info h4 { font-size: 1.4rem; margin-bottom: 5px; color: var(--text); }
.item-info p { font-size: 1rem; color: var(--text-light); font-style: italic; }
.item-price { font-weight: 700; color: var(--secondary); font-size: 1.2rem; background: rgba(139, 94, 60, 0.1); padding: 5px 15px; border-radius: 20px; }

/* Gallery Page Styles Mobile */
.gallery-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.gallery-card { height: 300px; border-radius: 15px; overflow: hidden; position: relative; box-shadow: var(--shadow); cursor: pointer; }
.gallery-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1); }
.gallery-card:hover img { transform: scale(1.08); }
.gallery-card::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.5), transparent); opacity: 0; transition: var(--transition);
}
.gallery-card:hover::after { opacity: 1; }
.gallery-card::before {
    content: '🔍'; position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.5); font-size: 2.5rem;
    color: white; opacity: 0; transition: var(--transition);
    z-index: 2; pointer-events: none;
}
.gallery-card:hover::before { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* Contact Page Styles Mobile */
.contact-info-box { background: var(--white); padding: 40px; border-radius: 20px; box-shadow: var(--shadow); }
.info-item { margin-bottom: 35px; display: flex; gap: 20px; }
.info-icon { font-size: 2rem; color: var(--secondary); }
.info-item h4 { font-size: 1.3rem; margin-bottom: 8px; color: var(--primary); }
.info-item p { color: var(--text-light); font-size: 1.1rem; }
.info-item a { color: var(--text); transition: var(--transition); }
.info-item a:hover { color: var(--secondary); }
.map-container { height: 400px; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); border: 8px solid var(--white); }

/* Floating WhatsApp Button */
.floating-wa {
    position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px;
    background-color: #25D366; color: white; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 1000; transition: var(--transition);
}
.floating-wa:hover { transform: scale(1.1); background-color: #1ebe57; box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6); }
.floating-wa svg { width: 35px; height: 35px; }

/* Footer Mobile */
footer { background: var(--primary); color: var(--white); padding: 60px 0 30px; position: relative; overflow: hidden; }
footer::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 5px; background: var(--accent); }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 40px; margin-bottom: 50px; }
.footer-logo { font-size: 2.5rem; font-family: var(--font-serif); font-weight: 700; margin-bottom: 20px; display: inline-block; }
.footer-logo span { color: var(--accent); font-style: italic; }
.footer-info h4 { font-size: 1.4rem; margin-bottom: 25px; color: var(--white); position: relative; display: inline-block; }
.footer-info h4::after { content: ''; position: absolute; left: 0; bottom: -8px; width: 40px; height: 2px; background: var(--accent); }
.footer-info p { margin-bottom: 15px; opacity: 0.8; font-size: 1.05rem; }
.social-links { display: flex; gap: 15px; margin-top: 20px; }
.social-links a { display: inline-flex; align-items: center; justify-content: center; width: 45px; height: 45px; border-radius: 50%; background: rgba(255,255,255,0.1); transition: var(--transition); }
.social-links a:hover { background: var(--accent); transform: translateY(-5px); }
.footer-bottom { text-align: center; padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.95rem; opacity: 0.6; }

/* Lightbox Styles Mobile */
.lightbox {
    display: none; position: fixed; z-index: 9999; padding-top: 60px;
    left: 0; top: 0; width: 100%; height: 100%; overflow: hidden;
    background-color: rgba(0, 0, 0, 0.9); backdrop-filter: blur(5px);
}
.lightbox-content {
    margin: auto; display: block; max-width: 90%; max-height: 85vh;
    object-fit: contain; animation: zoomIn 0.3s ease;
    border-radius: 10px; box-shadow: 0 0 30px rgba(0,0,0,0.5);
}
@keyframes zoomIn { from {transform: scale(0.9); opacity: 0;} to {transform: scale(1); opacity: 1;} }
.lightbox-close {
    position: absolute; top: 20px; right: 35px; color: #f1f1f1;
    font-size: 40px; font-weight: bold; transition: 0.3s; cursor: pointer; z-index: 10000;
}
.lightbox-close:hover, .lightbox-close:focus { color: var(--accent); text-decoration: none; }
.lightbox-prev, .lightbox-next {
    cursor: pointer; position: absolute; top: 50%; width: auto; padding: 16px;
    margin-top: -50px; color: white; font-weight: bold; font-size: 30px;
    transition: 0.3s ease; border-radius: 0 3px 3px 0; user-select: none;
    -webkit-user-select: none; background-color: rgba(0,0,0,0.3);
}
.lightbox-next { right: 0; border-radius: 3px 0 0 3px; }
.lightbox-prev { left: 0; }
.lightbox-prev:hover, .lightbox-next:hover { background-color: var(--accent); color: white; }
#lightbox-img {
    margin: auto; display: block; max-width: 90%; max-height: 85vh;
    object-fit: contain; animation: zoomIn 0.3s ease; border-radius: 10px;
}

/* Cookie Banner Mobile */
.cookie-banner {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background-color: var(--primary); color: var(--white);
    padding: 15px 0; z-index: 10000; transform: translateY(100%);
    transition: transform 0.5s ease-in-out; box-shadow: 0 -5px 20px rgba(0,0,0,0.2);
}
.cookie-banner.show { transform: translateY(0); }
.cookie-content {
    max-width: 1200px; margin: 0 auto; padding: 0 20px;
    display: flex; flex-direction: column; text-align: center; gap: 20px; align-items: center;
}
.cookie-content p { margin: 0; font-size: 0.9rem; line-height: 1.4; opacity: 0.9; }
.cookie-content a { color: var(--accent); text-decoration: underline; }

/* --- RESPONSIVE DESIGN (MOBILE FIRST) --- */

/* Tablet & Up (min-width: 769px) */
@media (min-width: 769px) {
    /* Header & Nav */
    .hamburger { display: none; }
    .nav-links {
        position: static; flex-direction: row; height: auto; width: auto;
        background-color: transparent; box-shadow: none; padding: 0;
        gap: 40px; justify-content: flex-start;
    }
    .nav-links li { margin: 0; }
    .nav-links a { font-size: 0.95rem; color: inherit; }
    .nav-cta {
        background: var(--primary); color: var(--white);
        padding: 12px 30px; font-size: 0.95rem; margin-left: 0; margin-right: 0;
        box-shadow: 0 4px 15px rgba(45, 74, 34, 0.2);
    }
    .logo { font-size: 2rem; }
    .logo img { height: auto; width: auto; margin-right: 0; }

    /* Typography & Spacing */
    section { padding: 100px 0; }
    .section-title { margin-bottom: 70px; }
    .section-title h2 { font-size: 3.5rem; }
    .hero-text h1 { font-size: 4rem; }
    .hero-text p { font-size: 1.3rem; }
    .page-hero h1 { font-size: 4rem; }
    .menu-category h3 { font-size: 2.5rem; margin-bottom: 40px; }
    .menu-category { margin-bottom: 80px; }

    /* Backgrounds */
    .home-hero, .page-hero, #cta-home { background-attachment: fixed; }

    /* Grids */
    .gallery-container { grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 30px; }
    .gallery-card { height: 350px; }
    .contact-info-box { padding: 50px; }
    footer { padding: 80px 0 30px; }
    .footer-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 50px; margin-bottom: 60px; }
    
    /* Features */
    .features-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important; gap: 40px !important; }
    .feature-item { padding: 30px !important; }

    /* Cookie */
    .cookie-content { flex-direction: row; text-align: left; justify-content: space-between; }
}

/* Desktop & Up (min-width: 993px) */
@media (min-width: 993px) {
    .hero-text h1 { font-size: 5rem; }
    .about-grid { grid-template-columns: 1fr 1fr; gap: 70px; }
    .contact-grid { grid-template-columns: 1fr 1.2fr; gap: 80px; }
    .about-image-wrapper { margin-top: 0; }
    .map-container { height: 600px; }
    .menu-items { grid-template-columns: repeat(auto-fit, minmax(450px, 1fr)); gap: 40px; }
}

/* Menu Tabs */
.menu-category.tab-pane {
    display: none;
    animation: fadeInTab 0.5s ease;
}
.menu-category.tab-pane.active {
    display: block;
}
.btn.tab-btn.active-tab {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Menu Navigation Mobile Optimization */
.menu-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 50px;
    position: sticky;
    top: 90px;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

@media (max-width: 768px) {
    .menu-nav {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 10px 15px;
        margin-bottom: 30px;
        top: 60px; /* Reduced top to stick closer to smaller mobile header */
        border-radius: 0;
        /* Custom scrollbar hiding */
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .menu-nav::-webkit-scrollbar {
        display: none;
    }
    .tab-btn {
        flex: 0 0 auto;
        white-space: nowrap;
    }
}
