/* ============================================
   TRAILGO — Portale Pubblico
   CSS Globale — Tutte le pagine
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ——— VARIABLES ——— */
:root {
    --green-dark: #1a5c38;
    --green: #2d8659;
    --green-light: #3aaf6e;
    --green-bg: #f0f8f4;
    --blue: #1565C0;
    --blue-light: #42A5F5;
    --orange: #E65100;
    --orange-light: #FF8F00;
    --purple: #7B1FA2;
    --text-dark: #1f3a3a;
    --text: #2c3e50;
    --text-muted: #6c757d;
    --bg: #f8f9fa;
    --white: #ffffff;
    --border: #e0e4e8;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

/* ——— RESET & BASE ——— */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
/* NB: niente overflow-x sul body, altrimenti diventa scroll container e rompe position:sticky della navbar */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

a { color: var(--green); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--green-dark); }
img { max-width: 100%; height: auto; }

/* ============================================
   NAVBAR
   ============================================ */
.navbar-trailgo {
    background: var(--white);
    border-bottom: 3px solid var(--green);
    box-shadow: var(--shadow-sm);
    padding: 8px 0;
    z-index: 1050;
}

.navbar-trailgo .navbar-brand {
    text-decoration: none;
}

.brand-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--green-dark), var(--green-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(45,134,89,0.3);
}
.brand-logo {
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}
/* Logo swap: white version hidden by default */
.brand-logo-white { display: none !important; }
.brand-logo-color { display: inline-block !important; }
/* When navbar is transparent (hero): show white, hide color */
.navbar-trailgo.navbar-transparent .brand-logo-white { display: inline-block !important; }
.navbar-trailgo.navbar-transparent .brand-logo-color { display: none !important; }
/* When scrolled: back to color logo */
.navbar-trailgo.navbar-transparent.scrolled .brand-logo-white { display: none !important; }
.navbar-trailgo.navbar-transparent.scrolled .brand-logo-color { display: inline-block !important; }

.brand-text {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.5px;
}

.navbar-trailgo .nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: #4b5563 !important;
    padding: 8px 14px !important;
    border-radius: 6px;
    position: relative;
    transition: var(--transition);
}

.navbar-trailgo .nav-link:hover {
    color: var(--green) !important;
    background: var(--green-bg);
}

.navbar-trailgo .nav-link.active {
    color: var(--green) !important;
    font-weight: 600;
}

.navbar-trailgo .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--green);
    border-radius: 2px;
}

.navbar-trailgo .navbar-toggler {
    border: none;
    padding: 6px 10px;
}

.navbar-trailgo .navbar-toggler:focus {
    box-shadow: 0 0 0 2px rgba(45,134,89,0.3);
}

.navbar-trailgo .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%232d8659' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

@media (max-width: 991px) {
    .navbar-trailgo .nav-link.active::after { display: none; }
    .navbar-trailgo .navbar-nav { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
    .navbar-trailgo .nav-link.active { background: var(--green-bg); border-left: 3px solid var(--green); }
    /* Mobile menu expanded: solid background when navbar-transparent */
    .navbar-trailgo.navbar-transparent .navbar-collapse.show,
    .navbar-trailgo.navbar-transparent .navbar-collapse.collapsing {
        background: rgba(0,0,0,0.92);
        backdrop-filter: blur(16px);
        border-radius: 0 0 16px 16px;
        padding: 12px 16px;
        margin: 8px -12px 0;
    }
    .navbar-trailgo.navbar-transparent .navbar-collapse.show .navbar-nav,
    .navbar-trailgo.navbar-transparent .navbar-collapse.collapsing .navbar-nav {
        border-top: 1px solid rgba(255,255,255,0.15);
    }
    .navbar-trailgo.navbar-transparent .navbar-collapse.show .nav-link,
    .navbar-trailgo.navbar-transparent .navbar-collapse.collapsing .nav-link {
        color: rgba(255,255,255,0.9) !important;
        padding: 10px 16px !important;
    }
    .navbar-trailgo.navbar-transparent .navbar-collapse.show .nav-link:hover {
        background: rgba(255,255,255,0.12) !important;
    }
    .navbar-trailgo.navbar-transparent .navbar-collapse.show .nav-link.active {
        background: rgba(255,255,255,0.15) !important;
        border-left: 3px solid #fff;
        color: #fff !important;
    }
    /* When scrolled, mobile menu uses white background */
    .navbar-trailgo.navbar-transparent.scrolled .navbar-collapse.show,
    .navbar-trailgo.navbar-transparent.scrolled .navbar-collapse.collapsing {
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(12px);
    }
    .navbar-trailgo.navbar-transparent.scrolled .navbar-collapse.show .navbar-nav,
    .navbar-trailgo.navbar-transparent.scrolled .navbar-collapse.collapsing .navbar-nav {
        border-top: 1px solid var(--border);
    }
    .navbar-trailgo.navbar-transparent.scrolled .navbar-collapse.show .nav-link {
        color: #4b5563 !important;
    }
    .navbar-trailgo.navbar-transparent.scrolled .navbar-collapse.show .nav-link:hover {
        color: var(--green) !important;
        background: var(--green-bg) !important;
    }
    .navbar-trailgo.navbar-transparent.scrolled .navbar-collapse.show .nav-link.active {
        background: var(--green-bg) !important;
        border-left: 3px solid var(--green);
        color: var(--green) !important;
    }
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: #1a1d23;
    color: white;
    padding: 50px 0 20px;
    margin-top: 0;
}

.brand-icon-sm {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--green-dark), var(--green-light));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.footer-heading {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,.5);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--green);
}

