/* Cleaned stylesheet — fixes: moved :root to top, removed nested rules, removed duplicates, corrected braces */
:root{
    --bg: #f5f6f7; /* page background */
    --surface: #ffffff;
    --text: #111217;
    --muted: #6b7280;
    --accent: #000000; /* professional teal */
    --panel: #58595a; /* dark panel used for header */
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

/* global box-sizing to avoid sizing issues on small screens */
*, *::before, *::after { box-sizing: border-box; }

/* Responsive rules — preserve layout and sizes, prevent overflow */
@media (max-width: 1024px) {
    .header-inner { padding: 0 16px; }
    .services-grid { gap: 12px; }
}

@media (max-width: 800px) {
    /* keep header centered but stack items to avoid overlap */
    .header-inner { flex-direction: column; align-items: center; gap: 10px; }
    /* hide wide nav, keep hamburger for navigation */
    .main-nav { display: none; }
    .menu-btn { display: inline-flex; }
    /* scale down large images slightly to fit narrow screens */
    .main-logo { max-height: 380px; }
    .carousel img { width: 160px; }
    /* services -> single column but same card sizes */
    .services-grid { grid-template-columns: 1fr; }
    .hours-grid { grid-template-columns: 1fr; }
    .sidebar { width: 240px; }
}

@media (max-width: 480px) {
    /* small phones adjustments */
    .menu-btn { left: 12px; top: 14px; }
    .main-logo { max-height: 280px; }
    .carousel img { width: 120px; }
    .contact-btn { padding: 10px 14px; }
    .topbar-inner { padding: 6px 10px; }
    .sidebar { width: 220px; }
    .hero { padding: 36px 12px; }
}

/* Topbar */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid rgba(16,24,40,0.06);
    color: var(--text);
    font-size: 14px;
}
.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 20px;
}
.topbar a { color: var(--accent); text-decoration: none; }
.top-logo { width: 28px; height: 28px; opacity: 0.9 }

/* Hamburger button */
.menu-btn {
    position: fixed;
    top: 22px;
    left: 20px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid rgba(16,24,40,0.06);
    font-size: 22px;
    cursor: pointer;
    z-index: 2000;
    padding: 8px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(16,24,40,0.06);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100%;
    background: var(--panel);
    transform: translateX(-110%);
    transition: transform 0.28s cubic-bezier(.2,.8,.2,1);
    padding-top: 72px;
    z-index: 1999;
    box-shadow: 2px 0 20px rgba(2,6,23,0.5);
}
.sidebar.open { transform: translateX(0); }
.sidebar a {
    display: block;
    padding: 14px 20px;
    color: #dceef2;
    text-decoration: none;
    font-size: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.sidebar a:last-child { border-bottom: none; }

/* Dropdown (nav) */
.dropdown { position: relative; }
.dropbtn { background: transparent; color: var(--accent); border: none; padding: 8px 12px; cursor: pointer; font-size: 16px; }
.dropdown .dropdown-content {
    display: none;
    position: absolute;
    background-color: #111;
    min-width: 180px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.25);
    z-index: 2100;
    border-radius: 6px;
    right: 0;
}
.dropdown .dropdown-content a { color: #dceef2; padding: 10px 14px; display: block; text-decoration: none; }
.dropdown:hover .dropdown-content { display: block; }

/* Header / centered logo */
#header { text-align: center; padding: 18px 0; background: var(--panel); }
.header-inner { max-width: 900px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.main-logo { display: block; margin: 8px auto 0 auto; max-width: 92%; height: auto; max-height: 460px; box-shadow: 0 6px 30px rgba(2,6,23,0.45); border-radius: 6px; }
.main-nav { display: flex; gap: 18px; }
.main-nav a { color: var(--accent); text-decoration: none; padding: 8px 12px; }
.main-nav a:hover { background: rgba(0,0,0,0.04); border-radius: 6px; }

/* Modal */
.modal { position: fixed; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.8); display:none; align-items:center; justify-content:center; z-index: 9999; }
.modal img { max-width:90%; max-height:90%; border-radius:10px; box-shadow: 0 0 20px rgba(0,0,0,0.6); }

/* gallery/lightbox removed — using hero slider + modal */

/* Reveal animations */
.reveal { opacity: 0; transform: translateY(18px) scale(.995); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.8,.2,1); }
.in-view { opacity: 1; transform: translateY(0) scale(1); }

/* Scroll-top default (JS sets inline, but provide a fallback) */
.scroll-top { transition: opacity .24s ease, transform .18s ease; }

/* Mini-map */
.mini-map { text-align: center; margin: 40px 0; }
.mini-map iframe { width: 90%; max-width: 600px; height: 320px; border: none; border-radius: 10px; box-shadow: 0 0 20px rgba(0,0,0,0.06); }
.mini-map p { color: var(--muted); margin-top: 10px; }

