/* =========================================
   RESET Y ESTILOS GENERALES
========================================= */

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #333;
    color: aliceblue;
}

main {
    flex: 1;
}


/* =========================================
   NAVEGACIÓN
========================================= */

nav {
    background-color: #992222;
    display: flex;
    justify-content: right;
    align-items: center;
    padding: 1rem;
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    z-index: 1000;
}

nav a {
    text-decoration: none;
    color: white;
    font-weight: bold;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
}

nav a:hover {
    color: #f46161;
}



.logo {
    display: block;
    margin-right: auto;
}


/* =========================================
   HEADER Y FOOTER
========================================= */

header {
    background-color: #333;
    color: white;
    padding: 20px 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: xx-large;
    font-family: cursive;
}

footer {
    background-color: #992222;
    color: white;
    text-align: center;
    padding: 1rem;
    width: 100%;
    box-sizing: border-box;
}


/* =========================================
   GALERÍA
========================================= */

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

.galeria img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    display: block;
    cursor: pointer;
}


/* =========================================
   ELEMENTOS GENERALES
========================================= */

p {
    display: flex;
    justify-content: center;
    align-items: center;
}

iframe {
    display: block;
    margin: 0 auto;
}

.titulo-noticias {
    text-align: center;
}


/* =========================================
   PÁGINA PRINCIPAL - PORTADA
========================================= */

.portada {
    position: relative;
    text-align: center;
    color: black;
}

.portada img {
    width: 100%;
    height: auto;
    display: block;
}

.portada-contenido {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(90%, 720px);
    box-sizing: border-box;
    padding: 28px 32px;
    background: rgba(255, 255, 255, 0.92);
    color: #222;
    border: 2px solid rgba(153, 34, 34, 0.35);
    border-radius: 12px;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
}

.portada-contenido h1 {
    margin: 0 0 12px;
    color: #992222;
}

.portada-contenido p {
    color: #333;
    font-weight: 500;
    line-height: 1.5;
}

.portada-contenido h1 {
    font-size: 40px;
}

.portada-contenido p {
    font-size: 20px;
    margin: 15px 0;
}


/* =========================================
   BOTONES WHATSAPP
========================================= */

.boton-whatsapp {
    display: inline-block;
    background-color: #25d366;
    color: #ffffff;
    padding: 12px 22px;
    border-radius: 5px;
    text-align: center;
    text-decoration: none;
    font-size: 16px;
}

.boton-whatsapp:hover {
    opacity: 0.85;
}

.boton-contacto {
    display: inline-block;
    padding: 12px 25px;
    background-color: #25d366;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 16px;
}

.boton-contacto:hover {
    opacity: 0.85;
}


/* =========================================
   SECCIONES DE LA PÁGINA PRINCIPAL
========================================= */

section {
    padding: 60px 5%;
}

.seccion-titulo {
    text-align: center;
    font-size: 32px;
    margin-bottom: 15px;
    color: #222;
}

.seccion-subtitulo {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px auto;
    color: #555;
    line-height: 1.6;
}


/* =========================================
   PRESENTACIÓN
========================================= */

#presentacion {
    background-color: #ffffff;
}

.presentacion-contenido {
    max-width: 1100px;
    margin: auto;
    text-align: center;
}

.presentacion-contenido p {
    font-size: 17px;
    line-height: 1.8;
    color: #444;
    margin-bottom: 18px;
}


/* =========================================
   PRODUCTOS Y SERVICIOS
========================================= */

#servicios {
    background-color: #f5f5f5;
}

.servicios-grid {
    max-width: 1200px;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
}

.servicio {
    background-color: white;
    padding: 30px 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s;
}

.servicio:hover {
    transform: translateY(-5px);
}

.servicio i {
    font-size: 40px;
    margin-bottom: 15px;
    color: #333;
}

.servicio h3 {
    margin-bottom: 12px;
    font-size: 21px;
    color: #222;
}

.servicio p {
    color: #555;
    line-height: 1.6;
}


/* =========================================
   VENTAJAS
========================================= */

#ventajas {
    background-color: #ffffff;
}

.ventajas-grid {
    max-width: 1100px;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 25px;
}

.ventaja {
    padding: 25px;
    border-left: 4px solid #333;
    background-color: #f7f7f7;
}

.ventaja h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #222;
}

.ventaja p {
    color: #555;
    line-height: 1.6;
}


/* =========================================
   LLAMADA A LA ACCIÓN
========================================= */

#contacto-inicio {
    background-color: #333;
    color: white;
    text-align: center;
}

#contacto-inicio h2 {
    font-size: 30px;
    margin-bottom: 15px;
}

#contacto-inicio p {
    max-width: 750px;
    margin: 0 auto 25px auto;
    line-height: 1.7;
}


/* =========================================
   NOTICIAS
========================================= */

#noticias {
    padding: 60px 5%;
    background-color: #f5f5f5;
}

#lista-noticias {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    max-width: 1200px;
    margin: auto;
}

