/* Reset y variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-red: #DC143C;
    --dark-red: #B22222;
    --light-red: #FFE4E1;
    --black: #1a1a1a;
    --dark-gray: #2c2c2c;
    --light-gray: #f5f5f5;
    --white: #ffffff;
    --gradient: linear-gradient(135deg, var(--primary-red), var(--dark-red));
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Fuentes y estilos base */
body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--black);
    overflow-x: hidden;
}

html {
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Pantalla de carga optimizada */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    will-change: opacity, visibility;
}

.loading-content {
    text-align: center;
}

.loading-logo {
    max-width: 250px;
    height: auto;
    margin-bottom: 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--light-gray);
    border-top: 3px solid var(--primary-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header mejorado */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    z-index: 1000;
    transition: var(--transition);
    will-change: background, backdrop-filter;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.navbar {
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.nav-logo {
    flex-shrink: 0;
    margin-right: 2rem;
}

.nav-logo img {
    height: 40px;
    transition: var(--transition);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
    flex: 1;
    justify-content: center;
}

.nav-link {
    color: var(--dark-gray);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: var(--transition);
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-red);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-red);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--dark-gray);
    margin: 3px 0;
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}


/* Botones flotantes optimizados */
.whatsapp-btn {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 55px;
    height: 55px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    text-decoration: none;
    z-index: 1000;
    transition: var(--transition);
    animation: float 3s ease-in-out infinite;
    will-change: transform;
}

.whatsapp-btn:hover {
    transform: scale(1.1);
    background: #128C7E;
}

.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: var(--primary-red);
    border: none;
    border-radius: 50%;
    color: var(--white);
    font-size: 18px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
    will-change: transform, opacity;
}

.scroll-top-btn.show {
    opacity: 1;
    visibility: visible;
}

.scroll-top-btn:hover {
    background: var(--dark-red);
    transform: translateY(-3px);
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

/* Hero Section con imagen de fondo local y efectos parallax */
.hero {
    min-height: 100vh;
    background: linear-gradient(rgba(64, 64, 64, 0.56), rgba(54, 54, 54, 0.63)),
                url('./Galeria/portada.png') center/cover no-repeat;
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    will-change: transform;
}

/* Fallback para cuando la imagen no carga */
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--dark-red) 100%);
    z-index: -1;
    opacity: 0.9;
}

/* Ajustes para móviles */
@media (max-width: 768px) {
    .hero {
        background-attachment: scroll;
        background: linear-gradient(rgba(64, 64, 64, 0.56), rgba(54, 54, 54, 0.63)),
                    url('./Galeria/portada.png') center/cover no-repeat;
    }
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 70%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    opacity: 0.5;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero-text {
    width: 100%;
}

.hero-text h1 {
    font-size: 4rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-text p {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 2.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-button {
    background: var(--white);
    color: var(--primary-red);
    padding: 18px 40px;
    border: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.cta-button:hover {
    background: var(--light-gray);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

.hero-image {
    display: none;
}

/* Page Hero */
.page-hero {
    padding: 100px 0 60px;
    background: var(--gradient);
    text-align: center;
}

.page-hero h1 {
    font-size: 2.8rem;
    color: var(--white);
    margin-bottom: 1rem;
}

.page-hero p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 800px;
    margin: 0 auto;
}

/* Secciones generales */
section {
    padding: 60px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-header h2 {
    font-size: 2.3rem;
    color: var(--black);
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--dark-gray);
    max-width: 600px;
    margin: 0 auto;
}

.animated-icon {
    font-size: 2.8rem;
    color: var(--primary-red);
    margin-bottom: 1rem;
    animation: iconFloat 3s ease-in-out infinite;
    display: inline-block;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    25% {
        transform: translateY(-8px) scale(1.05);
    }
    50% {
        transform: translateY(-15px) scale(1.1);
    }
    75% {
        transform: translateY(-8px) scale(1.05);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

/* About Us */
.about-us {
    background: var(--light-gray);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.about-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.about-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card-icon {
    width: 70px;
    height: 70px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.card-icon i {
    font-size: 1.8rem;
    color: var(--white);
}

.about-card h3 {
    font-size: 1.4rem;
    color: var(--black);
    margin-bottom: 1rem;
}

.about-card p {
    color: var(--dark-gray);
    line-height: 1.7;
}

/* Certificados */
.certificates {
    background: var(--white);
}

.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    align-items: center;
}

.certificate-item {
    text-align: center;
    transition: var(--transition);
}

.certificate-item:hover {
    transform: scale(1.05);
}

.certificate-item img {
    width: 100%;
    max-width: 140px;
    height: auto;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

/* Servicios */
.services {
    background: var(--light-gray);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.service-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.service-item:hover {
    transform: translateY(-8px);
}

.service-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: var(--transition);
}

.service-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--gradient);
    padding: 1rem;
    transform: translateY(100%);
    transition: var(--transition);
}

.service-item:hover .service-overlay {
    transform: translateY(0);
}

.service-item:hover img {
    transform: scale(1.1);
}

.service-overlay h3 {
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 600;
}

/* Carousel de clientes completamente corregido */
.clients-section {
    background: var(--white);
    overflow: hidden;
}

.clients-carousel {
    margin-top: 2rem;
    position: relative;
    width: 100%;
}

.carousel-container {
    overflow: hidden;
    width: 100%;
    position: relative;
}

.carousel-track {
    display: flex;
    width: 200%;
    animation: slideCarousel 20s linear infinite;
    will-change: transform;
}

.carousel-track:hover {
    animation-play-state: paused;
}

.client-slide {
    flex: 0 0 calc(100% / 36);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
}

.client-slide img {
    height: 50px;
    width: auto;
    max-width: 120px;
    filter: grayscale(100%);
    transition: filter 0.3s ease, transform 0.3s ease;
    object-fit: contain;
}

.client-slide:hover img {
    filter: grayscale(0%);
    transform: scale(1.1);
}

@keyframes slideCarousel {
    0% { 
        transform: translateX(0); 
    }
    100% { 
        transform: translateX(-50%); 
    }
}

/* Gradiente para efecto fade */
.carousel-container::before,
.carousel-container::after {
    content: '';
    position: absolute;
    top: 0;
    width: 100px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.carousel-container::before {
    left: 0;
    background: linear-gradient(to right, var(--white), transparent);
}

.carousel-container::after {
    right: 0;
    background: linear-gradient(to left, var(--white), transparent);
}

/* Especialidades (Curriculum) - Una sola fila */
.specialties-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.specialty-column {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.specialty-column h3 {
    color: var(--primary-red);
    font-size: 1.4rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.specialty-column h3 i {
    animation: bounce 2.5s ease-in-out infinite;
    display: inline-block;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.specialty-column ul {
    list-style: none;
}

.specialty-column li {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--light-gray);
    position: relative;
    padding-left: 1.5rem;
}

.specialty-column li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-red);
    font-weight: bold;
}

/* Proyectos relevantes */
.relevant-projects {
    background: var(--light-gray);
}

/* Mejorar visibilidad del título en proyectos relevantes */
.relevant-projects .section-header h2 {
    color: white !important;
    font-weight: 700 !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    position: relative;
}

/* Título principal del curriculum en blanco */
.page-hero .hero-title,
.curriculum-section .hero-title {
    color: white !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5) !important;
}

.relevant-projects .section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--gradient);
    border-radius: 2px;
}

/* Mejorar también el ícono */
.relevant-projects .section-header .animated-icon {
    color: var(--primary-red) !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.project-card {
    background: var(--white);
    padding: 1.8rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.project-card p {
    text-align: justify;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(220, 20, 60, 0.1), transparent);
    transition: left 0.6s ease;
}

.project-card:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 15px 30px rgba(0, 0, 0, 0.1),
        0 0 0 3px rgba(220, 20, 60, 0.2);
    border-color: rgba(220, 20, 60, 0.3);
}

.project-card:hover::before {
    left: 100%;
}

.project-icon {
    width: 70px;
    height: 70px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

.project-icon i {
    font-size: 1.8rem;
    color: var(--white);
    transition: all 0.3s ease;
}

.project-card:hover .project-icon {
    transform: translateY(-5px) scale(1.15) rotateY(360deg);
    box-shadow: 
        0 15px 30px rgba(220, 20, 60, 0.3),
        0 5px 15px rgba(0, 0, 0, 0.2);
    animation-play-state: paused;
}

.project-card:hover .project-icon i {
    font-size: 2rem;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.project-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    grid-auto-rows: 220px;
    gap: 1.5rem;
}

.project-image {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.project-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.image-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--gradient);
    padding: 1rem;
    transform: translateY(100%);
    transition: var(--transition);
}

.image-title h4 {
    color: var(--white);
    font-size: 1.1rem;
    margin: 0;
}

/* Proyecto Gamma - solo una fila como las demás */
.project-image-large {
    /* Sin span - mismo tamaño que las otras imágenes */
}

.project-image-large img {
    height: 100%;
    width: 100%;
    object-fit: contain; /* Mostrar imagen completa sin recortar */
    object-position: center;
}

/* Efectos hover para imágenes de proyectos */
.project-image {
    transition: all 0.25s ease-out;
    cursor: pointer;
}

.project-image:hover {
    transform: translateY(-8px);
}

.project-image:hover img {
    transform: scale(1.1);
}

.project-image:hover .image-title {
    transform: translateY(0);
}

/* Certificaciones ISO */
.iso-certifications {
    background: var(--white);
}

.iso-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

.iso-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.1),
        0 4px 10px rgba(0, 0, 0, 0.08);
    background: var(--white);
    border: 2px solid rgba(220, 20, 60, 0.1);
    aspect-ratio: 1.2;
    min-height: 220px;
}

.iso-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 10px 20px rgba(0, 0, 0, 0.1),
        0 0 0 3px rgba(220, 20, 60, 0.2);
    border-color: rgba(220, 20, 60, 0.3);
}

.iso-card img {
    width: 135%; /* Aumentar 35% el tamaño de la imagen */
    height: 135%; /* Aumentar 35% el tamaño de la imagen */
    object-fit: cover;
    object-position: center;
    transition: var(--transition);
    transform: translate(-12.5%, -12.5%); /* Centrar la imagen más grande */
}

.iso-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(220, 20, 60, 0.9) 0%, 
        rgba(178, 34, 34, 0.85) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(2px);
}

