/* CABECERA */

#cabecera {
    margin-top: -75px;
    padding-top: 175px;
    padding-bottom: 50px;
    background-color: var(--gris-esparta);
    position: relative;
    overflow: hidden;
    height: calc(100vh - 3vw);
}

#cabecera .container-fluid {
    position: relative;
    overflow: visible;
}

#cabecera h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 8rem);
    text-transform: uppercase;
}

#cabecera .row {
    position: relative;
}

.cabecera-title-wrapper {
    position: relative;
    z-index: 0;
    margin-bottom: 0;
    padding-bottom: 2vw;
}

#cabecera .col-12.pt-4 {
    padding-top: 0 !important;
}

.cabecera-video-wrapper {
    display: block;
    left: 0;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    background-color: #000;
}

.video-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    transition: opacity 0.5s ease-out;
}

.video-poster.hidden {
    opacity: 0;
    pointer-events: none;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

.hero-video.loaded {
    opacity: 1;
}

.video-sound-toggle {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.video-sound-toggle:hover {
    background-color: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

.video-sound-toggle svg {
    stroke: #ffffff;
    transition: opacity 0.2s ease;
}

.video-sound-toggle:active {
    transform: scale(0.95);
}

/* SECCION 2 */

#seccion2 {
    padding: 4rem 0;
    background-color: #ffffff;
}

#seccion2 h2 {
    margin: 0;
    text-transform: uppercase;
}

#seccion2 .container-fluid .row .col-12 {
    padding: 0;
}

.servicios-carousel-wrapper {
    width: 100%;
    overflow: hidden;
    background-color: transparent;
}

.servicios-carousel {
    display: flex;
    gap: 1rem;
    animation: scroll-infinite 30s linear infinite;
}

.servicios-carousel-item {
    background-color: var(--negro-esparta);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 10px;
    gap: 10px;
    flex-shrink: 0;
    width: fit-content;
    white-space: nowrap;
}

.servicios-carousel-icon {
    width: 21px;
    height: 21px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.servicios-carousel-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.servicios-carousel-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--blanco-esparta);
    margin: 0;
    text-transform: uppercase;
}

@keyframes scroll-infinite {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.desplegables-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.desplegable-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #ffffff;
}

.desplegable-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem;
    background-color: var(--blanco-esparta);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--negro-esparta);
}

.desplegable-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.desplegable-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.desplegable-title {
    flex: 1;
    text-align: left;
    text-transform: uppercase;
    font-weight: 600;
}

.desplegable-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.chevron-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    color: #333;
}

.desplegable-header.active .chevron-icon {
    transform: rotate(180deg);
}

.desplegable-toggle i {
    display: inline-block;
    transition: transform 0.3s ease;
}

.desplegable-header.active .desplegable-toggle i {
    transform: rotate(180deg);
}

.desplegable-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background-color: var(--blanco-esparta);
}

.desplegable-content.active {
    max-height: 1000px;
}

.desplegable-body {
    padding: 0 20px 20px 20px;
    color: var(--negro-esparta);
    line-height: 1.6;
}

.desplegable-body p {
    margin: 0;
}

.desplegable-body p + p {
    margin-top: 1rem;
}

.cita-parrafo {
    border-left: 2px solid var(--naranja-esparta);
    padding-left: 1rem;
}

.cita-parrafo p {
    font-size: clamp(1.5rem, 1vw, 8rem);
}

/* CAROUSEL CLIENTES */

#carrousel-clientes {
    padding: 4rem 0;
    background-color: var(--gris-esparta);
    overflow: hidden;
}

#carrousel-clientes .col-12 {
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#carrousel-clientes h2 {
    text-align: center;
    text-transform: uppercase;
    margin: 0 auto 3rem;
    max-width: 90%;
    padding: 0 1rem;
}

.clientes-carousel-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 2rem 0;
}

