/* Fondo del header siempre visible */
header {
    background-color: #1b5757;
    transition: background-color 0.3s ease-in-out, transform 0.3s ease-in-out;
}

/* Estilo del hero */
.hero-section-geologia {
    position: relative;
    height: 750px; /* Incrementamos la altura */
    overflow: hidden;
}

/* Fondo con la imagen */
.hero-background-geologia {
    background-image: url('../../assets/geologia-bg.jpg'); /* Ajustar ruta si es necesario */
    background-size: cover;
    background-position: top;
    background-repeat: no-repeat;
    filter: brightness(70%);
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* Capa de superposición */
.hero-overlay {
    background: rgba(0, 0, 0, 0.5);
    position: absolute;
    inset: 0;
    z-index: 2;
}

/* Contenedor del texto */
.hero-content {
    position: absolute;
    bottom: 7rem; /* Sección más hacia abajo */
    left: 9rem; /* Separación del borde izquierdo */
    z-index: 3;
    color: white;
    padding: 0; /* Quitamos padding adicional */
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* No se necesita centrar verticalmente */
}

/* Estilos del título */
.hero-content h2 {
    font-size: 1.75rem;
    font-weight: 450;
    margin-bottom: 0.5rem;
}

/* Estilos del encabezado principal */
.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
}



nav a {
    font-size: 1.3rem;
    font-weight: 400;
}

body {
    font-family: 'Raleway', sans-serif;
}

/* Estilo del hero */
.hero-section-geologia {
    position: relative;
    overflow: hidden;
    height: 80vh;
    padding-top: 80px;
}

.hero-section-geologia img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(65%);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
}

.hero-content {
    position: absolute;
    bottom: 15%;
    left: 5%;
    z-index: 10;
    color: white;
}

.hero-content h2 {
    font-size: 1.8rem;
    font-weight: 300;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 600;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}

.services-section {
    background-color: white;
    padding: 3rem 0;
    text-align: center;
}

/* Contenedor de servicios adicionales */
.services-container {
    display: flex;
    align-items: center;
    justify-content: center; /* Centra correctamente */
    margin-top: 2rem;
    padding: 2rem 0;
    position: relative;
    flex-wrap: wrap; /* Permite que los elementos se reorganicen en filas */
    gap: 3rem; /* Espaciado horizontal entre títulos */
}

/* Líneas a los lados */
.line {
    flex: 1;
    height: 1px;
    background-color: #4a6371;
    max-width: 120px; /* Ajusta el ancho máximo de las líneas */
}

/* Línea a los lados del título */
.services-container::before,
.services-container::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: #6c8b94; /* Color similar al de la imagen */
    max-width: 600px;
}


/* Estilo del título */
.services-container h3 {
    font-size: 1.75rem;
    font-weight: 500;
    color: #6c8b94; /* Color del texto */
    margin-bottom: 1.5rem; /* Espaciado entre títulos */
    margin: 0 1.5rem; /* Espaciado entre líneas */
    white-space: nowrap; /* Evita que el texto se divida */
}


/* Contenedor de los enlaces */
.services-links {
    display: flex;
    justify-content: space-evenly;  /* Distribución uniforme en todo el ancho */
    gap: 2rem; /* Espaciado entre enlaces */
    margin-top: 2rem;
}

/* Estilos de los enlaces */
.services-links a {
    font-size: 1.5rem;
    font-weight: 500;
    color: #6c8b94; /* Color del texto */
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px; /* Espaciado con la flecha */
    transition: transform 0.2s ease-in-out;
}

/* Flecha a la derecha */
.services-links a::after {
    content: "→";
    font-size: 1.25rem;
    transition: transform 0.2s ease-in-out;
}

/* Efecto hover */
.services-links a:hover {
    text-decoration: underline;
    transform: translateY(-2px); /* Ligero efecto de elevación */

}

.services-links a:hover::after {
    transform: translateX(3px);
}


/* Sección de servicios relacionados */
.related-services h2 {
    color: #1b5757;
}

.related-services a {
    text-decoration: none;
    font-weight: 500;
}

.related-services a:hover {
    text-decoration: underline;
}

/* Contenedor del slider */
.carousel-container {
    width: 100%;
    max-width: 600px; /* Tamaño máximo para mantener proporción */
    height: 500px;
    position: relative;
    border-radius: 0; /* Se elimina el redondeado */
    overflow: hidden; /* Para que las imágenes se mantengan dentro */
    background-color: transparent; /* Sin fondo */
    box-shadow: none; /* Elimina la sombra */
    border: none; /* Elimina cualquier borde */
}


.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out; /* Efecto de desplazamiento suave */
}

.carousel-image {
    min-width: 100%; /* Ocupa el 100% del ancho del contenedor */
    height: 100%;
    object-fit: contain; /* Mantiene la proporción */
}

