/* ============================================
   CLIENTS SLIDER STYLES
   Componente independiente - No afecta otros estilos
   Prefijo: xd-clients-*
   ============================================ */

/* Variables CSS para fácil personalización */
:root {
    --xd-clients-primary: #00A86B;
    --xd-clients-bg: #f8f9fa;
    --xd-clients-text: #333;
    --xd-clients-text-light: #666;
    --xd-clients-logo-bg: #ffffff;
    --xd-clients-logo-shadow: rgba(0, 0, 0, 0.08);
    --xd-clients-fade-color: #f8f9fa;
    
    /* Configuración de animación */
    --xd-clients-animation-speed: 60s; /* Más lento = más profesional */
    --xd-clients-logo-spacing: 4rem;
}

/* ============================================
   SECCIÓN PRINCIPAL
   ============================================ */
.xd-clients-section {
    width: 100%;
    padding: 5rem 2rem;
    background: var(--xd-clients-bg);
    overflow: hidden;
    position: relative;
}

.xd-clients-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================================
   ENCABEZADO
   ============================================ */
.xd-clients-header {
    text-align: center;
    margin-bottom: 4rem;
}

.xd-clients-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--xd-clients-text);
    margin-bottom: 1rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.xd-clients-subtitle {
    font-size: 1.1rem;
    color: var(--xd-clients-text-light);
    max-width: 600px;
    margin: 0 auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ============================================
   CONTENEDOR DEL SLIDER
   ============================================ */
.xd-clients-slider-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 2rem 0;
}

.xd-clients-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* ============================================
   TRACK DE LOGOS (Carrusel)
   ============================================ */
.xd-clients-track {
    display: flex;
    align-items: center;
    gap: var(--xd-clients-logo-spacing);
    width: max-content;
    animation: xd-slide-infinite var(--xd-clients-animation-speed) linear infinite;
    will-change: transform;
}

/* Pausar animación al hacer hover */
.xd-clients-slider:hover .xd-clients-track {
    animation-play-state: paused;
}

/* ============================================
   LOGOS INDIVIDUALES
   ============================================ */
.xd-client-logo {
    flex-shrink: 0;
    width: 180px;
    height: 100px;
    background: var(--xd-clients-logo-bg);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--xd-clients-logo-shadow);
    transition: all 0.3s ease;
    cursor: pointer;
}

.xd-client-logo:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 168, 107, 0.15);
}

.xd-client-logo img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: grayscale(100%) opacity(0.7);
    transition: filter 0.3s ease;
}

.xd-client-logo:hover img {
    filter: grayscale(0%) opacity(1);
}

/* ============================================
   GRADIENTES LATERALES (Efecto Fade)
   ============================================ */
.xd-clients-fade {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 150px;
    pointer-events: none;
    z-index: 10;
}

.xd-clients-fade-left {
    left: 0;
    background: linear-gradient(
        to right,
        var(--xd-clients-fade-color) 0%,
        transparent 100%
    );
}

.xd-clients-fade-right {
    right: 0;
    background: linear-gradient(
        to left,
        var(--xd-clients-fade-color) 0%,
        transparent 100%
    );
}

/* ============================================
   HINT TEXT
   ============================================ */
.xd-clients-hint {
    text-align: center;
    font-size: 0.85rem;
    color: var(--xd-clients-text-light);
    margin-top: 2rem;
    opacity: 0.7;
    font-style: italic;
}

/* ============================================
   ANIMACIÓN KEYFRAMES
   ============================================ */
@keyframes xd-slide-infinite {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablets */
@media (max-width: 1024px) {
    .xd-clients-title {
        font-size: 2rem;
    }
    
    .xd-client-logo {
        width: 160px;
        height: 90px;
    }
    
    :root {
        --xd-clients-logo-spacing: 3rem;
        --xd-clients-animation-speed: 50s;
    }
}

/* Móviles */
@media (max-width: 768px) {
    .xd-clients-section {
        padding: 3rem 1rem;
    }
    
    .xd-clients-header {
        margin-bottom: 3rem;
    }
    
    .xd-clients-title {
        font-size: 1.75rem;
    }
    
    .xd-clients-subtitle {
        font-size: 1rem;
    }
    
    .xd-client-logo {
        width: 140px;
        height: 80px;
        padding: 1rem;
    }
    
    .xd-clients-fade {
        width: 80px;
    }
    
    .xd-clients-hint {
        display: none; /* Ocultar en móvil */
    }
    
    :root {
        --xd-clients-logo-spacing: 2rem;
        --xd-clients-animation-speed: 40s;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .xd-clients-title {
        font-size: 1.5rem;
    }
    
    .xd-client-logo {
        width: 120px;
        height: 70px;
    }
    
    :root {
        --xd-clients-logo-spacing: 1.5rem;
    }
}

/* ============================================
   MODO OSCURO (Opcional)
   Descomentar si el sitio tiene modo oscuro
   ============================================ */
/*
@media (prefers-color-scheme: dark) {
    :root {
        --xd-clients-bg: #1a1a1a;
        --xd-clients-text: #ffffff;
        --xd-clients-text-light: #cccccc;
        --xd-clients-logo-bg: #2a2a2a;
        --xd-clients-logo-shadow: rgba(255, 255, 255, 0.05);
        --xd-clients-fade-color: #1a1a1a;
    }
}
*/

/* ============================================
   OPTIMIZACIONES DE RENDIMIENTO
   ============================================ */

/* Acelerar animaciones en hardware */
.xd-clients-track {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Prevenir parpadeos en Chrome */
.xd-client-logo,
.xd-client-logo img {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   ESTADOS ESPECIALES
   ============================================ */

/* Cuando no hay JavaScript habilitado */
.no-js .xd-clients-track {
    animation: none;
    justify-content: center;
    flex-wrap: wrap;
}

/* Estado de carga */
.xd-clients-track.loading {
    opacity: 0;
}

.xd-clients-track.loaded {
    opacity: 1;
    transition: opacity 0.5s ease;
}

/* ============================================
   VARIANTES DE ESTILO (Descomentar para usar)
   ============================================ */

/* Variante con borde en los logos */

.xd-client-logo {
    border: 2px solid rgba(0, 168, 107, 0.1);
}

/* Variante con fondo de color */

.xd-clients-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Variante con logos más pequeños */

.xd-client-logo {
    width: 300px;
    height: 300px;
}
