/* Reset & Base */
:root {
    --maragall-red: #C1272D;
    --maragall-green: #006837;
    --bg-wood-light: #E8DCC8; /* Un bianco caldo che ricorda il legno chiaro */
    
    --bg-color: var(--bg-wood-light);
    --text-color: #1A1A1A;
    --accent-red: var(--maragall-red);
    --accent-green: var(--maragall-green);
    --accent-gold: #e6b800;
    --card-bg: var(--bg-wood-light);
    --font-heading: 'Fraunces', serif;
    --font-body: 'Open Sans', sans-serif;
    --transition-speed: 0.4s;
    --shadow-soft: 0 20px 40px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 30px 60px rgba(0, 0, 0, 0.08);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: #E8DCC8 !important;
    background-image: none !important;
    color: var(--text-color);
    line-height: 1.9;
    /* Increased for editorial feel */
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0px;
    /* Tighter tracking for Fraunces */
    font-weight: 300;
    /* Light weight as requested */
    color: #111;
    line-height: 1.1;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease, opacity 0.3s ease;
}

img {
    max-width: 100%;
    display: block;
    border-radius: 2px;
    /* Slight softening */
}

/* Utilities */
.container {
    max-width: 1300px;
    /* Wider container */
    margin: 0 auto;
    padding: 0 2.5rem;
}

.text-accent-red {
    color: var(--accent-red);
}

.text-accent-green {
    color: var(--accent-green);
}

.btn {
    display: inline-block;
    padding: 1.1rem 2.8rem;
    background-color: var(--accent-red);
    color: white;
    font-family: var(--font-heading);
    font-size: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    border-radius: 4px; /* Slightly more rounded for warmth */
    font-weight: 600;
}

.btn:hover {
    background-color: #b01820;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 15px 30px rgba(208, 32, 42, 0.3);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--text-color);
    margin-left: 1rem;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.btn-outline:hover {
    background-color: var(--bg-color);
    color: var(--text-color);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 255, 255, 0.2);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid #ccc;
    color: var(--text-color);
    padding: 0.9rem 2rem;
    font-size: 0.9rem;
    border-radius: 4px;
}

.btn-secondary:hover {
    border-color: var(--text-color);
    background-color: var(--text-color);
    color: white;
}

.section-title {
    font-size: 4rem;
    /* Bigger */
    margin-bottom: 1.5rem;
    text-align: center;
    position: relative;
    display: inline-block;
    width: 100%;
    letter-spacing: -1px;
    /* Tighter heading tracking */
}

.section-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 5rem;
    font-family: var(--font-body);
    font-style: italic;
    font-size: 1.25rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Animations */
.fade-in-section {
    opacity: 1;
    /* Make visible by default for reliability */
    transform: none;
    transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1), transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, visibility;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: none;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 0.5rem 0;
    /* Reduced padding further */
    z-index: 1000;
    background-color: var(--bg-color);
    /* Always white */
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    /* Constant shadow */
    height: 60px;
}

/* Remove or simplify .scrolled as it's now the default state */
.navbar.scrolled {
    /* No changes on scroll needed for background/padding anymore */
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    position: relative;
    width: 100%;
    padding: 0 1.2rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.logo img {
    height: 87px;
    /* Slightly larger logo */
    width: auto;
    transition: height 0.3s ease;
}

.nav-links {
    display: flex;
    gap: 3rem;
    /* More spacing between links */
    align-items: center;
    /* Ensure vertical centering */
    justify-content: flex-end;
}

.nav-links a {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    letter-spacing: 2px;
    color: var(--text-color);
    /* Always dark color */
    font-weight: 500;
    position: relative;
    opacity: 0.9;
}

.nav-links a:hover {
    color: var(--accent-green);
    opacity: 1;
}

/* Language Dropdown */
.lang-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 0;
}

.lang-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem;
    transition: transform 0.2s ease;
}

.lang-btn .chevron {
    width: 14px;
    height: 14px;
    color: var(--text-color);
    transition: transform 0.3s ease;
}

