/* Servicios Section - Rediseñada y Mejorada */
#servicios {
    background: linear-gradient(135deg, var(--surface-color) 0%, var(--bg-color) 100%);
    position: relative;
    overflow: hidden;
}

#servicios::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(229, 57, 53, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(229, 57, 53, 0.05) 0%, transparent 50%);
    z-index: 1;
}

.section-title {
    text-align: center;
    margin-bottom: 80px;
    position: relative;
    z-index: 2;
}

.section-title h2 {
    font-size: 3.2rem;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-title h2::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 4px;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
}

.section-title p {
    color: var(--text-secondary-color);
    max-width: 600px;
    margin: 30px auto 0;
    font-size: 1.2rem;
    line-height: 1.6;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
    position: relative;
    z-index: 2;
}

.service-card {
    background: var(--card-color);
    border-radius: 24px;
    padding: 50px 35px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.1),
        0 1px 0 rgba(255, 255, 255, 0.1) inset;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(229, 57, 53, 0.03) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.service-card:hover::after {
    opacity: 1;
}

.service-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.15),
        0 15px 40px rgba(229, 57, 53, 0.1),
        0 1px 0 rgba(255, 255, 255, 0.1) inset;
    border-color: rgba(229, 57, 53, 0.2);
}

.service-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    font-size: 2.5rem;
    color: white;
    box-shadow: 
        0 15px 30px rgba(229, 57, 53, 0.3),
        0 0 0 8px rgba(229, 57, 53, 0.1);
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.service-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.service-card:hover .service-icon::before {
    left: 100%;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 
        0 20px 40px rgba(229, 57, 53, 0.4),
        0 0 0 12px rgba(229, 57, 53, 0.15);
}

.service-card h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 700;
    color: var(--text-primary-color);
    position: relative;
}

.service-card p {
    color: var(--text-secondary-color);
    margin-bottom: 30px;
    line-height: 1.7;
    font-size: 1.1rem;
}

.service-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1.05rem;
    padding: 12px 0;
    position: relative;
    overflow: hidden;
}

.service-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.4s ease;
}

.service-link:hover::before {
    width: 100%;
}

.service-link:hover {
    gap: 20px;
    color: var(--accent);
    transform: translateX(5px);
}

.service-link i {
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-size: 0.9rem;
}

.service-link:hover i {
    transform: translateX(8px) scale(1.2);
}

/* Efectos de partículas flotantes */
.services-grid::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(229, 57, 53, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
    z-index: -1;
}

.services-grid::after {
    content: '';
    position: absolute;
    bottom: -30px;
    right: -30px;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(255, 152, 0, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 10s ease-in-out infinite reverse;
    z-index: -1;
}

/* Animaciones mejoradas para scroll */
.service-card.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.service-card.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Efecto escalonado para las tarjetas */
.service-card:nth-child(1).animate-on-scroll.animated {
    transition-delay: 0.1s;
}

.service-card:nth-child(2).animate-on-scroll.animated {
    transition-delay: 0.2s;
}

.service-card:nth-child(3).animate-on-scroll.animated {
    transition-delay: 0.3s;
}

/* Responsive Design Mejorado */
@media (max-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 30px;
    }
    
    .service-card {
        padding: 40px 30px;
    }
}

@media (max-width: 992px) {
    .section-title h2 {
        font-size: 2.8rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        max-width: 600px;
        margin: 0 auto;
    }
    
    .service-card {
        padding: 40px;
    }
}

/* SERVICIOS RESPONSIVE - CORREGIDO */
@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        margin: 0 auto;
        max-width: 500px;
        padding: 0 10px;
    }
    
    .service-card {
        padding: 30px 20px;
        margin: 0;
        width: 100%;
    }
    
    .section-title h2 {
        font-size: 2rem;
        padding: 0 15px;
    }
    
    .section-title p {
        font-size: 1rem;
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .services-grid {
        gap: 20px;
        padding: 0 5px;
    }
    
    .service-card {
        padding: 25px 15px;
        border-radius: 16px;
    }
    
    .service-icon {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
    
    .service-card h3 {
        font-size: 1.3rem;
    }
}

/* Modo claro específico */
body.light-mode .service-card {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.08),
        0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

body.light-mode .service-card:hover {
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.12),
        0 15px 40px rgba(229, 57, 53, 0.08),
        0 1px 0 rgba(255, 255, 255, 0.8) inset;
}