.clientes-carousel {
    display: flex;
    gap: 4rem;
    width: fit-content;
    animation: scroll-clientes 40s linear infinite;
    will-change: transform;
}

.clientes-carousel:hover {
    animation-play-state: paused;
}

.clientes-carousel-item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
}

.clientes-carousel-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    width: 100%;
    padding: 0 1rem;
}

.clientes-carousel-logo img {
    max-height: 80px;
    max-width: 180px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: grayscale(100%) opacity(0.5);
    transition: filter 0.4s ease, transform 0.4s ease;
}

.clientes-carousel-item:hover .clientes-carousel-logo img {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.05);
}

@keyframes scroll-clientes {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* SECCION 3 */

#seccion3 {
    padding: 4rem 0;
    background-color: var(--negro-esparta);
}

#seccion3 h2 {
    color: var(--blanco-esparta);
    margin-bottom: 2rem;
    text-align: center;
    text-transform: uppercase;
}

.resenas-carousel-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    position: relative;
    margin-bottom: 2rem;
}

.resenas-carousel-container {
    flex: 1;
    overflow: hidden;
}

.resenas-carousel {
    display: flex;
    transition: transform 0.5s ease;
}

.resenas-carousel-item {
    flex: 0 0 100%;
    min-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resenas-item-content {
    display: flex;
    gap: 1rem;
    align-items: center;
    max-width: 100%;
    width: 100%;
}

.resenas-logo {
    flex: 0 0 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 300px;
    border-radius: 12px;
    padding: 2rem;
}

.resenas-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

.resenas-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    color: var(--blanco-esparta);
    position: relative;
}

.resenas-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -10px;
    width: 50px;
    height: 50px;
    background-image: url(../img/comillas.svg);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1;
}

.resenas-content p {
    text-wrap: balance;
    z-index: 2;
    font-size: 30px;
}

.resenas-nombre {
    font-weight: 600;
    margin: 0;
    color: var(--blanco-esparta);
    font-size: clamp(1rem, 2vw, 1.15rem) !important;
}

.resenas-empresa {
    margin: 0;
    color: rgba(244, 244, 244, 0.7);
    font-size: clamp(1rem, 2vw, 1.15rem) !important;
}

.resenas-control-btn {
    background-color: transparent;
    border: 2px solid var(--blanco-esparta);
    color: var(--blanco-esparta);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.resenas-control-btn:hover {
    background-color: var(--naranja-esparta);
    border-color: var(--naranja-esparta);
}

#esparta-digital {
    padding: 4rem 0;
}

#esparta-digital h2 {
    text-transform: uppercase;
    text-wrap: balance;
    margin: 0 0 1rem;
}

#esparta-digital p {
    margin: 0;
}

/* Video estático de esparta digital */
#esparta-digital .video-container {
    margin-top: 1.5rem;
    border-radius: 12px;
    aspect-ratio: 16/9;
    max-height: 400px;
}

#esparta-digital .video-poster,
#esparta-digital .hero-video {
    border-radius: 12px;
}

/* Estrategias List */
.estrategias-list {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.estrategia-item {
    display: flex;
    gap: 0;
    position: relative;
}

.estrategia-item:first-child {
    padding-top: 0;
}

.estrategia-content {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    flex: 1;
    position: relative;
}

.estrategia-image {
    flex-shrink: 0;
    width: 300px;
    height: 180px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f5f5f5;
    position: relative;
}

.estrategia-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.timeline-line {
    position: absolute;
    left: 150px;
    top: 180px;
    width: 1px;
    height: calc(100% + 2.5rem);
    background-color: rgba(0, 0, 0, 0.15);
    z-index: 0;
}

.estrategia-item:last-child .timeline-line {
    display: none;
}

.estrategia-text {
    flex: 1;
}

.estrategia-number {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--negro-esparta);
    opacity: 0.5;
    margin-bottom: 0.5rem;
    display: block;
}

.estrategia-text {
    flex: 1;
}

