@view-transition {
    navigation: auto;
}

::view-transition-old(root) {
    animation: fade-out .25s ease;
}

::view-transition-new(root) {
    animation: fade-in .25s ease;
}

.immagine-fluida {
    animation: fadeInImage 0.8s ease-in-out;
}

@keyframes fadeInImage {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fade-out {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

:root {
    --primary: #557A46;
    --primary-hover: #3A4D39;
    --secondary: #F2E3DB;
    --bg-color: #F9F8F6;
    --text-dark: #2C3333;
    --whatsapp: #25D366;
    --whatsapp-hover: #128C7E;
}

html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-dark);
    scroll-behavior: smooth;
    line-height: 1.6;
}

header img.logo {
    height: 50px;
    margin: 0px;
    padding: 0px;
}

header {
    padding: 20px 8%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: -5%
}

header h1 {
    color: var(--primary);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1px;
}

nav a {
    position: relative;
    margin-left: 20px;
    padding: 8px 14px;
    border-radius: 20px;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    overflow: hidden;
    transition: color .35s ease;
}

nav a::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--primary);
    border-radius: inherit;
    opacity: 0;
    transform: scale(.85);
    transition: opacity .34s ease, transform .35s ease;
    z-index: -1;
}

nav a.this_gallery {
    content: "";
    inset: 0;
    background: var(--primary);
    border-radius: 50px;
    color: white;
}

nav a:hover {
    color: white;
}

nav a:hover::before {
    opacity: 1;
    transform: scale(1);
}

.map-section iframe {
    display: block;
}

/* Previene spazi bianchi */

.hero {
    height: 75vh;
    background: linear-gradient(rgba(44, 51, 51, 0.6), rgba(44, 51, 51, 0.4)), url(img/home.jpg) center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    padding: 0 20px;
}

.hero-content h2 {
    font-size: 4rem;
    margin-bottom: 20px;
    font-family: Georgia, 'Times New Roman', Times, serif;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    padding: 15px 35px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(85, 122, 70, 0.3);
}

.about {
    padding: 80px 10%;
    text-align: center;
    background: #fff;
}

.about h2 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 2.5rem;
}

.about p {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    color: #555;
}

.services {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 80px 10%;
    flex-wrap: wrap;
}

.card {
    background: #fff;
    padding: 40px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    width: 320px;
    text-align: center;
    border-top: 5px solid var(--primary);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.card h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.4rem;
}

/* ARCHITETTURA CSS DELLO SLIDER */
.gallery {
    padding: 80px 10%;
    background: #fff;
    text-align: center;
}

.gallery h2 {
    color: var(--primary);
    margin-bottom: 40px;
    font-size: 2.5rem;
}

.slider-container {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
}

.slider-wrapper {
    overflow: hidden;
    width: 100%;
    padding: 10px 0;
}

.slider-track {
    display: flex;
    gap: 20px;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.slider-track img {
    width: calc((100% - 60px) / 4);
    /* Desktop: 4 foto */
    flex-shrink: 0;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.slider-track img:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.slider-btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    cursor: pointer;
    border-radius: 50%;
    font-size: 1.2rem;
    position: absolute;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.slider-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.prev-btn {
    left: -60px;
}

.next-btn {
    right: -60px;
}

.contact-section {
    padding: 80px 10%;
    text-align: center;
}

.contact-section h2 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.contact-section p {
    margin-bottom: 40px;
    color: #555;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    text-align: left;
}

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: #fdfdfd;
    transition: border-color 0.3s;
}

.input-group textarea {
    font-size: 0.8rem;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
}

.wa-btn {
    width: 100%;
    justify-content: center;
    background: var(--whatsapp);
    font-size: 1.1rem;
}

.wa-btn:hover {
    background: var(--whatsapp-hover);
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.4);
}

/* --- NUOVA SEZIONE ORARI --- */
.orari-section {
    padding: 80px 10%;
    text-align: center;
    background: white;
}

.orari-section h2 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.orari-section p {
    margin-bottom: 40px;
    color: #555;
}

.table-container {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    /* Per stondare gli angoli della tabella */
}

.orari-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.orari-table th {
    background-color: var(--primary);
    color: white;
    padding: 15px;
    font-size: 1.1rem;
}

.orari-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    color: var(--text-dark);
    font-weight: 500;
}

.orari-table tr:last-child td {
    border-bottom: none;
}

.orari-table tr:hover {
    background-color: #f9f9f9;
}