.iso-card:hover .iso-overlay {
    opacity: 1;
}

.iso-card:hover img {
    transform: translate(-12.5%, -12.5%) scale(1.05); /* Mantener centrado y agregar zoom */
}

.iso-overlay i {
    font-size: 3rem;
    color: var(--white);
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: iconPulse 2s ease-in-out infinite;
}

.iso-overlay p {
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    padding: 0 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Animation for ISO overlay icons */
@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Responsive styles for ISO grid */
@media (max-width: 768px) {
    .iso-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 1fr);
        gap: 1.5rem;
        max-width: 400px;
    }
    
    .iso-card {
        min-height: 200px;
        aspect-ratio: 1.3;
    }
    
    .iso-overlay i {
        font-size: 2.5rem;
    }
    
    .iso-overlay p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .iso-grid {
        padding: 0.5rem;
        gap: 1rem;
    }
    
    .iso-card {
        min-height: 180px;
        border-radius: 15px;
    }
    
    .iso-overlay i {
        font-size: 2rem;
        margin-bottom: 0.8rem;
    }
}

/* Modales optimizados */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    max-width: 45%;
    max-height: 45%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.close {
    position: absolute;
    top: 0;
    right: -60px;
    color: var(--white);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    z-index: 1002;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    color: var(--primary-red);
}

/* Botones de navegación en modales */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 1001;
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

.modal-nav:hover {
    background: var(--primary-red);
    transform: translateY(-50%) scale(1.1);
}

.modal-nav:active {
    transform: translateY(-50%) scale(0.95);
}

/* CV Section */
.cv-section {
    background: var(--light-gray);
}

/* Mejorar visibilidad del título "Curriculum Empresarial" */
.cv-section .section-header h2 {
    color: white !important;
    font-weight: 700 !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    position: relative;
}

.cv-section .section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--gradient);
    border-radius: 2px;
}

/* Mejorar también el ícono */
.cv-section .section-header .animated-icon {
    color: var(--primary-red) !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.cv-viewer {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.cv-viewer:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 10px 20px rgba(0, 0, 0, 0.1);
}

.cv-actions .btn-primary,
.cv-actions .btn-secondary {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.cv-actions .btn-primary::before,
.cv-actions .btn-secondary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: all 0.6s ease;
    transform: translate(-50%, -50%);
}

.cv-actions .btn-primary:hover::before,
.cv-actions .btn-secondary:hover::before {
    width: 300px;
    height: 300px;
}

.cv-actions .btn-primary:hover,
.cv-actions .btn-secondary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.cv-container {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.cv-viewer {
    width: 100%;
    height: 500px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.cv-viewer iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.cv-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-red);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--dark-red);
}

.btn-secondary {
    background: var(--black);
    color: var(--primary-red);
}

.btn-secondary:hover {
    background: var(--dark-gray);
}

/* Clientes profesional */
.clients-professional-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.client-card {
    background: var(--white);
    padding: 1.8rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.client-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.client-logo img {
    width: 70px;
    height: 45px;
    object-fit: contain;
}

.client-info h3 {
    color: var(--black);
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}

.client-info p {
    color: var(--dark-gray);
    font-size: 0.9rem;
}

/* Grid de logos de clientes - 3 columnas */
.clients-logos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.client-logo-item {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
    cursor: default;
    position: relative;
    overflow: hidden;
}

.client-logo-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(220, 20, 60, 0.1), transparent);
    transition: left 0.5s ease;
}

.client-logo-item:hover::before {
    left: 100%;
}

.client-logo-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(220, 20, 60, 0.15);
    border: 2px solid rgba(220, 20, 60, 0.2);
}

.client-logo-item img {
    width: 100%;
    max-width: 150px;
    height: auto;
    max-height: 80px;
    object-fit: contain;
    filter: grayscale(20%);
    transition: var(--transition);
}

.client-logo-item:hover img {
    filter: grayscale(0%);
    transform: scale(1.05);
}

/* Responsive para grid de logos */
@media (max-width: 768px) {
    .clients-logos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .clients-logos-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .client-logo-item {
        padding: 1rem;
        min-height: 100px;
    }
    
    .client-logo-item img {
        max-height: 60px;
        width: auto;
    }
}