.lang-dropdown.active .chevron {
    transform: rotate(180deg);
}

.lang-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--bg-color);
    min-width: 160px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 0.5rem 0;
    display: none;
    flex-direction: column;
    z-index: 1001;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.lang-dropdown.active .lang-menu {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.lang-menu a {
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
    color: var(--text-color) !important;
    /* Force dark text */
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: background-color 0.2s ease;
    font-family: var(--font-body);
    /* Body font for dropdown */
    letter-spacing: 0.5px;
    font-weight: 400;
}

.lang-menu a:hover {
    background-color: var(--bg-wood-light);
    color: var(--accent-red) !important;
}

.lang-flag {
    width: 20px;
    height: auto;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

/* Mobile adjustments for lang selector */
@media (max-width: 768px) {
    .hero-logo-text {
        font-size: 3.5rem;
        margin-top: 3rem;
    }

    .nav-left .lang-dropdown {
        display: flex;
    }

    .lang-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: auto;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        background-color: var(--bg-color);
        text-align: left;
        align-items: flex-start;
        padding-top: 0.5rem;
        min-width: 160px;
    }

    .lang-menu a {
        justify-content: flex-start;
        font-size: 0.95rem;
    }
}

/* Mobile Menu */
.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-color);
    /* Always dark color */
}


/* Hero Section - CORRETTA */
.hero {
    height: 95vh;
    /* La sfumatura ora va verso il color crema (#E8DCC8) per eliminare il distacco bianco */
    background-image: linear-gradient(to top, rgba(247, 242, 233, 0.9) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.5) 100%), url('/assets/heropm1.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 2;
    /* Forza il colore di fondo se l'immagine non carica */
    background-color: #E8DCC8; 
}

.hero-logo-text {
    font-family: var(--font-heading);
    font-size: 6rem;
    /* Large size for logo replacement */
    font-weight: 700;
    /* Bold style */
    color: white;
    margin: 0 auto 1.5rem auto;
    line-height: 1;
    text-transform: none;
    /* Keep natural case or uppercase depending on pref, user asked for "Pizzeria Maragall" */
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    letter-spacing: -2px;
}

/* Mobile adjustment for hero logo */
@media (max-width: 768px) {
    .hero-logo-text {
        font-size: 3.5rem;
    }
}

.hero-content {
    max-width: 1000px;
    padding: 0 1.5rem;
    opacity: 1;
    color: white;
}

.hero-title {
    font-size: 7.5rem;
    /* Massive, editorial size */
    line-height: 0.9;
    margin-bottom: 2rem;
    text-transform: uppercase;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.6);
    color: white;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 3.5rem;
    font-weight: 500;
    letter-spacing: 4px;
    text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.7);
    opacity: 1;
}

/* About Section */
.about {
    padding: 12rem 0;
    /* Generous spacing */
    background-color: transparent;
    text-align: center;
}

.about-text {
    max-width: 750px;
    margin: 0 auto;
    font-size: 1.3rem;
    /* Larger body text */
    color: #444;
    margin-bottom: 3rem;
    font-weight: 300;
}

.about-hours {
    display: inline-block;
    border: 1px solid #e0d8cd; /* Warmer border */
    padding: 3rem 4rem;
    margin-top: 2rem;
    background-color: var(--bg-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04); /* Softer shadow */
    border-radius: 4px;
}

.about-hours h3 {
    margin-bottom: 1.5rem;
    color: var(--accent-green);
    font-size: 1.5rem;
}

/* Pizza del Mese Section (Priority) */
.pizza-mese {
    padding: 6rem 0;
    background-color: transparent; /* Updated to blend seamlessly */
    position: relative;
}

.pizza-mese-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6rem;
    /* Huge gap */
    max-width: 1200px;
    margin: 0 auto;
    background: transparent;
    /* Cleaner look, no box */
    border: none;
    padding: 0;
    box-shadow: none;
}

