:root {
    --primary: #efbe00;
    --dark-text: #2e241d;
    --dark-bg: #2e241d;
    --info-bg: #5f4c3f;
    --footer-text: #e0e0e0;
    --white: #ffffff;
}

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

body {
    font-family: 'Signika', sans-serif;
    color: #666;
    line-height: 1.6;
    overflow-x: hidden;
    background-color: var(--white);
    scroll-behavior: smooth;
}

h1,
h2,
h3,
h4 {
    color: var(--dark-text);
    font-weight: 700;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2.8rem;
    line-height: 1.1;
    letter-spacing: -1px;
}

h2 {
    font-size: 2.2rem;
}

h3 {
    font-size: 1.4rem;
    color: var(--primary);
    font-weight: 400;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

p {
    margin-bottom: 1.2rem;
    text-align: justify;
    font-size: 1.05rem;
}

/* --- NAVIGAZIONE DESKTOP --- */
#nav-wrap {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 2000;
    background: var(--dark-bg);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    min-height: 60px;
}

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

ul#nav li a {
    display: block;
    color: var(--white);
    text-decoration: none;
    padding: 20px 20px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.8s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

ul#nav li a.active {
    background-color: var(--primary);
    color: var(--dark-text) !important;
}

/* --- HEADER & LOGO --- */
header {
    height: 80vh;
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.5)),
        url('../images/header-background.jpg') no-repeat center center / cover;
    display: flex;
    align-items: center;
    justify-content: center;
}

#logo-header {
    width: 320px;
    max-width: 70%;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
    transition: width 0.3s ease;
}

@media (min-width: 1001px) {
    #logo-header {
        width: 30vw;
    }
}

/* --- LAYOUT SEZIONI --- */
.section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px;
    display: flex;
    align-items: flex-start;
    gap: 50px;
}

.sectionpic {
    flex: 0 0 300px;
    text-align: center;
}

.sectionpic img {
    width: 300px;
    height: auto;
    border-radius: 8px;
}

.paragrafoservizi {
    flex: 1;
}

/* --- ACCORDION --- */
.accordion-container {
    margin-top: 30px;
}

.expandContent {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}

.servizio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    cursor: pointer;
    color: var(--dark-text);
    font-weight: 600;
    font-size: 1.1rem;
}

.servizio-header i {
    color: var(--primary);
    transition: transform 0.4s ease;
}

.servizio-header.active i {
    transform: rotate(180deg);
}

.expandedContent {
    max-height: 0;
    opacity: 0;
    padding: 0 25px;
    border-top: 1px solid transparent;
    overflow: hidden;
    transition: max-height 1.0s cubic-bezier(0.4, 0, 0.2, 1), padding 1.0s cubic-bezier(0.4, 0, 0.2, 1), opacity 1.0s cubic-bezier(0.4, 0, 0.2, 1), border-top 1.0s cubic-bezier(0.4, 0, 0.2, 1);
}

.expandedContent.show {
    max-height: 2500px;
    opacity: 1;
    padding: 10px 25px 30px 25px;
    border-top: 1px solid #eee;
}

.expandedContent p,
.expandedContent div,
.expandedContent ul,
.expandedContent li {
    text-align: left;
}

/* --- CAROSELLO DISSOLVENZA --- */
.carousel-container {
    position: relative;
    width: 100%;
    margin-top: 20px;
    border-radius: 6px;
    overflow: hidden;
}

.carousel-container img {
    width: 100%;
    display: block;
    transition: opacity 1s ease-in-out;
}

.carousel-container img:not(:first-child) {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}

/* --- INFO & FOOTER --- */
#info {
    background-color: var(--info-bg);
    color: var(--footer-text);
}

#map-container {
    height: 400px;
    width: 100%;
}

#map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.footerbox {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.footerbox h4 {
    color: var(--white);
    font-size: 16px;
    text-transform: uppercase;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
    width: 100%;
    text-align: center;
}

.footerbox h4::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background-color: var(--primary);
}

.footerbox p,
.footerbox a,
.footerbox div {
    color: var(--footer-text);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.8;
    width: 100%;
    text-align: center;
    transition: color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.footerbox a:hover {
    color: var(--primary);
}

.social-links {
    width: 100%;
    text-align: center;
}

.social-links a {
    display: block;
    margin-bottom: 10px;
    transition: color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.credits {
    background: var(--dark-bg);
    color: #aaa;
    text-align: center;
    padding: 20px;
    font-size: 13px;
    border-top: 1px solid #444;
}

.credits a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.credits a:hover {
    color: var(--primary);
}

/* --- MOBILE --- */
.menu-toggle {
    display: none;
    background-color: var(--primary);
    color: var(--white);
    width: 50px;
    height: 50px;
    align-items: center;
    justify-content: center;
    position: fixed;
    right: 20px;
    top: 20px;
    z-index: 4000;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
}

.menu-toggle:active {
    transform: scale(0.9);
}

.menu-toggle i {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-toggle.active i {
    transform: rotate(180deg);
}

@media (max-width: 767px) {
    #nav-wrap {
        background: transparent;
        pointer-events: none;
    }

    .menu-toggle {
        display: flex;
    }

    ul#nav {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background: rgba(46, 36, 29, 0.98);
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        z-index: 3000;
        pointer-events: auto;
        
        /* Animazione in sola dissolvenza */
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                    visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    }

    ul#nav.open {
        opacity: 1;
        visibility: visible;
    }

    ul#nav li a {
        font-size: 2rem;
        padding: 20px;
        color: var(--white);
    }

    ul#nav li a.active {
        background-color: transparent;
        color: var(--primary) !important;
    }

    .section {
        flex-direction: column;
        text-align: center;
        padding: 50px 40px;
        align-items: center;
    }

    .sectionpic {
        flex: 0 0 auto;
        width: 100%;
        margin-bottom: 0;
    }

    .sectionpic img {
        max-width: 250px;
        width: 100%;
        margin: 0 auto;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}
