/* Namespace per evitare conflitti */
.sa-slider-container,
.slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 1440 / 1004;
    max-height: 100vh;
}

.slide::before {
    background-image: linear-gradient(353deg, rgba(0, 0, 0, 0) 10.14%, rgba(0, 0, 0, 0.7) 92.84%);
    position: absolute;
    content: "";
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    pointer-events: none;
    z-index: 0;
}

@media screen and (max-width: 1083px) {

    .sa-slider-container,
    .slider-container {
        aspect-ratio: 415 / 525;
        height: auto;
        margin-top: 195px;
    }
}

.slider-inner-container {
    position: relative;
    width: 1100px;
    height: 100%;
    margin: 0 auto;
    z-index: 5;
    --container-width: 1100px;
    --textbox-width: 461px;
}

@media screen and (max-width: 1083px) {
    .slider-inner-container {
        width: 100vw;
        max-width: 1100px;
    }
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

.slide.prev-active {
    opacity: 1;
    z-index: 1;
}

.slide-1 {
    /* background-image gestito dinamicamente dal PHP */
}

.slide-2 {
    /* background-image gestito dinamicamente dal PHP */
}

.slide-3 {
    /* background-image gestito dinamicamente dal PHP */
}

.text-box {
    position: absolute;
    background: transparent;
    width: 461px;
    height: 461px;
    padding: 40px;
    transition: left 0.8s ease-in-out, top 0.8s ease-in-out, transform 0.8s ease-in-out, background 0.8s ease-in-out, opacity 0.8s ease-in-out;
    z-index: 10;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease-in-out;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.text-content-hidden {
    opacity: 0;
    visibility: hidden;
    z-index: 0;
    pointer-events: none;
}

/* Typography styles */
.typography-uppercase {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 55px;
    line-height: 65px;
    text-transform: uppercase;
    color: white;
    letter-spacing: 0.5px;
}

/* Tablet */
@media screen and (max-width: 1083px) {
    .typography-uppercase {
        font-size: 42px;
        line-height: 44px;
    }
}

@media screen and (max-width: 580px) {
    .typography-uppercase {
        font-size: 33px;
        line-height: 38px;
    }
}

/* Tablet portrait - fino a 767px */
@media screen and (max-width: 767px) {}

.typography-cursive {
    font-family: 'Hurricane', cursive;
    font-size: 170px;
    line-height: 76px;
    color: white;
    font-weight: 400;
}

@media screen and (max-width: 580px) {
    .typography-cursive {
        font-size: 100px;
        line-height: 54px;
    }
}

/* Specific text line styles */
.text-line-1 {
    margin-bottom: -5px;
}


.text-cursive {
    margin-top: 20px;
}

.dotted-separator {
    margin: 15px auto 25px;
    width: 390px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dotted-separator img {
    width: 100%;
    height: auto;
}

@media screen and (max-width: 767px) {
    .dotted-separator {
        width: 280px
    }
}

.text-box h2 {
    font-size: 24px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.text-box .subtitle {
    font-style: italic;
    font-size: 32px;
    margin-bottom: 15px;
}

.text-box .description {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Posizioni del box per ogni slide */
.position-1 {
    left: 0;
    top: 28%;
    transform: translateX(0);
    opacity: 0.8;
    background: var(--Prugna, #728FBC);
}

@media screen and (max-width: 1083px) {
    .position-1 {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
}

@media screen and (max-width: 580px) {

    .position-1,
    .position-2,
    .position-3 {
        width: 53vw;
        height: 53vw;
    }
}

.position-2 {
    left: 0;
    top: 45%;
    transform: translateX(0);
    opacity: 0.8;
    background: var(--Rosso-caldo, #FD6A64);
}

@media screen and (max-width: 1083px) {
    .position-2 {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
}

.position-3 {
    left: 0;
    top: 30%;
    transform: translateX(calc(var(--container-width) - var(--textbox-width)));
    opacity: 0.9;
    background: var(--Verde-Salvia, #53936E);
}

@media screen and (max-width: 1083px) {
    .position-3 {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
}

.sa-slider-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    border-radius: 25px;
    padding: 8px 12px;
    gap: 15px;
    z-index: 10;
}

/* Slide 1 elements */
.text-content[data-slide="1"] [data-element="elemento1"] {
    text-align: left;
    transform: translateX(220px);
}

@media screen and (max-width: 1083px) {
    .text-content[data-slide="1"] [data-element="elemento1"] {
        text-align: left;
        transform: translateX(-10px);
    }
}

@media screen and (max-width: 767px) {
    .text-content[data-slide="1"] [data-element="elemento1"] {
        text-align: left;
        transform: translateX(-10px);
    }
}

@media screen and (max-width: 478px) {
    .text-content[data-slide="1"] [data-element="elemento1"] {
        text-align: left;
        transform: translateX(-10px);
    }
}

.text-content[data-slide="1"] [data-element="elemento2"] {
    text-align: left;
    transform: translateX(220px);
}

@media screen and (max-width: 1083px) {
    .text-content[data-slide="1"] [data-element="elemento2"] {
        text-align: left;
        transform: translateX(0px);
    }
}

@media screen and (max-width: 767px) {
    .text-content[data-slide="1"] [data-element="elemento2"] {
        text-align: left;
        transform: translateX(0px);
    }
}

@media screen and (max-width: 478px) {
    .text-content[data-slide="1"] [data-element="elemento2"] {
        text-align: left;
        transform: translateX(0px);
    }
}

.text-content[data-slide="1"] [data-element="elemento3"] {
    transform: translateX(220px);
}

@media screen and (max-width: 1083px) {
    .text-content[data-slide="1"] [data-element="elemento3"] {
        transform: translateX(90px);
    }
}

@media screen and (max-width: 767px) {
    .text-content[data-slide="1"] [data-element="elemento3"] {
        transform: translateX(50px);
    }
}

@media screen and (max-width: 478px) {
    .text-content[data-slide="1"] [data-element="elemento3"] {
        transform: translateX(-29px);
    }
}

.text-content[data-slide="1"] [data-element="elemento4"] {
    transform: translateX(70px);
}

@media screen and (max-width: 1083px) {
    .text-content[data-slide="1"] [data-element="elemento4"] {
        transform: translateX(-100px);
    }
}

@media screen and (max-width: 767px) {
    .text-content[data-slide="1"] [data-element="elemento4"] {
        transform: translateX(-100px);
    }
}

@media screen and (max-width: 478px) {
    .text-content[data-slide="1"] [data-element="elemento4"] {
        transform: translateX(-30px);
    }
}

/* Slide 2 elements */
.text-content[data-slide="2"] [data-element="elemento1"] {
    transform: translateY(-40px);
}

@media screen and (max-width: 1083px) {
    .text-content[data-slide="2"] [data-element="elemento1"] {
        transform: translate(-70px, -40px)
    }
}

@media screen and (max-width: 767px) {
    .text-content[data-slide="2"] [data-element="elemento1"] {
        transform: translate(-62px, -10px);
    }
}

@media screen and (max-width: 478px) {
    .text-content[data-slide="2"] [data-element="elemento1"] {
        transform: translateY(-40px);
    }
}

.text-content[data-slide="2"] [data-element="elemento2"] {}

@media screen and (max-width: 1083px) {
    .text-content[data-slide="2"] [data-element="elemento2"] {}
}

@media screen and (max-width: 767px) {
    .text-content[data-slide="2"] [data-element="elemento2"] {
        transform: translate(-47px, 15px)
    }
}

@media screen and (max-width: 478px) {
    .text-content[data-slide="2"] [data-element="elemento2"] {}
}

.text-content[data-slide="2"] [data-element="elemento3"] {
    transform: translate(111px, 25px);
}

@media screen and (max-width: 1083px) {
    .text-content[data-slide="2"] [data-element="elemento3"] {
        transform: translate(111px, 25px);
    }
}

@media screen and (max-width: 767px) {
    .text-content[data-slide="2"] [data-element="elemento3"] {
        transform: translate(61px, 25px)
    }
}

@media screen and (max-width: 478px) {
    .text-content[data-slide="2"] [data-element="elemento3"] {
        transform: translate(-34px, 25px);
    }
}

.text-content[data-slide="2"] [data-element="elemento4"] {
    transform: translateX(150px);
}

@media screen and (max-width: 1083px) {
    .text-content[data-slide="2"] [data-element="elemento4"] {
        transform: translate(80px, 23px)
    }
}

@media screen and (max-width: 767px) {
    .text-content[data-slide="2"] [data-element="elemento4"] {
        transform: translateX(33px)
    }
}

@media screen and (max-width: 478px) {
    .text-content[data-slide="2"] [data-element="elemento4"] {
        transform: translateX(0px);
    }
}

.text-content[data-slide="2"] [data-element="elemento5"] {}

@media screen and (max-width: 1083px) {
    .text-content[data-slide="2"] [data-element="elemento5"] {}
}

@media screen and (max-width: 767px) {
    .text-content[data-slide="2"] [data-element="elemento5"] {}
}

@media screen and (max-width: 478px) {
    .text-content[data-slide="2"] [data-element="elemento5"] {}
}

/* Slide 3 elements */
.text-content[data-slide="3"] [data-element="elemento1"] {
    text-align: left;
    transform: translate(70px, 0px);
}

@media screen and (max-width: 1083px) {
    .text-content[data-slide="3"] [data-element="elemento1"] {
        text-align: left;
        transform: translate(-70px, 0px)
    }
}

@media screen and (max-width: 767px) {
    .text-content[data-slide="3"] [data-element="elemento1"] {
        text-align: left;
        transform: translate(-30px, 0px)
    }
}

@media screen and (max-width: 478px) {
    .text-content[data-slide="3"] [data-element="elemento1"] {
        text-align: left;
        transform: translate(0px, 0px);
    }
}

.text-content[data-slide="3"] [data-element="elemento2"] {

    transform: translate(70px, 10px);
}

@media screen and (max-width: 1083px) {
    .text-content[data-slide="3"] [data-element="elemento2"] {

        transform: translate(41px, 10px)
    }
}

@media screen and (max-width: 767px) {
    .text-content[data-slide="3"] [data-element="elemento2"] {

        transform: translate(20px, 10px)
    }
}

@media screen and (max-width: 478px) {
    .text-content[data-slide="3"] [data-element="elemento2"] {
        width: 280px;
        transform: translate(-20px, 10px);
    }
}

.text-content[data-slide="3"] [data-element="elemento3"] {
    transform: translate(19px, 30px);
}

@media screen and (max-width: 1083px) {
    .text-content[data-slide="3"] [data-element="elemento3"] {
        transform: translate(-5px, 30px)
    }
}

@media screen and (max-width: 767px) {
    .text-content[data-slide="3"] [data-element="elemento3"] {
        transform: translate(19px, -8px)
    }
}

@media screen and (max-width: 478px) {
    .text-content[data-slide="3"] [data-element="elemento3"] {
        transform: translate(-2px, -10px)
    }
}

.sa-nav-btn {
    background: #353535;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 50%;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 43px;
    height: 43px;
}

.sa-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sa-pause-btn {
    background: #353535;
    border: none;
    color: white;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 20px;
    transition: background 0.3s ease;
    text-transform: uppercase;
    height: 43px;
}

.sa-pause-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sa-pause-btn.paused {
    color: #f39c12;
}

.dotted-line {
    position: relative;
    margin: 10px 0;
}

.dotted-line::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 60px;
    height: 1px;
    background: repeating-linear-gradient(to right, currentColor 0, currentColor 3px, transparent 3px, transparent 6px);
}

.text-group {
    display: flex;
    align-items: baseline;
    flex-direction: row;
    gap: 15px;
}

/* Media query for responsive behavior
@media (max-width: 1200px) {
    .slider-inner-container {
        width: 95vw;
        max-width: 1100px;
        --container-width: 95vw;
    }

    .text-box {
        width: min(461px, 42vw);
        height: min(461px, 42vw);
        --textbox-width: min(461px, 42vw);
    }

    .position-3 {
        transform: translateX(calc(95vw - min(461px, 42vw)));
    }
} */

/* Mobile - fino a 478px */
@media screen and (max-width: 478px) {}

/* Mobile portrait - fino a 767px */
@media screen and (max-width: 767px) {
    /* Stili per tablet in modalità portrait e mobile large */

}

/* Tablet */
@media screen and (max-width: 1083px) {
    /* Stili per desktop small e tablet in modalità landscape */

}