/* Testimonios */
.testimonials-section {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 2px solid var(--light-gray);
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.testimonial-card {
    background: var(--white);
    padding: 1.8rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    position: relative;
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: -5px;
    left: 20px;
    font-size: 3.5rem;
    color: var(--primary-red);
    font-family: serif;
}

.testimonial-content p {
    font-style: italic;
    margin-bottom: 1rem;
    color: var(--dark-gray);
}

.testimonial-author strong {
    color: var(--black);
    display: block;
    margin-bottom: 0.25rem;
}

.testimonial-author span {
    color: var(--dark-gray);
    font-size: 0.9rem;
}

/* Galería optimizada */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.gallery-item:hover {
    transform: scale(1.03);
}

.gallery-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay i {
    font-size: 1.8rem;
    color: var(--primary-red);
    margin-bottom: 0.5rem;
}

.gallery-overlay p {
    color: var(--white);
    font-weight: 600;
    text-align: center;
    font-size: 0.9rem;
}

/* Lightbox optimizado */
.lightbox {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.lightbox-content {
    position: relative;
    margin: 5% auto;
    max-width: 80%;
    max-height: 80%;
    text-align: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
    transition: opacity 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: var(--white);
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.lightbox-close:hover {
    color: var(--primary-red);
}

.lightbox-caption {
    color: var(--white);
    margin-top: 1rem;
    font-size: 1.1rem;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.lightbox-prev,
.lightbox-next {
    background: rgba(220, 20, 60, 0.8);
    border: none;
    color: var(--white);
    font-size: 1.8rem;
    padding: 0.8rem;
    cursor: pointer;
    border-radius: 50%;
    pointer-events: all;
    transition: var(--transition);
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--primary-red);
}

/* Contacto optimizado */
.contact-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.contact-card {
    background: var(--white);
    padding: 1.8rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.contact-card:hover {
    transform: translateY(-8px);
}

.contact-icon {
    width: 70px;
    height: 70px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.contact-icon i {
    font-size: 1.8rem;
    color: var(--white);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

.map-wrapper {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.contact-form {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--black);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.1);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--light-gray);
    border-radius: 4px;
    position: relative;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-red);
    border-color: var(--primary-red);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--white);
    font-weight: bold;
    font-size: 12px;
}

.link {
    color: var(--primary-red);
    text-decoration: none;
}

.link:hover {
    text-decoration: underline;
}

.submit-btn {
    width: 100%;
    background: var(--gradient);
    color: var(--white);
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* FAQ optimizado */
.faq-section {
    background: var(--light-gray);
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--white);
    border-radius: 10px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.faq-question {
    padding: 1.3rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    background: var(--light-gray);
}

.faq-question h3 {
    margin: 0;
    color: var(--black);
    font-size: 1.1rem;
}

.faq-question i {
    color: var(--primary-red);
    transition: var(--transition);
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 1.3rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 200px;
    padding: 0 1.3rem 1.3rem;
}

.faq-answer p {
    color: var(--dark-gray);
    line-height: 1.7;
    margin: 0;
}

/* Footer optimizado */
.footer {
    background: var(--black);
    color: var(--white);
    padding: 2.5rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.footer-section h3 {
    color: var(--primary-red);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-logo {
    max-width: 180px;
    height: auto;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: var(--primary-red);
}

.contact-info p {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-info i {
    color: var(--primary-red);
    width: 20px;
}

.footer-bottom {
    border-top: 1px solid var(--dark-gray);
    padding-top: 1rem;
    text-align: center;
    color: var(--light-gray);
}

/* Animaciones de scroll optimizadas */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.animate-on-scroll.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive optimizado */
@media (max-width: 1024px) {
    .specialties-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 80px;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(25px);
        width: 100%;
        height: auto;
        text-align: center;
        transition: 0.3s;
        padding: 2rem 0;
        gap: 1.5rem;
        z-index: 999;
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-container {
        justify-content: space-between;
        padding: 0 1rem;
        max-width: 100%;
        position: relative;
        align-items: center;
    }
    
    .nav-logo {
        margin-right: 0;
    }
    
    .hamburger {
        flex-shrink: 0;
        position: relative;
        z-index: 1001;
        margin-left: auto;
        align-self: center;
    }
    
    .hero-text h1 {
        font-size: 2.8rem;
    }
    
    .hero-text p {
        font-size: 1.1rem;
    }
    
    .cta-button {
        padding: 15px 30px;
        font-size: 1rem;
    }
    
    .page-hero h1 {
        font-size: 2rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .specialties-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .projects-grid,
    .project-images,
    .clients-professional-grid,
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
    
    
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .contact-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .services-grid,
    .about-grid {
        grid-template-columns: 1fr;
    }
    
    .certificates-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .hero-text h1 {
        font-size: 2.2rem;
    }
    
    .hero-text p {
        font-size: 1rem;
    }
    
    .page-hero h1 {
        font-size: 1.6rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .gallery-item {
        margin-bottom: 1rem;
    }
    
    .gallery-item img {
        height: 200px;
    }
    
    .info-grid,
    .contact-info-grid,
    .certificates-grid {
        grid-template-columns: 1fr;
    }
    
    .info-item {
        text-align: center;
        padding: 1rem;
    }
    
    .info-icon {
        margin: 0 auto 1rem auto;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .modal-content,
    .lightbox-content {
        margin: 10% auto;
        max-width: 95%;
    }
    
    section {
        padding: 40px 0;
    }
    
    .about-card,
    .project-card,
    .client-card,
    .contact-card {
        padding: 1.5rem;
    }
}

/* Optimizaciones de rendimiento */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.card-hover:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Estados de carga completada */
.loaded #loading-screen {
    opacity: 0;
    visibility: hidden;
}

/* Utilidades */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.hidden { display: none; }
.visible { display: block; }

/* Mejoras de accesibilidad */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus states mejorados */
*:focus {
    outline: 3px solid var(--primary-red);
    outline-offset: 2px;
}

button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid var(--primary-red);
    outline-offset: 2px;
    box-shadow: 0 0 0 5px rgba(220, 20, 60, 0.2);
}

/* Mejora de contraste en enlaces */
a {
    color: var(--primary-red);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

a:hover {
    text-decoration-thickness: 3px;
}

/* Skip link para navegación por teclado */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-red);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 6px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar optimizado */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-red);
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-red);
}

/* Asegurar que el scrollbar no interfiera con el header */
body {
    margin-right: 0;
    overflow-x: hidden;
}

/* Para Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-red) var(--light-gray);
}

/* Optimizaciones adicionales */
.touch-device .service-item:hover,
.touch-device .gallery-item:hover {
    transform: none;
}

.touch-device .touch-active {
    transform: scale(0.98);
}

.slow-connection * {
    animation-duration: 0.1s !important;
    transition-duration: 0.1s !important;
}

.image-error {
    filter: grayscale(100%);
    opacity: 0.7;
}

/* High contrast mode */
.high-contrast {
    filter: contrast(150%) brightness(120%);
}

.high-contrast .gradient {
    background: var(--black) !important;
}

/* Keyboard navigation */
.keyboard-navigation *:focus {
    outline: 3px solid var(--primary-red) !important;
    outline-offset: 2px !important;
}

/* Dark mode preparado para futuro */
[data-theme="dark"] {
    --white: #1a1a1a;
    --black: #ffffff;
    --light-gray: #2c2c2c;
    --dark-gray: #cccccc;
}

/* Media queries para optimización */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --light-gray: #2c2c2c;
    }
}
/* =================================
   MEJORAS COMPATIBLES SIN CONFLICTOS
   ================================= */

/* Mejorar visibilidad del título "¿Quiénes Somos?" - Selectores específicos para evitar conflictos */
.about-us .section-header h2 {
    color: var(--primary-red) !important;
    font-weight: 700 !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
}

.about-us .section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--gradient);
    border-radius: 2px;
}