.footer-links li { margin-bottom: 10px; }
.footer-links a {
    color: rgba(255,255,255,.7);
    font-size: 0.9rem;
    transition: var(--transition);
}
.footer-links a:hover { color: #81c784; padding-left: 4px; }

.footer-social {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.6);
    font-size: 1rem;
    transition: var(--transition);
}
.footer-social:hover {
    background: var(--green);
    color: white;
    transform: translateY(-2px);
}

/* ============================================
   HOME PAGE
   ============================================ */

/* Hero — Video fullscreen */
.hero-video-section {
    position: relative;
    width: 100%; min-height: 100vh;
    overflow: hidden;
    display: flex; align-items: flex-start; justify-content: center;
}
.hero-video-section video {
    position: absolute; top: 50%; left: 50%;
    min-width: 100%; min-height: 100%;
    width: auto; height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover; z-index: 0;
}
.hero-video-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.15) 40%, rgba(0,0,0,0.25) 70%, rgba(0,0,0,0.6) 100%);
    z-index: 1;
}
.hero-content {
    position: relative; z-index: 2;
    text-align: center; max-width: 900px;
    padding: 20px 24px 0;
    margin-top: max(90px, 12vh);
}
.hero-pretitle {
    display: inline-flex; align-items: center; gap: 8px;
    flex-wrap: wrap; justify-content: center;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 8px 20px; border-radius: 50px;
    font-size: clamp(0.6rem, 1.2vw, 0.85rem); font-weight: 600;
    color: rgba(255,255,255,0.95);
    letter-spacing: 1.5px; text-transform: uppercase;
    margin-bottom: 24px;
    max-width: 90vw;
    line-height: 1.6;
    animation: heroFadeInUp .8s ease both;
}
.hero-title {
    font-size: clamp(2.8rem, 6vw, 5rem);
    font-weight: 900; color: #fff;
    line-height: 1.05; margin-bottom: 20px;
    letter-spacing: -2px;
    text-shadow: 0 2px 40px rgba(0,0,0,0.3);
    animation: heroFadeInUp .8s ease .15s both;
}
.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: rgba(255,255,255,0.85);
    line-height: 1.6; max-width: 760px;
    margin: 0 auto 36px; font-weight: 400;
    animation: heroFadeInUp .8s ease .3s both;
}
.hero-actions {
    display: flex; gap: 14px;
    justify-content: center; flex-wrap: wrap;
    animation: heroFadeInUp .8s ease .45s both;
}
.hero-btn-primary {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--green); color: #fff;
    padding: 16px 36px; border-radius: 50px;
    font-size: 1.05rem; font-weight: 700;
    text-decoration: none; border: none; cursor: pointer;
    transition: all .3s ease;
    box-shadow: 0 4px 20px rgba(45,134,89,0.4);
}
.hero-btn-primary:hover {
    background: var(--green-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(45,134,89,0.5);
    color: #fff;
}
.hero-btn-secondary {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border: 1.5px solid rgba(255,255,255,0.3);
    color: #fff; padding: 16px 36px;
    border-radius: 50px;
    font-size: 1.05rem; font-weight: 600;
    text-decoration: none; cursor: pointer;
    transition: all .3s ease;
}
.hero-btn-secondary:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px); color: #fff;
}
.hero-search { margin-top: 48px; animation: heroFadeInUp .8s ease .6s both; }
.hero-search-box {
    display: flex; gap: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-radius: 60px; padding: 6px;
    max-width: 680px; margin: 0 auto;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}
.hero-search-box input {
    flex: 1; border: none; outline: none;
    padding: 14px 24px; font-size: 1rem;
    background: transparent; color: #1a202c;
    border-radius: 60px; min-width: 0;
}
.hero-search-box input::placeholder { color: #9ca3af; }
.hero-search-box .btn-search {
    background: var(--green); color: #fff;
    border: none; padding: 14px 32px;
    border-radius: 50px;
    font-size: 1rem; font-weight: 600;
    cursor: pointer; transition: all .3s ease;
    white-space: nowrap;
}
.hero-search-box .btn-search:hover { background: var(--green-dark); }

.hero-explore-link {
    margin-top: 18px;
    animation: heroFadeInUp .8s ease .65s both;
    text-align: center;
}
.hero-explore-link a {
    display: inline-flex; align-items: center; gap: 8px;
    color: rgba(255,255,255,0.9);
    font-size: 0.95rem; font-weight: 500;
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 50px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all .3s ease;
}
.hero-explore-link a:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.4);
    color: #fff;
    transform: translateY(-1px);
}
.hero-explore-link a i { font-size: 1.1rem; }

