/* ==========================================================
   CONFIGURACIÓN GLOBAL Y VARIABLES
   ========================================================== */
:root {
    --tmm-black: #050505;
    --tmm-card-bg: #111111;
    --tmm-white: #ffffff;
    --tmm-gold: #FFD700;
    --tmm-font-title: "Raleway", sans-serif;
    --tmm-font-body: "Rubik", sans-serif;
}

body {
    margin: 0;
    background-color: var(--tmm-black);
    overflow-x: hidden; /* Previene scroll horizontal indeseado */
}

* {
    box-sizing: border-box;
}

/* OPTIMIZACIÓN GLOBAL DE IMÁGENES (Vital para SEO/CLS) */
img, video {
    max-width: 100%;
    height: auto;
    font-size: 0; /* Elimina espacios fantasma */
}

/* ==========================================================
   SECCIÓN 1: LOGOS SLIDER (INFINITE SCROLL)
   ========================================================== */
.tmm-section-wrapper {
    color: #ffffff;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0px;
    overflow: hidden;
}

.logos-container {
    display: flex;
    justify-content: space-between;
    height: 800px;
    width: 100%;
    max-width: 1200px;
    overflow: hidden;
    position: relative;
    padding: 0px;
}

.logos {
    width: 48%;
    position: relative;
    height: 100%;
    overflow: hidden;
    /* Mejora de renderizado */
    mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
}

.logos-slide {
    display: flex;
    flex-direction: column;
    width: 100%;
    /* OPTIMIZACIÓN: Indica al navegador que prepare la GPU */
    will-change: transform; 
}

