:root {
    --yellow: #FFF616;
    --text-color: #172655;
    --text-color-hover: #4466ca;
    --bg-dark-blue: #00293f;
    --sans-serif: 'IBM Plex Sans Thai', sans-serif;
}
*,
*:before,
*:after {
    box-sizing: border-box;
}
html,
body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1; /* Este es el espacio que empuja al footer hacia abajo */
}
html {
    font-size: 10px;
}

body {
    font-family: var(--sans-serif);
    font-optical-sizing: auto;
    font-weight: 400;
    font-size: 1.5rem;
    line-height: 1.6;
    color: var(--text-color);
    background-color: lightslategray;
}

a,
a:visited {
    color: inherit;
    text-decoration: underline;
}


/* Migas*/

.migas {
    font-size: 14px;
    margin: 20px;
}

.migas a {
    text-decoration: none;
    color: var(--text-color);
}

.migas a:hover {
    text-decoration: underline;
}


.container {
    width: 94%;
    max-width: 1200px;
    margin: 0 auto;
    background-color: inherit;
}

.centrado-h1 {
    text-align: center;
}


h3 {
    font-size: 1.8rem;
}

h6 {
    margin-top: 0;
}

nav {
    position: relative;
}

/* Menu hamburguesa*/


#hamburger-toggle {
    opacity: 0;
    position: absolute;
    right: 0;
    top: 0;
}

nav .checkbox:checked~.hamburger .slice:nth-child(2) {
    transform: translateY(12px) rotate(45deg);
}

nav .checkbox:checked~.hamburger .slice:nth-child(3) {
    opacity: 0;
}

nav .checkbox:checked~.hamburger .slice:nth-child(4) {
    transform: translateY(-12px) rotate(-45deg);
}

.hamburger {
    width: 32px;
    height: 32px;
    position: relative;
    top: -1rem;
    display: block;
    transition: transform 0.5s ease;
    z-index: 10;
    cursor: pointer;
}

.hamburger .slice {
    display: block;
    width: 100%;
    height: 2px;
    background-color: white;
    transition: all 0.5s ease;
}

.hamburger .slice:not(:first-child) {
    margin-top: 10px;
}
/* Header*/


header {
    color: white;
}

header ul,
header li,
footer ul,
footer li {
    margin: 0;
    padding: 0;
    list-style-type: none;
}

header ul {
    display: flex;
}

header a {
    color: inherit;
}

.header {
    background: var(--bg-dark-blue);
}

header nav {
    padding: 1.5rem 0;
    line-height: 1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

header nav ul a {
    display: block;
    padding: 1.3rem 1rem;
    border-bottom: 4px solid transparent;
    margin-right: 2rem;
}

header ul li:last-child a {
    margin-right: 0;
}

.logo-saludo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.saludo-usuario {
    font-size: 1.6rem;
    color: white;
    font-weight: 500;
}

/* Portada */

.portada-container {
    position: relative;
    height: auto;
    min-height: 100vh; /* Ocupa toda la altura de la ventana */
    padding: 5rem 0;
    background-color: var(--bg-dark-blue);
}

.portada-imagen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(60%);
    z-index: 1; /* Fondo más bajo */
}

/* Texto principal  y Cubos debajo del texto */
.portada-texto,
.cubos-portada {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
}

.portada-texto {
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.cubos-portada {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2.5rem;
    width: 94%;
    max-width: 960px;
    margin: 0 auto;
    margin-top: 1rem; /* más cerca del texto secundario */
}

.portada-texto h1 {
    font-size: 4rem;
    margin-bottom: 3rem; /* más espacio debajo del título */
}

.frase-inicial {
    font-size: 2rem;
    margin-bottom: 3rem; /* más espacio debajo de la frase inicial */
}

.frase-secundaria {
    font-size: 2rem;
    margin-bottom: 1rem; /* más cerca de los cubos */
}

.cubo {
    width: 220px;
    height: 280px; /* Altura fija para todos */
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    color: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cubo:hover {
    transform: scale(1.03);
}

.cubo img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 1rem;
    background-color: rgba(255,255,255,0.1);
}

.cubo h3 {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.cubo p {
    font-size: 1.3rem;
    margin: 0;
}

/* categoria */

.categoria-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, 250px);
    justify-content: center;
    gap: 10px;
    margin: 2rem;

}

.categoria-container a {
    color: var(--text-color);
}

.categoria-container a:hover {
    color: var(--text-color);
}

.categoria-item {
    text-align: center;
    width: 250px;
    margin: 0 auto;
}

.categoria-item img {
    width: 250px;
    height: 150px;
    border-radius: 10px;
    object-fit: cover;
}

.categoria-item h2 {
    font-size: 1.2em;
    margin-top: 0;
    margin-bottom: 0;
}

.categoria-item h6 {
    width: 100%;
    margin: 0 auto;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.categoria-container.vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}
.bloque-amplio {
    max-width: 1000px;
    width: 94%;
    margin: 3rem auto;
    text-align: left;
}

.bloque-amplio h2 {
    font-size: 2.6rem;
    margin-bottom: 1rem;
    text-align: center;
}

.bloque-amplio h5 {
    font-size: 1.8rem;
    line-height: 1.8;
}

.bloque-amplio ul {
    padding-left: 2rem;
}


.bloque-amplio h5 ul li a {
    color: var(--text-color);
    text-decoration: none;
}

/* Página detalle*/

.detalle-container {
    text-align: center;
}

.fluid {
    max-width: 100%;
    height: auto;
}