.hero-stats {
    position: relative; z-index: 2;
    display: flex; gap: 48px;
    justify-content: center; margin-top: 32px;
    animation: heroFadeInUp .8s ease .7s both;
}
.hero-stat { text-align: center; color: #fff; }
.hero-stat-num { font-size: 2rem; font-weight: 800; text-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.hero-stat-label { font-size: 0.75rem; font-weight: 500; text-transform: uppercase; letter-spacing: 1.5px; opacity: 0.75; }

.hero-scroll-indicator {
    position: relative; z-index: 2;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    color: rgba(255,255,255,0.7);
    font-size: 0.75rem; font-weight: 500;
    letter-spacing: 2px; text-transform: uppercase;
    margin-top: 16px;
    animation: heroFadeInUp .8s ease .8s both;
}
.scroll-mouse {
    width: 24px; height: 38px;
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 14px; position: relative;
}
.scroll-mouse::after {
    content: ''; position: absolute;
    top: 6px; left: 50%; transform: translateX(-50%);
    width: 3px; height: 8px;
    background: rgba(255,255,255,0.7);
    border-radius: 3px;
    animation: heroScrollDot 2s ease infinite;
}

@keyframes heroFadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes heroScrollDot {
    0%,100% { opacity: 1; transform: translate(-50%, 0); }
    50% { opacity: 0.3; transform: translate(-50%, 10px); }
}

/* Navbar transparent mode (on hero) */
.navbar-trailgo.navbar-transparent {
    position: fixed !important;
    top: 0; left: 0; right: 0;
    background: transparent !important;
    border-bottom: none !important;
    box-shadow: none !important;
    padding: 16px 0;
    transition: background .4s ease, padding .3s ease, box-shadow .3s ease, border .3s ease;
}
.navbar-trailgo.navbar-transparent .brand-text { color: #fff; transition: color .3s ease; }
.navbar-trailgo.navbar-transparent .nav-link { color: rgba(255,255,255,0.9) !important; }
.navbar-trailgo.navbar-transparent .nav-link:hover { color: #fff !important; background: rgba(255,255,255,0.15); }
.navbar-trailgo.navbar-transparent .nav-link.active { color: #fff !important; }
.navbar-trailgo.navbar-transparent .nav-link.active::after { background: #fff; }
.navbar-trailgo.navbar-transparent .btn-outline-secondary { background: rgba(255,255,255,0.15); color: #fff; border-color: rgba(255,255,255,0.3); }
.navbar-trailgo.navbar-transparent .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
.navbar-trailgo.navbar-transparent.scrolled {
    background: rgba(255,255,255,0.97) !important;
    border-bottom: 3px solid var(--green) !important;
    box-shadow: var(--shadow-sm) !important;
    padding: 8px 0;
    backdrop-filter: blur(12px);
}
.navbar-trailgo.navbar-transparent.scrolled .brand-text { color: var(--text-dark); }
.navbar-trailgo.navbar-transparent.scrolled .nav-link { color: #4b5563 !important; }
.navbar-trailgo.navbar-transparent.scrolled .nav-link:hover { color: var(--green) !important; background: var(--green-bg); }
.navbar-trailgo.navbar-transparent.scrolled .nav-link.active { color: var(--green) !important; }
.navbar-trailgo.navbar-transparent.scrolled .nav-link.active::after { background: var(--green); }
.navbar-trailgo.navbar-transparent.scrolled .btn-outline-secondary { background: transparent; color: #4b5563; border-color: #d1d5db; }
.navbar-trailgo.navbar-transparent.scrolled .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%232d8659' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Hero responsive */
@media (max-width: 992px) {
    .hero-pretitle { font-size: 0.65rem; letter-spacing: 1px; padding: 6px 16px; border-radius: 30px; }
    .hero-content { margin-top: max(80px, 10vh); }
}
@media (max-width: 768px) {
    .hero-stats { gap: 24px; }
    .hero-stat-num { font-size: 1.5rem; }
    .hero-search-box { flex-direction: column; border-radius: 20px; }
    .hero-search-box input { border-radius: 16px; }
    .hero-search-box .btn-search { border-radius: 16px; margin: 0; }
    .hero-btn-primary, .hero-btn-secondary { padding: 14px 28px; font-size: 0.95rem; }
    .hero-pretitle { font-size: 0.6rem; letter-spacing: 0.5px; padding: 6px 14px; max-width: 85vw; }
    .hero-content { margin-top: 70px; padding: 10px 20px 0; }
}
@media (max-width: 480px) {
    .hero-stats { flex-direction: row; flex-wrap: wrap; gap: 16px; justify-content: center; }
    .hero-stat { min-width: 70px; }
    .hero-content { margin-top: 60px; padding: 10px 16px 0; }
    .hero-pretitle { font-size: 0.55rem; padding: 5px 12px; letter-spacing: 0.3px; }
}

/* Old hero (legacy) */
.hero-section { background: var(--bg); }

.badge-free {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(45,134,89,0.12);
    color: var(--green);
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Percorsi Grid */
.percorsi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
@media (max-width: 991px) { .percorsi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575px) { .percorsi-grid { grid-template-columns: 1fr; } }

.percorsi-grid .trail-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.percorsi-grid .trail-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.trail-image-container {
    position: relative;
    height: 200px;
    overflow: hidden;
}
.trail-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.trail-card:hover .trail-image-container img { transform: scale(1.08); }

.difficulty-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
}
.difficulty-T { background: #27AE60; }
.difficulty-E { background: #F39C12; }
.difficulty-EE { background: #E67E22; }
.difficulty-EEA { background: #E74C3C; }

/* Service sections */
.service-section { padding: 80px 0; }

.service-icon-box {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
    margin-bottom: 20px;
}

.feature-card {
    background: white;
    border-radius: 16px;
    padding: 36px 28px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    transition: var(--transition);
    height: 100%;
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
.feature-card .feature-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
    color: white;
}
.feature-card h5 { font-weight: 700; color: var(--text-dark); margin-bottom: 10px; }
.feature-card p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; }

/* Step numbers (how it works) */
.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0 auto 16px;
}

/* CTA Banner */
.cta-banner {
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 50%, var(--green-light) 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}
.cta-banner h2 { font-size: 2.2rem; font-weight: 800; margin-bottom: 16px; }
.cta-banner p { font-size: 1.1rem; opacity: 0.9; max-width: 600px; margin: 0 auto 30px; }

/* ============================================
   TRAIL CARD (list page + homepage)
   ============================================ */
.trail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.trail-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}
.trail-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* Trail card info section */
.trail-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.trail-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
    line-height: 1.3;
}
.trail-location {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.trail-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.trail-stats .stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.trail-stats .stat i { color: var(--green); font-size: 0.9rem; }
.trail-rating {
    font-size: 0.85rem;
}
.trail-rating i { font-size: 0.8rem; }
.trail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.trail-card:hover .trail-image { transform: scale(1.08); }

/* ============================================
   DETAIL PAGE
   ============================================ */

/* Detail Hero */
.detail-hero {
    position: relative;
    height: 500px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.detail-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.6));
    z-index: 1;
}
.detail-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
}
.detail-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
    margin: 0;
}

/* Detail Breadcrumb */
.detail-hero + .breadcrumb {
    background: #f8f9fa;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

/* Info Grid */
.detail-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    margin-top: -40px;
    margin-bottom: 30px;
    position: relative;
    z-index: 5;
    overflow: hidden;
}
/* Support both class names: info-stat (legacy) and info-item (current) */
.info-stat,
.info-item {
    text-align: center;
    padding: 22px 12px;
    border-right: 1px solid #f0f0f0;
    border-left: 3px solid transparent;
    transition: var(--transition);
}
.info-stat:last-child,
.info-item:last-child { border-right: none; }
.info-stat:hover,
.info-item:hover {
    border-left-color: var(--green);
    background: var(--green-bg);
}
.info-stat .info-value,
.info-item .info-item-value,
.info-item-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--green);
    display: block;
    margin-bottom: 4px;
}
.info-stat .info-label,
.info-item .info-item-label,
.info-item-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* QR Code in info grid */
.info-item-qr {
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px !important;
    overflow: visible;
}
.info-item-qr .qr-mini {
    width: 85px;
    height: 85px;
    overflow: hidden;
    line-height: 0;
}
.info-item-qr .qr-mini canvas,
.info-item-qr .qr-mini img {
    width: 85px !important;
    height: 85px !important;
    display: block;
}
.qr-tooltip-box {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    padding: 16px;
    z-index: 100;
    text-align: center;
    min-width: 180px;
}
.qr-tooltip-box::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #fff;
}
.info-item-qr:hover .qr-tooltip-box { display: block; }
.qr-tooltip-box .qr-big canvas,
.qr-tooltip-box .qr-big img { width: 128px !important; height: 128px !important; }
.qr-tooltip-box p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 8px 0 0;
}

/* Detail Sections */
.detail-section {
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}
.detail-section h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--green);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e8f5e9;
}
.detail-section h2 i { font-size: 24px; }