.carousel-container img {
    width: 100%;
    height: 100%; 
    background-color: transparent; /* Elimina el fondo gris en las imágenes */
    object-fit: contain; /* Asegura que la imagen mantenga su proporción sin recortarse */
    border-radius: 12px;
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
}



/* Botones del slider */
.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 128, 128, 0.8);
    color: white;
    width: 32px; /* Tamaño reducido para que no destaque demasiado */
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease;
}

.carousel-container img:hover {
    transform: scale(1.01); /* Efecto suave de ampliación */
    opacity: 0.97; /* Ligero oscurecimiento para destacar */
}

.carousel-button:hover {
    background-color: #0d9488;
}

.carousel-button.left-2 {
    left: 10px;
}

.carousel-button.right-2 {
    right: 10px;
}

/* Footer */
footer {

    color: white;
    padding: 1.5rem 0;
}

/* Efecto de elevación en iconos del footer */
.social-icon img {
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.social-icon:hover img {
    transform: translateY(-5px); /* Eleva ligeramente */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); /* Sombra suave */
}

/* Estado inicial del menú móvil */
#mobile-menu {
    display: none;
    flex-direction: column;
    position: fixed; /* Cambiado a fixed */
    top: 0;
    left: 0;
    background-color: #1b5757; /* Azul oscuro */
    width: 100%;
    z-index: 9999; /* Muy alto para estar por encima de todo */
    opacity: 0; /* Comienza invisible */
    transform: translateY(-20px); /* Posición inicial fuera de vista */
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

/* Animación del menú hamburguesa */
#mobile-menu {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: -100%; /* El menú inicia fuera de la pantalla */
    background-color: #1b5757;
    width: 100%;
    z-index: 9999;
    opacity: 0;
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
}

/* Mostrar el menú con animación */
#mobile-menu.active {
    display: flex;
    opacity: 1;
    transform: translateX(0); /* El menú se desliza desde la izquierda */
}

#menu-toggle {
    cursor: pointer;
}




/* HERO SECTION RESPONSIVE */
@media (max-width: 1024px) {
    #mobile-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: #1b5757;
        width: 100%;
        z-index: 50;
        transition: all 0.3s ease-in-out;
    }

    #mobile-menu.active {
        display: flex;
    }
    
    .hero-content {
        bottom: 5rem; 
        left: 5rem; 
    }

    .hero-content h2 {
        font-size: 1.5rem;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {

    #mobile-menu {
        display: none;
    }

    #menu-toggle {
        display: none; /* Aparece solo en pantallas pequeñas */
    }

    #menu-toggle {
        display: flex;
        align-items: center; /* Centrar el contenido verticalmente */
        justify-content: center; /* Centrar el contenido horizontalmente */
    }

    #mobile-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%; /* Justo debajo del header */
        left: 0;
        background-color: #1b5757; /* Color del menú desplegable */
        width: 100%;
        z-index: 50;
        transition: all 0.3s ease-in-out;
    }

    .hero-content {
        bottom: 3rem; 
        left: 2rem; 
    }

    .hero-content h2 {
        font-size: 1.3rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }
}

