body {
    background-color: #fdf6ec;
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
}

/* ==========================
   SEZIONE TRATTAMENTI
========================== */
.trattamenti-section {
    padding: 100px 0;
    max-width: 1200px;
}

/* Titoli */
.titolo-sezione {
    font-family: 'Playfair Display', serif;
    color: #b77a50;
    font-size: 2.3rem;
    margin-bottom: 15px;
}

/* Descrizione e liste */
.descrizione {
    font-size: 1.05rem;
    color: #444;
    margin-bottom: 15px;
    line-height: 1.6;
}

ul {
    list-style: disc;
    padding-left: 25px;
    color: #555;
}

/* ==========================
   CUBO 3D ROTANTE
========================== */
.cube-slider {
    perspective: 1200px;
    width: 380px;
    height: 380px;
    margin: 0 auto;
    position: relative;
}

.cube {
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: rotateCube 18s infinite linear;
    transform-origin: center;
}

.cube img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0px;
    backface-visibility: hidden;
    box-shadow: 0 8px 16px rgba(0,0,0,0.25);
}

/* Facce del cubo */
.cube img:nth-child(1) { transform: rotateY(0deg) translateZ(190px); }
.cube img:nth-child(2) { transform: rotateY(90deg) translateZ(190px); }
.cube img:nth-child(3) { transform: rotateY(180deg) translateZ(190px); }
.cube img:nth-child(4) { transform: rotateY(-90deg) translateZ(190px); }

@keyframes rotateCube {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

/* ==========================
   LAYOUT BLOCCO TRATTAMENTO
========================== */
.trattamento-blocco {
    display: flex;
    align-items: left;
    justify-content: space-between;
    margin-bottom: 100px;
    flex-wrap: nowrap;
    gap: 3px;
}

.trattamento-blocco:nth-child(even) {
    flex-direction: row-reverse;
}

.trattamento-blocco .col-md-6 {
    flex: 1;
}

/* Testo */
.trattamento-blocco .text-start {
    padding: 0 40px;
}

/* ==========================
   RESPONSIVE
========================== */
@media (max-width: 992px) {
    .cube-slider {
        width: 300px;
        height: 300px;
    }
    .cube img:nth-child(1),
    .cube img:nth-child(2),
    .cube img:nth-child(3),
    .cube img:nth-child(4) {
        transform: none !important;
        opacity: 0;
    }
    .cube img:nth-child(1) {
        opacity: 1;
    }
    .cube {
        animation: none;
    }
}

@media (max-width: 768px) {
    .trattamento-blocco {
        flex-direction: column;
        text-align: left;
        margin-bottom: 60px;
    }
    .trattamento-blocco .text-start {
        padding: 0;
    }
    .cube-slider {
        margin-bottom: 20px;
    }
    .titolo-sezione {
        font-size: 1.8rem;
    }
}

/* contenitore generale del blocco */
.cube-slider {
    width: 380px;
    height: 380px;
    margin: 0 auto;
    position: relative;
}

/* --- DESKTOP: cubo 3D (come prima) --- */
.cube-wrapper { width:100%; height:100%; perspective:1200px; }
.cube {
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: rotateCube 18s infinite linear;
    transform-origin: center;
}
.cube img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0px;
    backface-visibility: hidden;
    box-shadow: 0 8px 18px rgba(0,0,0,0.25);
}

/* facce */
.cube img:nth-child(1) { transform: rotateY(0deg) translateZ(calc(50%)); }
.cube img:nth-child(2) { transform: rotateY(90deg) translateZ(calc(50%)); }
.cube img:nth-child(3) { transform: rotateY(180deg) translateZ(calc(50%)); }
.cube img:nth-child(4) { transform: rotateY(-90deg) translateZ(calc(50%)); }
@keyframes rotateCube { from{transform:rotateY(0deg);} to{transform:rotateY(360deg);} }

/* --- MOBILE: slideshow a dissolvenza --- */
.mobile-slider {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: none; /* attivo via media query su mobile */
}
.mobile-slider img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 700ms ease-in-out;
    border-radius: 0px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.18);
}
/* immagine iniziale visibile */
.mobile-slider img.active {
    opacity: 1;
}

/* piccoli indicatori */
.mobile-slider .ms-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display:flex;
    gap:6px;
    z-index: 5;
}
.mobile-slider .ms-indicators button {
    width:10px; height:10px; border-radius:50%;
    background: rgba(255,255,255,0.6); border:none;
    padding:0; cursor:pointer;
}
.mobile-slider .ms-indicators button.active {
    background: #b77a50;
}

/* =========================
   VISIBILITÀ: desktop vs mobile
   breakpoint: 992px (bootstrap md/lg)
   ========================= */
.desktop-only { display:block; }
.mobile-only { display:none; }

/* su schermi piccoli: mostra il mobile slider e nascondi il cubo */
@media (max-width: 991.98px) {
    .cube { animation: none; } /* stop 3D per mobile */
    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; height: auto; }
    .cube-slider { width: 100%; height: auto; max-width: 420px; }
    .mobile-slider { height: 260px; } /* altezza slideshow su mobile */
}

/* adattamenti: mantiene dimensioni costanti durante rotazione su desktop */
@media (min-width: 992px) {
    .cube-slider { width: 380px; height: 380px; }
}

/* accessibilità: immagini con testo laterale non sovrapposto */
.trattamento-blocco .text-start { min-height: 380px; }

/* su mobile il testo sta sotto */
@media (max-width: 991.98px) {
    .trattamento-blocco .text-start { min-height: auto; padding-top: 10px; }
}

/* ====== CORREZIONE LAYOUT MOBILE ====== */
@media (max-width: 991.98px) {
    /* Forza tutti i blocchi a colonna normale */
    .trattamento-blocco {
        flex-direction: column !important;
    }

    /* Forza immagini sopra il testo */
    .trattamento-blocco .col-md-6:first-child {
        order: 1 !important;
    }

    .trattamento-blocco .col-md-6:last-child {
        order: 2 !important;
    }

    /* Centra il testo e immagini */
    .trattamento-blocco .text-start {
        text-align: left !important;
        padding: 15px 0 !important;
    }
}