/* Mejorar visibilidad del título "Nuestros Servicios" - Selectores específicos */
.services .section-header h2 {
    color: var(--white) !important;
    font-weight: 700 !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    position: relative;
}

.services .section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--white);
    border-radius: 2px;
}

/* Mejorar también el ícono de servicios */
.services .section-header .animated-icon {
    color: var(--white) !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* CARRUSEL MEJORADO - Reemplaza la animación existente sin conflictos */
/* Sobrescribir la animación existente slideCarousel con una mejor */
.clients-section .carousel-track {
    display: flex !important;
    width: 200% !important;
    animation: slideCarouselInfinite 30s linear infinite !important;
    will-change: transform;
}

/* Nueva animación que reemplaza slideCarousel - nombre diferente para evitar conflictos */
@keyframes slideCarouselInfinite {
    0% { 
        transform: translateX(0); 
    }
    100% { 
        transform: translateX(-50%); 
    }
}

/* Pausar al hover - selector más específico */
.clients-section .carousel-track:hover {
    animation-play-state: paused !important;
}

/* Corregir el flex de cada slide - selector más específico para evitar conflictos */
.clients-section .client-slide {
    flex: 0 0 calc(100% / 18) !important; /* 18 elementos por serie (duplicada) */
    min-width: 120px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 1rem !important;
}

/* Mejorar las imágenes del carrusel - selector específico */
.clients-section .client-slide img {
    height: 50px !important;
    width: auto !important;
    max-width: 120px !important;
    filter: grayscale(100%) !important;
    transition: all 0.3s ease !important;
    object-fit: contain !important;
}

.clients-section .client-slide:hover img {
    filter: grayscale(0%) !important;
    transform: scale(1.1) !important;
}

/* Gradientes más suaves - selectores específicos */
.clients-section .carousel-container::before {
    left: 0 !important;
    background: linear-gradient(to right, var(--white) 0%, rgba(255,255,255,0.8) 70%, transparent 100%) !important;
    width: 100px !important;
}

.clients-section .carousel-container::after {
    right: 0 !important;
    background: linear-gradient(to left, var(--white) 0%, rgba(255,255,255,0.8) 70%, transparent 100%) !important;
    width: 100px !important;
}

/* Responsive para el carrusel - selectores específicos para evitar conflictos */
@media (max-width: 768px) {
    .clients-section .client-slide {
        flex: 0 0 calc(100% / 14) !important; /* Ajuste para móvil */
        min-width: 90px !important;
        padding: 0 0.5rem !important;
    }
    
    .clients-section .client-slide img {
        height: 40px !important;
        max-width: 90px !important;
    }
    
    .clients-section .carousel-track {
        animation-duration: 25s !important; /* Más rápido en móvil */
    }
}

@media (max-width: 480px) {
    .clients-section .client-slide {
        flex: 0 0 calc(100% / 10) !important; /* Menos elementos en pantallas pequeñas */
        min-width: 70px !important;
        padding: 0 0.3rem !important;
    }
    
    .clients-section .client-slide img {
        height: 35px !important;
        max-width: 70px !important;
    }
    
    .clients-section .carousel-track {
        animation-duration: 20s !important; /* Más rápido en móvil pequeño */
    }
}
/* =================================
   HEADER SEGURO - SIN CONFLICTOS CON CÓDIGO EXISTENTE
   ================================= */

/* Variables CSS para control centralizado */
:root {
    --header-height-base: 1.2rem; /* 20% más que el original (1rem) */
    --header-transparency: 0.12;;   /* Más transparente que 0.95 */
    --header-blur: 20px;          /* Más blur para compensar */
}

/* Sobrescribir header de forma segura - mayor especificidad */
body .header {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(var(--header-blur));
    background: rgba(255, 255, 255, 0.95);
}

/* Navbar más alto - mayor especificidad */
body .navbar {
    padding: var(--header-height-base) 0;
}

/* Logo más grande proporcionalmente */
body .nav-logo img {
    height: 45px;
}

/* Links con mejor espaciado */
body .nav-link {
    padding: 0.6rem 0;
}

/* SOLO para index.html - Ajustar espacio superior */
body.index-page main {
    padding-top: 85px;
}

/* Asegurar altura mínima del contenedor */
body .nav-container {
    min-height: 60px;
}

/* Responsive seguro - no interfiere con media queries existentes */
@media screen and (max-width: 768px) {
    body .navbar {
        padding: 1rem 0; /* Menor en móvil */
    }
    
    body .nav-logo img {
        height: 40px; /* Tamaño original en móvil */
    }
    
    body.index-page main {
        padding-top: 75px;
    }
    
    /* Ajustar menú móvil desplegable */
    body .nav-menu {
        top: 80px;
    }
    
    body .nav-menu.active {
        top: 80px;
    }
}

@media screen and (max-width: 480px) {
    body.index-page main {
        padding-top: 70px;
    }
}
/* =========================================
   PORTADA INDUSTRIAL PROFESIONAL ANIMADA
   ========================================= */

/* Mejorar el hero base con efectos industriales */
.hero {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(64, 64, 64, 0.60), rgba(54, 54, 54, 0.63)),
                url('galeria/portada.png') center/cover no-repeat;
    display: flex;
    align-items: center;
}

/* Partículas industriales flotantes */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,0.3), transparent),
        radial-gradient(1px 1px at 40% 70%, rgba(255,255,255,0.2), transparent),
        radial-gradient(1px 1px at 90% 40%, rgba(255,255,255,0.25), transparent),
        radial-gradient(1px 1px at 10% 80%, rgba(255,255,255,0.2), transparent);
    background-size: 300px 300px, 200px 200px, 250px 250px, 180px 180px;
    animation: industrialParticles 20s linear infinite;
    z-index: 1;
}

/* Efecto de grid industrial */
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 50px 50px, 50px 50px;
    animation: gridPulse 8s ease-in-out infinite;
    z-index: 1;
}

/* Contenedor principal con mejores efectos */
.hero-content {
    position: relative;
    z-index: 10;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

/* Texto principal con efectos industriales avanzados */
.hero-text h1 {
    font-size: 4.5rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 2rem;
    line-height: 1.1;
    text-shadow: 
        3px 3px 6px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(220, 20, 60, 0.3),
        0 0 60px rgba(220, 20, 60, 0.1);
    position: relative;
    animation: heroTitleEntry 1.5s ease-out forwards;
    opacity: 0;
    transform: translateY(50px);
}

/* Efecto de glow dinámico en el título */
.hero-text h1::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: transparent;
    background: linear-gradient(45deg, 
        rgba(255,255,255,0.1) 0%, 
        rgba(255,255,255,0.3) 50%, 
        rgba(255,255,255,0.1) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    animation: titleShine 3s ease-in-out infinite;
    z-index: -1;
}

/* Subtítulo con animación escalonada */
.hero-text p {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 3rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.4;
    animation: heroSubtitleEntry 1.8s ease-out 0.3s forwards;
    opacity: 0;
    transform: translateY(30px);
}

/* Botón CTA con efectos industriales avanzados */
.cta-button {
    background: linear-gradient(45deg, var(--white), #f0f0f0);
    color: var(--primary-red);
    padding: 20px 50px;
    border: none;
    border-radius: 50px;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: ctaButtonEntry 2s ease-out 0.6s forwards;
    opacity: 0;
    transform: translateY(30px) scale(0.9);
}

/* Efectos hover del botón */
.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(220, 20, 60, 0.2), 
        transparent);
    transition: left 0.6s ease;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(220, 20, 60, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(45deg, #ffffff, #f8f8f8);
}

/* Indicador de scroll animado */
.hero-content::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 40px;
    background: linear-gradient(to bottom, 
        rgba(255,255,255,0.8), 
        rgba(255,255,255,0.2));
    animation: scrollIndicator 2s ease-in-out infinite;
}

/* Elementos decorativos industriales */
.hero-content::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    animation: industrialRotate 15s linear infinite;
}