/* CARRUSEL RESPONSIVE */
@media (max-width: 1024px) {
    .carousel-container {
        height: 350px; /* Tamaño intermedio */
    }

    .carousel-button {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 768px) {
    .carousel-container {
        height: 280px; /* Reducido para pantallas pequeñas */
        max-width: 100%; 
    }

    .carousel-button {
        width: 28px;
        height: 28px;
    }
}

/* SECCIÓN DE SERVICIOS RESPONSIVE */
@media (max-width: 1024px) {
    .services-links {
        gap: 1rem; /* Espaciado menor para ocupar mejor el ancho */
    }

    .services-links a {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .services-links {
        flex-direction: column;  
        gap: 1.5rem;  
        text-align: center;  
        align-items: center;
    }

    .services-links a {
        font-size: 1.25rem;  
        align-items: center;
    }
}

@media (max-width: 768px) {
    .services-container {
        flex-direction: column; /* En móviles el título se apilará */
        gap: 1rem; /* Espacio entre el título y las líneas */
    }

    .services-container::before,
    .services-container::after {
        width: 100%; /* Líneas completas para que se vea mejor */
    }

    .services-container h3 {
        margin: 0; /* Centra el texto sin márgenes innecesarios */
    }
}

/* 🌙 Hero Geotecnia permanece sin cambios visuales */
body.dark-mode .hero-section-geotecnia {
    background: inherit; /* No afecta el fondo */
}

body.dark-mode .hero-section-geologia h1,
body.dark-mode .hero-section-geologia h2 {
    color: #f7fafc; /* Asegura que el texto sea claro si es necesario */
}

/* 🌙 Sección Principal de Geotecnia */
body.dark-mode .geologia-services-section {
    background-color: #1a202c; /* Fondo oscuro */
    color: #f7fafc; /* Texto claro */
}

body.dark-mode .geologia-services-section h1,
body.dark-mode .geologia-services-section p,
body.dark-mode .geologia-services-section li {
    color: #f7fafc;
}

/* 🌙 Carousel Geotecnia */
body.dark-mode .carousel-container {
    background-color: transparent; /* Sin fondo grisáceo */
}

body.dark-mode .carousel-button svg {
    stroke: #f7fafc; /* Iconos blancos */
}


body.dark-mode .services-section h3,
body.dark-mode .services-section a {
    color: #f7fafc;
}

body.dark-mode .services-section a:hover {
    color: #90cdf4; /* Azul claro al hover */
}

/* 🌙 Difuminación tipo "Nosotros" para Servicios adicionales SOLO en modo oscuro */
body.dark-mode .services-section {
    background: linear-gradient(to bottom, #1a202c, #2d3748, #1a202c);
    padding-top: 5rem;
    padding-bottom: 5rem;
}

/* 🌞 Modo claro - Sección Servicios mantiene su fondo original */
.services-section {
    background: linear-gradient(to bottom, #ffffff, #f7fafc, #ffffff); /* Ajusta al fondo claro original */
    padding-top: 5rem;
    padding-bottom: 5rem;
}



/* 🌙 Sección de Contacto específica */
body.dark-mode #contacto {
    background-color: #1a202c; /* Fondo general oscuro */
}

body.dark-mode #contacto .bg-white {
    background-color: #2d3748 !important; /* Fondo del contenedor oscuro */
    color: #f7fafc;
}

body.dark-mode #contacto h2,
body.dark-mode #contacto p,
body.dark-mode #contacto label {
    color: #f7fafc;
}

body.dark-mode #contacto input,
body.dark-mode #contacto textarea {
    background-color: #4a5568;
    color: #f7fafc;
    border-color: #718096;
}

body.dark-mode #contacto input::placeholder,
body.dark-mode #contacto textarea::placeholder {
    color: #cbd5e0;
}

body.dark-mode #contacto button {
    background-color: #587299;
    color: #f7fafc;
    border: 1px solid #718096;
}

body.dark-mode #contacto button:hover {
    background-color: #4a5568;
}

body.dark-mode section:not(.hero-section-geotecnia) {
    background-color: #1a202c;
    color: #f7fafc;
}

/* 🌙 Footer - Fondo y texto claros */
body.dark-mode footer {
    background-color: #1a202c;
    color: #f7fafc;
}

body.dark-mode footer a {
    color: #f7fafc; /* Blanco para enlaces */
}

body.dark-mode footer a:hover {
    color: #90cdf4; /* Azul claro al pasar el mouse */
}

body.dark-mode footer .social-icon img {
    filter: brightness(5) invert(1); /* Hace los íconos blancos */
}

/* 🌙 Footer logo en modo oscuro */
body.dark-mode footer img[src="../assets/Logo-1.png"] {
    content: url("../assets/Logo-4.png"); /* Cambia al logo claro */
}

/* Animación al cambiar de ícono (tema claro/oscuro) */
#theme-icon {
    transition: transform 0.4s ease-in-out, color 0.3s ease-in-out;
}

#theme-toggle.clicked #theme-icon {
    transform: rotate(180deg);
}

/* 🌗 Transición suave en fondo y color, excepto header y hero */
body section:not(.hero-section),
body footer,
body .service-image-wrapper,
body input,
body textarea,
body label,
body h1, 
body h2, 
body .subtitle, 
body .content-text,
body p,
body a {
    transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease;
}

/* 🌙 Fondo Global Asegurado */
body.dark-mode {
    background-color: #1a202c;
    color: #f7fafc;
}

/* 🌙 Fondo base para todo el body excepto hero */
body.dark-mode > *:not(header):not(.hero-section):not(.hero-section-geotecnia) {
    background-color: #1a202c !important;
}

/* 🌙 Modo Oscuro para íconos personalizados */
body.dark-mode footer .icon-transition {
    filter: brightness(5) invert(1); /* Igual que las redes sociales */
    transition: filter 0.3s ease, transform 0.3s ease;
}

.icon-transition {
    transition: filter 0.3s ease, transform 0.3s ease;
}

/* Animación de escala ya aplicada con Tailwind, pero puedes ajustar: */
a:hover .icon-transition {
    transform: scale(1.1);
}

/* 🌐 Íconos de Redes Sociales - Tamaño 20% más grande */
footer .social-icon img {
    width: 28px; /* antes 24px */
    height: 28px;
    transition: transform 0.3s ease, filter 0.3s ease;
}

/* Animación al pasar el mouse */
footer .social-icon:hover img {
    transform: scale(1.1); /* efecto suave */
}

/* 🌙 Modo Oscuro */
body.dark-mode footer .social-icon img {
    filter: brightness(5) invert(1); /* mantiene coherencia en oscuro */
}