.noticia {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

.noticia img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.noticia-contenido {
    padding: 20px;
    flex: 1;
}

.noticia h3 {
    margin-top: 0;
    font-size: 20px;
}

.noticia-descripcion {
    color: #555;
    line-height: 1.5;
}

.noticia-info {
    font-size: 13px;
    color: #777;
    margin-bottom: 15px;
}

.noticia a {
    display: inline-block;
    padding: 10px 15px;
    background-color: #333;
    color: white;
    text-decoration: none;
    border-radius: 5px;
}

.noticia a:hover {
    opacity: 0.8;
}

#error-noticias {
    text-align: center;
    color: #b00020;
}


/* =========================================
   FORMULARIO DE PRESUPUESTO
========================================= */

.contenedor-presupuesto {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
}

fieldset {
    margin-bottom: 25px;
    padding: 20px;
    border-radius: 10px;
}

legend {
    font-size: 1.3em;
    font-weight: bold;
}

.campo {
    margin-bottom: 15px;
}

.campo label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.campo input,
.campo select {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
}

.extras label {
    display: block;
    margin: 10px 0;
}

.ayuda-plazo {
    display: block;
    margin: 10px 0;
    line-height: 1.5;
}

.resultado {
    margin-top: 20px;
    padding: 20px;
    border-radius: 10px;
    font-size: 1.2em;
}

#presupuesto {
    font-size: 1.6em;
    font-weight: bold;
}

.error {
    color: red;
    font-size: 0.9em;
}

.botones {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.botones button {
    padding: 10px 20px;
    cursor: pointer;
}


/* =========================================
   MENSAJES DEL FORMULARIO
========================================= */

.mensaje-formulario {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    font-size: 1em;
    display: none;
}

.mensaje-exito {
    display: block;
    background-color: #e8f5e9;
    color: #2e7d32;
}

.mensaje-error {
    display: block;
    background-color: #ffebee;
    color: #c62828;
}



/* =========================================
   GALERÍA - TARJETAS Y VISOR
========================================= */

.galeria {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    max-width: 1100px;
    margin: 40px auto;
    padding: 20px;
}

.foto {
    background-color: white;
    color: #222;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
    transition: transform 0.3s;
}

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

.foto img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.foto h3 {
    margin: 0;
    padding: 15px;
    color: #222;
    background-color: #fff;
    font-size: 18px;
    line-height: 1.4;
}

#visor {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
}

#imagen-grande {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

#cerrar {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 50px;
    cursor: pointer;
}


/* =========================================
   PÁGINA DE CONTACTO
========================================= */

.contenedor-contacto {
    max-width: 1000px;
    margin: 40px auto;
    padding: 20px;
}

.datos-contacto {
    margin-bottom: 25px;
}

.datos-contacto p {
    margin: 10px 0;
}

#mapa {
    width: 100%;
    height: 500px;
    border-radius: 10px;
    margin-top: 20px;
}

.boton-ubicacion {
    margin-top: 15px;
    padding: 12px 20px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
}

#informacionRuta {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
}

.titulo-galeria {
    text-align: center;
    margin-top: 40px;
}

/* =========================================
   GALERÍA DINÁMICA - VISOR
========================================= */

#visor {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#imagen-grande {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    border-radius: 8px;
}

#cerrar,
#anterior,
#siguiente {
    position: absolute;
    border: none;
    background: rgba(0, 0, 0, 0.55);
    color: white;
    cursor: pointer;
    border-radius: 50%;
}

#cerrar {
    top: 20px;
    right: 30px;
    width: 50px;
    height: 50px;
    font-size: 36px;
}

#anterior,
#siguiente {
    top: 50%;
    transform: translateY(-50%);
    width: 55px;
    height: 55px;
    font-size: 30px;
}

#anterior {
    left: 25px;
}

#siguiente {
    right: 25px;
}

#cerrar:hover,
#anterior:hover,
#siguiente:hover {
    background: #c62828;
}

#contador-galeria {
    color: white;
    margin: 15px 0 0;
    font-size: 16px;
}

/* Página actual de la navegación */
.nav-activa {
    color: #f4a261 !important;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
}


/* =========================================
   MEJORAS DE ESTRUCTURA Y ACCESIBILIDAD
========================================= */

.logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

footer p {
    margin: 0;
}

.redes-sociales {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.redes-sociales img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    display: block;
}

.etiqueta-contacto,
.resultado-dato {
    font-weight: 700;
}

.ayuda-plazo {
    display: block;
    margin: 10px 0;
    line-height: 1.5;
}

.linea-ayuda {
    display: block;
}


@media (max-width: 700px) {
    .portada-contenido {
        width: 88%;
        padding: 18px 20px;
    }

    .portada-contenido h1 {
        font-size: 26px;
    }

    .portada-contenido p {
        font-size: 16px;
        margin: 10px 0;
    }

    .portada-contenido .boton-whatsapp {
        padding: 10px 16px;
        font-size: 14px;
    }
}
