/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
}

/* Cabecera fija */
/* Cabecera */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: #666;
    color: #fff;
    display: flex;
    justify-content: space-between; /* Distribuye los elementos a los extremos */
    align-items: center;
    padding: 10px 20px;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

header .logo img {
    height: 50px;
}

header .contacto-link a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

header .contacto-link a:hover,
header .contacto-link a:focus,
header .contacto-link a:visited {
    color: #fff;  /* Asegura que el color permanezca blanco */
    text-decoration: none;  /* Elimina el subrayado */}

nav {
    position: relative;
}

nav .menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1100;
}

nav .menu-toggle div {
    width: 25px;
    height: 3px;
    background-color: #fff;
    margin: 4px 0;
    transition: 0.4s;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

nav ul li {
    margin: 0 15px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

nav ul li a:hover {
    text-decoration: underline;
}

/* Secciones principales */
main {
    padding: 100px 20px 20px; /* Espacio para la cabecera fija */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    background: #fff;
}

.titulo-principal {
    text-align: center;
    font-size: 2rem;
    color: #333;
    margin-bottom: 20px;
    font-weight: bold;
}

.contenido {
    display: flex;
    flex-direction: column; /* Coloca el título encima de las cajas */
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin-bottom: 10px; /* Reducir el margen inferior */
}

.cajas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    margin-bottom: 10px; /* Reducir el margen inferior */
    justify-items: center;  /* Esto asegura que los elementos dentro de la cuadrícula se centren horizontalmente */
}


.caja {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.5s;
    width: 6cm;
    height: 6cm;
    cursor: pointer;
}

.texto-explicativo {
    position: absolute;
    bottom: -100%; /* Comienza oculto fuera del cuadro */
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px;
    text-align: center;
    font-size: 0.9rem;
    transition: bottom 0.4s ease;
}

nav ul li a:focus {
    outline: 2px solid #fff;
}

.caja.activa {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}


.caja.activa .texto-explicativo {
    bottom: 0; /* Se despliega hacia arriba al hacer clic */
}

.caja img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.caja:hover img {
    transform: scale(1.1); /* Mantiene el efecto hover */
}

.caja h2 {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    text-align: center;
    padding: 10px 0;
    margin: 0;
    font-size: 0.8rem;
}

/* Sección de contacto */
footer {
    background: #666;
    color: #fff;
    padding: 20px;
    text-align: center;
}

footer h2 {
    margin-bottom: 20px;
}

footer form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

footer label {
    margin: 10px 0 5px;
}

footer input, footer textarea {
    width: 100%;
    max-width: 500px;
    padding: 10px;
    margin-bottom: 15px;
    border: none;
    border-radius: 5px;
}

footer button {
    background: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

footer button:hover {
    background: #45a049;
}

.info-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9em;
    color: #ffffff; /* Color gris suave */
}

.info-footer a {
    color: #007BFF; /* Azul suave para el enlace */
    text-decoration: none;
}

.info-footer a:hover {
    text-decoration: underline;
}


/* Responsive */
@media (max-width: 768px) {
    nav .menu-toggle {.caja.activa {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

        display: flex;
    }

    nav ul {
        flex-direction: column;
        align-items: flex-start;
        position: fixed;
        top: 60px;
        right: -250px;
        background: #333;
        width: 200px;
        height: calc(100vh - 60px);
        padding: 20px 0;
        transition: right 0.3s ease-in-out;
        box-shadow: -2px 0 5px rgba(0,0,0,0.5);
        justify-content: flex-start; /* Alinear enlaces en la parte superior */
    }

    nav ul.active {
        right: 0;
    }

    nav ul li {
        margin: 0;
        width: 100%;
        text-align: left;
    }

    nav ul li a {
        display: block;
        padding: 15px 20px;
        width: 100%;
    }

    main {
        padding: 30px 10px 10px;
    }


    .caja {
        width: 100%;
        height: auto;
    }
}

.marquesina {
    width: 100%;
    background-color: #333; /* Color de fondo */
    color: white; /* Color del texto */
    text-align: center;
    padding: 10px 0;
    position: fixed; /* Mantener en la parte superior */
    top: 0;
    left: 0;
    z-index: 1000; /* Asegura que esté encima de otros elementos */
    font-size: 18px;
    margin-top: 70px; /* Ajusta este valor si tu cabecera es más alta */
    overflow: hidden; /* Evita que el texto sobresalga fuera de la marquesina */
}

.marquesina p {
    margin: 0;
    padding: 0;
    white-space: nowrap; /* Evita que el texto se divida */
    animation: scroll-left 20s linear infinite; /* Desplazamiento del texto */
}

@keyframes scroll-left {
    from {
        transform: translateX(-100%); /* Comienza fuera de la pantalla a la derecha */
    }
    to {
        transform: translateX(100%); /* Termina fuera de la pantalla a la izquierda */
    }
}


/* Animación para el menú hamburguesa */
.menu-toggle.open div:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.open div:nth-child(2) {
    opacity: 0;
}

.menu-toggle.open div:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}
