body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    color: #333;
    background-color: #f9f9f9;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px;
}

header {
    background-color: rgba(255, 255, 255, 0.9); /* Fondo ligeramente transparente */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 0em 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100; /* Asegura que el header esté siempre arriba */
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-container img {
    height: 100px;
    width: auto;
    margin: 0%;
    padding: 0%;
    transition: transform 0.3s ease;
    animation: pulseLogo 2s infinite ease-in-out; /* Animación de pulsación */
}

@keyframes pulseLogo {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.02); filter: brightness(1.1); }
    100% { transform: scale(1); filter: brightness(1); }
}

.logo-container img:hover {
    transform: scale(1.05); /* Efecto de zoom sutil */
}

header h1 {
    margin: 0;
    color: #00838f;
    font-size: 1.8em;
    transition: transform 0.3s ease-in-out;
}

header h1:hover {
    transform: scale(1.05);
}

header nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

header nav ul li {
    overflow: hidden;
}

header nav ul li a {
    color: #555;
    text-decoration: none;
    padding: 0.7em 1.2em;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
}

header nav ul li a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #00838f;
    transform: scaleX(0);
    transition: transform 0.3s ease-in-out;
    transform-origin: bottom left;
}

header nav ul li a:hover::before,
header nav ul li a.active::before {
    transform: scaleX(1);
    transform-origin: bottom right;
}

header nav ul li a:hover,
header nav ul li a.active {
    color: #00838f;
    background-color: rgba(0, 131, 143, 0.05);
}

main {
    padding-top: 80px; /* Para que el contenido no quede debajo del header fijo */
}

.hero {
    background: linear-gradient(135deg, #e0f7fa 0%, #cdd8f1 100%);
    padding: 150px 20px;
    text-align: center;
    color: #333;
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    position: relative; /* Necesario para posicionar pseudo-elementos o partículas */
    overflow: hidden; /* Oculta cualquier superposición externa */
}

/* Superposición de color/gradiente en el Hero para mejorar legibilidad */
/*.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 131, 143, 0.4) 0%, rgba(0, 172, 193, 0.2) 100%); /* Gradiente semi-transparente 
    z-index: 0; /* Detrás del contenido, encima de la imagen de fondo 
}
*/
/* Si usas particles.js, asegúrate de que #particles-js esté por debajo del contenido */
#particles-js { /* Si añades este div en tu HTML */
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0; /* Puede ser z-index: -1 si la superposición es z-index: 0 */
    background-color: transparent;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative; /* Necesario para que el contenido esté por encima de la superposición */
    z-index: 1;
}

.hero h2 {
    font-size: 3em;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.hero p {
    font-size: 1.2em;
    margin-bottom: 30px;
}

.button {
    display: inline-block;
    background-color: #00838f;
    color: white;
    padding: 14px 30px;
    text-decoration: none;
    border-radius: 8px;
    margin-top: 25px;
    transition: background-color 0.3s ease, transform 0.2s ease-in-out, box-shadow 0.3s ease-in-out;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.button:hover {
    background-color: #00acc1;
    transform: scale(1.03);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2);
}

.button:active { /* Microinteracción */
    transform: scale(0.95);
}

.full-width-section {
    width: 100%;
    padding: 60px 0;
    background-color: #fff;
}

#servicios {
    background-color: #f2f2f2;
    padding-top: 80px; /* <--- Aumentado para dar espacio al hover y evitar que se corte el borde superior */
    padding-bottom: 80px; /* Mantiene el padding inferior original */
}

#servicios h2 {
    text-align: center;
    margin-bottom: 60px;
    font-size: 2.5em;
    color: #00838f;
    position: relative;
    z-index: 0;
    
}

.services-carousel {
    max-width: 900px;
    margin-top: 40px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    isolation: isolate;
    overflow: visible !important;
}

