/* Base Styles */
:root {
    --primary: #E30613; /* Red */
    --secondary: #009246; /* Green */
    --accent: #F9F5E8; /* Creamy white / light beige */
    --text: #333333;
    --light: #FFFFFF;
    --dark: #1A1A1A;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

header {
    background: var(--light);
    box-shadow: var(--shadow);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    transition: padding 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0; /* Prevent logo from shrinking too much */
}

.logo img {
    height: 50px; /* Adjust if your placeholder is taller/shorter */
    width: auto; /* Allow width to adjust based on height */
    margin-right: 10px;
    transition: transform 0.3s ease;
    border-radius: 5px; /* Optional: if you want rounded corners for the placeholder */
}
.logo:hover img {
    transform: rotate(-5deg) scale(1.05);
}

.logo-text {
    /* Styles for logo text if you are keeping it */
}
.logo-text h1 {
    font-size: 1.6rem;
    color: var(--primary);
    margin: 0;
}
.logo-text p {
    font-size: 0.8rem;
    color: var(--secondary);
    margin: 0;
}

nav {
    flex-grow: 1; /* Allow nav to take available space if needed */
    display: flex;
    justify-content: center; /* Center nav links if space allows */
}

nav ul {
    display: flex;
    list-style: none;
    align-items: center; /* Align items vertically */
}

nav ul li {
    margin-left: 25px; /* Adjust spacing */
}
nav ul li:first-child {
    margin-left: 0; /* Remove margin for the first item if centered */
}


/* NEW: Header Actions (Search + Hamburger) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px; /* Space between search and hamburger */
}

/* Search Form Styles */
.search-form {
    display: flex;
    align-items: center;
    background-color: var(--accent); /* Light background for the search bar itself */
    border: 1px solid #ddd;
    border-radius: 25px; /* Rounded search bar */
    padding: 0px 5px 0px 15px; /* Padding inside the search bar */
    overflow: hidden; /* To keep button contained */
    max-width: 220px; /* Max width of search bar */
    transition: max-width 0.3s ease-in-out, border-color 0.3s ease;
}
.search-form:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(227, 6, 19, 0.2);
}

.search-form input[type="search"] {
    border: none;
    outline: none;
    padding: 8px 0; /* Vertical padding for the input field */
    background-color: transparent; /* Make input field transparent */
    font-family: 'Open Sans', sans-serif;
    font-size: 0.9rem;
    width: 100%;
    min-width: 120px; /* Minimum width before shrinking */
    color: var(--text);
}
.search-form input[type="search"]::placeholder {
    color: #999;
}

.search-form button[type="submit"] {
    background: transparent;
    border: none;
    color: var(--primary);
    padding: 8px 10px; /* Padding for the search button */
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}
.search-form button[type="submit"]:hover {
    color: var(--secondary);
}


.hamburger {
    display: none;
    cursor: pointer;
    z-index: 1001;
}
/* ... (rest of your existing CSS, including hamburger styles, hero, etc.) ... */


/* Responsive adjustments for header with search */
@media (max-width: 992px) {
    /* Potentially hide search bar or make it an icon toggle on smaller tablets if needed */
    /* For now, let's try to keep it, but reduce its size or move nav */
    nav {
        /* If nav needs to move for search bar, adjust here */
        /* Or hide nav items further if too crowded */
    }
    .search-form {
        max-width: 180px;
    }
    .search-form input[type="search"] {
        min-width: 100px;
    }
}


@media (max-width: 768px) {
    /* On mobile, the nav is hidden by default, so search bar has more space */
    /* OR you might want to make the search bar an icon that expands */
    nav {
        order: 3; /* Ensure hamburger is last if header-actions is used */
    }
    .header-actions {
        margin-left: auto; /* Push search and hamburger to the right */
    }
    nav ul {
        /* ... existing mobile nav styles ... */
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: var(--light);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 20px 0;
        transition: left 0.4s cubic-bezier(0.23, 1, 0.32, 1);
        box-shadow: 0 0 20px rgba(0,0,0,0.1);
        z-index: 999;
    }
    .search-form {
        /* If you want to hide the search input on mobile and only show an icon */
        /* background-color: transparent;
        border: none;
        padding: 0; */
    }
    /* .search-form input[type="search"] {
        display: none; /* Example: hide input on mobile, only show icon */
    /* }
    .search-form input[type="search"].active {
        display: block; /* If you implement a toggle */
    /* } */
    /* .search-form button[type="submit"] {
        padding: 8px;
    } */

    .hamburger {
        display: block;
    }
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--accent);
    overflow-x: hidden; /* Prevent horizontal scroll often caused by animations */
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
}

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

