/* ============================================
   SERVICES CAROUSEL - Estilo Premium Horizontal
   Inspirado en Netflix/Apple con scroll suave
   ============================================ */

/* Reset de la sección de servicios */
.services {
    padding: 100px 0;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    position: relative;
    overflow: hidden;
}

/* Wrapper principal */
.services-wrapper {
    max-width: 100%;
    margin: 0 auto;
    position: relative;
}

/* Header de la sección mejorado */
.services .section-header {
    text-align: center;
    margin-bottom: 60px;
    padding: 0 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.services .section-header h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: var(--primary-blue);
    margin-bottom: 1rem;
    font-family: 'Prata', serif;
    position: relative;
    display: inline-block;
}

.services .section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-blue), var(--secondary-gold));
    border-radius: 2px;
}

.services .section-header p {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 20px auto 0;
}

/* ============================================
   CONTENEDOR DEL CARRUSEL
   ============================================ */

.services-carousel-container {
    position: relative;
    margin: 0 auto;
    padding: 0 20px;
    max-width: 1400px;
}

/* Track del carrusel */
.services-carousel-track {
    display: flex;
    gap: 25px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding: 40px 20px 60px;
    position: relative;
    align-items: center;
    min-height: 520px;
    
    /* Ocultar scrollbar pero mantener funcionalidad */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.services-carousel-track::-webkit-scrollbar {
    display: none;
}

/* ============================================
   NUEVO DISEÑO DE CARDS
   ============================================ */

.service-card {
    flex: 0 0 380px;
    min-width: 380px;
    height: 480px;
    background: white;
    border-radius: 20px;
    padding: 0;
    position: relative;
    overflow: hidden;
    scroll-snap-align: center;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.08),
        0 2px 4px rgba(0, 0, 0, 0.04);
    display: flex !important;
    visibility: visible !important;
    flex-direction: column;
    background-blend-mode: normal !important;
    /* Estado inicial - todas las cards difuminadas */
    opacity: 0.6;
    filter: blur(2px);
    transform: scale(0.92);
}

/* Card activa/enfocada - completamente nítida */
.service-card.active {
    opacity: 1 !important;
    filter: blur(0) !important;
    transform: scale(1) !important;
    box-shadow: 
        0 25px 50px rgba(71, 115, 175, 0.25),
        0 15px 30px rgba(239, 192, 118, 0.15) !important;
    z-index: 10;
}

/* Card en hover (solo desktop) */
@media (hover: hover) {
    .service-card:hover {
        opacity: 1 !important;
        filter: blur(0) !important;
        transform: scale(1.02) !important;
    }
}

/* Imagen de fondo de la card */
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: inherit;
    background-size: cover !important;
    background-position: center !important;
    z-index: 1;
    transition: transform 0.4s ease;
}

/* Overlay gradiente sobre la imagen - removido para mejor visibilidad */
.service-card::after {
    display: none;
}

/* Contenido de la card - ícono ocultado */
.service-card .service-icon {
    display: none;
}

.service-card h3 {
    position: relative;
    margin-top: 200px;
    padding: 0 30px;
    font-size: 1.5rem;
    color: var(--primary-blue);
    font-family: 'Prata', serif;
    z-index: 3;
    transition: color 0.3s ease;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.9);
}

.service-card p {
    position: relative;
    padding: 0 30px;
    margin-top: 15px;
    color: #000000;
    font-size: 0.95rem;
    line-height: 1.6;
    z-index: 3;
    flex-grow: 1;
}

.service-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 15px 30px;
    margin: 20px 30px 30px;
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    z-index: 3;
    transition: all 0.3s ease;
    border-radius: 25px;
    background: rgba(71, 115, 175, 0.08);
}

.service-link span {
    transition: transform 0.3s ease;
}

/* Hover effects */
.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 10px 20px rgba(0, 0, 0, 0.1);
}

.service-card:hover::before {
    transform: scale(1.1);
}

.service-card:hover::after {
    opacity: 0.6;
}

/* Hover del ícono removido */

.service-card:hover .service-link {
    background: var(--primary-blue);
    color: white;
    transform: translateX(5px);
}

.service-card:hover .service-link span {
    transform: translateX(5px);
}

/* Botones de navegación removidos - Bucle automático */

/* ============================================
   INDICADORES DEL CARRUSEL
   ============================================ */

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
    position: relative;
}

