/* Estilos generales */
body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    color: #333;
    background: #f8f8f8;
}

/* Header */
header {
    display: flex;
    justify-content: flex-end; /* Alinea los elementos a la derecha */
    align-items: center;
    padding: 15px 30px;
    background: #ffffff;
    width: 100%;
    box-sizing: border-box;
    flex-wrap: nowrap; /* Evita que los elementos se desborden */
}

/* Logo y texto GBS */
.logo {
    display: flex;
    align-items: center;
    margin-right: auto; /* Mueve el logo a la izquierda */
}

.logo img {
    width: 40px;
    margin-right: 10px;
}

.gbs-text {
    color: #54B05A;
    font-weight: bold;
    font-size: 1.2em;
}

/* Menú de navegación */
nav {
    margin-right: 20px; /* Ajusta la distancia entre el logo y los botones */
    display: flex;
    align-items: center;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    text-decoration: none;
    color: #54B05A;
    font-weight: bold;
    font-size: 0.9em;
    position: relative;
    transition: color 0.3s ease-in-out;
    white-space: nowrap; /* Evita que el texto se parta */
}

/* Efecto de hover en los enlaces del menú */
nav ul li a:hover {
    color: #2e7d32;
}

nav ul li a::after {
    content: "";
    display: block;
    width: 0;
    height: 2px;
    background: #2e7d32;
    transition: width 0.3s ease-in-out;
}

nav ul li a:hover::after {
    width: 100%;
}

/* Botón de contacto */
.btn-contact {
    background: #54B05A;
    color: white;
    padding: 10px 20px; /* Ajustado para evitar que se corte */
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.9em;
    transition: background 0.3s ease-in-out;
    margin-left: 20px; /* Separación con el menú */
    white-space: nowrap; /* Evita que el texto se parta */
    display: inline-flex;
    align-items: center;
}

.btn-contact:hover {
    background: #2e7d32;
    color: white; 
}

/* Contenido principal */
h1 {
    font-size: 2.5em;
    color: #54B05A;
    margin-top: 20px;
    text-align: center;
}

.subtitle {
    font-size: 1.2em;
    color: #666;
    text-align: center;
}

/* Ajuste del contenido */
.content {
    max-width: 800px;
    margin: 20px auto;
    text-align: justify;
    font-size: 1.1em;
}

/* Imagen principal más ancha */
.image-container {
    margin: 20px auto;
    max-width: 90%;
}

.image-container img {
    width: 100%;
    max-height: 350px;
    object-fit: cover;
    border-radius: 8px;
}

/* Call to Action sin fondo */
.cta {
    padding: 15px;
    margin: 20px auto;
    max-width: 700px;
    text-align: center;
}

.cta p {
    font-size: 1.2em;
    color: #333;
    font-weight: bold;
}

/* Ajuste de la posición del CTA */
.cta {
    padding: 15px;
    margin: 20px auto;
    margin-top: 10px;
}

/* Efecto de aparición */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Aplicar el efecto de aparición a los elementos */
h1, .subtitle, .image-container, .cta {
    opacity: 0;
    animation: fade-in 1s ease-in-out forwards;
}

.subtitle {
    animation-delay: 0.3s;
}

.image-container {
    animation-delay: 0.6s;
}

.cta {
    animation-delay: 0.9s;
}

.carousel-container {
    width: 100%;
    max-width: 1800px;
    height: 630px;
    margin: 20px auto;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    animation-delay: 1.2s;
}

.carousel {
    position: relative;
    width: 100%;
    height: 850px;
}

.carousel img {
    position: absolute;
    width: 100%;
    height: 850px;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.carousel img.active {
    opacity: 1;
    z-index: 1; 
    animation: fade-in 2s ease-in-out; /* Asegura que la imagen activa esté por encima */
}

footer {
    text-align: center;
    padding: 20px;
    background-color: #f5f5f5;
}

.legal-links {
    font-size: 14px;
    color: #666;
}

.legal-links a {
    color: #666;
    text-decoration: none;
    margin: 0 10px;
}

.legal-links a:hover {
    text-decoration: underline;
}


/* Media Queries para hacer la web responsive */

/* Tablets (768px - 1024px) */
@media (max-width: 1024px) {
    header {
        padding: 15px;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    nav {
        margin-right: 0;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    nav ul li {
        margin: 10px;
    }

    .carousel-container {
        height: 400px;
    }

    .carousel {
        height: 400px;
    }

    .carousel img {
        height: 400px;
    }

    .content {
        max-width: 95%;
        font-size: 1em;
    }

    .image-container img {
        max-height: 300px;
    }
}

/* Móviles grandes (hasta 767px) */
@media (max-width: 767px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px;
    }

    .logo {
        margin: 0 0 10px 0;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
    }

    nav ul li {
        margin: 10px 0;
    }

    .btn-contact {
        width: 100%;
        text-align: center;
        margin: 10px 0;
    }

    .carousel-container {
        height: 300px;
    }

    .carousel {
        height: 300px;
    }

    .carousel img {
        height: 300px;
    }

    .content {
        max-width: 100%;
        padding: 10px;
        font-size: 0.95em;
    }

    h1 {
        font-size: 2em;
    }

    .subtitle {
        font-size: 1em;
    }

    .cta p {
        font-size: 1em;
    }
}

/* Móviles pequeños (hasta 480px) */
@media (max-width: 480px) {
    h1 {
        font-size: 1.8em;
    }

    .subtitle {
        font-size: 0.9em;
    }

    .btn-contact {
        padding: 8px;
        font-size: 0.8em;
    }

    .image-container img {
        max-height: 200px;
    }

    .carousel-container {
        height: 250px;
    }

    .carousel {
        height: 250px;
    }

    .carousel img {
        height: 250px;
    }

    .cta p {
        font-size: 0.9em;
    }
}