/* ===============================
   ANIMACIONES KEYFRAMES
   =============================== */

@keyframes industrialParticles {
    0% { transform: translateX(-100px) translateY(-100px); }
    25% { transform: translateX(100px) translateY(-50px); }
    50% { transform: translateX(-50px) translateY(100px); }
    75% { transform: translateX(150px) translateY(50px); }
    100% { transform: translateX(-100px) translateY(-100px); }
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

@keyframes heroTitleEntry {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes heroSubtitleEntry {
    0% {
        opacity: 0;
        transform: translateY(30px);
        filter: blur(5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@keyframes ctaButtonEntry {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes titleShine {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes scrollIndicator {
    0%, 100% { 
        opacity: 0.3;
        transform: translateX(-50%) translateY(0);
    }
    50% { 
        opacity: 1;
        transform: translateX(-50%) translateY(15px);
    }
}

@keyframes industrialRotate {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

/* Efectos de parallax suaves */
@media (min-width: 1024px) {
    .hero {
        background-attachment: fixed;
    }
    
    .hero-content {
        animation: parallaxFloat 6s ease-in-out infinite;
    }
}

@keyframes parallaxFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ===============================
   RESPONSIVE INDUSTRIAL
   =============================== */

@media (max-width: 768px) {
    .hero-text h1 {
        font-size: 3rem;
        text-shadow: 
            2px 2px 4px rgba(0, 0, 0, 0.6),
            0 0 20px rgba(220, 20, 60, 0.4);
    }
    
    .hero-text p {
        font-size: 1.2rem;
        margin-bottom: 2rem;
    }
    
    .cta-button {
        padding: 15px 35px;
        font-size: 1.1rem;
        letter-spacing: 1px;
    }
    
    .hero::before {
        background-size: 200px 200px, 150px 150px, 180px 180px, 120px 120px;
    }
}

@media (max-width: 480px) {
    .hero-text h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-text p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .cta-button {
        padding: 12px 25px;
        font-size: 1rem;
    }
}

/* ===============================
   EFECTOS ADICIONALES PREMIUM
   =============================== */

/* Efecto de ondas de energía */
.hero-energy-waves {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    transform: translate(-50%, -50%);
    z-index: 2;
    pointer-events: none;
}

.hero-energy-waves::before,
.hero-energy-waves::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    animation: energyPulse 4s ease-in-out infinite;
}

.hero-energy-waves::after {
    animation-delay: 2s;
}

@keyframes energyPulse {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.3;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    .hero::before,
    .hero::after,
    .hero-content::after,
    .hero-content::before,
    .hero-text h1,
    .hero-text p,
    .cta-button {
        animation: none !important;
    }
    
    .hero-text h1,
    .hero-text p,
    .cta-button {
        opacity: 1;
        transform: none;
    }
}

/* =======================================
   ELEMENTOS INDUSTRIALES ADICIONALES
   ======================================= */

/* Partículas industriales flotantes */
.industrial-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.particle-1 {
    width: 4px;
    height: 4px;
    top: 20%;
    left: 10%;
    animation: particleFloat1 8s infinite;
}

.particle-2 {
    width: 6px;
    height: 6px;
    top: 60%;
    left: 80%;
    animation: particleFloat2 12s infinite;
}

.particle-3 {
    width: 3px;
    height: 3px;
    top: 80%;
    left: 20%;
    animation: particleFloat3 10s infinite;
}

.particle-4 {
    width: 5px;
    height: 5px;
    top: 30%;
    left: 70%;
    animation: particleFloat4 15s infinite;
}

.particle-5 {
    width: 4px;
    height: 4px;
    top: 50%;
    left: 50%;
    animation: particleFloat5 9s infinite;
}



/* Animaciones de partículas */
@keyframes particleFloat1 {
    0%, 100% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0.4; }
    25% { transform: translateY(-100px) translateX(50px) rotate(90deg); opacity: 0.8; }
    50% { transform: translateY(-50px) translateX(100px) rotate(180deg); opacity: 0.6; }
    75% { transform: translateY(-150px) translateX(30px) rotate(270deg); opacity: 0.3; }
}

@keyframes particleFloat2 {
    0%, 100% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0.3; }
    33% { transform: translateY(-80px) translateX(-70px) rotate(120deg); opacity: 0.7; }
    66% { transform: translateY(-120px) translateX(-30px) rotate(240deg); opacity: 0.5; }
}

@keyframes particleFloat3 {
    0%, 100% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0.5; }
    50% { transform: translateY(-200px) translateX(80px) rotate(180deg); opacity: 0.2; }
}

@keyframes particleFloat4 {
    0%, 100% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0.4; }
    20% { transform: translateY(-60px) translateX(-40px) rotate(72deg); opacity: 0.8; }
    40% { transform: translateY(-120px) translateX(-80px) rotate(144deg); opacity: 0.6; }
    60% { transform: translateY(-80px) translateX(-120px) rotate(216deg); opacity: 0.4; }
    80% { transform: translateY(-40px) translateX(-60px) rotate(288deg); opacity: 0.7; }
}

@keyframes particleFloat5 {
    0%, 100% { transform: translateY(0) translateX(0) rotate(0deg) scale(1); opacity: 0.4; }
    25% { transform: translateY(-100px) translateX(-100px) rotate(90deg) scale(1.5); opacity: 0.8; }
    50% { transform: translateY(-200px) translateX(0px) rotate(180deg) scale(0.8); opacity: 0.3; }
    75% { transform: translateY(-100px) translateX(100px) rotate(270deg) scale(1.2); opacity: 0.6; }
}

/* Animaciones de las barras de progreso */
@keyframes progressBarsEntry {
    from { 
        opacity: 0; 
        transform: translateX(50px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes progressFill95 {
    from { width: 0; }
    to { width: 95%; }
}

@keyframes progressFill98 {
    from { width: 0; }
    to { width: 98%; }
}

@keyframes progressFill92 {
    from { width: 0; }
    to { width: 92%; }
}

/* Mejora del botón CTA con efectos adicionales */
.cta-button span {
    position: relative;
    z-index: 2;
}

.cta-button:active {
    transform: translateY(-3px) scale(1.02);
}

/* Efectos de profundidad en el contenedor */
.hero-content {
    backdrop-filter: blur(1px);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
    padding: 3rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive para elementos adicionales */
@media (max-width: 1024px) {
    .hero-progress-bars {
        bottom: 60px;
        right: 30px;
        width: 150px;
    }
    
    .progress-bar {
        width: 150px;
        height: 3px;
    }
    
    .progress-bar::before {
        font-size: 0.7rem;
        top: -20px;
    }
}

@media (max-width: 768px) {
    .hero-progress-bars {
        display: none; /* Ocultar en móvil para mejor UX */
    }
    
    .hero-content {
        padding: 2rem 1rem;
        background: rgba(255, 255, 255, 0.05);
    }
    
    .industrial-particles .particle {
        display: none; /* Reducir animaciones en móvil */
    }
}

@media (max-width: 480px) {
    .hero-energy-waves {
        width: 200px;
        height: 200px;
    }
    
    .hero-content {
        padding: 1.5rem 1rem;
    }
}

/* Estados de hover mejorados */
@media (hover: hover) {
    .hero-content:hover {
        background: rgba(255, 255, 255, 0.03);
        transform: translateY(-2px);
        transition: all 0.3s ease;
    }
    
    .cta-button:hover span {
        animation: buttonTextGlow 0.3s ease-out forwards;
    }
}

@keyframes buttonTextGlow {
    to {
        text-shadow: 0 0 10px rgba(220, 20, 60, 0.5);
    }
}

/* Mejoras de contraste para accesibilidad */
@media (prefers-contrast: high) {
    .hero-text h1 {
        text-shadow: 3px 3px 0 rgba(0, 0, 0, 1);
    }
    
    .hero-text p {
        text-shadow: 2px 2px 0 rgba(0, 0, 0, 1);
    }
    
    .cta-button {
        border: 2px solid var(--primary-red);
    }
}
/* ========================================
   EFECTOS DE RELIEVE PARA ABOUT CARDS
   ======================================== */

/* Relieve y profundidad en las tarjetas */
.about-card {
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.1),
        0 4px 10px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
}

/* Hover con más relieve */
.about-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.15),
        0 8px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 0 0 1px rgba(220, 20, 60, 0.1);
}

/* Relieve en los íconos */
.about-card .card-icon {
    box-shadow: 
        0 6px 20px rgba(220, 20, 60, 0.3),
        0 3px 8px rgba(220, 20, 60, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Círculo rojo flotando suavemente DENTRO del recuadro */
.about-card .card-icon {
    animation: iconFloat 3s ease-in-out infinite;
}

/* Delay para cada círculo */
.about-card:nth-child(1) .card-icon { animation-delay: 0s; }
.about-card:nth-child(2) .card-icon { animation-delay: 1s; }
.about-card:nth-child(3) .card-icon { animation-delay: 2s; }

/* Hover en ícono */
.about-card:hover .card-icon {
    box-shadow: 
        0 10px 30px rgba(220, 20, 60, 0.4),
        0 5px 12px rgba(220, 20, 60, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

/* Títulos con relieve sutil */
.about-card h3 {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.about-card:hover h3 {
    color: var(--primary-red);
    text-shadow: 0 2px 4px rgba(220, 20, 60, 0.2);
}

/* ========================================
   ANIMACIÓN SUAVE PARA ICONOS
   ======================================== */

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-6px);
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .about-card {
        box-shadow: 
            0 4px 15px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.6);
    }
    
    .about-card .card-icon {
    animation: iconFloat 4s ease-in-out infinite;
}
}

/* Reducir animaciones si el usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {
    .about-card .card-icon {
    animation: none;
}
}

/* ========================================
   LANGUAGE SWITCHER IN NAVBAR
   ======================================== */

.nav-languages {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid #e0e0e0;
}

.nav-lang-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: rgba(245, 245, 245, 0.8);
    border-radius: 12px;
    text-decoration: none;
    color: var(--dark-gray);
    font-size: 11px;
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid transparent;
}

.nav-lang-link:hover {
    background: rgba(220, 20, 60, 0.1);
    border-color: var(--primary-red);
    transform: translateY(-1px);
}

.nav-lang-link.active {
    background: var(--primary-red);
    color: white;
    box-shadow: 0 2px 8px rgba(220, 20, 60, 0.3);
}

.nav-lang-link img {
    width: 16px;
    height: auto;
    border-radius: 2px;
}

/* Mobile language switcher in hamburger menu */
@media (max-width: 768px) {
    .nav-languages {
        width: 100%;
        justify-content: center;
        margin: 15px 0 0 0;
        padding: 15px 0 0 0;
        border-left: none;
        border-top: 1px solid #e0e0e0;
    }
    
    .nav-lang-link {
        padding: 8px 15px;
        font-size: 12px;
        background: rgba(245, 245, 245, 0.9);
    }
    
    .nav-lang-link.active {
        background: var(--primary-red);
        color: white;
    }
    
    .nav-lang-link img {
        width: 18px;
    }
    
    .nav-link {
        color: var(--dark-gray);
        font-weight: 500;
        padding: 10px 0;
    }
    
    .nav-link:hover,
    .nav-link.active {
        color: var(--primary-red);
    }
    
}

/* ========================================
   CHATBOT STYLES
   ======================================== */

.chatbot-container {
    position: fixed;
    bottom: 195px;
    right: 20px;
    z-index: 1000;
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.chatbot-toggle:hover {
    transform: scale(1.1);
}

.chatbot-toggle i {
    color: white;
    font-size: 24px;
}

.chatbot-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 350px;
    height: 450px;
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chatbot-window.active {
    display: flex;
}

.chatbot-header {
    background: var(--gradient);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h4 {
    margin: 0;
    font-size: 16px;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 18px;
}

.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bot-message, .user-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
}

.bot-message {
    background: #f0f0f0;
    align-self: flex-start;
}

.user-message {
    background: var(--primary-red);
    color: white;
    align-self: flex-end;
}

.quick-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.quick-btn {
    background: var(--primary-red);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.quick-btn:hover {
    background: var(--dark-red);
}

.chatbot-input {
    display: flex;
    padding: 15px;
    border-top: 1px solid #eee;
}

.chatbot-input input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 15px;
    outline: none;
    margin-right: 10px;
}

.chatbot-input button {
    background: var(--primary-red);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .chatbot-window {
        width: 300px;
        height: 400px;
    }
    
    .chatbot-container {
        bottom: 180px;
        right: 15px;
    }
}

/* ===== ANIMACIONES DE HOVER MEJORADAS ===== */

/* Animaciones suaves para botones principales */
.cta-button:hover,
.btn-primary:hover,
.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 20, 60, 0.2);
    transition: all var(--transition);
}

/* Animaciones suaves para cards de servicios */
.service-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all var(--transition);
}

.service-item:hover .service-icon {
    transform: scale(1.05);
    color: var(--primary-red);
    transition: all var(--transition);
}

/* Animaciones suaves para cards de proyectos */
.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    transition: all var(--transition);
}

/* Animaciones suaves para galería */
.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    transition: all var(--transition);
}

.gallery-item:hover img {
    transform: scale(1.05);
    filter: brightness(1.05);
    transition: all var(--transition);
}

/* Animaciones suaves para cards de clientes */
.client-card:hover,
.client-logo-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: all var(--transition);
}