/* ESTILOS DE LA TARJETA DE SERVICIO - CONSOLIDADO Y CORREGIDO */
.service-item {
    padding: 30px;
    text-align: center;
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Sombra inicial sutil */
    margin: 0 15px; /* Tu margen original */
    position: relative; /* CRÍTICO para que z-index funcione */
    z-index: 1; /* Valor inicial para el apilamiento */
    /* Transiciones para todas las propiedades que cambian: transform, box-shadow, y z-index */
    transition: transform 0.3s ease, box-shadow 0.3s ease, z-index 0s step-end;
    /* IMPORTANTE: La propiedad 'overflow: hidden;' ha sido removida de aquí.
       El pseudo-elemento '::before' para el borde también fue removido y el borde
       ahora se maneja con el box-shadow en el estado hover. */
}

.service-item h3 {
    color: #00838f;
    margin-bottom: 15px;
    font-size: 1.5em;
    /* NO NECESITA position: relative; o z-index; aquí si no usas el ::before como antes */
}

.service-item p {
    color: #555;
    margin-bottom: 20px;
    font-size: 1em;
    /* NO NECESITA position: relative; o z-index; aquí */
}

.service-item .icon {
    font-size: 2.5em;
    color: #00acc1;
    transition: transform 0.3s ease, color 0.3s ease; /* Transición para el ícono */
    /* NO NECESITA position: relative; o z-index; aquí */
}

.service-item .service-image {
    width: 100%;
    max-width: 150px;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    object-fit: cover;
    transition: box-shadow 0.3s ease;
    /* NO NECESITA position: relative; o z-index; aquí */
}

/* EFECTO HOVER EN LA TARJETA DE SERVICIO - UNA ÚNICA Y CORRECTA DEFINICIÓN */
.service-item:hover {
    transform: translateY(-8px) scale(1.02); /* Eleva más y hace un zoom sutil */
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.15), /* Sombra principal para la elevación */
        0 0 0 4px #00838f; /* <-- ESTE ES EL BORDE EXTERNO ANIMADO CON BOX-SHADOW */
    cursor: pointer; /* Indica que es interactivo */
    z-index: 1; /* <--- ¡Asegura que la tarjeta se apile por encima! */
    /* Transición cuando SE SALE del hover (el z-index vuelve rápidamente al valor normal) */
    transition: transform 0.3s ease, box-shadow 0.3s ease, z-index 0s step-start;
}

/* ANIMACIÓN DEL ÍCONO Y LA IMAGEN AL HOVER */
.service-item:hover .icon {
    transform: rotateY(180deg) scale(1.1); /* Rota y se agranda */
    color: #00acc1; /* Cambia a un color secundario */
}

.service-item:hover .service-image {
    box-shadow: 0 0 15px rgba(0, 131, 143, 0.7); /* Brillo alrededor de la imagen */
}

#sobre-nosotros {
    padding: 80px 0;
}

#sobre-nosotros h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5em;
    color: #00838f;
}

.about-us-content {
    display: flex;
    gap: 40px;
    align-items: center;
    max-width: 900px;
    margin: 0 auto;
}

.about-us-content .image-container {
    flex: 1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.about-us-content .image-container:hover img {
    transform: scale(1.02);
    filter: brightness(1.05); /* Ligeramente más brillante */
}

.about-us-content img {
    width: 100%;
    display: block;
}

.about-us-content .text-container {
    flex: 1;
    line-height: 1.7;
    color: #555;
}

/* Estilos para la información de certificación con la imagen */
.certification-info {
    display: flex; /* Habilita Flexbox */
    align-items: center; /* Centra los ítems verticalmente */
    gap: 20px; /* Espacio entre el texto y la imagen */
    margin-top: 20px; /* Espacio superior para separarlo de la lista */
    flex-wrap: wrap; /* Permite que los elementos salten de línea en pantallas pequeñas */
    justify-content: center; /* Centra el contenido horizontalmente en pantallas pequeñas */
}

.certification-info .certification-text p {
    margin-bottom: 5px; /* Espacio entre cada línea de cédula */
    font-size: 1em; /* Asegura un tamaño de fuente legible */
    color: #333; /* Color del texto */
    line-height: 1.3; /* Ajusta la altura de línea */
}

.certification-info .certification-image-container {
    flex-shrink: 0; /* Evita que la imagen se encoja demasiado */
    text-align: center; /* Centra la imagen si hay espacio extra */
}

.certification-info .unam-shield {
    max-width: 100px; /* Ajusta el tamaño máximo de la imagen del escudo */
    height: auto; /* Mantiene la proporción */
    display: block; /* Elimina espacio extra debajo de la imagen */
}

/* Ajustes para pantallas pequeñas en la certificación de la Dra. */
@media (max-width: 600px) {
    .certification-info {
        flex-direction: column; /* Apila el texto y la imagen verticalmente */
        align-items: center; /* Centra los elementos apilados */
        text-align: center;
    }

    .certification-info .certification-text {
        margin-bottom: 15px; /* Espacio entre el texto y la imagen apilados */
    }
}

#ubicacion {
    background: #f2f2f2;
    padding: 80px 0;
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
}