.pizza-mese-content {
    flex: 1;
    min-width: 350px;
    text-align: left;
}

.pizza-mese-image {
    flex: 1;
    min-width: 350px;
    max-width: 600px;
    position: relative;
}

.pizza-mese-image img {
    border-radius: 2px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
    transform: rotate(-1deg);
    transition: transform 0.6s ease;
}

.pizza-mese-image:hover img {
    transform: rotate(0deg) scale(1.02);
}

/* Helper for reversed layout on desktop */
.bottega-container-reverse {
    flex-direction: row-reverse;
}

.badge {
    display: inline-block;
    background-color: var(--accent-red);
    color: white;
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    margin-bottom: 1.5rem;
    border-radius: 0;
    /* Sharp, modern */
}

.pizza-mese h2 {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
}

.pizza-mese-desc {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 2.5rem;
    font-weight: 300;
}

/* Menu Section */
.menu {
    padding: 12rem 0;
    background-color: transparent;
    /* Clean white contrast against the warm background */
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    /* Bigger cards */
    gap: 4rem;
}

.menu-item {
    background: transparent;
    /* No card background, more editorial */
    border-radius: 0;
    overflow: visible;
    transition: transform 0.3s ease;
    box-shadow: none;
    display: flex;
    flex-direction: column;
}

.menu-item:hover {
    transform: translateY(-8px);
    box-shadow: none;
    /* Keep it clean */
}

.menu-img-container {
    height: 350px;
    /* Taller images */
    overflow: hidden;
    position: relative;
    border-radius: 2px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 1.5rem;
}

.menu-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.menu-item:hover .menu-img-container img {
    transform: scale(1.04);
}

.menu-details {
    padding: 0.5rem 0;
    /* Minimal padding */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
    border-bottom: none;
    /* Cleaner */
    padding-bottom: 0;
}

.menu-name {
    font-size: 1.6rem;
    color: #111;
    font-weight: 700;
}

.menu-price {
    font-family: var(--font-heading);
    color: var(--accent-red);
    font-size: 1.4rem;
    font-weight: 400;
}

.menu-desc {
    color: #666;
    font-size: 1.05rem;
    line-height: 1.6;
    font-weight: 300;
}

/* Gallery Section */
.gallery {
    padding: 0;
    background-color: transparent;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

.gallery-item {
    height: 500px;
    /* Taller gallery */
    overflow: hidden;
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.9s ease;
}

.gallery-item:hover img {
    transform: scale(1.03);
}

/* Reservation Section */
.reservation {
    padding: 12rem 0;
    background-color: transparent;
    text-align: center;
}

.reservation h2 {
    font-size: 4rem;
    margin-bottom: 2rem;
    color: #1a1a1a;
}

.reservation p {
    font-size: 1.3rem;
    margin-bottom: 3.5rem;
    color: #555;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 300;
}

.contact-details {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin-top: 5rem;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    color: #333;
    font-size: 1.15rem;
    font-weight: 500;
}

/* Footer */
.footer {
    padding: 6rem 0;
    background-color: transparent; /* Updated to blend completely */
    text-align: center;
    color: #444;
    border-top: 1px solid #e0d8cd; /* Darkened slightly for warm theme */
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    margin-bottom: 2rem;
    color: var(--accent-green);
    letter-spacing: 2px;
}

.social-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.social-icons a {
    color: #222;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-icons a:hover {
    color: var(--accent-red);
    transform: translateY(-3px);
}

.copyright {
    color: #888;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.btn-link {
    display: inline-block;
    background-color: transparent;
    color: var(--accent-red) !important;
    padding: 0.5rem 1.2rem;
    border-radius: 2px;
    font-weight: 600;
    letter-spacing: 1px;
    border: 1.5px solid var(--accent-red);
    font-size: 0.85rem;
    line-height: 1;
}

.menu-link {
    display: inline-block;
    background-color: transparent;
    color: var(--accent-green) !important;
    padding: 0.5rem 1.2rem;
    border-radius: 2px;
    font-weight: 600;
    letter-spacing: 1px;
    border: 1.5px solid var(--accent-green);
    font-size: 0.85rem;
    line-height: 1;
}

.menu-link:hover {
    background-color: var(--accent-green);
    color: white !important;
}

.btn-link:hover {
    background-color: #b01820;
    color: white !important;
}

/* Responsive Utility Classes */
.mobile-only {
    display: none;
}
/* Recensioni Section */
.recensioni {
    padding: 8rem 0;
    background-color: transparent;
    text-align: center;
}

.recensioni-carousel {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    overflow: hidden;
}

.recensioni-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
}

