/* Testimonianze Shortcode Styles - Design Benefit con Card Bianche */

.my-shortcodes-testimonianze {
    max-width: 1400px;
    margin: 0 auto;
    padding: 6rem 2rem;
    position: relative;
    overflow: hidden;
    /* background: linear-gradient(135deg, #1e293b 0%, #334155 100%); */
    /* Previene overflow orizzontale */
    width: 100%;
    box-sizing: border-box;
}

/* Header della sezione con stile benefit */
.testimonianze-header {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    z-index: 3;
}


.testimonianze-subtitle {
    display: inline-block;
    font-size: 0.9rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    position: relative;
}

.testimonianze-subtitle::before,
.testimonianze-subtitle::after {
    content: "|";
    margin: 0 6px;
    color: #d94f34;
}


.testimonianze-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 1rem 0;
}

.title-underline {
    width: 120px;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
    margin: 0 auto 1.5rem;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.title-underline::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

.testimonianze-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #e5e7eb;
    margin: 0;
    max-width: 600px;
    margin: 0 auto;
}

/* Container del carosello con nuova logica */
.testimonianze-carousel-wrapper {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 60px;
    /* Previene overflow orizzontale */
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.testimonianze-carousel {
    display: flex;
    gap: 2rem;
    /* Scroll orizzontale per vedere tutte le card */
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
    /* Scroll-snap solo su mobile */
    scroll-snap-type: x mandatory;
    /* Previene overflow orizzontale */
    width: 100%;
    box-sizing: border-box;
}

.testimonianze-carousel::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari/Opera */
}

/* Card testimonianza con scroll-snap */
.testimonianza-card {
    min-width: calc(50% - 1rem);
    background: #ffffff;
    border-radius: 24px;
    padding: 3rem 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #f1f5f9;
    /* Nuova logica: scroll-snap per centraggio perfetto */
    scroll-snap-align: center;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: 500px; /* Altezza fissa per tutte le card */
}

.testimonianza-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

/* Logo azienda - 20% dell'altezza */
.testimonianza-logo {
    text-align: center;
    height: 20%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    margin-bottom: 0;
}

.testimonianza-logo img {
    max-width: 140px;
    height: 60px !important;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

.testimonianza-logo img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* Sezione nome azienda e imprenditore - 10% dell'altezza */
.testimonianza-azienda {
    font-size: 1.6rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
    text-align: center;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.testimonianza-imprenditore {
    font-size: 1.1rem;
    color: #64748b;
    margin: 0;
    text-align: center;
    font-style: italic;
    font-weight: 500;
    line-height: 1.3;
}

/* Container per nome azienda e imprenditore */
.testimonianza-names {
    height: 20%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Testo testimonianza - 70% dell'altezza */
.testimonianza-testo {
    text-align: center;
    padding: 0 0.5rem;
    height: 60%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.testimonianza-testo p {
    font-size: 1.05rem;
    color: #374151;
    line-height: 1.8;
    margin: 0;
    font-style: italic;
    font-weight: 400;
    max-width: 100%;
    word-wrap: break-word;
    hyphens: auto;
}

/* Elementi decorativi */
.testimonianza-ornaments {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: -1;
}

.ornament {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(59, 130, 246, 0.05), rgba(147, 51, 234, 0.05));
}

.ornament-1 {
    width: 60px;
    height: 60px;
    top: 20px;
    right: 20px;
}

.ornament-2 {
    width: 40px;
    height: 40px;
    bottom: 20px;
    left: 20px;
}

/* Frecce di navigazione */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.carousel-arrow:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
    transform: translateY(-50%) scale(1.1);
}

.carousel-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-prev {
    left: 0;
}

.carousel-next {
    right: 0;
}

.carousel-arrow svg {
    width: 20px;
    height: 20px;
}

/* Indicatori (dots) */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 2rem;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e2e8f0;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot:hover {
    background: #cbd5e1;
}

.carousel-dot.active {
    background: #3b82f6;
    transform: scale(1.2);
}

/* Elementi grafici di sfondo */
.background-elements {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: -1;
    /* Previene overflow orizzontale */
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.floating-circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.1));
    animation: float 6s ease-in-out infinite;
}

.circle-1 {
    width: 100px;
    height: 100px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
    /* Previene overflow orizzontale - corretto */
    max-left: calc(100% - 100px);
    left: min(10%, calc(100% - 100px));
}