.client-logo-item:hover img {
    transform: scale(1.05);
    filter: brightness(1.05);
    transition: all var(--transition);
}

/* Animaciones suaves para iconos */
.about-card:hover .card-icon i,
.service-item:hover .service-icon i {
    transform: scale(1.1);
    transition: all var(--transition);
}

/* Animaciones suaves para formularios */
.contact-form input:focus,
.contact-form textarea:focus,
.chatbot-input input:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 10px rgba(220, 20, 60, 0.1);
    transition: all var(--transition);
}

/* Animaciones suaves para WhatsApp button */
.whatsapp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.3);
    transition: all var(--transition);
}


/* Animaciones suaves para elementos de scroll */
.scroll-top-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(220, 20, 60, 0.3);
    transition: all var(--transition);
}

/* Animaciones suaves para links del footer */
.footer-section ul li a:hover {
    color: var(--primary-red);
    transition: all var(--transition);
}

/* Animaciones suaves para botones del chatbot */
.chatbot-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(220, 20, 60, 0.2);
    transition: all var(--transition);
}

.chatbot-input button:hover {
    background: var(--dark-red);
    box-shadow: 0 3px 10px rgba(220, 20, 60, 0.2);
    transition: all var(--transition);
}

/* Animaciones adicionales simples para mejor UX */
.contact-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(220, 20, 60, 0.1);
    transition: all var(--transition);
}