.orari-table .closed-day td {
    color: var(--primary);
    /* Colore rosso per il giorno di chiusura */
    font-weight: bold;
}

/* FOOTER E SOCIAL LINKS */
footer {
    background: var(--text-dark);
    color: #fff;
    text-align: center;
    padding: 50px 20px;
}

footer h3 {
    margin-bottom: 15px;
    color: var(--secondary);
    font-size: 1.5rem;
}

footer p,
footer a {
    color: #ccc;
    text-decoration: none;
    margin-bottom: 5px;
}

footer a:hover {
    color: var(--secondary);
    text-decoration: underline;
}

.social-links {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 25px;
}

.social-links a {
    color: #ccc;
    transition: color 0.3s ease;
    display: inline-flex;
}

.social-links a:hover {
    color: var(--secondary);
}

.social-links svg {
    transition: transform 0.3s ease;
}

.social-links a:hover svg {
    transform: translateY(-4px);
}

.copyright {
    margin-top: 20px;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* TASTO FLUTTUANTE WHATSAPP IN BASSO A SINISTRA */
.wa-floating {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--whatsapp);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: transform 0.3s ease, background 0.3s ease;
}

.wa-floating:hover {
    transform: scale(1.1);
    background: var(--whatsapp-hover);
}

.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);
}

/* --- AGGIUNTE PER ACCESSIBILITÀ --- */
*:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px 15px;
    z-index: 9999;
    transition: top 0.3s;
    text-decoration: none;
    font-weight: bold;
}

.skip-link:focus {
    top: 0;
}

/* --- MENU HAMBURGER --- */
.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    z-index: 1001;
}



/* MEDIA QUERIES RESPONSIVE */
@media (max-width: 1024px) {
    .slider-track img {
        width: calc((100% - 20px) / 2);
        /* Tablet: 2 Foto visibili */
    }

    .prev-btn {
        left: -60px;
    }

    .next-btn {
        right: -60px;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
    }

    nav a {
        margin: 0 10px;
    }

    .hero-content h2 {
        font-size: 2.8rem;
    }

    .contact-form {
        padding: 25px;
    }

    .orari-table th,
    .orari-table td {
        padding: 10px;
        font-size: 0.9rem;
    }

    .contact-forms {
        flex-direction: column;
        align-items: center;
    }

    .contact-box {
        width: 100%;
        max-width: 650px;
    }

    .hamburger {
        display: block;
        position: absolute;
        top: 25px;
        right: 5%;
    }

    #main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #fff;
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.05);
    }

    #main-nav.active {
        max-height: 400px;
        padding: 20px 0;
    }

    #main-nav a {
        margin: 10px 20px;
        display: block;
        width: calc(100% - 40px);
    }
}

@media (max-width: 600px) {
    .slider-track img {
        width: 100%;
        /* Mobile: 1 sola foto a schermo intero */
    }

    .slider-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    .prev-btn {
        left: -10px;
    }

    .next-btn {
        right: -10px;
    }

    /* Riduce la grandezza del tasto WhatsApp su mobile */
    .wa-floating {
        width: 50px;
        height: 50px;
        bottom: 15px;
        left: 15px;
    }

    .wa-floating svg {
        width: 30px;
        height: 30px;
    }
}

/* --- GRIGLIA FOTOGRAFICA (Senza Slider) --- */
.galleria {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 40px;
    margin-bottom: 40px;
}

.photo-grid img {
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
    border-radius: 12px;
}

.photo-grid img:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.galleria h2 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 2.5rem;
    margin-top: 40px;
}

.galleria {
    text-align: center;
}

.galleria p {
    color: #555;
    font-size: 1.5rem;
    font-weight: 500;
}

a .this_gallery {
    color: var(--primary);
    font-weight: bold;
    text-decoration: underline;
}

/* Adatta l'header per schermi intermedi (es. portatili) per evitare overflow */
@media (max-width: 1200px) and (min-width: 769px) {
    header {
        padding: 15px 3%; /* Riduciamo il padding laterale dall'8% al 3% */
    }

    header h1 {
        font-size: 1.4rem; /* Rimpiccioliamo leggermente il titolo */
    }

    nav a {
        margin-left: 8px; /* Avviciniamo i link del menu */
        padding: 6px 10px;
    }

    .logo-container {
        gap: 10px;
        margin-left: 0; /* Rimuoviamo il margine negativo che ruba spazio */
    }
}

/* Sicurezza globale: impedisce in ogni caso lo scroll orizzontale */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}