.imagen-destacada img {
    width: 66%;
    border-radius: 10px;
}

.galeria {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin: 1rem 0;
}

.descripcion img {
    border-radius: 10px;
}

.descripcion {
    margin-top: 3rem;
    margin-bottom: 3rem;
}

/* indice */

.indice-container {
    margin-bottom: 5rem;
}

.indice-grupo {
    padding-left: 2rem;
}

.indice-grupo a {
    display: block;
    margin-bottom: 0.5rem;
}

/*paginacion noticias*/

.paginacion {
    text-align: center;
    margin-top: 2rem;
}

.paginacion nav {
    display: inline-block;
}


/* footer*/
footer {
    color: white;
    background: var(--bg-dark-blue);
    padding: 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.footer-seccion:last-child {
    text-align: right;

}

.footer-seccion p {
    margin: 0 auto;
}

.footer-seccion h2 {
    margin-bottom: 1rem;
}

.footer-links a {
    color: white;
}

.footer-links a:hover {
    color: skyblue;
}

/* Password*/

.password-wrapper {
    position: relative;
}

.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
    width: 100%;
    padding: 0.8rem 2.5rem 0.8rem 0.8rem;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
    user-select: none;
}

/* Botón volver a buscar*/

.boton-volver {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: var(--bg-dark-blue);
    color: white;
    border-radius: 4px;
    text-decoration: none;
    margin-top: 3rem;
    margin-bottom: 5rem;
    text-align: center;
}

.boton-accion {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: var(--bg-dark-blue);
    color: white !important;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s ease;
}

.boton-accion:hover {
    background-color: var(--text-color-hover);
    color: white;
}

.contenedor-boton-volver {
    text-align: center;
    margin-top: 3rem;
    margin-bottom: 5rem;
}


.categoria-item img.cristal-img {
    background-color: white;
    padding: 0.5rem;
    width: 80%;
    max-width: 180px;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 4px;
    display: block;
    margin: 0 auto;
    height: auto;
}

.detalle-img {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 10px;
    object-fit: contain;
    display: block;
    margin: 1.5rem auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 1.4rem;
}

/* Consentimiento de privacidad */
.consentimiento-container {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    line-height: 1.6;
    color: var(--text-color);
}

.consentimiento-container label {
    display: inline-block;
    cursor: pointer;
}

.consentimiento-container input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Consentimiento en una sola línea */

.consentimiento-limpio {
    display: inline-block;
    font-weight: normal;
    white-space: normal;
}

.consentimiento-limpio input[type="checkbox"] {
    vertical-align: middle;
    margin-right: 0.5rem;
}

.boton-formulario {
    display: block;
    width: 100%;
    padding: 1rem;
    background-color: var(--bg-dark-blue);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    font-size: 1.6rem;
    margin-top: 1rem;
}


/* Aviso de cookies */
.cookie-banner {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: #222;
    color: white;
    padding: 1rem 2rem;
    text-align: center;
    z-index: 1000;
    font-size: 1.4rem;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
}

.cookie-banner a {
    color: var(--yellow);
    text-decoration: underline;
}

.cookie-banner button {
    background: var(--yellow);
    border: none;
    padding: 0.6rem 1.2rem;
    margin-left: 1rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
}
/* Media*/

/* Pantallas grandes: ≥ 1200px */
@media screen and (min-width: 1200px) {
    #hamburguer-toggle,
    .hamburger {
        display: none;
    }

    header nav ul {
        flex-flow: row wrap;
        justify-content: right;
        width: 100%;
        max-width: 85rem;
    }

    header nav ul a:hover {
        border-color: white;
    }

    .descripcion {
        margin: 5rem 20rem;
    }
}

/* Pantallas medianas: ≤ 1199px */
@media screen and (max-width: 1199px) {
    header nav ul {
        flex-flow: column wrap;
        display: none;
    }

    header nav .checkbox:checked+.hamburger {
        position: fixed;
        z-index: 6;
        right: 3%;
        top: 6rem;
    }

    header nav .checkbox:checked~ul {
        position: fixed;
        background: black;
        display: flex;
        right: 0;
        top: 0;
        width: 100%;
        height: 100%;
        z-index: 5;
        padding: 7rem 3rem 3rem 3rem;
    }

    header .header nav ul a {
        border-color: transparent;
    }

    header .header nav ul a:active,
    header .header nav ul a:hover {
        color: var(--yellow);
    }
}

/* Pantallas pequeñas: ≤ 836px */
@media screen and (max-width: 836px) {
    .footer-seccion:last-child {
        text-align: unset;
    }
}

/* Pantallas pequeñas: ≤ 768px */
@media screen and (max-width: 768px) {
    h1 {
        font-size: 4rem;
        text-align: center;
    }

    .descripcion {
        margin: 5rem 5rem;
    }

    .categoria-container {
        grid-template-columns: 1fr;
    }

    .categoria-item img {
        width: 100%;
        max-width: 250px;
        height: auto;
        object-fit: cover;
        border-radius: 10px;
    }

    .categoria-item h2 {
        font-size: 3rem;
    }

    .portada-texto h1 {
        margin-top: 5rem; /* antes era 20rem, ahora sube el texto */
    }

    .bloque-amplio {
        width: 90%;
    }

    .bloque-amplio h2 {
        font-size: 2.2rem;
    }

    .bloque-amplio h5 {
        font-size: 1.6rem;
    }

}

/* Pantallas muy pequeñas: ≤ 575px */
@media screen and (max-width: 575px) {
    nav .checkbox:checked~ul {
        top: 6.5rem;
    }
}
