/* ============================================================
   Insta360 Video Slider — Flatsome UX Builder
   ============================================================ */

.i360-video-slider *,
.i360-video-slider *::before,
.i360-video-slider *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.i360-video-slider {
    color: #fff;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
}

/* ── Grid desktop ── */
.i360-section {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 3fr 2fr;
    grid-template-rows: auto auto auto auto;
    grid-template-areas:
    "overline overline"
    "title    title"
    "tabs     tabs"
    "video    content";
    gap: 0;
    justify-items: center;
    align-items: stretch;
}

.i360-section-overline {
    grid-area: overline;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #3da0f0;
    text-align: center;
    margin-bottom: 12px;
}

.i360-section-title {
    grid-area: title;
    font-size: 44px;
    font-weight: 800;
    font-style: italic;
    text-align: center;
    line-height: 1.15;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 32px;
}

/* ── Tabs ── */
.i360-tabs-wrapper {
    grid-area: tabs;
    background: #1a1a1a;
    border-radius: 80px;
    display: inline-flex;
    position: relative;
    padding: 0;
    overflow: hidden;
    justify-self: center;
    margin-bottom: 32px;
}

.i360-tab-highlight {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 80px;
    background: radial-gradient(103.64% 128.57% at 46.19% -0.57%, rgb(0, 64, 164) 0%, rgb(61, 160, 240) 60%, rgb(225, 241, 255) 100%);
    z-index: 1;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.i360-tab-btn {
    position: relative;
    z-index: 2;
    padding: 11px 28px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    color: rgb(175, 177, 180);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.i360-tab-btn.active {
    color: #fff;
}

/* ── Video area ── */
.i360-card-media {
    grid-area: video;
    position: relative;
    overflow: hidden;
    border-radius: 24px 0 0 24px;
    background: #1a1a1a;
    min-height: 350px;
}

.i360-card-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.5s ease;
}

/* ── Content area ── */
.i360-card-content {
    grid-area: content;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 40px 48px;
    position: relative;
    overflow: hidden;
    background: #1a1a1a;
    border-radius: 0 24px 24px 0;
}

.i360-slides-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: flex-start;
}

.i360-card-text {
    font-size: 15px;
    line-height: 1.7;
    color: rgb(175, 177, 180);
}

/* ── Progress bar ── */
.i360-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
}

.i360-progress-fill {
    height: 100%;
    background: #3da0f0;
    width: 0;
}

.i360-progress-fill.running {
    animation: i360ProgressFill var(--i360-duration, 5s) linear forwards;
}

@keyframes i360ProgressFill {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* ── Arrows ── */
.i360-card-arrows {
    position: absolute;
    bottom: 40px;
    right: 48px;
    display: flex;
    gap: 12px;
}

.i360-arrow-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    color: #fff;
}

.i360-arrow-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.i360-arrow-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Slide transition ── */
.i360-slide-content {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
}

.i360-slide-content.active {
    opacity: 1;
    transform: translateY(0);
    position: relative;
    pointer-events: auto;
}

/* ── Mobile (hidden desktop) ── */
.i360-mobile-carousel {
    display: none;
}