/* GPS Navigation Buttons */
.gps-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    background: var(--green);
}
.gps-nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    color: white;
}
#btn-locate { background: #2d8659; }
#btn-locate:hover { background: #1a5c38; }
#btn-navigate-desktop,
#btn-navigate-mobile { background: #1565C0; }
#btn-navigate-desktop:hover,
#btn-navigate-mobile:hover { background: #0d47a1; }

/* Navigation Info Panel */
#nav-info {
    background: #f0f8f4;
    border: 2px solid #2d8659;
    border-radius: 12px;
}

/* Elevation Profile */
.elevation-profile { position: relative; }
.elevation-container { position: relative; }
#elevation-canvas {
    width: 100%;
    border-radius: 8px;
}

/* Gallery */
.gallery,
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.gallery-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
    height: 160px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.gallery-item:hover { transform: scale(1.03); }
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: white;
    font-size: 2rem;
}
.gallery-item:hover .gallery-item-overlay { opacity: 1; }

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.lightbox.active { display: flex; }
.lightbox-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.lightbox-image,
.lightbox img {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 8px;
    object-fit: contain;
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10000;
}
.lightbox-close:hover { background: rgba(255,255,255,0.3); }
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10000;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.3); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* POI */
.poi-list { list-style: none; padding: 0; margin: 0; }
.poi-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}
.poi-item:hover { padding-left: 8px; background: var(--green-bg); margin: 0 -16px; padding: 16px; border-radius: 8px; }
.poi-item:last-child { border-bottom: none; }
.poi-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--green-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green);
    font-size: 20px;
    flex-shrink: 0;
    border: 2px solid rgba(45,134,89,0.15);
}
.poi-content h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 4px;
}
.poi-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}
.poi-distance {
    font-size: 0.8rem;
    color: var(--green);
    margin: 0 0 4px;
    font-weight: 500;
}