img {
    max-width: 100%;
    height: auto;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary);
    color: var(--light);
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn:hover {
    background: var(--secondary);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.8rem; /* Slightly larger for better impact */
    color: var(--primary);
    animation: fadeInDown 0.8s ease-out; /* Added animation */
}

/* Header Styles */
header {
    background: var(--light);
    box-shadow: var(--shadow);
    position: fixed;
    width: 100%;
    top: 0; /* Ensure it's at the top */
    left: 0; /* Ensure it's at the left */
    z-index: 1000;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0; /* Slightly reduced padding */
    transition: padding 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 50px; /* Adjusted size */
    margin-right: 10px;
    transition: transform 0.3s ease;
}
.logo:hover img {
    transform: rotate(-5deg) scale(1.05);
}

.logo-text h1 {
    font-size: 1.6rem; /* Adjusted size */
    color: var(--primary);
    margin: 0; /* Remove default h1 margin */
}

.logo-text p {
    font-size: 0.8rem;
    color: var(--secondary);
    margin: 0; /* Remove default p margin */
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 30px;
}

nav ul li a {
    font-weight: 600;
    position: relative;
    padding-bottom: 8px; /* Increased padding for better hover effect */
    color: var(--text);
    transition: color 0.3s ease;
}

nav ul li a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px; /* Thicker underline */
    background: var(--primary);
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

nav ul li a:hover {
    color: var(--primary);
}

nav ul li a:hover:after,
nav ul li a.active-link:after { /* For JS to add active state */
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
    z-index: 1001; /* Above nav menu when it slides */
}

.hamburger div {
    width: 25px;
    height: 3px;
    background: var(--primary);
    margin: 5px;
    transition: all 0.3s ease;
}

/* Scrolled header style for visual feedback (optional, can be added via JS) */
header.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
header.scrolled .header-container {
    padding: 10px 0;
}


/* Hero Section */
/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('https://images.unsplash.com/photo-1550507992-eb63ffee0847?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1920&q=80') no-repeat center center/cover;
    /* Rustic Italian ingredients background */
    min-height: 100vh; /* Use min-height to ensure it covers viewport */
    display: flex;
    align-items: center;
    justify-content: center; /* Center content vertically and horizontally */
    text-align: center;
    color: var(--light);
    padding-top: 80px; /* Account for fixed header */
    position: relative; /* For potential pseudo-elements or overlays */
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    animation: fadeIn 1s ease-out 0.2s backwards; /* Backwards fills animation before it starts */
}

.hero h1 {
    font-size: 3.5rem; /* Adjusted for responsiveness */
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    animation: fadeInDown 1s ease-out 0.5s backwards;
}

.hero p {
    font-size: 1.3rem; /* Adjusted for responsiveness */
    margin-bottom: 30px;
    animation: fadeInUp 1s ease-out 0.8s backwards;
    opacity: 0; /* Start hidden for animation */
}

.hero .btn {
    animation: fadeInUp 1s ease-out 1.1s backwards;
    opacity: 0; /* Start hidden for animation */
}

/* About Section */
.about {
    background: var(--light);
}

.about-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-img {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    /* Removed specific animation, will use general scroll animation */
}

.about-img img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.about-img:hover img {
    transform: scale(1.05);
}

.about-content {
    /* Removed specific animation */
}

.about-content h2 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 2.2rem;
}

.about-content p {
    margin-bottom: 20px;
    color: #555;
}

/* Menu Section */
.menu {
    background: var(--accent);
}

.menu-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    animation: fadeIn 0.8s ease-out;
}