.parallax-2 {
    background-image: url('img/parallax.jpg'); /* Reemplaza con tu imagen */
}

#ubicacion h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5em;
    color: #00838f;
}

.location-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    color: #fff; /* Asegúrate de que el color sea legible sobre tu fondo */
}

#map {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    transition: box-shadow 0.3s ease; /* Animación para la sombra del mapa */
}

#map:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3); /* Sombra más pronunciada al pasar el cursor */
}

.location-content .address,
.location-content .contact {
    margin-top: 20px;
    font-size: 1.1em;
    color: #333; /* Ajusta el color del texto si el fondo es claro en esta sección */
}

footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 2em 0;
}

footer p {
    margin: 0;
    font-size: 0.9em;
}

/* Animaciones */
.fade-in-down {
    opacity: 0;
    transform: translateY(-30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-down.active {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-up.active {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.scroll-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Slick Carousel Styles */
.slick-list {
    overflow: visible;
}
.slick-track {
    display: flex !important;
    overflow: visible;
    
}

.slick-slide {
    height: auto !important;
    margin: 20px 10px; /* Reducido para que las tarjetas sean ligeramente más anchas */
}

.slick-prev:before,
.slick-next:before {
    font-family: 'slick';
    font-size: 20px;
    line-height: 1;
    opacity: .75;
    color: #00838f;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Tipografía Dinámica (ejemplo sutil al cargar) */
header h1 {
    opacity: 0;
    transform: translateY(-10px);
    animation: slideInHeader 0.8s ease-out forwards;
}

@keyframes slideInHeader {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Parallax Backgrounds */
.parallax {
    /* background-image: url('../img/desk-of-chief-physician-2025-01-29-08-20-25-utc.jpg');  Reemplaza con tu imagen */
    /*background-image: url('../img/Logo.jpg');*/
    position: relative;
    background-color: transparent;
    z-index: 0;
    overflow: hidden;
    
}
.parallax::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../img/Logo.jpg');
    background-size: contain;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center center;
    background-blend-mode: overlay;
    opacity: 0.20; /* Marca de agua sutil */
    pointer-events: none; /* Para que no bloquee clics */
    z-index: -1; /* Detrás del contenido */
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        align-items: center;
    }

    header h1 {
        margin-bottom: 10px;
        font-size: 1.5em;
    }

    header nav ul {
        flex-direction: column;
        align-items: center;
    }

    header nav ul li {
        margin: 5px 0;
    }

    .hero {
        padding: 120px 20px;
        background-attachment: scroll; /* Desactivar parallax en móviles */
    }

    .hero h2 {
        font-size: 2.5em;
    }

    .about-us-content {
        flex-direction: column;
        text-align: center;
    }

    .about-us-content .image-container {
        margin-bottom: 20px;
    }

    #ubicacion {
        background-attachment: scroll; /* Desactivar parallax en móviles */
    }
}
#contacto-footer .footer-content {
    display: flex;
    justify-content: center; /* Centra la única columna */
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 2em;
    text-align: center; /* Centra el texto dentro de la columna */
}

#contacto-footer .footer-column {
    /* Puedes ajustar el max-width o eliminarlo para que ocupe más espacio si es la única */
    /* max-width: 50%; /* O un valor que te guste */
    min-width: 250px;
    max-width: 100%; /* Ajusta si es necesario, o déjalo a 100% para que se adapte */
}

#contacto-footer .footer-column h3 {
    /* Asegúrate de que este título también esté centrado */
    text-align: center;
}