.contact-card:hover .contact-icon {
    transform: scale(1.1);
    color: var(--primary-red);
    transition: all var(--transition);
}

.certificate-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transition: all var(--transition);
}

.certificate-item:hover img {
    transform: scale(1.05);
    filter: brightness(1.05);
    transition: all var(--transition);
}

.nav-logo img:hover {
    transform: scale(1.02);
    filter: brightness(1.05);
    transition: all var(--transition);
}

.close:hover {
    transform: scale(1.1);
    color: var(--primary-red);
    transition: all var(--transition);
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(220, 20, 60, 0.8);
    transition: all var(--transition);
}

/* ===== PREMIUM SCROLL REVEAL EFFECTS (Apple/Webflow Style) ===== */

/* Core timing functions - Apple inspired */
:root {
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-out-circ: cubic-bezier(0.075, 0.82, 0.165, 1);
    --ease-in-out-quart: cubic-bezier(0.77, 0, 0.175, 1);
    --apple-ease: cubic-bezier(0.645, 0.045, 0.355, 1);
}

/* Advanced scroll reveal system */
.scroll-reveal {
    opacity: 0;
    transform: translateY(60px) translateZ(0);
    transition: all 1.2s var(--ease-out-expo);
    will-change: opacity, transform;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Multi-directional reveals with enhanced physics */
.scroll-reveal-up {
    opacity: 0;
    transform: translateY(100px) scale(0.95) translateZ(0);
    transition: opacity 1.4s var(--ease-out-expo), 
                transform 1.6s var(--ease-out-expo);
    will-change: opacity, transform;
}

.scroll-reveal-down {
    opacity: 0;
    transform: translateY(-80px) rotate(1deg) translateZ(0);
    transition: all 1.3s var(--ease-out-quart);
}

.scroll-reveal-left {
    opacity: 0;
    transform: translateX(-60px) scale(0.9) rotateY(8deg) translateZ(0);
    transition: all 1.5s var(--ease-out-circ);
    transform-origin: center right;
}

.scroll-reveal-right {
    opacity: 0;
    transform: translateX(60px) scale(0.9) rotateY(-8deg) translateZ(0);
    transition: all 1.5s var(--ease-out-circ);
    transform-origin: center left;
}

.scroll-reveal-scale {
    opacity: 0;
    transform: scale(0.7) rotateZ(3deg) translateZ(0);
    transition: all 1.8s var(--apple-ease);
    filter: blur(1px);
}

.scroll-reveal-zoom {
    opacity: 0;
    transform: scale(1.3) translateZ(0);
    transition: all 1.6s var(--ease-out-expo);
    filter: blur(2px);
}

/* 3D Flip Effects */
.scroll-reveal-flip-x {
    opacity: 0;
    transform: perspective(1000px) rotateX(45deg) scale(0.8) translateZ(-100px);
    transition: all 1.7s var(--ease-out-quart);
    transform-style: preserve-3d;
}

.scroll-reveal-flip-y {
    opacity: 0;
    transform: perspective(1000px) rotateY(45deg) scale(0.8) translateZ(-100px);
    transition: all 1.7s var(--ease-out-quart);
    transform-style: preserve-3d;
}

/* Advanced revealed states with spring physics */
.scroll-reveal.revealed,
.scroll-reveal-up.revealed,
.scroll-reveal-down.revealed,
.scroll-reveal-left.revealed,
.scroll-reveal-right.revealed,
.scroll-reveal-scale.revealed,
.scroll-reveal-zoom.revealed,
.scroll-reveal-flip-x.revealed,
.scroll-reveal-flip-y.revealed {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1) rotate(0) rotateX(0) rotateY(0) rotateZ(0) translateZ(0);
    filter: blur(0);
}

/* Professional timing variations */
.scroll-reveal-instant { transition-duration: 0.8s; }
.scroll-reveal-fast { transition-duration: 1s; }
.scroll-reveal-normal { transition-duration: 1.4s; }
.scroll-reveal-slow { transition-duration: 1.8s; }
.scroll-reveal-glacial { transition-duration: 2.4s; }

/* Enhanced stagger delays with exponential curve */
.scroll-reveal-delay-1 { transition-delay: 0.08s; }
.scroll-reveal-delay-2 { transition-delay: 0.16s; }
.scroll-reveal-delay-3 { transition-delay: 0.28s; }
.scroll-reveal-delay-4 { transition-delay: 0.44s; }
.scroll-reveal-delay-5 { transition-delay: 0.64s; }
.scroll-reveal-delay-6 { transition-delay: 0.88s; }
.scroll-reveal-delay-7 { transition-delay: 1.16s; }
.scroll-reveal-delay-8 { transition-delay: 1.48s; }

/* Apple-style text reveals */
.scroll-reveal-text {
    opacity: 0;
    transform: translateY(40px) translateZ(0);
    transition: all 1.1s var(--ease-out-expo);
    mask: linear-gradient(180deg, transparent 0%, black 25%, black 75%, transparent 100%);
}

.scroll-reveal-text.revealed {
    opacity: 1;
    transform: translateY(0) translateZ(0);
    mask: linear-gradient(180deg, black 0%, black 100%);
}

/* Professional element targeting */
.section-title,
.hero-title,
.hero-subtitle {
    opacity: 0;
    transform: translateY(80px) scale(0.95) translateZ(0);
    transition: opacity 1.6s var(--ease-out-expo) 0.2s,
                transform 1.8s var(--ease-out-expo) 0.2s;
    will-change: opacity, transform;
}

.hero-content h1,
.hero-content p {
    opacity: 0;
    transform: translateY(60px) translateZ(0);
    transition: all 1.4s var(--ease-out-expo);
    transition-delay: 0.4s;
}

/* Enhanced card animations with depth */
.about-card,
.service-item,
.project-card,
.client-card,
.gallery-item,
.contact-card,
.certificate-item {
    opacity: 0;
    transform: translateY(80px) scale(0.92) rotateX(8deg) translateZ(0);
    transition: opacity 1.5s var(--ease-out-expo),
                transform 1.7s var(--ease-out-expo);
    transform-origin: center bottom;
    transform-style: preserve-3d;
    will-change: opacity, transform;
}

/* Premium image effects */
.gallery-item,
.project-card {
    overflow: hidden;
}

.gallery-item img,
.project-card img,
.about-card img {
    opacity: 0;
    transform: scale(1.2) translateZ(0);
    transition: opacity 1.8s var(--ease-out-expo) 0.3s,
                transform 2.2s var(--ease-out-expo) 0.3s;
    filter: blur(4px) brightness(0.8);
}

.gallery-item.revealed img,
.project-card.revealed img,
.about-card.revealed img {
    opacity: 1;
    transform: scale(1) translateZ(0);
    filter: blur(0) brightness(1);
}

/* Section-level animations with parallax hint */
.hero-section,
.about-section,
.services-section,
.projects-section,
.clients-section,
.contact-section,
.gallery-section,
.curriculum-section {
    opacity: 0;
    transform: translateY(40px) translateZ(0);
    transition: all 1.8s var(--ease-out-quart);
}