/* Practical Info */
.practical-info p {
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 12px;
    color: #495057;
}
.practical-info strong {
    color: var(--text-dark);
}

/* Reviews Section */
.reviews-section { padding: 0; }
.reviews-summary {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.review-score { text-align: center; }
.review-score-big {
    font-size: 48px;
    font-weight: 900;
    color: var(--green);
    line-height: 1;
    margin-bottom: 6px;
}
.stars { color: #FFB400; font-size: 1.2rem; margin-bottom: 4px; }
.stars i { margin: 0 1px; }
.review-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Review Form */
.review-form {
    background: var(--green-bg);
    border-radius: var(--radius);
    padding: 28px;
    margin-top: 20px;
}
.review-form h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
}
.star-rating {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}
.star-rating span {
    font-size: 2rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
    line-height: 1;
}
.star-rating span:hover,
.star-rating span.active {
    color: #FFB400;
    transform: scale(1.15);
}
.review-form textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    min-height: 120px;
    resize: vertical;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
    margin-bottom: 16px;
}
.review-form textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(45,134,89,0.1);
}
.review-submit-btn {
    background: linear-gradient(135deg, var(--green), var(--green-light));
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
}
.review-submit-btn:hover {
    background: linear-gradient(135deg, var(--green-dark), var(--green));
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(45,134,89,0.3);
}

/* QR Code Section */
.qr-canvas {
    display: inline-block;
    padding: 12px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

/* Map */
#map, #map-explore, #map-detail { height: 500px; width: 100%; border-radius: var(--radius-sm); }
.map-container {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

/* User Position Marker */
.user-position-marker { background: transparent !important; border: none !important; }
.poi-marker, .paline-marker { background: transparent !important; border: none !important; }

/* Spin animation */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spin-icon { animation: spin 1s linear infinite; display: inline-block; }

/* ============================================
   COMUNI PAGE
   ============================================ */
.comune-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
@media (max-width: 1199px) { .comune-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 991px)  { .comune-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575px)  { .comune-grid { grid-template-columns: 1fr; } }

.comune-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
}
.comune-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.comune-image { position: relative; height: 180px; overflow: hidden; }
.comune-image img { width: 100%; height: 100%; object-fit: cover; }
.comune-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}
.comune-card:hover .comune-overlay { opacity: 1; }