.menu-tab {
    padding: 10px 25px;
    background: var(--light);
    border: 1px solid #ddd; /* Added subtle border */
    border-radius: 30px;
    margin: 5px; /* Adjusted margin for wrapping */
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: var(--text);
}

.menu-tab.active, .menu-tab:hover {
    background: var(--primary);
    color: var(--light);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.menu-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); /* Slightly smaller min for more items */
    gap: 30px;
}

.menu-item {
    background: var(--light);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; /* For better content alignment */
    flex-direction: column;
    /* Initial state for scroll animation - JS will handle adding 'visible' class */
    opacity: 0;
    transform: translateY(20px);
}

.menu-item.visible { /* Class added by JS */
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.menu-item.visible:nth-child(2) { transition-delay: 0.1s; }
.menu-item.visible:nth-child(3) { transition-delay: 0.2s; }
/* Add more nth-child delays if needed or handle delay via JS data-attribute */


.menu-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.menu-item-img {
    height: 220px; /* Slightly taller */
    overflow: hidden;
}

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

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

.menu-item-content {
    padding: 20px;
    flex-grow: 1; /* Allows content to fill space if items have different text length */
}

.menu-item-title {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Align price and title nicely */
    margin-bottom: 10px;
}

.menu-item-title h3 {
    color: var(--primary);
    font-size: 1.3rem;
    margin: 0;
}

.menu-item-title span {
    color: var(--secondary);
    font-weight: 700;
    font-size: 1.1rem;
}
.menu-item-content p {
    font-size: 0.9rem;
    color: #666;
}

/* Gallery Section */
.gallery {
    background: var(--light);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    height: 280px;
    box-shadow: var(--shadow);
    opacity: 0; /* Initial state: hidden */
    transform: translateY(20px); /* Initial state: slightly below */
    /* The transition itself is defined when .visible is added */
}

.gallery-item.visible { /* Class added by JS to trigger animation */
    opacity: 1;
    transform: translateY(0);
    transition-property: opacity, transform; /* Specify properties to transition */
    transition-duration: 0.6s;
    transition-timing-function: ease-out;
    /* transition-delay is handled by :nth-child below */
}

/* Staggered animation delays for gallery items when .visible class is applied */
.gallery-item.visible:nth-child(1) { transition-delay: 0s; }
.gallery-item.visible:nth-child(2) { transition-delay: 0.1s; }
.gallery-item.visible:nth-child(3) { transition-delay: 0.2s; }
.gallery-item.visible:nth-child(4) { transition-delay: 0.3s; }
.gallery-item.visible:nth-child(5) { transition-delay: 0.4s; }
.gallery-item.visible:nth-child(6) { transition-delay: 0.5s; }
/* Add more if you have more than 6 items you want to stagger individually */


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

.gallery-item:hover img {
    transform: scale(1.1);
    filter: brightness(0.8);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
    pointer-events: auto;
}

.gallery-overlay i {
    color: var(--light);
    font-size: 2.5rem;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}
.gallery-item:hover .gallery-overlay i {
    transform: scale(1);
}

/* Contact Section */
.contact {
    background: var(--accent);
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr; /* Give form slightly more space */
    gap: 50px;
    align-items: flex-start; /* Align items to the top */
}

.contact-info {
    /* Removed specific animation, will use general scroll animation */
}

.contact-info h3 {
    color: var(--primary);
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.contact-details {
    margin-bottom: 30px;
}

.contact-detail {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    color: var(--text);
}

.contact-detail i {
    color: var(--primary);
    font-size: 1.4rem; /* Slightly larger icon */
    margin-right: 15px;
    margin-top: 3px; /* Fine-tune alignment */
    width: 25px; /* Ensure consistent icon spacing */
    text-align: center;
}
.contact-detail div h4 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    color: var(--secondary);
}
.contact-detail div p {
    margin: 0;
    font-size: 0.95rem;
}


.contact-form {
    background: var(--light);
    padding: 40px; /* More padding */
    border-radius: 10px;
    box-shadow: var(--shadow);
    /* Removed specific animation */
}
.contact-form h3 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8rem;
    color: var(--primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(227, 6, 19, 0.2);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical; /* Allow vertical resize only */
}

/* Footer */
footer {
    background: var(--dark);
    color: #bbb; /* Lighter gray for better readability */
    padding: 60px 0 20px;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: var(--light); /* Brighter for headings */
    margin-bottom: 20px;
    font-size: 1.3rem;
    position: relative;
    padding-bottom: 10px;
}
.footer-col h4::after { /* Underline for footer headings */
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background-color: var(--primary);
}

.footer-col p {
    font-size: 0.95rem;
    line-height: 1.7;
}
.footer-col ul {
    list-style: none;
}
.footer-col ul li {
    margin-bottom: 10px;
}
.footer-col ul li a {
    color: #bbb;
    transition: color 0.3s ease, padding-left 0.3s ease;
}
.footer-col ul li a:hover {
    color: var(--primary);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px; /* Added margin for spacing in contact/footer */
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--light);
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary);
    transform: translateY(-3px) scale(1.1);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px; /* Increased padding */
    margin-top: 30px; /* Added margin */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}