@media (max-width: 480px) { .mini-map iframe { height: 220px; } }

/* Hero / CTA */
.hero { text-align: center; padding: 0; background: transparent; }
.hero-inner { max-width: none; margin: 0 auto; color: var(--text); }
.hero h1 { font-size: 2.4em; color: var(--surface); margin-bottom: 10px; color: rgb(8, 8, 8); }
.hero p { color: var(--muted); margin-bottom: 18px; }
.intro-hero {
    position: relative;
    width: 100vw;
    min-height: 485px;
    margin-left: 50%;
    transform: translateX(-50%);
    padding: 40px 20px 78px;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.intro-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url('locale1.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center 10%;
    filter: blur(1px);
    transform: scale(1.02);
    z-index: 0;
}
.intro-box {
    position: relative;
    width: min(100%, 560px);
    margin: 0 auto;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.82);
    padding: 16px 18px;
    border-radius: 10px;
    color: #ffffff;
    z-index: 1;
}
.intro-box h1 {
    color: #ffffff;
    margin-bottom: 8px;
    font-size: 1.72em;
    text-shadow: 0 2px 12px rgba(0,0,0,0.45);
}
.intro-box p {
    color: rgba(255,255,255,0.98);
    margin: 6px 0;
    line-height: 1.5;
    font-size: 0.88rem;
    text-shadow: 0 1px 10px rgba(0,0,0,0.42);
}

.method-hero {
    position: relative;
    width: 100vw;
    min-height: 400px;
    margin-top: 12px;
    margin-left: 50%;
    transform: translateX(-50%);
    padding: 42px 20px 56px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.method-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url('locale5.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    filter: blur(1px);
    transform: scale(1.02);
    z-index: 0;
}
.method-box {
    position: relative;
    width: min(100%, 540px);
    margin: 0 auto;
    padding: 16px 18px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.82);
    border-radius: 10px;
    color: #ffffff;
    z-index: 1;
}
.method-box h2 {
    margin: 0 0 8px;
    color: #ffffff;
    text-align: center;
    font-size: 1.65em;
    text-shadow: 0 2px 12px rgba(0,0,0,0.45);
}
.method-box p {
    margin: 0;
    color: rgba(255,255,255,0.98);
    text-align: center;
    line-height: 1.5;
    font-size: 0.88rem;
    text-shadow: 0 1px 10px rgba(0,0,0,0.42);
}

.location-hero {
    position: relative;
    --location-bg-y: 0%;
    width: 100vw;
    min-height: clamp(320px, 42vw, 520px);
    margin-top: 16px;
    margin-left: 50%;
    transform: translateX(-50%);
    padding: 28px 20px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.location-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(0,0,0,0.14), rgba(0,0,0,0.38)), url('locale2.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center var(--location-bg-y);
    filter: blur(0.8px);
    transform: scale(1.015);
    z-index: 0;
}
.location-content {
    position: relative;
    z-index: 1;
    width: min(100%, 620px);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ffffff;
}
.location-content h2 {
    margin: 0 0 10px;
    color: #ffffff;
    font-size: 1.9em;
    text-shadow: 0 2px 14px rgba(0,0,0,0.45);
}
.location-content p {
    margin: 0 auto 20px;
    color: rgba(255,255,255,0.97);
    line-height: 1.6;
    font-size: 0.94rem;
    text-shadow: 0 1px 10px rgba(0,0,0,0.4);
}
.location-btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 999px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.34);
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 26px rgba(2,6,23,0.18);
}

.location-gallery-section {
    position: relative;
    padding: 18px 12px 26px;
    overflow: hidden;
}
.location-gallery-shell {
    --location-gallery-bg-image: url('locale2.jpg');
    max-width: 1240px;
    margin: 0 auto;
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) 62px;
    align-items: center;
    gap: 12px;
}
.location-gallery-shell::before {
    content: "";
    position: absolute;
    top: -28px;
    bottom: -28px;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    background-image: linear-gradient(rgba(255,255,255,0.08), rgba(15,23,42,0.12)), var(--location-gallery-bg-image);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    filter: blur(12px);
    opacity: 0.5;
    z-index: 0;
}
.location-gallery-stage {
    position: relative;
    min-height: clamp(380px, 68vh, 860px);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
.location-gallery-stage::before {
    content: none;
}
.location-gallery-stage::after {
    content: none;
}
.location-gallery-image-button {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: inherit;
    border: none;
    background: transparent;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
}
.location-gallery-image {
    display: block;
    width: auto;
    max-width: min(100%, 1020px);
    max-height: clamp(340px, 62vh, 780px);
    height: auto;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}
.location-gallery-arrow {
    width: auto;
    height: auto;
    border: none;
    border-radius: 0;
    background: transparent;
    color: rgba(107, 114, 128, 0.78);
    font-size: 2.2rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0 6px;
    z-index: 1;
    text-shadow: 0 1px 10px rgba(255,255,255,0.2);
}
.location-gallery-note {
    margin: 14px auto 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.92rem;
}

.location-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.9);
    display: none;
    z-index: 10000;
}
.location-lightbox.open {
    display: block;
}
.location-lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    color: #ffffff;
    font-size: 1.7rem;
    cursor: pointer;
    z-index: 2;
}
.location-lightbox-toolbar {
    position: absolute;
    top: 18px;
    left: 18px;
    display: flex;
    gap: 10px;
    z-index: 2;
}
.location-lightbox-tool {
    min-width: 52px;
    height: 42px;
    border: none;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    padding: 0 16px;
}
.location-lightbox-viewport {
    position: absolute;
    inset: 0;
    padding: 88px 24px 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
    cursor: grab;
}
.location-lightbox-viewport.dragging {
    cursor: grabbing;
}
.location-lightbox-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transform-origin: center center;
    will-change: transform;
    user-select: none;
    -webkit-user-drag: none;
}
body.location-lightbox-open {
    overflow: hidden;
}