/* Regione/Provincia section headers */
.comuni-regione-header {
    background: linear-gradient(135deg, #2d6a4f 0%, #1b4332 100%);
    color: #fff;
    padding: 16px 24px;
    border-radius: var(--radius);
    margin-bottom: 12px;
}
.comuni-regione-header h2 { margin: 0; font-size: 1.4rem; font-weight: 700; }
.comuni-provincia-header {
    background: #f0f4f0;
    padding: 10px 20px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    border-left: 4px solid #2d6a4f;
}
.comuni-provincia-header h3 { margin: 0; font-size: 1rem; font-weight: 600; color: #555; }

/* Pagination */
.comuni-pagination { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.comuni-pagination .page-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px; padding: 0 10px;
    border: 1px solid #dee2e6; border-radius: 8px;
    background: #fff; color: #2d6a4f; font-weight: 600; font-size: 14px;
    cursor: pointer; transition: all .2s;
    text-decoration: none;
}
.comuni-pagination .page-btn:hover { background: #e8f5e9; border-color: #2d6a4f; }
.comuni-pagination .page-btn.active { background: #2d6a4f; color: #fff; border-color: #2d6a4f; }
.comuni-pagination .page-btn.disabled { opacity: .4; pointer-events: none; }
.comuni-no-results { text-align: center; padding: 40px 20px; color: #888; font-size: 1.1rem; display: none; }

/* ============================================
   STRUTTURE LISTA - Card Design
   ============================================ */
.struttura-card-new {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}
.struttura-card-new:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.struttura-card-cover {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: #f1f5f9;
}
.struttura-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}
.struttura-card-new:hover .struttura-card-cover img {
    transform: scale(1.05);
}
.struttura-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}
.struttura-card-new:hover .struttura-card-overlay { opacity: 1; }
.struttura-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(22,101,52,0.9);
    color: #fff;
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    backdrop-filter: blur(4px);
}
.struttura-card-logo {
    position: absolute;
    bottom: -18px;
    left: 16px;
    width: 48px;
    height: 48px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    padding: 4px;
    overflow: hidden;
    z-index: 2;
}
.struttura-card-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}
.struttura-card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.struttura-card-body.has-logo { padding-top: 26px; }
.struttura-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1b4332;
    margin: 0 0 6px 0;
    line-height: 1.3;
}
.struttura-card-location {
    font-size: 0.82rem;
    color: #666;
    margin: 0 0 10px 0;
}
.struttura-card-location i { color: #2d6a4f; }
.struttura-card-stats {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.struttura-stat {
    font-size: 0.82rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.struttura-stat i { font-size: 0.9rem; }
.struttura-page-link {
    border-radius: 8px !important;
    border: 1px solid #dee2e6;
    color: #2d6a4f;
    font-weight: 600;
    min-width: 38px;
    text-align: center;
}
.struttura-page-link.active,
.page-item.active .struttura-page-link {
    background: #2d6a4f !important;
    border-color: #2d6a4f !important;
    color: #fff !important;
}
.struttura-page-link:hover { background: #e8f5e9; border-color: #2d6a4f; }

/* ============================================
   ESPLORA - Dynamic Navigation Cards
   ============================================ */
.esplora-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.esplora-card {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}
.esplora-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
    border-color: #2d6a4f;
}
.esplora-card:focus {
    outline: none;
    border-color: #2d6a4f;
    box-shadow: 0 0 0 3px rgba(45,106,79,0.15);
}
.esplora-card-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 20px;
}
.esplora-card-regione .esplora-card-icon {
    background: linear-gradient(135deg, #2d6a4f 0%, #40916c 100%);
    color: #fff;
}
.esplora-card-provincia .esplora-card-icon {
    background: linear-gradient(135deg, #52b788 0%, #74c69d 100%);
    color: #fff;
}
.esplora-card-body {
    flex: 1;
    min-width: 0;
}
.esplora-card-title {
    margin: 0 0 6px 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #1b4332;
}
.esplora-card-title small {
    font-weight: 500;
    font-size: 0.85em;
}
.esplora-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.88rem;
    color: #666;
}
.esplora-card-meta i { color: #2d6a4f; }
.esplora-card-arrow {
    margin-left: 16px;
    font-size: 1.2rem;
    color: #aaa;
    transition: var(--transition);
}
.esplora-card:hover .esplora-card-arrow { color: #2d6a4f; transform: translateX(4px); }

@media (max-width: 575px) {
    .esplora-card { padding: 14px 16px; }
    .esplora-card-icon { width: 44px; height: 44px; min-width: 44px; font-size: 20px; margin-right: 14px; border-radius: 10px; }
    .esplora-card-title { font-size: 1rem; }
    .esplora-card-meta { gap: 10px; font-size: 0.82rem; }
}

/* ============================================
   CONTACT PAGE
   ============================================ */
.contact-hero {
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 50%, var(--green-light) 100%);
    color: white;
    padding: 80px 0 60px;
    text-align: center;
}
.contact-hero h1 { font-size: 2.8rem; font-weight: 800; margin-bottom: 12px; }
.contact-hero p { font-size: 1.15rem; opacity: 0.9; max-width: 600px; margin: 0 auto; }

.contact-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-top: -50px;
    position: relative;
    z-index: 2;
}
.contact-card {
    background: white;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    transition: var(--transition);
}
.contact-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}
.contact-card-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
    color: white;
}
.contact-card h5 { font-weight: 700; margin-bottom: 8px; color: var(--text-dark); }
.contact-card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 8px; }
.contact-card a { color: var(--green); font-weight: 600; font-size: 1rem; }
.contact-card a:hover { color: var(--green-dark); }

.contact-form-section { padding: 80px 0; }
.contact-form-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    overflow: hidden;
}
.form-sidebar {
    background: linear-gradient(180deg, var(--green-dark) 0%, var(--green) 100%);
    color: white;
    padding: 48px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.form-sidebar h3 { font-size: 1.6rem; font-weight: 700; margin-bottom: 16px; }
.form-sidebar p { opacity: 0.85; line-height: 1.7; margin-bottom: 30px; }
.form-sidebar-item {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}
.form-sidebar-item i {
    font-size: 1.3rem;
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.form-sidebar-item span { font-size: 0.95rem; }

.form-body { padding: 48px 40px; }
.form-body h3 { font-size: 1.5rem; font-weight: 700; color: var(--text-dark); margin-bottom: 8px; }
.form-body .form-subtitle { color: var(--text-muted); margin-bottom: 30px; }

.form-floating-custom { margin-bottom: 20px; }
.form-floating-custom label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #495057;
    margin-bottom: 6px;
    display: block;
}
.form-floating-custom input,
.form-floating-custom select,
.form-floating-custom textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
}
.form-floating-custom input:focus,
.form-floating-custom select:focus,
.form-floating-custom textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(45,134,89,0.1);
}
.form-floating-custom textarea { min-height: 140px; resize: vertical; }

.btn-submit {
    background: linear-gradient(135deg, var(--green), var(--green-light));
    color: white;
    border: none;
    padding: 14px 36px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.btn-submit:hover {
    background: linear-gradient(135deg, var(--green-dark), var(--green));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45,134,89,0.3);
}
.btn-submit:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

.form-alert {
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: none;
    font-weight: 500;
}
.form-alert.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; display: block; }
.form-alert.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; display: block; }

.company-section { padding: 60px 0; background: var(--bg); }
.company-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.company-card h4 { font-weight: 700; color: var(--text-dark); margin-bottom: 20px; }

.response-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(45,134,89,0.1);
    color: var(--green);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Honeypot (anti-spam) */