.carousel-indicator {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: rgba(71, 115, 175, 0.2);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.carousel-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: var(--primary-blue);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.carousel-indicator.active {
    background: rgba(71, 115, 175, 0.3);
}

.carousel-indicator.active::before {
    animation: progressFill 4s linear forwards;
}

@keyframes progressFill {
    from { width: 0; }
    to { width: 100%; }
}

.carousel-indicator:hover:not(.active) {
    background: rgba(71, 115, 175, 0.4);
}

/* ============================================
   BARRA DE PROGRESO
   ============================================ */

.carousel-progress {
    position: relative;
    height: 4px;
    background: rgba(71, 115, 175, 0.1);
    border-radius: 2px;
    margin-top: 20px;
    overflow: hidden;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.carousel-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--primary-blue),
        var(--secondary-gold)
    );
    border-radius: 2px;
    width: 16.66%;
    transition: width 0.3s ease;
}

/* ============================================
   EFECTOS ESPECIALES
   ============================================ */

/* Gradientes de fade removidos para mejor visibilidad */

/* Animación de entrada */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.service-card {
    animation: slideInFromRight 0.6s ease-out backwards;
}

.service-card:nth-child(1) { animation-delay: 0.1s; }
.service-card:nth-child(2) { animation-delay: 0.2s; }
.service-card:nth-child(3) { animation-delay: 0.3s; }
.service-card:nth-child(4) { animation-delay: 0.4s; }
.service-card:nth-child(5) { animation-delay: 0.5s; }
.service-card:nth-child(6) { animation-delay: 0.6s; }

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1200px) {
    .services-carousel-container {
        padding: 0 60px;
    }
    
    .carousel-nav-prev {
        left: 10px;
    }
    
    .carousel-nav-next {
        right: 10px;
    }
}

@media (max-width: 768px) {
    .services-carousel-container {
        padding: 0 15px;
    }
    
    .services-carousel-track {
        gap: 20px;
        padding: 20px 10px 40px;
        /* Scroll suave en móvil */
        -webkit-overflow-scrolling: touch;
    }
    
    .service-card {
        flex: 0 0 80vw;
        min-width: 80vw;
        max-width: 320px;
        height: 440px;
    }
    
    /* En móvil, todas las cards se ven más claras */
    .service-card {
        opacity: 0.8;
        filter: blur(1px);
        transform: scale(0.95);
    }
    
    .service-card.active {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }
    
    .service-card h3 {
        margin-top: 180px;
        font-size: 1.4rem;
        padding: 0 20px;
    }
    
    .service-card p {
        padding: 0 20px;
        font-size: 0.9rem;
    }
    
    .service-card .service-icon {
        display: none;
    }
    
    .service-link {
        margin: 15px 20px 25px;
        font-size: 0.9rem;
    }
    
    .carousel-nav {
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .carousel-nav-prev {
        left: 5px;
    }
    
    .carousel-nav-next {
        right: 5px;
    }
    
    .carousel-indicators {
        gap: 8px;
        margin-top: 20px;
    }
    
    .carousel-indicator {
        width: 30px;
        height: 3px;
    }
    
    .services-carousel-container::before,
    .services-carousel-container::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .services {
        padding: 60px 0;
    }
    
    .services .section-header h2 {
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
    }
    
    .services .section-header p {
        font-size: 0.9rem;
    }
    
    .services-carousel-container {
        padding: 0;
    }
    
    .service-card {
        flex: 0 0 90vw;
        min-width: 90vw;
        height: 420px;
    }
    
    .service-card::before {
        height: 180px;
    }
    
    .service-card .service-icon {
        top: 140px;
        width: 65px;
        height: 65px;
    }
    
    .service-card h3 {
        margin-top: 220px;
        font-size: 1.3rem;
    }
    
    .carousel-nav {
        display: none;
    }
    
    .services-carousel-track {
        padding-left: 10px;
        padding-right: 10px;
        gap: 15px;
    }
}

/* ============================================
   MODO OSCURO
   ============================================ */

[data-theme="dark"] .services {
    background: linear-gradient(180deg, #1a1a1a 0%, #2a2a2a 100%);
}

[data-theme="dark"] .service-card {
    background: #2a2a2a;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .service-card h3 {
    color: var(--secondary-gold);
}

[data-theme="dark"] .service-card p {
    color: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .carousel-nav {
    background: #2a2a2a;
    color: var(--secondary-gold);
}

[data-theme="dark"] .carousel-nav:hover {
    background: var(--secondary-gold);
    color: #2a2a2a;
}

[data-theme="dark"] .services-carousel-container::before {
    background: linear-gradient(
        90deg,
        rgba(26, 26, 26, 1) 0%,
        rgba(26, 26, 26, 0) 100%
    );
}

[data-theme="dark"] .services-carousel-container::after {
    background: linear-gradient(
        270deg,
        rgba(26, 26, 26, 1) 0%,
        rgba(26, 26, 26, 0) 100%
    );
}