.circle-2 {
    width: 80px;
    height: 80px;
    bottom: 30%;
    right: 15%;
    animation-delay: 3s;
    /* Previene overflow orizzontale - corretto */
    max-right: calc(100% - 80px);
    right: min(15%, calc(100% - 80px));
}

.wave-element {
    position: absolute;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.05), rgba(147, 51, 234, 0.05));
    border-radius: 50%;
    animation: wave 8s ease-in-out infinite;
}

.wave-1 {
    width: 200px;
    height: 200px;
    top: 10%;
    right: 5%;
    animation-delay: 0s;
    /* Previene overflow orizzontale - corretto */
    max-right: calc(100% - 200px);
    right: min(5%, calc(100% - 200px));
}

.wave-2 {
    width: 150px;
    height: 150px;
    bottom: 20%;
    left: 5%;
    animation-delay: 4s;
    /* Previene overflow orizzontale - corretto */
    max-left: calc(100% - 150px);
    left: min(5%, calc(100% - 150px));
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes wave {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 0.6;
    }
}

/* Controllo globale overflow orizzontale */
* {
    box-sizing: border-box;
}

/* Prevenzione overflow orizzontale globale */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Assicura che il container principale non causi overflow */
.my-shortcodes-testimonianze {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Controllo più rigoroso per gli elementi decorativi */
.background-elements {
    overflow: hidden;
    max-width: 100%;
}

/* Assicura che le card non causino overflow */
.testimonianza-card {
    max-width: 100%;
    overflow: hidden;
}

/* Responsive Design con nuova logica */
@media (max-width: 1024px) {
    .testimonianza-card {
        min-width: 100% !important;
        width: 100% !important;
        flex-shrink: 0 !important;
    }

    .testimonianze-carousel-wrapper {
        padding: 0 40px;
    }

    .testimonianze-title {
        font-size: 3rem;
    }

    /* Su mobile: usa scroll-snap per centraggio perfetto */
    .testimonianze-carousel {
        scroll-snap-type: x proximity;
        gap: 0;
        /* Previene scroll automatico ma mantiene scroll normale */
        overscroll-behavior: auto;
    }
}

@media (min-width: 1025px) {

    /* Su desktop: mostra 2 card per volta ma permette scroll per vedere le altre */
    .testimonianza-card {
        min-width: calc(50% - 1rem);
        width: calc(50% - 1rem);
        flex-shrink: 0;
    }

    .testimonianze-carousel {
        scroll-snap-type: none;
        /* Disabilita scroll-snap su desktop */
        /* Assicura che il contenuto si espanda correttamente */
        justify-content: flex-start;
        /* Scroll fluido e controllato */
        scroll-behavior: smooth;
    }

    /* Assicura che il wrapper del carosello gestisca correttamente lo scroll */
    .testimonianze-carousel-wrapper {
        overflow: hidden;
        /* Nasconde scrollbar ma mantiene funzionalità */
    }

    /* Assicura che tutte le card siano visibili e scrollabili */
    .testimonianza-card {
        position: relative;
        z-index: 1;
    }
}

@media (max-width: 768px) {
    .my-shortcodes-testimonianze {
        padding: 4rem 1rem;
    }

    .testimonianze-header {
        margin-bottom: 3rem;
    }

    .testimonianze-title {
        font-size: 2.5rem;
    }

    .testimonianza-card {
        padding: 2rem;
        min-width: 100% !important;
        width: 100% !important;
        flex-shrink: 0 !important;
    }

    .testimonianze-carousel-wrapper {
        padding: 0 20px;
    }

    .carousel-arrow {
        width: 40px;
        height: 40px;
    }

    .carousel-arrow svg {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .testimonianze-title {
        font-size: 2rem;
    }

    .testimonianza-card {
        padding: 1.5rem;
        min-width: 100% !important;
        width: 100% !important;
        flex-shrink: 0 !important;
    }

    .testimonianza-azienda {
        font-size: 1.3rem;
    }

    .testimonianza-testo p {
        font-size: 0.9rem;
    }
    
    .testimonianze-carousel-wrapper {
        padding: 0 10px;
    }
}

/* Animazioni di entrata */
.testimonianza-card {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

.testimonianza-card:nth-child(1) {
    animation-delay: 0.1s;
}

.testimonianza-card:nth-child(2) {
    animation-delay: 0.2s;
}

.testimonianza-card:nth-child(3) {
    animation-delay: 0.3s;
}

.testimonianza-card:nth-child(4) {
    animation-delay: 0.4s;
}

.testimonianza-card:nth-child(5) {
    animation-delay: 0.5s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}