.footer-bottom p {
    margin: 0;
}

/* Keyframe Animations (shared) */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px); /* Increased distance */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px); /* Increased distance */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px); /* Increased distance */
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px); /* Increased distance */
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* General scroll-triggered animation class (can be applied by JS) */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.animate-on-scroll.fade-in-up { transform: translateY(30px); }
.animate-on-scroll.fade-in-down { transform: translateY(-30px); }
.animate-on-scroll.fade-in-left { transform: translateX(-30px); }
.animate-on-scroll.fade-in-right { transform: translateX(30px); }

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translate(0, 0);
}


/* Responsive Styles */
@media (max-width: 992px) {
    .section-title { font-size: 2.2rem; }
    .hero h1 { font-size: 3rem; }
    .hero p { font-size: 1.1rem; }

    .about-container, .contact-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .about-img {
        order: -1; /* Image appears above text on mobile */
        margin-bottom: 30px;
    }
    .contact-info {
        margin-bottom: 40px;
        text-align: center; /* Center contact info details on smaller screens */
    }
    .contact-detail {
        justify-content: center; /* Center individual contact details */
        text-align: left; /* Keep text left-aligned within the centered block */
    }
    .contact-detail i {
         margin-top: 5px; /* Adjust icon if needed */
    }
    .contact-form {
        padding: 30px;
    }
    .social-links {
        justify-content: center; /* Center social links in contact info */
    }
}

@media (max-width: 768px) {
    nav ul {
        position: fixed;
        top: 0; /* Start from very top */
        left: -100%;
        width: 100%;
        height: 100vh; /* Full height */
        background: var(--light);
        flex-direction: column;
        align-items: center;
        justify-content: center; /* Center links vertically */
        padding: 20px 0;
        transition: left 0.4s cubic-bezier(0.23, 1, 0.32, 1); /* Smoother slide */
        box-shadow: 0 0 20px rgba(0,0,0,0.1);
        z-index: 999; /* Below hamburger icon */
    }

    nav ul.active {
        left: 0;
    }

    nav ul li {
        margin: 20px 0; /* Increased spacing */
    }
    nav ul li a {
        font-size: 1.2rem; /* Larger font for mobile menu */
    }

    .hamburger {
        display: block;
        position: relative; /* For z-index to work correctly */
    }

    .hamburger.active div:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .hamburger.active div:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active div:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    .hero { min-height: auto; padding: 120px 0 60px 0;} /* Adjust hero padding */
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1rem; }
    

    .menu-items {
        grid-template-columns: 1fr; /* Stack menu items */
    }
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* Allow 2 columns on smaller tablets */
    }
}

@media (max-width: 576px) {
    .section-title { font-size: 2rem; }
    .btn { padding: 10px 25px; font-size: 0.9rem;}
    .gallery-grid {
        grid-template-columns: 1fr; /* Stack gallery items */
    }
    .footer-container {
        text-align: center;
    }
    .footer-col h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
    .social-links {
        justify-content: center;
    }
}