.logos img {
    width: 100%;
    height: auto;
    display: block;
    margin: 15px 0;
    border-radius: 12px;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    
    /* Optimización de renderizado */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.logos img:hover {
    transform: scale(1.05);
    z-index: 10;
}

/* ANIMACIONES */
@keyframes scrollUp {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

@keyframes scrollDown {
    0% { transform: translateY(-50%); }
    100% { transform: translateY(0); }
}

.scroll-up {
    animation: scrollUp 35s linear infinite;
}

.scroll-down {
    animation: scrollDown 35s linear infinite;
}

.logos-container:hover .logos-slide {
    animation-play-state: paused;
}

/* Media Queries Logos */
@media screen and (max-width: 768px) {
    .logos-container {
        height: 500px;
        padding: 10px;
    }
    .logos img { margin: 10px 0; }
}

@media screen and (max-width: 480px) {
    .logos-container { height: 400px; }
}

/* ==========================================================
   SECCIÓN 2: TEAM / CAROUSEL GENERAL
   ========================================================== */
.tmm-team-section-wrapper {
    padding: 60px 0;
    width: 100%;
    display: flex;
    justify-content: center;
}

.tmm-carousel-container {
    position: relative;
    width: 100%;
    margin: 0 auto;
}

.swiper {
    width: 100%;
    height: 100%;
    padding-bottom: 20px;
}

.swiper-slide {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
    background: transparent;
}

.col-izq {
    flex: 0 0 auto;
    width: 500px;
    height: auto;
    margin-right: 100px;
    overflow: hidden;
    border-radius: 30px;
    position: relative;
}

.col-izq img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 30px;
    display: block;
}

.col-der {
    flex: 1;
    color: #fff;
    text-align: left;
}

.col-der h2 {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    font-family: "Raleway", sans-serif;
    margin-top: 0;
    margin-bottom: 0.2em;
}

.col-der h3 {
    font-size: 18px;
    margin-top: 0;
    margin-bottom: 0.8em;
    background: linear-gradient(to right, rgb(255 0 0) 0%, rgb(255 255 255 / 100%) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: "Rubik", sans-serif;
    font-weight: 500;
}

.col-der p {
    font-size: 14px;
    line-height: 30px;
    font-family: "Rubik", sans-serif;
    margin-bottom: 0;
}

/* Navegación Carousel */
.tmm-nav-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
    display: flex;
    gap: 10px;
}

.tmm-nav-btn {
    background: #3A3A3A;
    color: #fff;
    width: 50px;
    height: 50px;
    padding: 0;
    margin: 0;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.3s, transform 0.2s;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tmm-nav-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
}

.tmm-nav-btn:hover {
    background: #fff;
    color: #000;
}

/* Media Queries Carousel */
@media screen and (max-width: 1024px) {
    .swiper-slide {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .col-izq {
        width: 80%;
        max-width: 500px;
        margin: 0 0 20px 0;
    }
    .col-der { width: 100%; text-align: center; }
    .col-der h2 { font-size: 28px; }
    .col-der h3 { font-size: 16px; }
    .col-der p { font-size: 14px; line-height: 26px; }
    .tmm-nav-container {
        position: relative;
        bottom: auto;
        right: auto;
        justify-content: center;
        margin-top: 20px;
        width: 100%;
    }
}

@media screen and (max-width: 600px) {
    .col-izq { width: 100%; }
    .col-der h2 { font-size: 24px; }
    .col-der h3 { font-size: 14px; }
    .col-der p { font-size: 13px; line-height: 24px; }
    .tmm-nav-btn { width: 40px; height: 40px; }
}

/* ==========================================================
   SECCIÓN 3: REVIEWS SPLIT SECTION (9:16 OPTIMIZED)
   ========================================================== */
.tmm-reviews-split-section {
    width: 100%;
    padding: 80px 0;
    display: flex;
    justify-content: center;
}

.tmm-split-container {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

/* Header Reviews */
.tmm-split-header {
    margin-bottom: 0px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tmm-split-header h2 {
    font-family: var(--tmm-font-title);
    font-size: 48px;
    color: var(--tmm-white);
    margin: 0;
    line-height: 1;
    text-transform: uppercase;
}

.tmm-google-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    font-family: var(--tmm-font-body);
    color: #d1d1d1;
    font-size: 14px;
    background: rgba(255,255,255,0.05);
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Swiper Reviews */
.reviewsSplitSwiper {
    width: 100%;
    overflow: visible !important;
    padding-bottom: 40px;
}

.reviewsSplitSwiper .swiper-slide {
    height: auto; 
    opacity: 0.4;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: center;
}

.reviewsSplitSwiper .swiper-slide-active {
    opacity: 1;
}

/* Tarjeta Split */
.review-split-card {
    display: flex;
    background-color: var(--tmm-card-bg);
    border-radius: 24px;
    overflow: hidden;
    width: 100%;
    max-width: 1100px;
    height: 600px; /* Altura base desktop */
    border: 1px solid #222;
    position: relative;
    /* Sombra sutil para profundidad */
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Columna Texto */
.rs-col-text {
    flex: 1;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.rs-stars {
    display: flex;
    gap: 5px;
    margin-bottom: 30px;
}
.rs-stars svg { width: 20px; height: 20px; fill: var(--tmm-gold); }

.rs-quote {
    font-family: var(--tmm-font-title);
    font-size: 24px;
    line-height: 1.4;
    color: var(--tmm-white);
    margin-bottom: 40px;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 8;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rs-author {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: auto;
}

.rs-avatar {
    width: 50px; height: 50px; border-radius: 50%;
    background: #333; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-family: var(--tmm-font-body);
}

.rs-info h4 { margin: 0; color: #fff; font-family: var(--tmm-font-body); font-size: 18px; }
.rs-info span { color: #888; font-family: var(--tmm-font-body); font-size: 14px; }

/* Columna Multimedia (OPTIMIZADA) */
.rs-col-img {
    flex: 0 0 360px; 
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background-color: #000;
    border-left: 1px solid #222;
    /* CRÍTICO: Reserva espacio para evitar CLS en cargas lentas */
    aspect-ratio: 9 / 16;
}

.rs-col-img img, 
.rs-col-img video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    /* Transición Premium */
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.3s ease;
    display: block;
}

.review-split-card:hover .rs-col-img img,
.review-split-card:hover .rs-col-img video {
    transform: scale(1.03);
    filter: brightness(1.1);
}

/* Icono Expandir */
.rs-col-img::after {
    content: '⤢';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 40px;
    color: white;
    opacity: 0;
    transition: all 0.3s ease;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    pointer-events: none;
    z-index: 5;
}

.review-split-card:hover .rs-col-img::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.rs-img-badge {
    position: absolute;
    bottom: 20px; right: 20px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    padding: 5px 12px;
    border-radius: 8px;
    color: #fff;
    font-family: var(--tmm-font-body);
    font-size: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    pointer-events: none;
    z-index: 6;
}

/* Navegación Reviews */
.rs-nav-container {
    display: flex; gap: 15px; margin-top: 30px; justify-content: flex-end;
}

.rs-nav-btn {
    width: 60px; height: 60px; border-radius: 50%;
    border: 1px solid #444; background: transparent; color: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.3s ease;
}
.rs-nav-btn:hover { background: #fff; color: #000; border-color: #fff; }

/* Lightbox */
.tmm-lightbox {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
    /* Efecto moderno */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.tmm-lightbox.active { opacity: 1; pointer-events: all; }

.tmm-lightbox-content {
    width: auto; height: auto;
    max-width: 90vw; max-height: 90vh;
    aspect-ratio: auto;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tmm-lightbox img, .tmm-lightbox video {
    max-width: 100%; max-height: 90vh;
    display: block;
    object-fit: contain;
}

.tmm-lightbox-close {
    position: absolute; top: 30px; right: 30px;
    color: white; font-size: 40px; cursor: pointer;
    z-index: 10000; font-family: sans-serif;
    line-height: 1;
    transition: transform 0.2s;
}
.tmm-lightbox-close:hover { transform: scale(1.1); }

/* Media Queries Reviews */
@media screen and (max-width: 1024px) {
    .rs-quote { font-size: 20px; }
    .rs-col-text { padding: 40px; }
    .rs-col-img { flex: 0 0 320px; } 
}

@media screen and (max-width: 768px) {
    .review-split-card { 
        flex-direction: column-reverse; 
        height: auto; 
        max-width: 500px;
    }
    .rs-col-text { width: 100%; padding: 30px; flex: none; }
    
    .rs-col-img { 
        width: 100%; 
        flex: none;
        height: auto; /* Dejar que el aspect ratio controle la altura */
        /* Ajuste para móvil: Un poco menos alto que 9:16 para que quepa mejor en pantalla */
        aspect-ratio: 9 / 12; 
    } 
    
    .tmm-split-header h2 { font-size: 36px; }
    .rs-nav-container { justify-content: center; }
}