/* Reset básico */
   * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            background-color: white;
     font-family: Arial, sans-serif;
     min-height: 100vh;
     display: flex;
     flex-direction: column;
     overflow-x: hidden;
        }

        /* ===== CONTENIDO PRINCIPAL - ESPECIALIDADES ===== */
        main {
            flex: 1;
        }

        /* Formas de fondo animadas */
        .background-shapes {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
            z-index: 0;
            pointer-events: none;
        }

        .background-shapes::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(255, 215, 0, 0.03) 0%, transparent 70%);
            animation: rotate 30s linear infinite;
            z-index: 1;
        }

        .shape {
            position: absolute;
            border-radius: 50%;
            opacity: 0.08;
            animation: float 8s ease-in-out infinite;
        }

        .shape1 {
            width: 300px;
            height: 300px;
            background: linear-gradient(45deg, #FFD700, #FFA500);
            top: 10%;
            left: -10%;
            animation-delay: 0s;
        }

        .shape2 {
            width: 200px;
            height: 200px;
            background: linear-gradient(45deg, #FFD700, #FFFFFF);
            top: 70%;
            right: -5%;
            animation-delay: 3s;
        }

        .shape3 {
            width: 150px;
            height: 150px;
            background: linear-gradient(45deg, #FFFFFF, #FFD700);
            top: 40%;
            left: 80%;
            animation-delay: 6s;
        }

        @keyframes float {
            0%, 100% {
                transform: translateY(0px) rotate(0deg);
                opacity: 0.08;
            }
            50% {
                transform: translateY(-30px) rotate(180deg);
                opacity: 0.12;
            }
        }

        @keyframes rotate {
            from {
                transform: rotate(0deg);
            }
            to {
                transform: rotate(360deg);
            }
        }

        /* Container principal */
        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 2rem;
            position: relative;
            z-index: 1;
        }

        /* Secciones de especialidades */
        .especialidades-section {
            padding: 80px 20px;
            background: linear-gradient(135deg, #f8f8f8 0%, #ffffff 100%);
            position: relative;
            overflow: hidden;
        }

        .especialidades-container {
            max-width: 1200px;
            margin: 0 auto;
            position: relative;
            z-index: 2;
        }

        /* Título principal de especialidades */
        .especialidades-title {
            text-align: center;
            font-size: 3.5rem;
            font-weight: bold;
            margin-bottom: 3rem;
            background: linear-gradient(45deg, #1d1d1d, #565656);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            opacity: 0;
            transform: translateY(50px);
            animation: fadeInUp 1.2s ease 0.3s forwards;
        }

        /* Subtítulos y descripciones */
        .hero-subtitle {
            font-size: 1.8rem;
            font-weight: bold;
            color: #343434;
            margin-bottom: 1.5rem;
            text-align: center;
            position: relative;
        }

        .hero-subtitle::after {
            content: '';
            position: absolute;
            bottom: -10px;
            left: 50%;
            transform: translateX(-50%);
            width: 80px;
            height: 4px;
            background: linear-gradient(45deg, #FFD700, #FFA500);
            border-radius: 2px;
        }

        .hero-description {
            color: #666;
            font-size: 1.1rem;
            line-height: 1.8;
            text-align: center;
            max-width: 800px;
            margin: 0 auto 2rem;
            background: linear-gradient(135deg, rgba(255,215,0,0.05) 0%, rgba(255,255,255,0.8) 100%);
            backdrop-filter: blur(10px);
            border-radius: 15px;
            padding: 2rem;
            border-left: 4px solid transparent;
            border-image: linear-gradient(45deg, rgba(255,215,0,0.6), rgba(255,165,0,0.3)) 1;
            transition: all 0.4s cubic-bezier(0.23, 1, 0.320, 1);
            position: relative;
            overflow: hidden;
            opacity: 0;
            transform: translateY(50px);
            animation: fadeInUp 1s ease 0.5s forwards;
        }

        .hero-description::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,215,0,0.1), transparent);
            transition: left 0.6s ease;
        }

        .hero-description:hover::before {
            left: 100%;
        }

        .hero-description:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 30px rgba(255,215,0,0.15);
            border-image: linear-gradient(45deg, rgba(255,215,0,0.8), rgba(255,165,0,0.5)) 1;
        }

        /* Animaciones */
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(50px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* Media queries responsive */
        @media (max-width: 768px) {
            .especialidades-title {
                font-size: 2.5rem;
            }

            .hero-subtitle {
                font-size: 1.5rem;
            }

            .hero-description {
                font-size: 1rem;
                padding: 1.5rem;
            }

            .container {
                padding: 0 1rem;
            }

            .especialidades-section {
                padding: 60px 20px;
            }
        }

        @media (max-width: 480px) {
            .especialidades-title {
                font-size: 2rem;
            }

            .hero-subtitle {
                font-size: 1.3rem;
            }

            .hero-description {
                padding: 1rem;
            }
        }
         .loading-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: #050505;
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 9999;
            transition: opacity 0.5s ease-out;
        }

        .loading-screen.fade-out {
            opacity: 0;
            pointer-events: none;
        }

        /* Imagen de carga */
        .loading-image {
            max-width: 500px;
            max-height: 500px;
            width: auto;
            height: auto;
            animation: pulse 2s ease-in-out infinite;
        }
         .services-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
            gap: 2rem;
            margin-bottom: 2rem;
        }
        
        .last-two-services {
            display: flex;
            justify-content: center;
            gap: 2rem;
            flex-wrap: wrap;
            max-width: 800px;
            margin: 2rem auto 0;
        }
        
        .last-two-services .service-card {
            flex: 0 1 350px;
            max-width: 350px;
        }
        
        @media (max-width: 768px) {
            .last-two-services {
                flex-direction: column;
                align-items: center;
                gap: 1.5rem;
            }
            
            .last-two-services .service-card {
                width: 100%;
                max-width: 400px;
            }
        }

        @keyframes pulse {
            0%, 100% { 
                transform: scale(1);
                opacity: 0.8;
            }
            50% { 
                transform: scale(1.05);
                opacity: 1;
            }
        }
        @media (max-width: 480px) {
    /* Contenedor principal */
    .container {
        padding: 0 0.8rem;
    }
    
    /* Sección especialidades */
    .especialidades-section {
        padding: 40px 10px;
    }
    
    .especialidades-container {
        padding: 0 5px;
    }
    
    /* Título principal */
    .especialidades-title {
        font-size: 1.8rem;
        margin-bottom: 2rem;
        line-height: 1.3;
        padding: 0 10px;
    }
    
    /* Subtítulos */
    .hero-subtitle {
        font-size: 1.2rem;
        margin-bottom: 1.2rem;
        padding: 0 15px;
        line-height: 1.4;
    }
    
    .hero-subtitle::after {
        width: 60px;
        height: 3px;
        bottom: -8px;
    }
    
    /* Descripción hero */
    .hero-description {
        font-size: 0.95rem;
        padding: 1.2rem 1rem;
        margin: 0 auto 1.5rem;
        line-height: 1.6;
        border-radius: 12px;
        max-width: 95%;
        text-align: justify;
    }
    
    .hero-description:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 20px rgba(255,215,0,0.12);
    }
    
    /* Services grid */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 1.5rem;
        padding: 0 5px;
    }
    
    /* Últimos dos servicios */
    .last-two-services {
        gap: 1.5rem;
        margin: 1.5rem auto 0;
        padding: 0 5px;
        max-width: 100%;
    }
    
    .last-two-services .service-card {
        flex: 1;
        max-width: 100%;
        margin: 0 auto;
    }
    
    /* Formas de fondo - reducidas para móvil */
    .shape1 {
        width: 200px;
        height: 200px;
        top: 5%;
        left: -15%;
        opacity: 0.05;
    }
    
    .shape2 {
        width: 150px;
        height: 150px;
        top: 75%;
        right: -10%;
        opacity: 0.05;
    }
    
    .shape3 {
        width: 100px;
        height: 100px;
        top: 45%;
        left: 85%;
        opacity: 0.05;
    }
    
    /* Loading screen */
    .loading-image {
        max-width: 280px;
        max-height: 280px;
    }
    
    /* Animaciones optimizadas para móvil */
    .especialidades-title,
    .hero-description {
        animation-duration: 0.8s;
    }
    
    /* Mejoras adicionales para móviles muy pequeños */
    @media (max-width: 360px) {
        .especialidades-section {
            padding: 30px 5px;
        }
        
        .container {
            padding: 0 0.5rem;
        }
        
        .especialidades-title {
            font-size: 1.6rem;
            padding: 0 5px;
        }
        
        .hero-subtitle {
            font-size: 1.1rem;
            padding: 0 10px;
        }
        
        .hero-description {
            font-size: 0.9rem;
            padding: 1rem 0.8rem;
            max-width: 98%;
        }
        
        .services-grid,
        .last-two-services {
            padding: 0;
        }
        
        .hero-subtitle::after {
            width: 50px;
            height: 2px;
        }
        
        /* Formas aún más pequeñas para pantallas muy pequeñas */
        .shape1 {
            width: 150px;
            height: 150px;
        }
        
        .shape2 {
            width: 120px;
            height: 120px;
        }
        
        .shape3 {
            width: 80px;
            height: 80px;
        }
    }
}

/* Mejoras adicionales para tablets pequeños */
@media (max-width: 640px) and (min-width: 481px) {
    .especialidades-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1.4rem;
    }
    
    .hero-description {
        font-size: 1rem;
        padding: 1.5rem 1.2rem;
        max-width: 90%;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.8rem;
    }
    
    .last-two-services {
        gap: 1.8rem;
        max-width: 90%;
    }
}
