body {
    overflow-x: hidden;
    max-width: 100vw;
}

.trip-container {
    max-width: 100%;
    perspective: 1px;
    transform-style: preserve-3d;
    overflow-y: scroll;
    position: relative;
}

.trip-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 20px;
}

.trip-map {
    width: 100%;
    height: 50dvh;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.trip-info {
    background: #b4cfa3;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* GALLERIA: griglia responsive e miniature ritagliate */
.trip-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-top: 20px;
}

/* wrapper della singola miniatura */
.trip-photo {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #eee;
    height: 140px;
    /* altezza uniforme per tutte le miniature */
}

/* immagine miniatura riempie il wrapper e viene ritagliata */
.trip-photo .gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform .25s ease, filter .25s ease;
}

.trip-photo .gallery-image:hover {
    transform: scale(1.04);
    filter: brightness(0.95);
}

/* MARKER SULLA MAPPA */
.white-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: white;
    border: 2px solid #FF6B35;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}

/* === STATISTICHE HERO === */
.stats-hero {
    margin-top: -10px;
    position: relative;
    z-index: 10;
    padding: 0 20px 0px;
}

.stats-container {
    max-width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    padding: 40px;
    backdrop-filter: blur(10px);
}

.stat-box {
    text-align: center;
    padding: 20px 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(56, 135, 190, 0.2);
    border-color: rgba(56, 135, 190, 0.3);
}

.stat-box-wide {
    grid-column: span 1;
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: #FF6B35;
    line-height: 1;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Date speciali */
.stat-dates {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 10px 0;
}

.date-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.date-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.date-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #FF6B35;
}

.date-separator {
    font-size: 1.5rem;
    color: #dee2e6;
    font-weight: 300;
}

/* === RESPONSIVE === */
@media (max-width: 968px) {
    .stats-hero {
        margin-top: -60px;
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        padding: 30px 20px;
        gap: 15px;
    }

    .stat-box-wide {
        grid-column: span 2;
    }

    .stat-number {
        font-size: 2.2rem;
    }

    .stat-icon {
        font-size: 2rem;
    }
}

@media (max-width: 600px) {
    .stats-hero {
        margin-top: -40px;
        padding: 0 15px 40px;
    }

    .stats-container {
        padding: 25px 15px;
        gap: 12px;
    }

    .stat-box {
        padding: 20px 10px;
    }

    .stat-dates {
        flex-direction: column;
        gap: 10px;
    }

    .date-separator {
        transform: rotate(90deg);
        font-size: 1.2rem;
    }
}


@media (max-width: 768px) {

    /* Riduci altezza mappa e chart su mobile */
    .trip-map {
        height: 250px !important;
    }

    #elevationChart {
        height: 150px !important;
    }
}

.trip-description {
    margin: 30px auto;
    padding: 20px;
    line-height: 1.6;
    font-size: 1rem;
}

.trip-description h2 {
    font-size: 1.8rem;
    margin-top: 20px;
    margin-bottom: 10px;
    color: #333;
}

.trip-description h3 {
    font-size: 1.4rem;
    margin-top: 15px;
    margin-bottom: 8px;
}

.trip-description ul,
.trip-description ol {
    margin: 15px 0;
    padding-left: 30px;
}

.trip-description li {
    margin: 5px 0;
}

.trip-description strong {
    font-weight: 600;
    color: #3887be;
}

.trip-description em {
    font-style: italic;
}

.trip-description p {
    margin: 10px 0;
}

/* Responsive mobile */
@media (max-width: 768px) {
    .trip-description {
        padding: 15px;
        font-size: 0.95rem;
    }
}


/* === CAROSELLO IMMAGINI === */
.trip-carousel-section {
    margin: 40px 0;
    padding: 0;
}

.trip-carousel-section h2 {
    margin-bottom: 20px;
    font-size: 24px;
    color: #333;
}

.trip-swiper {
    width: 60vw;
    height: 80vh;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    background: #f5f5f5;
}

.trip-swiper .swiper-slide {
    display: flex;
    position: relative;
    align-items: center;
    justify-content: center;
    background: #000;
}

.trip-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.trip-swiper .swiper-button-next,
.trip-swiper .swiper-button-prev {
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.trip-swiper .swiper-button-next:after,
.trip-swiper .swiper-button-prev:after {
    font-size: 22px;
}

/* Mobile */
@media (max-width: 768px) {
    .trip-swiper {
        height: 300px;
    }

    .trip-swiper .swiper-button-next,
    .trip-swiper .swiper-button-prev {
        width: 40px;
        height: 40px;
    }

    .trip-swiper .swiper-button-next:after,
    .trip-swiper .swiper-button-prev:after {
        font-size: 18px;
    }
}


/* Fullscreen per mappa + altimetria */
.map-elevation-wrapper {
    width: 100%;
    position: relative;
    margin: 40px auto;
}

/* === BOTTONI ESPANDI/CHIUDI === */
.expand-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    background: white;
    color: #1a1a1a;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.expand-btn:hover {
    background: #FF6B35;
    color: white;
    transform: scale(1.05);
}

/* Bottone CHIUDI */
.close-map-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    background: #dc3545;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    display: none;
    /* Nascosto di default */
    align-items: center;
    gap: 10px;
    box-shadow: 0 6px 30px rgba(220, 53, 69, 0.4);
    transition: all 0.3s ease;
}

.close-map-btn:hover {
    background: #c82333;
    transform: scale(1.08);
    box-shadow: 0 10px 50px rgba(220, 53, 69, 0.6);
}

.close-map-btn:active {
    transform: scale(1);
}