.ht-field { position: absolute !important; left: -9999px !important; opacity: 0 !important; height: 0 !important; width: 0 !important; }

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb-item a { color: var(--green); }
.breadcrumb-item a:hover { color: var(--green-dark); text-decoration: underline; }
.breadcrumb-item.active { color: #495057; }

/* ============================================
   FILTERS (percorsi page)
   ============================================ */
/* ── New modern filter panel ── */
.filter-panel {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
    overflow: hidden;
    position: sticky;
    top: 80px;
}
.filter-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f0f1f3;
}
.filter-header h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1a1a2e;
}
.filter-header .reset-btn {
    font-size: 0.8rem;
    color: #9ca3af;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color .2s;
}
.filter-header .reset-btn:hover { color: var(--green); }
.filter-body { padding: 20px 24px; }
.filter-group { margin-bottom: 20px; }
.filter-group:last-child { margin-bottom: 0; }
.filter-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.filter-label i { font-size: 0.85rem; color: var(--green); }
.search-input { position: relative; }
.search-input input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    background: #fafafa;
}
.search-input input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(45,134,89,0.1);
    background: #fff;
}
.search-input > i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.9rem;
}
.filter-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.88rem;
    background: #fafafa;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    color: #374151;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
.filter-select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(45,134,89,0.1);
    background-color: #fff;
}
.filter-select:disabled { opacity: 0.5; cursor: not-allowed; }
/* Range slider */
.range-slider-wrap { padding: 4px 0; }
.range-values {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.range-val {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--green-dark);
    background: #f0faf4;
    padding: 3px 10px;
    border-radius: 6px;
}
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--green) 0%, var(--green) var(--pct, 100%), #e5e7eb var(--pct, 100%), #e5e7eb 100%);
    outline: none;
    cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--green);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    cursor: grab;
    transition: transform .15s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.1); }
input[type="range"]::-moz-range-thumb {
    width: 22px; height: 22px; border-radius: 50%;
    background: #fff; border: 3px solid var(--green);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12); cursor: grab;
}
.range-marks {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    padding: 0 2px;
}
.range-marks span { font-size: 0.65rem; color: #b0b5bf; }
/* Pill toggles */
.pill-group { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-toggle { display: none; }
.pill-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all .2s;
    background: #fafafa;
    user-select: none;
}
.pill-label:hover {
    border-color: var(--green);
    color: var(--green);
    background: #f0faf4;
}
.pill-toggle:checked + .pill-label {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
    box-shadow: 0 2px 8px rgba(45,134,89,0.25);
}
/* Accessibility switch */
.access-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f0faf4;
    border-radius: 12px;
    border: 1.5px solid #d1f0e0;
}
.access-switch-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--green-dark);
}
.access-switch-label i { font-size: 1.1rem; }
.toggle-switch { position: relative; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: #d1d5db; border-radius: 24px; transition: background .3s;
}
.toggle-slider::before {
    content: ''; position: absolute; width: 18px; height: 18px;
    left: 3px; bottom: 3px; background: #fff; border-radius: 50%;
    transition: transform .3s; box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-slider { background: var(--green); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
.filter-divider { height: 1px; background: #f0f1f3; margin: 18px 0; }
.search-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--green-dark), var(--green-light));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform .15s, box-shadow .2s;
    box-shadow: 0 4px 12px rgba(45,134,89,0.3);
    margin-top: 24px;
}
.search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(45,134,89,0.35);
}
/* Legacy compat */
.filters-panel { display: none; }
.filters-grid { display: flex; flex-direction: column; }

/* Search container on homepage */
.search-container {
    background: white;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.search-container .form-control,
.search-container .form-select {
    border: 2px solid var(--border);
    border-radius: 10px;
}
.search-container .form-control:focus,
.search-container .form-select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(45,134,89,0.1);
}

/* ============================================
   INSTITUTIONAL PAGES
   ============================================ */
.page-content { padding: 60px 0; }
.page-content h1 { font-size: 36px; font-weight: 800; color: var(--green); margin-bottom: 24px; }
.page-content h2 { font-size: 24px; font-weight: 700; color: var(--green); margin-top: 40px; margin-bottom: 16px; }
.page-content p { font-size: 16px; margin-bottom: 16px; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 991px) {
    .trail-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
    .percorsi-grid { grid-template-columns: repeat(2, 1fr); }
    .gallery, .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    .gallery-item { height: 130px; }
    .filter-panel { position: static; }
}

@media (max-width: 768px) {
    .contact-hero { padding: 60px 0 50px; }
    .contact-hero h1 { font-size: 2rem; }
    .form-body { padding: 30px 24px; }
    .form-sidebar { padding: 30px 24px; }
    .detail-hero { height: 300px; }
    .detail-hero h1 { font-size: 2rem; }
    .detail-info-grid { margin-top: -25px; grid-template-columns: repeat(3, 1fr); }
    .info-stat, .info-item { padding: 16px 8px; }
    .info-stat .info-value, .info-item .info-item-value, .info-item-value { font-size: 1.1rem; }
    .detail-section { padding: 20px; }
    #map, #map-explore, #map-detail { height: 350px; }
    .gps-nav-btn { padding: 12px 18px; font-size: 0.9rem; }
    .reviews-summary { flex-direction: column; text-align: center; }
    .review-score-big { font-size: 36px; }
    .review-form { padding: 20px; }
    .lightbox-nav { width: 40px; height: 40px; font-size: 22px; }
}