.recensione-card {
    min-width: 100%;
    background-color: #f5ede0;
    border-radius: 8px;
    padding: 3rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.recensione-stelle {
    color: var(--accent-gold);
    font-size: 1.6rem;
    letter-spacing: 4px;
}

.recensione-testo {
    font-size: 1.15rem;
    color: #444;
    font-style: italic;
    font-weight: 300;
    line-height: 1.8;
    max-width: 550px;
}

.recensione-autore {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.recensione-nome {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: #111;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.recensione-via {
    font-size: 0.8rem;
    color: #999;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 1.5px solid #ddd;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text-color);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 10;
}

.carousel-btn:hover {
    background-color: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
}

.carousel-prev { left: -22px; }
.carousel-next { right: -22px; }

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 2rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ccc;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dot.active {
    background-color: var(--accent-red);
}

@media (max-width: 768px) {
    .recensione-card {
        padding: 2rem 1.5rem;
    }
    .carousel-prev { left: 0; }
    .carousel-next { right: 0; }
}

/* Responsive */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: inline-block !important;
        margin-top: 1.5rem;
    }

    .container {
        padding: 0 1.5rem;
        /* Better padding for mobile */
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .nav-links {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: var(--bg-color);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transform: translateY(-100%);
        transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.5s ease;
        opacity: 0;
        pointer-events: none;
        z-index: 1000;
    }

    .nav-links.mobile-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links a {
        font-size: 1.8rem;
        /* Slightly smaller to fit better */
        margin: 1.2rem 0;
        color: var(--text-color);
    }

    /* Make "PRENOTA" more visible on mobile menu */
    .nav-links .btn-link {
        background-color: var(--accent-red);
        color: white !important;
        padding: 0.8rem 2rem;
        border-radius: 2px;
        font-weight: 700;
        letter-spacing: 2px;
        margin-top: 1rem;
        box-shadow: 0 10px 20px rgba(208, 32, 42, 0.2);
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .pizza-mese-container {
        flex-direction: column;
        padding: 0;
        gap: 3rem;
    }

    #pizza-mese .pizza-mese-image {
        order: -1;
    }

    /* Override for specific reversed sections on mobile to keep column-reverse */
    .bottega-container-reverse {
        flex-direction: column !important;
        /* Changed to column for Text -> Image -> Button flow */
    }

    /* Center content on mobile and fix overflow */
    .pizza-mese-content {
        min-width: 0;
        /* Allow shrinking */
        width: 100%;
        text-align: center;
    }

    .pizza-mese-image {
        min-width: 0;
        /* Allow shrinking */
        width: 100%;
    }

    .menu-grid {
        grid-template-columns: 1fr;
        /* Single column on mobile */
    }

    .hamburger {
        display: block;
        z-index: 1001;
        position: relative;
    }

    .section-title {
        font-size: 2.8rem;
    }

    .about,
    .pizza-mese,
    .menu,
    .reservation {
        padding: 5rem 0;
        /* Reduced padding on mobile */
    }

    .hero-content {
        padding: 0 1rem;
    }

    .hero {
        background-attachment: scroll; /* Fix for mobile pixelation/zoom */
        background-position: center;
        height: 100vh; /* Ensure full height on mobile */
    }
}
@media (max-width: 768px) {
    #pizza-mese .pizza-mese-image {
        order: -1;
    }
}