/* ===== CSS Variables ===== */
:root {
    --primary: #8B4513;
    --primary-dark: #654321;
    --primary-light: #A0522D;
    --secondary: #D2691E;
    --accent: #CD853F;
    --gold: #D4A574;
    --light: #F5F5DC;
    --cream: #FFF8DC;
    --white: #FFFFFF;
    --dark: #2C1810;
    --text: #4A3728;
    --text-light: #6B5344;
    --gray: #8B7355;
    --border: #D2B48C;
    --shadow: rgba(44, 24, 16, 0.15);
    --shadow-dark: rgba(44, 24, 16, 0.25);
    --transition: all 0.3s ease;
    --radius: 8px;
    --radius-lg: 16px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--text);
    line-height: 1.6;
    background-color: var(--cream);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

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

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

.accent {
    color: var(--primary);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: 0 4px 15px var(--shadow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-dark);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

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

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* ===== Section Styles ===== */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-subtitle {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--primary);
    margin-bottom: 10px;
    position: relative;
    padding: 0 20px;
}

.section-subtitle::before,
.section-subtitle::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40px;
    height: 1px;
    background: var(--border);
}

.section-subtitle::before {
    left: -40px;
}

.section-subtitle::after {
    right: -40px;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.section-description {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== Header ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--white);
    box-shadow: 0 2px 20px var(--shadow);
}

.header-top {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    padding: 8px 0;
}

.header-top .container {
    display: flex;
    justify-content: flex-end;
}

.contact-info {
    display: flex;
    gap: 25px;
}

.contact-info a {
    color: var(--cream);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.contact-info a:hover {
    color: var(--gold);
}

/* ===== Navigation ===== */
.navbar {
    padding: 15px 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.2rem;
}

.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--dark);
}

.logo-accent {
    color: var(--primary);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 35px;
}

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text);
    position: relative;
    padding: 5px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 24px;
    position: relative;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    transition: var(--transition);
}

.hamburger {
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(44, 24, 16, 0.85) 0%, rgba(101, 67, 33, 0.85) 100%),
                url('https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=1920') center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 120px;
}

.hero-content {
    text-align: center;
    color: var(--white);
    max-width: 800px;
    padding: 0 20px;
    animation: fadeInUp 1s ease;
}

.hero-title {
    font-size: 4rem;
    color: var(--white);
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-title .accent {
    color: var(--gold);
}

.hero-subtitle {
    font-size: 1.4rem;
    font-weight: 300;
    margin-bottom: 20px;
    color: var(--cream);
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 35px;
    opacity: 0.9;
}

.hero-cta {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-scroll {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.hero-scroll a {
    color: var(--white);
    font-size: 1.5rem;
    opacity: 0.7;
}

.hero-scroll a:hover {
    opacity: 1;
}

/* ===== Servizi Section ===== */
.servizi {
    padding: 100px 0;
    background: var(--cream);
}

.servizi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.servizio-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: 0 5px 20px var(--shadow);
    transition: var(--transition);
    border-bottom: 4px solid transparent;
}

.servizio-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px var(--shadow-dark);
    border-bottom-color: var(--primary);
}

.servizio-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    color: var(--white);
    font-size: 1.8rem;
}

.servizio-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.servizio-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ===== Chi Siamo Section ===== */
.chi-siamo {
    padding: 100px 0;
    background: var(--white);
}

.chi-siamo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.chi-siamo-content .lead {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 20px;
}

.chi-siamo-content p {
    margin-bottom: 15px;
    color: var(--text-light);
}

.features {
    display: flex;
    gap: 25px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 600;
}

.feature i {
    color: var(--secondary);
}

.chi-siamo-image {
    position: relative;
}

.image-frame {
    position: relative;
}

.image-frame::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100%;
    height: 100%;
    border: 3px solid var(--primary);
    border-radius: var(--radius-lg);
    z-index: -1;
}

.image-placeholder {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    border-radius: var(--radius-lg);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--white);
    gap: 15px;
}

.image-placeholder i {
    font-size: 4rem;
    opacity: 0.8;
}

.image-placeholder span {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
}

/* ===== Stats Section ===== */
.stats {
    padding: 60px 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    text-align: center;
}

.stat-item {
    color: var(--white);
}

.stat-number {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* ===== Lavori/Gallery Section ===== */
.lavori {
    padding: 100px 0;
    background: var(--cream);
}

.gallery-filter {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 25px;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    color: var(--text);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

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

.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4/3;
    background: var(--border);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(44, 24, 16, 0.9) 0%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    opacity: 0;
    transition: var(--transition);
}

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

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

.gallery-overlay h4 {
    color: var(--white);
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.gallery-overlay span {
    color: var(--gold);
    font-size: 0.85rem;
}

.gallery-load-more {
    text-align: center;
    margin-top: 40px;
}

/* ===== Contatti Section ===== */
.contatti {
    padding: 100px 0;
    background: var(--white);
}

.contatti-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 50px;
}

.info-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 25px;
    background: var(--cream);
    border-radius: var(--radius);
    margin-bottom: 20px;
    transition: var(--transition);
}

.info-card:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 20px var(--shadow);
}

.info-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.info-content h4 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.info-content p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.info-content a {
    color: var(--primary);
    font-weight: 500;
}

.info-content a:hover {
    text-decoration: underline;
}

.contatti-form-wrapper {
    background: var(--cream);
    padding: 40px;
    border-radius: var(--radius-lg);
}

.contatti-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--white);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-checkbox {
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
}

.form-checkbox input {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: var(--primary);
}

.form-checkbox label {
    font-size: 0.85rem;
    font-weight: 400;
    margin: 0;
}

/* ===== Footer ===== */
.footer {
    background: var(--dark);
    color: var(--cream);
}

.footer-top {
    padding: 80px 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
}

.footer-brand .logo {
    margin-bottom: 20px;
}

.footer-brand .logo-text {
    color: var(--white);
}

.footer-brand p {
    color: var(--gray);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: var(--transition);
}

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

.footer-links h4,
.footer-contact h4 {
    color: var(--white);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--gray);
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--gold);
    padding-left: 5px;
}

.footer-contact p {
    color: var(--gray);
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.footer-contact i {
    color: var(--primary);
    margin-right: 10px;
    width: 20px;
}

.footer-contact a {
    color: var(--gray);
}

.footer-contact a:hover {
    color: var(--gold);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 25px 0;
    text-align: center;
}

.footer-bottom p {
    color: var(--gray);
    font-size: 0.85rem;
}

.footer-bottom a {
    color: var(--gray);
    text-decoration: underline;
}

.footer-bottom a:hover {
    color: var(--gold);
}

/* ===== Lightbox ===== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-img {
    max-width: 90%;
    max-height: 85vh;
    border-radius: var(--radius);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: none;
    border: none;
    color: var(--white);
    font-size: 2rem;
    cursor: pointer;
    padding: 10px;
    transition: var(--transition);
}

.lightbox-close {
    top: 20px;
    right: 30px;
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    color: var(--gold);
}

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .chi-siamo-grid,
    .contatti-grid {
        grid-template-columns: 1fr;
    }

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

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

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 130px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 130px);
        background: var(--white);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 50px;
        gap: 25px;
        transition: var(--transition);
    }

    .nav-menu.active {
        left: 0;
    }

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

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

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .features {
        flex-direction: column;
        gap: 15px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    .info-card {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .header-top .container {
        justify-content: center;
    }

    .contact-info {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }

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

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .gallery-filter {
        gap: 8px;
    }

    .filter-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
    }

    .contatti-form-wrapper {
        padding: 25px;
    }
}