.estrategia-text h3 {
    font-size: clamp(1.5rem, 2vw, 2rem);
    font-weight: 700;
    text-transform: uppercase;
    margin: 0 0 0.75rem;
    color: var(--negro-esparta);
    line-height: 1.2;
}

.estrategia-text p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--negro-esparta);
    margin: 0;
}

@media (max-width: 1024px) {
    
}

@media (max-width: 768px) {
    #cabecera {
        margin-top: -60px;
        padding-bottom: 30px;
        height: auto;
    }

    #cabecera .row {
        gap: 0 !important;
    }

    #cabecera h1 {
        font-size: clamp(1.8rem, 8vw, 3rem);
    }

    #cabecera p {
        font-size: clamp(0.9rem, 3vw, 1.1rem);
    }

    .cabecera-title-wrapper {
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

    #cabecera .col-lg-3 {
        justify-content: flex-start !important;
    }

    #cabecera .btn-ver-todas {
        margin-top: 0 !important;
        width: 100%;
        max-width: 300px;
        margin: 0 !important;
    }

    .cabecera-video-wrapper {
        margin-top: 1.5rem;
    }

    .video-container {
        border-radius: 8px;
        min-height: 200px;
        aspect-ratio: 16/9;
    }

    .video-sound-toggle {
        width: 40px;
        height: 40px;
        bottom: 12px;
        right: 12px;
    }

    .video-sound-toggle svg {
        width: 20px;
        height: 20px;
    }

    .resenas-item-content {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .resenas-logo {
        padding: 0;
    }

    .resenas-logo img {
        height: 250px;
        width: 100%;
    }
    
    .resenas-content {
        flex: 1;
    }

    #carrousel-clientes h2 {
        font-size: clamp(1.5rem, 4vw, 2.5rem);
        margin-bottom: 2rem;
        max-width: 95%;
    }

    .clientes-carousel {
        gap: 2rem;
        animation-duration: 30s;
    }

    .clientes-carousel-item {
        min-width: 150px;
    }

    .clientes-carousel-logo {
        height: 60px;
    }

    .clientes-carousel-logo img {
        max-height: 60px;
        max-width: 140px;
    }

    #esparta-digital .video-container {
        margin-top: 1rem;
        max-height: 250px;
    }

    .estrategias-list {
        gap: 2rem;
        margin-top: 2rem;
    }

    .estrategia-item {
        padding: 0;
    }

    .estrategia-content {
        flex-direction: column-reverse;
        gap: 1rem;
    }

    .estrategia-image {
        width: 100%;
        height: 200px;
    }

    .timeline-line {
        display: none;
    }

    .estrategia-text h3 {
        font-size: 1.25rem;
    }

    .resenas-carousel-item {
        padding: 0.1rem;
    }

    .resenas-content::before {
        top: -20px;
        left: 5px;
        width: 50px;
        height: 50px;
    }
    
    .resenas-content p {
        font-size: 22px;
	}
}

@media (min-width: 769px) and (max-width: 1024px) {
    #cabecera {
        margin-top: -70px;
        height: auto;
    }

    #cabecera h1 {
        font-size: clamp(2.5rem, 6vw, 5rem);
    }

    .cabecera-title-wrapper {
        padding-bottom: 1.5rem;
    }

    .video-container {
        border-radius: 10px;
        aspect-ratio: 16/9;
    }

    .video-sound-toggle {
        width: 44px;
        height: 44px;
        bottom: 16px;
        right: 16px;
    }

    #carrousel-clientes h2 {
        max-width: 80%;
    }

    .clientes-carousel {
        animation-duration: 35s;
    }

    .estrategia-content {
        gap: 1.5rem;
    }

    .estrategia-image {
        width: 250px;
        height: 150px;
    }

    .timeline-line {
        left: 125px;
        height: calc(100% + 2rem);
    }

    #esparta-digital .video-container {
        max-height: 300px;
    }
}