@media (max-width: 720px) {
    .location-gallery-section {
        padding: 16px 10px 24px;
    }

    .location-gallery-shell {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .location-gallery-stage {
        min-height: clamp(260px, 48vh, 430px);
        padding: 0 42px;
    }

    .location-gallery-image-button {
        min-height: 100%;
    }

    .location-gallery-image {
        max-width: 100%;
        max-height: clamp(240px, 42vh, 380px);
    }

    .location-gallery-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: 999px;
        background: rgba(255,255,255,0.72);
        color: rgba(17,24,39,0.82);
        box-shadow: 0 10px 24px rgba(15,23,42,0.12);
        text-shadow: none;
        z-index: 2;
    }

    .location-gallery-arrow.prev {
        left: 4px;
    }

    .location-gallery-arrow.next {
        right: 4px;
    }

    .location-lightbox-toolbar {
        max-width: calc(100% - 84px);
        flex-wrap: wrap;
    }
}

@media (max-width: 560px) {
    .intro-hero {
        min-height: 340px;
        padding: 24px 14px 48px;
    }

    .intro-box {
        width: min(100%, 470px);
        padding: 14px 12px;
    }

    .intro-box h1 {
        font-size: 1.45em;
    }

    .intro-box p {
        font-size: 0.84rem;
    }

    .method-hero {
        min-height: 320px;
        padding: 28px 14px 40px;
    }

    .method-box {
        width: min(100%, 470px);
        padding: 14px 12px;
    }

    .method-box h2 {
        font-size: 1.4em;
    }

    .method-box p {
        font-size: 0.84rem;
    }

    .location-hero {
        min-height: 340px;
        padding: 24px 14px;
    }

    .location-content {
        width: min(100%, 460px);
    }

    .location-content h2 {
        font-size: 1.55em;
    }

    .location-content p {
        font-size: 0.86rem;
        margin-bottom: 18px;
    }

    .location-btn {
        padding: 11px 18px;
    }

    .location-gallery-section {
        padding: 12px 6px 18px;
    }

    .location-gallery-shell {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .location-gallery-stage {
        min-height: clamp(220px, 42vh, 340px);
        padding: 0 34px;
    }

    .location-gallery-image {
        max-height: clamp(200px, 36vh, 300px);
    }

    .location-gallery-arrow {
        width: 34px;
        height: 34px;
        font-size: 1.25rem;
    }

    .location-gallery-note {
        font-size: 0.82rem;
        padding: 0 8px;
    }

    .location-lightbox-toolbar {
        top: 12px;
        left: 10px;
        right: 56px;
        gap: 6px;
    }

    .location-lightbox-tool {
        min-width: 42px;
        height: 36px;
        padding: 0 10px;
    }

    .location-lightbox-close {
        top: 12px;
        right: 10px;
        width: 40px;
        height: 40px;
    }

    .location-lightbox-viewport {
        padding: 72px 10px 16px;
    }
}
.contact-btn { background: var(--accent); color: #fff; padding: 12px 20px; border-radius: 8px; text-decoration: none; font-weight: 700; box-shadow: 0 6px 18px rgba(0,166,166,0.12); }

/* Services */
.section-title, .about-title {
    text-align: center;
    color: var(--accent);
    margin: 40px auto 18px;
    max-width: 1100px;
}
.services { padding: 20px 10px 40px 10px; }
.services-grid { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 16px; }
.service { background: var(--surface); padding: 20px; border-radius: 10px; color: var(--text); text-align: center; box-shadow: 0 6px 18px rgba(16,24,40,0.06); border: 1px solid rgba(16,24,40,0.03); }

/* Price card tweaks for prezziario */
.services-grid { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 16px; }
.service img { width: 100%; height: 140px; object-fit: cover; border-radius: 8px; margin-bottom: 10px; }
.service h3 { margin: 6px 0; font-size: 1.05em; }
.service .price { font-weight: 800; color: var(--accent); margin-top: 6px; }
.service .service-desc { color: var(--muted); font-size: 0.92em; margin-top: 6px; }

/* Reviews UI */
.reviews-section { padding: 28px 12px 48px; }
.review-form { max-width: 820px; margin: 0 auto; background: var(--surface); padding: 18px; border-radius: 10px; box-shadow: 0 8px 30px rgba(2,6,23,0.06); }
.review-form label { display: block; margin: 8px 0 6px; color: var(--text); }
.review-form textarea { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid rgba(16,24,40,0.06); resize: vertical; }
.review-form input[type="text"], .review-form input[type="file"] { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid rgba(16,24,40,0.06); }
.stars { display: flex; gap: 6px; justify-content: center; margin: 10px 0; }
.star { background: transparent; border: none; font-size: 28px; cursor: pointer; color: #ffb400; }
.review-actions { display:flex; gap:8px; justify-content:center; margin-top:8px; }
.review-note { font-size: 0.9em; color: var(--muted); text-align:center; margin-top:10px; }

/* Recensioni page */
.recensioni-controls { display:flex; gap:8px; align-items:center; justify-content:center; margin: 10px 0 18px; }
.average-rating { text-align:center; font-size:1.05em; margin-bottom: 12px; }
.review-list { max-width: 900px; margin: 0 auto; display:flex; flex-direction:column; gap:12px; }
.review-item { background: var(--surface); padding: 12px; border-radius: 8px; border: 1px solid rgba(16,24,40,0.04); }
.review-stars { font-size: 18px; color: #ffb400; margin-bottom:6px; }
.review-text { color: var(--text); margin-bottom:6px; }
.review-meta { font-size:0.85em; color: var(--muted); }

/* Hours */
.hours { padding: 20px 10px 60px 10px; }
.hours-grid { max-width: 600px; margin: 0 auto; display: grid; grid-template-columns: 1fr; gap: 8px; }
.day { display:flex; justify-content:space-between; background: var(--surface); padding:10px 14px; border-radius:8px; color:var(--text); border:1px solid rgba(16,24,40,0.04); }

/* Prenota area under Hours */
.hours .prenota-title { text-align: center; color: var(--accent); margin: 20px auto 6px; }
.hours .prenota-text { max-width: 760px; margin: 0 auto 12px; color: var(--muted); text-align: center; }
.hours-cta { text-align: center; margin-top: 8px; }
.hours-cta .contact-btn, .hours-cta #prenota-btn { display: inline-block; padding: 12px 20px; }

/* Background panel behind the hours grid */
.hours-band {
    position: relative;
    width: min(100% - 24px, 820px);
    margin: 0 auto;
    aspect-ratio: 3 / 4;
    padding: 36px 22px 40px;
    box-sizing: border-box;
    border-radius: 18px;
    overflow: hidden;
    isolation: isolate;
    box-shadow: 0 18px 42px rgba(2,6,23,0.16);
    display: flex;
    align-items: center;
    justify-content: center;
}
.hours-band::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url('locale4.jpg');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    filter: blur(2px);
    transform: scale(1.01);
    z-index: 0;
}
.hours-band .hours-grid {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
.hours-band .day {
    background: rgba(255,255,255,0.72);
    border: 1px solid rgba(255,255,255,0.48);
    box-shadow: 0 8px 24px rgba(2,6,23,0.16);
}

@media (max-width: 560px) {
    .hours-band {
        width: min(100% - 16px, 820px);
        padding: 28px 10px 32px;
        border-radius: 14px;
    }
}


/* Footer / misc */
.reviews { max-width: 800px; margin: 0 auto; padding: 20px; }
.review { background: #fff; margin: 20px 0; padding: 20px; border-radius: 10px; box-shadow: 0 6px 18px rgba(16,24,40,0.06); }

h1 { text-align: center; font-size: 2.5em; margin: 40px 0 20px 0; color: var(--text); }
p { line-height: 1.6; margin: 20px 0; text-align: center; color: var(--muted); }

/* Origin paragraph formatting: centered, tighter lines, respect newline breaks */
.origin-text {
    text-align: center;
    line-height: 1.18;
    max-width: 900px;
    margin: 8px auto 20px;
    white-space: normal;
}

/* Contacts specific styling: keep centered block but left-align inner items for readability */


/* Small inline social item with aligned icon */
.contact-social { display: inline-flex; align-items: center; gap: 8px; }
.social-icon { width: 18px; height: auto; display: inline-block; }

@media (max-width: 800px) { .main-nav { display: none; } .top-center { display: none; } .topbar-inner { padding: 8px 12px; } }
