/* --- IMPOSTAZIONI GLOBALI E PALETTE COLORI --- */
:root {
    --primary-color: #ffffff;
    --secondary-color: #d32c20;
    --background-color: #f8c96a;
    --text-color: #37474F;
    --light-text-color: #FFFFFF;
    --footer-background: #263238;
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Lato', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; height: 100%; }

/* SOLUZIONE PER IL FOOTER FLUTTUANTE */
body {
    font-family: var(--font-body);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
main {
    flex-grow: 1;
}
/* FINE SOLUZIONE FOOTER */

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; }
a { color: var(--secondary-color); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: #000000; }

/* --- HEADER CON ANIMAZIONE A SCOMPARSA --- */
.main-header {
    background-color: #fff;
    padding: 20px 0;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: top 0.4s ease-in-out;
}
.main-header.header-hidden {
    top: -150px;
}
.main-header .container { display: flex; justify-content: space-between; align-items: center; }
.logo img { max-height: 60px; display: block; transition: max-height 0.3s ease; }

/* --- MENU DI NAVIGAZIONE (DESKTOP) --- */
.main-nav { display: block; }
.main-nav ul { list-style: none; display: flex; gap: 35px; }
.main-nav a { text-decoration: none; color: var(--text-color); font-weight: 600; position: relative; }
.main-nav a::after { content: ''; position: absolute; width: 0; height: 2px; bottom: -5px; left: 0; background-color: var(--secondary-color); transition: width 0.3s ease; }
.main-nav a:hover::after { width: 100%; }

/* --- SEZIONE HERO CON SFONDO E PARALLASSE --- */
.hero {
    padding: 100px 0;
    color: var(--light-text-color);
    text-align: center;
    position: relative;
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('images/indexFOTO/hero-image.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}
.hero-content {
    position: relative;
    z-index: 2;
}
.hero-text {
    max-width: 800px;
    margin: 0 auto;
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.2s forwards;
}
.hero-text h1 {
    font-size: 52px;
    line-height: 1.2;
    margin-bottom: 20px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
}
.hero-text p {
    font-size: 20px;
    margin-bottom: 40px;
}
.discover-button {
    background-color: var(--primary-color);
    color: #333;
    padding: 18px 40px;
    font-size: 18px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-family: var(--font-heading);
    display: inline-block;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.discover-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}
.discover-button:active {
    transform: translateY(0) scale(1);
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

/* --- SEZIONE CHI SIAMO NELLA HOME --- */
.about-section { padding: 80px 0; background-color: #fff; }
.about-content { display: flex; align-items: center; gap: 40px; }
.about-images {
    flex: 1.5;
    display: flex;
    align-items: center;
    gap: 20px;
}
.image-wrapper-curved {
    flex: 1.5;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.image-wrapper-square {
    flex: 1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.about-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.about-text { flex: 1; }
.about-text h2 { font-size: 36px; margin-bottom: 10px; }
.about-text h3 { font-size: 20px; font-weight: 400; color: #777; margin-bottom: 20px; }
.about-text p { line-height: 1.8; }

/* --- SEZIONE SERVIZI --- */
.services { padding: 80px 0; text-align: center; background-color: var(--background-color); }
.services h2 { font-size: 36px; margin-bottom: 50px; }
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
.service-card { background-color: #fff; border: 1px solid #eee; border-radius: 15px; overflow: hidden; text-decoration: none; color: var(--text-color); box-shadow: 0 5px 15px rgba(0,0,0,0.05); transition: transform 0.3s ease, box-shadow 0.3s ease; display: flex; flex-direction: column; text-align: left; }
.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}
.service-card img { width: 100%; height: 200px; object-fit: cover; }
.service-card .card-content { padding: 25px; flex-grow: 1; display: flex; flex-direction: column; }
.service-card h3 { margin-bottom: 10px; }
.service-card p { flex-grow: 1; margin-bottom: 15px; }
.service-card span {
    font-weight: 700;
    color: var(--secondary-color);
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* --- NUOVA SEZIONE ORARI DI APERTURA --- */
.work-hours-section {
    background-color: #fff;
    padding: 60px 0;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}
.work-hours-section svg {
    width: 40px;
    height: 40px;
    stroke: var(--secondary-color);
    margin-bottom: 15px;
}
.work-hours-section h2 {
    font-size: 32px;
    margin-bottom: 20px;
}
.hours-list p {
    font-size: 18px;
    line-height: 1.7;
    margin-bottom: 5px;
}
.hours-list strong {
    color: var(--text-color);
}

/* --- FOOTER --- */
.main-footer { background-color: var(--footer-background); color: rgba(255, 255, 255, 0.8); text-align: center; padding: 40px 20px; }

/* --- STILI PER LE ALTRE PAGINE (PORTFOLIO, CONTATTI) --- */
.page-header { text-align: center; padding: 60px 0; background-color: #fff; }
.page-header h1 { font-size: 42px; }
.content-section { padding: 80px 0; }

/* MODIFICA: Griglia Portfolio più stretta e alta */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Colonne più strette */
    gap: 25px;
}
.portfolio-grid img {
    width: 100%;
    height: 350px; /* Immagini più alte */
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}
.portfolio-grid img:hover { transform: scale(1.05); box-shadow: 0 8px 20px rgba(0,0,0,0.15); }

/* Regola per la galleria verticale (porte) */
.portfolio-grid-vertical {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}
.portfolio-grid-vertical img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}
.portfolio-grid-vertical img:hover { transform: scale(1.05); box-shadow: 0 8px 20px rgba(0,0,0,0.15); }

/* --- STILI PAGINA CONTATTI --- */
.contact-info-wrapper {
    background-color: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    margin-bottom: 60px;
}
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 40px; }
.contact-item { text-align: center; }
.contact-item svg { width: 40px; height: 40px; stroke: var(--secondary-color); margin-bottom: 15px; }
.contact-item h4 { font-size: 20px; margin-bottom: 10px; color: var(--primary-color); }
.contact-item p { font-size: 16px; line-height: 1.5; color: var(--text-color); word-break: break-all; }
.contact-item a { color: var(--text-color); }
.contact-item a:hover { color: #000000; text-decoration: underline; }
.section-divider {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 40px auto;
    width: 80%;
}
.map-container { margin-top: 40px; }
.map-container iframe { width: 100%; height: 450px; border: none; border-radius: 12px; }

/* --- NUOVO MENU HAMBURGER E RESPONSIVE --- */
.hamburger-menu { display: none; background: none; border: none; cursor: pointer; width: 24px; height: 24px; position: relative; z-index: 1001; }
.hamburger-menu span { display: block; width: 100%; height: 2px; background-color: var(--text-color); border-radius: 2px; position: absolute; left: 0; transition: all 0.3s ease-in-out; }
.hamburger-menu span:nth-child(1) { top: 4px; }
.hamburger-menu span:nth-child(2) { top: 11px; }
.hamburger-menu span:nth-child(3) { top: 18px; }
body.menu-open .hamburger-menu span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.menu-open .hamburger-menu span:nth-child(2) { opacity: 0; }
body.menu-open .hamburger-menu span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); opacity: 0; visibility: hidden; transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out; z-index: 998; }
body.menu-open .overlay { opacity: 1; visibility: visible; }

/* NUOVA REGOLA: Pulsante "Torna Su" */
.back-to-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--secondary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 990;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}
.back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top-btn:hover {
    background-color: #a02318;
}

/* --- STILI LIGHTBOX --- */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 15px;
}
.lightbox.active {
    opacity: 1;
    visibility: visible;
}
.lightbox-content {
    max-width: 90%;
    max-height: 85%;
    position: relative;
}
.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    display: block;
    border-radius: 4px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
}
.lightbox-close {
    position: absolute;
    top: -45px;
    right: 0;
    font-size: 45px;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    line-height: 1;
}

@media (min-width: 851px) {
    .logo img { max-height: 80px; }
}

@media (max-width: 850px) {
    .main-nav { position: fixed; top: 0; right: 0; width: 280px; height: 100vh; background-color: #fff; box-shadow: -5px 0 15px rgba(0,0,0,0.1); transform: translateX(100%); transition: transform 0.4s ease-in-out; z-index: 999; padding-top: 100px; }
    body.menu-open .main-nav { transform: translateX(0); }
    .main-nav ul { flex-direction: column; gap: 0; align-items: center; }
    .main-nav li { width: 100%; }
    .main-nav a { display: block; padding: 20px; text-align: center; font-size: 18px; }
    .main-nav a:hover { background-color: #f5f5f5; }
    .main-nav a::after { display: none; }
    .hamburger-menu { display: block; }
    .hero-content, .about-content { flex-direction: column; text-align: center; }
    .about-images { order: -1; margin-bottom: 40px; }
    .hero-text h1 { font-size: 38px; }
    .hero-text p { font-size: 18px; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}