@media (max-width: 576px) {
    .detail-info-grid { grid-template-columns: repeat(2, 1fr); }
    .gallery, .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .gallery-item { height: 110px; }
    .poi-item { gap: 12px; }
    .poi-icon { width: 40px; height: 40px; font-size: 16px; }
    .trail-grid { grid-template-columns: 1fr; }
    .percorsi-grid { grid-template-columns: 1fr; }
    .trail-image-container { height: 180px; }

    /* Fix homepage horizontal scroll on mobile */
    .hero-section .display-4 { font-size: 1.8rem; }
    .hero-section .lead { font-size: 1rem; }
    .search-container { padding: 16px; }
    .search-container form { flex-direction: column; }
    .search-container .form-control,
    .search-container .form-select { min-width: 0 !important; width: 100%; }
    .search-container .btn { width: 100%; }
    .d-flex.gap-3.mb-4 { flex-wrap: wrap; }
    .badge-free { font-size: 0.8rem; padding: 6px 14px; }
    .service-section { padding: 50px 0; }
    .feature-card { padding: 20px 16px; }
    .cta-banner h2 { font-size: 1.6rem; }
    .cta-banner p { font-size: 0.95rem; }
}

/* ============================================
   COOKIE CONSENT BANNER
   ============================================ */
/* ── COOKIE CONSENT BANNER (Professional) ── */
.cookie-banner {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 9998;
    padding: 0 16px 16px;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    pointer-events: none;
}
.cookie-banner.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.cookie-banner-inner {
    max-width: 520px;
    margin: 0 auto;
    background: rgba(18, 40, 38, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 28px 28px 24px;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.25), 0 0 0 1px rgba(45,134,89,0.15);
}

/* Header */
.cookie-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.cookie-header-icon {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--green), var(--green-light));
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    flex-shrink: 0;
}
.cookie-header-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.3;
}

/* Description */
.cookie-desc {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.65;
    margin: 0 0 18px;
}
.cookie-desc strong {
    color: rgba(255,255,255,0.9);
    font-weight: 600;
}

/* Tech cookie card */
.cookie-tech-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 16px;
}
.cookie-tech-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.cookie-tech-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    gap: 8px;
}
.cookie-tech-title i {
    color: #81c784;
    font-size: 1rem;
}
.cookie-badge-active {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(129,199,132,0.15);
    color: #81c784;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(129,199,132,0.2);
}
.cookie-badge-active::before {
    content: '';
    width: 6px; height: 6px;
    background: #81c784;
    border-radius: 50%;
    display: inline-block;
}
.cookie-tech-desc {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.55);
    margin: 0 0 10px;
    line-height: 1.5;
}
.cookie-detail-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.cookie-detail-list li {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    gap: 5px;
}
.cookie-detail-list li i {
    color: #81c784;
    font-size: 0.7rem;
}

/* No profiling / no third-party badges */
.cookie-guarantees {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.cookie-guarantee {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255,255,255,0.65);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 6px 12px;
}
.cookie-guarantee i {
    color: #ef9a9a;
    font-size: 0.8rem;
}

/* Actions */
.cookie-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cookie-accept-btn {
    flex: 1;
    background: linear-gradient(135deg, var(--green), var(--green-light));
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.cookie-accept-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(45,134,89,0.35);
}
.cookie-accept-btn:active {
    transform: scale(0.97);
}
.cookie-policy-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cookie-policy-link {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}
.cookie-policy-link:hover {
    color: #81c784;
}
.cookie-policy-link i {
    font-size: 0.65rem;
}

/* Cookie banner responsive */
@media (max-width: 768px) {
    .cookie-banner { padding: 0 10px 10px; }
    .cookie-banner-inner {
        max-width: 100%;
        padding: 22px 18px 20px;
        border-radius: 16px;
    }
    .cookie-header-icon { width: 36px; height: 36px; font-size: 1.1rem; border-radius: 10px; }
    .cookie-header-title { font-size: 0.95rem; }
    .cookie-desc { font-size: 0.78rem; margin-bottom: 14px; }
    .cookie-tech-card { padding: 14px 14px; }
    .cookie-guarantees { gap: 8px; }
    .cookie-guarantee { font-size: 0.7rem; padding: 5px 10px; }
    .cookie-actions { flex-direction: column; gap: 10px; }
    .cookie-accept-btn { width: 100%; padding: 13px 20px; }
    .cookie-policy-links { flex-direction: row; gap: 14px; justify-content: center; }
}
@media (max-width: 400px) {
    .cookie-banner-inner { padding: 18px 14px 16px; border-radius: 14px; }
    .cookie-header { gap: 10px; margin-bottom: 12px; }
    .cookie-header-icon { width: 32px; height: 32px; font-size: 1rem; }
    .cookie-header-title { font-size: 0.9rem; }
    .cookie-guarantees { flex-direction: column; gap: 6px; }
}