/* Premium button reveals with physics */
.cta-button,
.btn-primary,
.btn-secondary {
    opacity: 0;
    transform: translateY(30px) scale(0.9) translateZ(0);
    transition: opacity 1.2s var(--ease-out-expo) 0.6s,
                transform 1.4s var(--ease-out-expo) 0.6s;
    filter: blur(1px);
}

.whatsapp-btn:not(.revealed) {
    opacity: 0;
    transform: scale(0.7) rotate(45deg) translateZ(0);
    transition: all 1.6s var(--apple-ease) 1s;
    filter: blur(2px);
}

.whatsapp-btn.revealed {
    opacity: 1;
    transform: scale(1) rotate(0deg) translateZ(0);
    filter: blur(0);
}

/* Advanced stagger patterns for grids */
.service-item:nth-child(odd) {
    transform: translateY(80px) translateX(-20px) scale(0.92) rotateY(2deg) translateZ(0);
}

.service-item:nth-child(even) {
    transform: translateY(80px) translateX(20px) scale(0.92) rotateY(-2deg) translateZ(0);
}

/* Exponential stagger timing */
.service-item:nth-child(1) { transition-delay: 0.1s; }
.service-item:nth-child(2) { transition-delay: 0.15s; }
.service-item:nth-child(3) { transition-delay: 0.22s; }
.service-item:nth-child(4) { transition-delay: 0.31s; }
.service-item:nth-child(5) { transition-delay: 0.42s; }
.service-item:nth-child(6) { transition-delay: 0.55s; }
.service-item:nth-child(7) { transition-delay: 0.7s; }
.service-item:nth-child(8) { transition-delay: 0.87s; }
.service-item:nth-child(9) { transition-delay: 1.06s; }
.service-item:nth-child(10) { transition-delay: 1.27s; }
.service-item:nth-child(11) { transition-delay: 1.5s; }
.service-item:nth-child(12) { transition-delay: 1.75s; }

/* Gallery advanced stagger */
.gallery-item:nth-child(3n+1) { 
    transform: translateY(100px) scale(0.9) rotateZ(1deg) translateZ(0);
    transition-delay: 0.1s;
}
.gallery-item:nth-child(3n+2) { 
    transform: translateY(80px) scale(0.95) rotateZ(-0.5deg) translateZ(0);
    transition-delay: 0.2s;
}
.gallery-item:nth-child(3n) { 
    transform: translateY(90px) scale(0.92) rotateZ(0.8deg) translateZ(0);
    transition-delay: 0.3s;
}

/* Contact cards with 3D depth */
.contact-card:nth-child(1) { 
    transform: translateY(60px) rotateY(5deg) scale(0.95) translateZ(0);
    transition-delay: 0.1s; 
}
.contact-card:nth-child(2) { 
    transform: translateY(60px) scale(0.95) translateZ(0);
    transition-delay: 0.25s; 
}
.contact-card:nth-child(3) { 
    transform: translateY(60px) rotateY(-5deg) scale(0.95) translateZ(0);
    transition-delay: 0.4s; 
}

/* Footer siempre visible - sin scroll reveal */
.footer {
    opacity: 1;
    transform: translateY(0) scale(1) translateZ(0);
    filter: blur(0);
}



/* Forms with sophisticated entrance */
.contact-form,
.cv-viewer {
    opacity: 0;
    transform: translateY(80px) scale(0.95) perspective(1000px) rotateX(10deg) translateZ(0);
    transition: all 1.9s var(--ease-out-quart) 0.4s;
    transform-origin: center top;
}

/* Revealed states for all elements */
.section-title.revealed,
.hero-title.revealed,
.hero-subtitle.revealed,
.hero-content h1.revealed,
.hero-content p.revealed,
.about-card.revealed,
.service-item.revealed,
.project-card.revealed,
.client-card.revealed,
.gallery-item.revealed,
.contact-card.revealed,
.certificate-item.revealed,
.contact-form.revealed,
.cv-viewer.revealed,
.iso-card.revealed,
.hero-section.revealed,
.about-section.revealed,
.services-section.revealed,
.projects-section.revealed,
.clients-section.revealed,
.contact-section.revealed,
.gallery-section.revealed,
.curriculum-section.revealed,
.cta-button.revealed,
.btn-primary.revealed,
.btn-secondary.revealed,
.whatsapp-btn.revealed {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1) rotate(0) rotateX(0) rotateY(0) rotateZ(0) translateZ(0);
    filter: blur(0) brightness(1);
}

/* Específico para ISO cards revelados - mantener sus características */
.iso-card.revealed img {
    width: 135% !important;
    height: 135% !important;
    transform: translate(-12.5%, -12.5%) !important;
}

.iso-card.revealed:hover img {
    transform: translate(-12.5%, -12.5%) scale(1.05) !important;
}

/* Optimización específica para móviles - Sin desbordamiento */
@media (max-width: 768px) {
    .scroll-reveal,
    .scroll-reveal-up,
    .scroll-reveal-down,
    .scroll-reveal-left,
    .scroll-reveal-right,
    .scroll-reveal-scale,
    .scroll-reveal-zoom,
    .scroll-reveal-flip-x,
    .scroll-reveal-flip-y {
        transition-duration: 0.8s !important;
        transform: translateY(30px) translateZ(0) !important;
    }
    
    /* Eliminar movimientos horizontales que causan overflow */
    .scroll-reveal-left {
        transform: translateY(30px) scale(0.95) translateZ(0) !important;
    }
    
    .scroll-reveal-right {
        transform: translateY(30px) scale(0.95) translateZ(0) !important;
    }
    
    .scroll-reveal-flip-x,
    .scroll-reveal-flip-y {
        transform: translateY(30px) scale(0.95) translateZ(0) !important;
    }
    
    .scroll-reveal.revealed,
    .scroll-reveal-up.revealed,
    .scroll-reveal-down.revealed,
    .scroll-reveal-left.revealed,
    .scroll-reveal-right.revealed,
    .scroll-reveal-scale.revealed,
    .scroll-reveal-zoom.revealed,
    .scroll-reveal-flip-x.revealed,
    .scroll-reveal-flip-y.revealed {
        opacity: 1 !important;
        transform: translateY(0) translateX(0) scale(1) translateZ(0) !important;
    }
    
    /* Asegurar visibilidad de elementos críticos SOLO en móviles cuando no están revelados */
    .project-card:not(.revealed),
    .gallery-item:not(.revealed) {
        opacity: 1 !important;
        transform: translateY(0) translateX(0) scale(1) translateZ(0) !important;
        animation: mobileShow 0.5s ease-out forwards;
    }
    
    /* Forzar visibilidad solo si hay problemas reales */
    .relevant-projects:not(.revealed),
    .gallery-section:not(.revealed) {
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    @keyframes mobileShow {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* Reducir animaciones en dispositivos con menor capacidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .scroll-reveal,
    .scroll-reveal-up,
    .scroll-reveal-down,
    .scroll-reveal-left,
    .scroll-reveal-right,
    .scroll-reveal-scale,
    .section-title,
    .hero-title,
    .hero-subtitle,
    .about-card,
    .service-item,
    .project-card,
    .client-card,
    .gallery-item,
    .contact-card,
    .certificate-item,
    .hero-section,
    .about-section,
    .services-section,
    .projects-section,
    .clients-section,
    .contact-section,
    .gallery-section,
    .curriculum-section,
    .footer {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}