/* === MAPPA FULLSCREEN === */

.map-elevation-wrapper.fullscreen #map {
    position: fixed;
    inset: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    background: #fff;
}

.map-elevation-wrapper.fullscreen canvas {
    position: fixed;
    bottom: 0;
    width: 100vw;
    z-index: 10000 !important;
    background-color: #fff;
}

.map-elevation-wrapper.fullscreen .white-marker,
.map-elevation-wrapper.fullscreen .finish-flag {
    z-index: 10000;
}


body.fullscreen-active header,
body.fullscreen-active .header,
body.fullscreen-active nav,
body.fullscreen-active .navbar {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* === SWIPER FULLSCREEN === */
.trip-swiper.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 10000 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.trip-swiper.fullscreen .swiper-slide img {
    object-fit: contain;
    /* Mostra immagine intera in fullscreen */
    width: 100% !important;
    height: 100% !important;
}

.trip-swiper.fullscreen .swiper-button-next,
.trip-swiper.fullscreen .swiper-button-prev {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.trip-swiper.fullscreen .swiper-button-next:hover,
.trip-swiper.fullscreen .swiper-button-prev:hover {
    background: rgba(255, 107, 53, 0.8);
}

.swiper-pagination {
    color: white !important;
    padding-bottom: 15px;
}


/* === RESPONSIVE === */
@media (max-width: 768px) {
    .expand-btn {
        padding: 10px 20px;
        font-size: 0.95rem;
        top: 15px;
        right: 15px;
    }

    .close-map-btn {
        padding: 12px 24px;
        font-size: 1rem;
        top: 20px;
        right: 20px;
    }

    .expand-btn svg,
    .close-map-btn svg {
        width: 18px;
        height: 18px;
    }

    .map-elevation-wrapper.fullscreen {
        padding: 15px;
    }

}

@media (max-width: 480px) {
    .expand-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .close-map-btn {
        padding: 10px 20px;
        font-size: 0.95rem;
        top: 15px;
        right: 15px;
    }
}


/* === HERO FULLSCREEN CON PARALLAX === */
.hero-fullscreen {
    position: relative;
    height: 90vh;
    background-size: cover;
    background-position: center bottom;
    background-attachment: fixed;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 5%;
    overflow: hidden;
    flex: 1 0 auto;
    z-index: -1;
}

.hero-main-title {
    font-size: clamp(2.5rem, 6vw, 6rem) !important;
    font-weight: 800;
    color: #fff !important;
    line-height: 1.1;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

/* === SILHOUETTE MONTAGNE === */
.mountain-silhouette {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 250px;
    /* Altezza delle montagne */
    z-index: 1;
    pointer-events: none;
    /* Permette click attraverso */
}

.mountain-silhouette svg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}


/* === CONTENT WRAPPER === */
.content-wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    z-index: 2;
    position: relative;
    display: block;
    align-items: center;
    background-color: #f7f9fc;
}


/* === RESPONSIVE === */
@media (max-width: 768px) {
    .hero-fullscreen {
        min-height: 400px;
        padding: 60px 5% 50px;
        background-attachment: scroll;
        /* Su mobile disabilita parallax per performance */
    }

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

    .hero-meta {
        font-size: 0.85rem;
        gap: 12px;
    }

    .hero-meta span {
        padding: 6px 14px;
    }
}

/* === COUNTRIES BANNER STYLE === */
.countries-banner {
    background: linear-gradient(135deg, #FF6B35 0%, #ff8c61 100%);
    border-radius: 20px;
    padding: 30px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    box-shadow: 0 10px 40px rgba(255, 107, 53, 0.2);
    margin: 50px auto;
    max-width: 100%;
}

.banner-left {
    display: flex;
    align-items: center;
    gap: 20px;
    color: white;
}

.banner-icon {
    font-size: 3.5rem;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

.banner-title {
    font-size: 2rem !important;
    font-weight: 800;
    margin: 0 0 4px 0;
    text-align: center;
}

.banner-text {
    margin: 0;
    opacity: 0.95;
    font-size: 1.5rem;
    text-align: center;
}

.banner-right {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.country-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 18px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.country-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.badge-flag {
    font-size: 1.8rem;
    line-height: 1;
}

.badge-name {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
}

@media (max-width: 968px) {
    .countries-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 25px 30px;
    }

    .banner-right {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .countries-banner {
        padding: 20px;
    }

    .banner-icon {
        font-size: 2.5rem;
    }

    .banner-title {
        font-size: 1.3rem;
    }

    .country-badge {
        padding: 6px 14px;
    }

    .badge-flag {
        font-size: 1.5rem;
    }

    .badge-name {
        font-size: 0.9rem;
    }
}

/* Container principale */
.swiper-wrapper-container {
    position: relative;
    width: 100%;
    margin: 40px 0;
}

/* Bottone espandi (sopra lo swiper) */
.expand-swiper-btn {
    position: absolute;
    top: 20px;
    right: 13%;
    z-index: 20;
    /* Sopra le immagini */
    background: white;
    color: #1a1a1a;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.expand-swiper-btn:hover {
    background: #FF6B35;
    color: white;
    transform: scale(1.05);
}

/* Bottone chiudi (fixed, appare solo in fullscreen) */
.close-swiper-fullscreen-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    background: #dc3545;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    display: none;
    /* Nascosto di default */
    align-items: center;
    gap: 10px;
    box-shadow: 0 6px 30px rgba(220, 53, 69, 0.4);
    transition: all 0.3s ease;
}

.close-swiper-fullscreen-btn:hover {
    background: #c82333;
    transform: scale(1.08);
}