/* Arrows inside mobile viewport hidden by default */
.i360-m-arrows {
    display: none;
}

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 768px) {
    .i360-video-slider {
        padding: 32px 0;
        align-items: flex-start;
    }

    .i360-card-media,
    .i360-card-content,
    .i360-tabs-wrapper {
        display: none;
    }

    .i360-mobile-carousel {
        display: block;
        order: 1;
        width: 100%;
    }

    .i360-section {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        max-width: 100%;
        overflow: hidden;
    }

    .i360-section-title {
        font-size: 32px;
        text-align: left;
        margin-bottom: 20px;
        padding: 0 20px;
    }

    /* Carousel track */
    .i360-m-viewport {
        width: 100%;
        overflow: hidden;
        position: relative;
    }

    .i360-m-track {
        display: flex;
        transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
        will-change: transform;
    }

    .i360-m-track.dragging {
        transition: none;
    }

    .i360-m-slide {
        flex: 0 0 calc(100% - 70px);
        margin: 0 6px;
        border-radius: 20px;
        overflow: hidden;
        position: relative;
        background: #1a1a1a;
        transition: opacity 0.4s ease;
        opacity: 0.4;
    }

    .i360-m-slide.active {
        opacity: 1;
    }

    .i360-m-slide:first-child {
        margin-left: 20px;
    }

    .i360-m-slide:last-child {
        margin-right: 20px;
    }

    .i360-m-slide video {
        width: 100%;
        aspect-ratio: 16 / 10;
        object-fit: cover;
        display: block;
    }

    .i360-m-progress {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 3px;
        background: rgba(255, 255, 255, 0.15);
    }

    .i360-m-progress-fill {
        height: 100%;
        background: #3da0f0;
        width: 0;
    }

    .i360-m-slide.active .i360-m-progress-fill {
        animation: i360ProgressFill var(--i360-duration, 5s) linear forwards;
    }

    /* Mobile tabs */
    .i360-m-tabs {
        padding: 20px 20px 0;
        position: relative;
        overflow: hidden;
        width: 100%;
        -webkit-mask-image: linear-gradient(to right, transparent 0%, black 20px, black calc(100% - 20px), transparent 100%);
        mask-image: linear-gradient(to right, transparent 0%, black 20px, black calc(100% - 20px), transparent 100%);
    }

    .i360-m-tabs-inner {
        background: #1a1a1a;
        border-radius: 80px;
        display: inline-flex;
        position: relative;
        overflow: hidden;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .i360-m-tab-highlight {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        border-radius: 80px;
        background: radial-gradient(103.64% 128.57% at 46.19% -0.57%, rgb(0, 64, 164) 0%, rgb(61, 160, 240) 60%, rgb(225, 241, 255) 100%);
        z-index: 1;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .i360-m-tab-btn {
        position: relative;
        z-index: 2;
        padding: 10px 20px;
        font-size: 13px;
        font-weight: 700;
        font-family: inherit;
        color: rgb(175, 177, 180);
        background: none;
        border: none;
        cursor: pointer;
        transition: color 0.3s ease, opacity 0.3s ease;
        white-space: nowrap;
        text-transform: uppercase;
        letter-spacing: 0.02em;
        opacity: 0.3;
    }

    .i360-m-tab-btn.active {
        color: #fff;
        opacity: 1;
    }

    /* Mobile text */
    .i360-m-text-container {
        padding: 16px 20px 0;
        position: relative;
        min-height: 100px;
    }

    .i360-m-text {
        font-size: 15px;
        line-height: 1.6;
        color: rgb(175, 177, 180);
        opacity: 0;
        transform: translateY(6px);
        transition: opacity 0.35s ease, transform 0.35s ease;
        position: absolute;
        top: 16px;
        left: 20px;
        right: 20px;
        pointer-events: none;
    }

    .i360-m-text.active {
        opacity: 1;
        transform: translateY(0);
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        pointer-events: auto;
    }

    /* Mobile arrows */
    .i360-m-arrows {
        display: none;
    }

    .i360-m-arrows .i360-arrow-btn {
        width: 40px;
        height: 40px;
    }

    .i360-m-arrows .i360-arrow-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* ============================================================
   THEME — LIGHT
   ============================================================ */
.i360-video-slider.i360-theme-light {
    color: #1d1d1f;
    background-color: #f5f5f7;
}

.i360-video-slider.i360-theme-light .i360-section-title {
    color: #1d1d1f;
}

.i360-video-slider.i360-theme-light .i360-tabs-wrapper,
.i360-video-slider.i360-theme-light .i360-card-media,
.i360-video-slider.i360-theme-light .i360-card-content {
    background: #fff;
}

.i360-video-slider.i360-theme-light .i360-tab-highlight {
    background: radial-gradient(103.64% 128.57% at 46.19% -0.57%, rgb(0, 40, 120) 0%, rgb(0, 102, 204) 60%, rgb(61, 160, 240) 100%);
}

.i360-video-slider.i360-theme-light .i360-tab-btn {
    color: #6e6e73;
}

.i360-video-slider.i360-theme-light .i360-tab-btn.active {
    color: #fff;
}

.i360-video-slider.i360-theme-light .i360-card-text {
    color: #6e6e73;
}

.i360-video-slider.i360-theme-light .i360-progress {
    background: rgba(0, 0, 0, 0.1);
}

.i360-video-slider.i360-theme-light .i360-arrow-btn {
    background: rgba(0, 0, 0, 0.06);
    color: #1d1d1f;
}

.i360-video-slider.i360-theme-light .i360-arrow-btn:hover {
    background: rgba(0, 0, 0, 0.12);
}

/* Mobile light */
@media (max-width: 768px) {
    .i360-video-slider.i360-theme-light .i360-m-slide {
        background: #fff;
    }

    .i360-video-slider.i360-theme-light .i360-m-tabs-inner {
        background: #fff;
    }

    .i360-video-slider.i360-theme-light .i360-m-tab-highlight {
        background: radial-gradient(103.64% 128.57% at 46.19% -0.57%, rgb(0, 40, 120) 0%, rgb(0, 102, 204) 60%, rgb(61, 160, 240) 100%);
    }

    .i360-video-slider.i360-theme-light .i360-m-tab-btn {
        color: #6e6e73;
    }

    .i360-video-slider.i360-theme-light .i360-m-tab-btn.active {
        color: #fff;
    }

    .i360-video-slider.i360-theme-light .i360-m-text {
        color: #6e6e73;
    }

    .i360-video-slider.i360-theme-light .i360-m-progress {
        background: rgba(0, 0, 0, 0.1);
    }
}

/* ============================================================
   LAYOUT — STACKED (testo sotto il video)
   Usa il DOM del mobile carousel anche su desktop
   ============================================================ */
.i360-video-slider.i360-layout-stacked .i360-section {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    max-width: 1200px;
    width: 100%;
}

/* Nascondi il layout side */
.i360-video-slider.i360-layout-stacked .i360-card-media,
.i360-video-slider.i360-layout-stacked .i360-card-content,
.i360-video-slider.i360-layout-stacked .i360-tabs-wrapper {
    display: none;
}

/* Mostra il carousel "mobile" anche su desktop */
.i360-video-slider.i360-layout-stacked .i360-mobile-carousel {
    display: block;
    width: 100%;
    position: relative;
}

.i360-video-slider.i360-layout-stacked .i360-m-viewport {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.i360-video-slider.i360-layout-stacked .i360-m-track {
    display: flex;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.i360-video-slider.i360-layout-stacked .i360-m-track.dragging {
    transition: none;
}

.i360-video-slider.i360-layout-stacked .i360-m-slide {
    flex: 0 0 70%;
    margin: 0 12px;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    background: #1a1a1a;
    transition: opacity 0.4s ease;
    opacity: 0.4;
}

.i360-video-slider.i360-layout-stacked .i360-m-slide.active {
    opacity: 1;
}

.i360-video-slider.i360-layout-stacked .i360-m-slide:first-child {
    margin-left: 15%;
}

.i360-video-slider.i360-layout-stacked .i360-m-slide:last-child {
    margin-right: 15%;
}

.i360-video-slider.i360-layout-stacked .i360-m-slide video {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.i360-video-slider.i360-layout-stacked .i360-m-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
}

.i360-video-slider.i360-layout-stacked .i360-m-progress-fill {
    height: 100%;
    background: #3da0f0;
    width: 0;
}

.i360-video-slider.i360-layout-stacked .i360-m-slide.active .i360-m-progress-fill {
    animation: i360ProgressFill var(--i360-duration, 5s) linear forwards;
}

/* Frecce overlay al centro verticale del video */
.i360-video-slider.i360-layout-stacked .i360-m-arrows {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20px;
    right: 20px;
    pointer-events: none;
    z-index: 3;
    /* Le frecce si allineano al centro verticale del video (il video usa aspect-ratio,
       quindi le frecce centrate verticalmente nel viewport coincidono col centro video) */
}

.i360-video-slider.i360-layout-stacked .i360-m-arrows .i360-arrow-btn {
    pointer-events: auto;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity 0.25s ease, background 0.2s ease;
}

.i360-video-slider.i360-layout-stacked .i360-m-arrows .i360-arrow-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.i360-video-slider.i360-layout-stacked .i360-m-arrows .i360-arrow-btn.i360-arrow-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Tabs centrati sotto il video */
.i360-video-slider.i360-layout-stacked .i360-m-tabs {
    padding: 32px 20px 0;
    display: flex;
    justify-content: center;
    position: relative;
    overflow: visible;
    width: 100%;
    -webkit-mask-image: none;
    mask-image: none;
}

.i360-video-slider.i360-layout-stacked .i360-m-tabs-inner {
    background: #2a2a2a;
    border-radius: 80px;
    display: inline-flex;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.i360-video-slider.i360-layout-stacked .i360-m-tab-highlight {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 80px;
    background: #fff;
    z-index: 1;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.i360-video-slider.i360-layout-stacked .i360-m-tab-btn.active {
    color: #000;
    opacity: 1;
}

.i360-video-slider.i360-layout-stacked .i360-m-tab-btn {
    position: relative;
    z-index: 2;
    padding: 11px 28px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    color: rgb(175, 177, 180);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease, opacity 0.3s ease;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    opacity: 1;
}

/* Testo centrato sotto i tab */
.i360-video-slider.i360-layout-stacked .i360-m-text-container {
    padding: 20px 20px 0;
    position: relative;
    min-height: 60px;
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
}

.i360-video-slider.i360-layout-stacked .i360-m-text {
    font-size: 15px;
    line-height: 1.6;
    color: rgb(175, 177, 180);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    pointer-events: none;
    text-align: center;
}

.i360-video-slider.i360-layout-stacked .i360-m-text.active {
    opacity: 1;
    transform: translateY(0);
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    pointer-events: auto;
}

/* Stacked + Light */
.i360-video-slider.i360-layout-stacked.i360-theme-light .i360-m-slide {
    background: #fff;
}

.i360-video-slider.i360-layout-stacked.i360-theme-light .i360-m-tabs-inner {
    background: #f0f0f0;
}

.i360-video-slider.i360-layout-stacked.i360-theme-light .i360-m-tab-highlight {
    background: #000;
}

.i360-video-slider.i360-layout-stacked.i360-theme-light .i360-m-tab-btn {
    color: #6e6e73;
}

.i360-video-slider.i360-layout-stacked.i360-theme-light .i360-m-tab-btn.active {
    color: #fff;
}

.i360-video-slider.i360-layout-stacked.i360-theme-light .i360-m-text {
    color: #6e6e73;
}

.i360-video-slider.i360-layout-stacked.i360-theme-light .i360-m-progress {
    background: rgba(0, 0, 0, 0.1);
}

/* Stacked mobile: slide più larga, peek ridotto, frecce nascoste */
@media (max-width: 768px) {
    .i360-video-slider.i360-layout-stacked .i360-m-slide {
        flex: 0 0 calc(100% - 70px);
        margin: 0 6px;
        border-radius: 20px;
    }

    .i360-video-slider.i360-layout-stacked .i360-m-slide:first-child {
        margin-left: 20px;
    }

    .i360-video-slider.i360-layout-stacked .i360-m-slide:last-child {
        margin-right: 20px;
    }

    .i360-video-slider.i360-layout-stacked .i360-m-slide video {
        aspect-ratio: 16 / 10;
    }

    .i360-video-slider.i360-layout-stacked .i360-m-arrows {
        display: none;
    }

    .i360-video-slider.i360-layout-stacked .i360-m-tabs {
        display: block;
        padding: 20px 20px 0;
        overflow: hidden;
        -webkit-mask-image: linear-gradient(to right, transparent 0%, black 20px, black calc(100% - 20px), transparent 100%);
        mask-image: linear-gradient(to right, transparent 0%, black 20px, black calc(100% - 20px), transparent 100%);
    }

    .i360-video-slider.i360-layout-stacked .i360-m-tab-btn {
        padding: 10px 20px;
        font-size: 13px;
        opacity: 0.3;
    }

    .i360-video-slider.i360-layout-stacked .i360-m-tab-btn.active {
        opacity: 1;
    }

    .i360-video-slider.i360-layout-stacked .i360-m-text-container {
        padding: 16px 20px 0;
        text-align: left;
    }

    .i360-video-slider.i360-layout-stacked .i360-m-text {
        text-align: left;
        top: 16px;
    }
}