* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-y: scroll; }

body {
    width: 100%;
    font-family: Arial, sans-serif;
    background-color: #f7f7f7;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    animation: aparecer 0.5s ease-out;
}

/* Aparición suave al cargar cada página (solo opacidad, para no afectar a los elementos fijos) */
@keyframes aparecer {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Desvanecimiento al salir hacia otra página (lo activa script.js) */
body.saliendo { opacity: 0; animation: none; transition: opacity 0.2s ease-in; }

/* ---------- HEADER ---------- */
header {
    position: sticky;
    top: 0;
    z-index: 2000;
    flex-shrink: 0;
    width: 100%;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    border-bottom: 4px solid #d42a1f;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo { width: clamp(150px, 22vw, 300px); height: auto; display: block; }

.menu-hamburguesa { display: none; background: none; border: none; cursor: pointer; padding: 5px; }
.menu-hamburguesa span { display: block; width: 30px; height: 3px; background-color: #333; margin: 5px 0; }

nav { display: flex; align-items: center; gap: clamp(6px, 1.5vw, 25px); }

nav a {
    padding: 12px clamp(6px, 1vw, 14px);
    font-size: clamp(12px, 1.5vw, 17px);
    white-space: nowrap;
    font-weight: bold;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1a1a1a;
    border-bottom: 3px solid transparent;
    transition: color 0.3s ease, border-color 0.3s ease;
}

nav a:hover, nav a[aria-current="page"] { color: #d42a1f; border-bottom-color: #d42a1f; }

nav a:focus-visible, .menu-hamburguesa:focus-visible { outline: 3px solid #d42a1f; outline-offset: 2px; }

.dropdown { position: relative; }

.dropbtn { display: block; }

.dropbtn::after { content: "▾"; margin-left: 4px; letter-spacing: 0; vertical-align: 1px; }

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background-color: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.dropdown-content a {
    display: block;
    padding: 10px 20px;
    white-space: nowrap;
    text-transform: none;
    border-bottom: none;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.dropdown-content a:hover { background-color: #fdecea; color: #d42a1f; }

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content { opacity: 1; visibility: visible; transform: translateY(0); }

/* ---------- ICONOS Y CONTACTO DE CABECERA ---------- */
.icono { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.header-derecha { display: flex; flex-direction: row; align-items: center; align-self: stretch; gap: clamp(8px, 1.5vw, 25px); }
.header-contacto { --relleno: 20px; position: relative; display: flex; align-items: center; align-self: stretch; gap: 12px; }

.header-contacto .tel { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: bold; color: #1a1a1a; text-decoration: none; transition: color 0.3s ease; }
.header-contacto .tel .icono { width: 16px; height: 16px; color: #d42a1f; }
.header-contacto .tel:hover { color: #d42a1f; }

.header-contacto .red { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; color: #fff; background: #1a1a1a; border-radius: 50%; transition: background-color 0.3s ease, transform 0.3s ease; }
.header-contacto .red .icono { width: 16px; height: 16px; }
.header-contacto .red:hover { background: #d42a1f; transform: translateY(-2px); }

.header-contacto a:focus-visible { outline: 3px solid #d42a1f; outline-offset: 2px; }

.header-contacto .area-personal {
    position: absolute;
    left: 0;
    right: 0;
    /* punto medio entre la base de los iconos (30 px) y el borde blanco inferior de la cabecera */
    top: calc(75% + 7.5px + var(--relleno) / 2);
    transform: translateY(-50%);
    text-align: center;
    white-space: nowrap;
    font-size: 12px;
    line-height: 1;
    font-weight: bold;
    letter-spacing: 0.3px;
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.3s ease;
}
.header-contacto .area-personal span { padding-bottom: 2px; border-bottom: 2px solid transparent; transition: border-color 0.3s ease; }
.header-contacto .area-personal:hover { color: #d42a1f; }
.header-contacto .area-personal:hover span { border-bottom-color: #d42a1f; }

/* ---------- INICIO ---------- */
.inicio { max-width: 1100px; margin: 0 auto; padding: 80px 40px; text-align: center; }

.etiqueta {
    display: inline-block;
    margin-bottom: 15px;
    color: #d42a1f;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.inicio h1 { font-size: 42px; margin-bottom: 40px; }

.inicio h1::after,
.catalogo-intro h1::after,
.valores h2::after {
    content: "";
    display: block;
    width: 70px;
    height: 3px;
    margin: 20px auto 0;
    background: #d42a1f;
}

.destacada { max-width: 800px; margin: 0 auto 50px; font-size: 22px; line-height: 1.7; color: #444; }

.inicio-columnas { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: stretch; text-align: left; }

.inicio-columnas p {
    padding: 30px;
    background: #fff;
    border-left: 4px solid #d42a1f;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
    line-height: 1.7;
    color: #444;
}

.inicio-textos { display: flex; flex-direction: column; gap: 30px; }
.inicio-textos p { flex: 1; display: flex; align-items: center; }
.inicio-img { display: block; width: 100%; height: 100%; min-height: 300px; object-fit: cover; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12); }

/* ---------- CARRUSEL ---------- */
.carrusel { position: relative; width: 100%; height: 600px; overflow: hidden; }

.destacado {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateX(-100%);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.destacado::before { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); }

.destacado.activo { opacity: 1; transform: translateX(0); }

.destacado.saliendo-derecha,
.destacado.entrando-derecha { opacity: 0; transform: translateX(100%); }

.contenido-carrusel { position: relative; z-index: 2; width: 80%; max-width: 1000px; text-align: center; color: #fff; }

.contenido-carrusel h2 { font-size: 52px; line-height: 1.15; margin-bottom: 25px; font-weight: 700; }

.contenido-carrusel p { max-width: 850px; margin: 0 auto 35px; font-size: 20px; line-height: 1.6; color: #fff; }

.flecha {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border: none;
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 25px;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.flecha-izquierda { left: 0; }
.flecha-derecha { right: 0; }

.flecha:hover { background-color: #d42a1f; color: #fff; transform: translateY(-50%) scale(1.08); }

.boton {
    display: inline-block;
    padding: 16px 45px;
    background-color: #d42a1f;
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 14px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.boton:hover { background-color: #a81f16; transform: translateY(-3px); }

/* ---------- VALORES ---------- */
.valores { max-width: 1400px; margin: 0 auto; padding: 20px 5% 80px; text-align: center; }

.valores h2 { font-size: 44px; margin-bottom: 50px; }

.valores-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }

.valor {
    background: #fff;
    border-top: 4px solid #d42a1f;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.valor:hover { transform: scale(1.05); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); }

.valor h3 { padding: 28px 20px; font-size: 24px; color: #1a1a1a; }

.valor img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }

/* ---------- FONDO CON FOTO (inicio, catálogo, galería y contacto) ---------- */
/* Va en una capa fija propia: no se repinta al desplegar contenido */
.inicio::before,
.catalogo::before,
.galeria::before,
.contacto::before,
.legal::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.78)), url('imagenes/madera.jpg') center / cover;
    transform: translateZ(0);
}

/* ---------- CATÁLOGO ---------- */
.catalogo { flex: 1; width: 100%; padding: 60px 3%; }

.catalogo-caja { max-width: 1700px; margin: 0 auto; }

.catalogo-intro { text-align: center; margin-bottom: 60px; }
.catalogo-intro h1 { font-size: 42px; margin-bottom: 20px; }
.catalogo-intro p { font-size: 18px; color: #444; }

.categoria { margin-bottom: 70px; scroll-margin-top: 110px; }

.categoria h2 {
    position: relative;
    width: fit-content;
    margin: 0 0 25px 30px;
    padding-bottom: 12px;
    font-size: 30px;
}

.categoria h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; background: #d42a1f; }

.galeria-grid { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 30px; }

.galeria-grid figure {
    position: relative;
    flex: 0 1 calc((100% - 90px) / 4);
    min-width: 280px;
    background: #fff;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.galeria-grid figure:hover { z-index: 2; transform: scale(1.04); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); }

.galeria-grid img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.ver { display: block; width: 100%; padding: 0; border: none; background: none; cursor: zoom-in; font: inherit; }
.ver:focus-visible { outline: 3px solid #d42a1f; outline-offset: -3px; }

.grupo { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; }
.galeria-grid .grupo img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.6s ease; }
.galeria-grid .grupo img.activa { opacity: 1; }
.grupo::after {
    content: attr(data-n) " fotos";
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: bold;
    color: #fff;
    background: rgba(26, 26, 26, 0.75);
    border-radius: 20px;
    pointer-events: none;
}

.flecha-grupo { position: absolute; top: 0; left: 0; right: 0; aspect-ratio: 4 / 3; display: flex; justify-content: space-between; align-items: center; padding: 0 8px; pointer-events: none; }
.flecha-grupo button { pointer-events: auto; width: 38px; height: 38px; border: none; font-size: 16px; color: #fff; background: rgba(26, 26, 26, 0.65); cursor: pointer; opacity: 0; transition: opacity 0.3s ease, background-color 0.3s ease; }
.galeria-grid figure:hover .flecha-grupo button, .flecha-grupo button:focus-visible { opacity: 1; }
.flecha-grupo button:hover { background: #d42a1f; }
.flecha-grupo button:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }
@media (hover: none) { .flecha-grupo button { opacity: 1; } }

.detalles { border-top: 3px solid #d42a1f; }
.detalles summary { display: flex; justify-content: space-between; align-items: center; padding: 14px 22px; font-weight: bold; color: #d42a1f; cursor: pointer; list-style: none; }
.detalles summary::-webkit-details-marker { display: none; }
.detalles summary::after { content: "+"; font-size: 22px; line-height: 1; }
.detalles[open] summary::after { content: "−"; }
.detalles.cerrando summary::after { content: "+"; }
.detalles p { padding: 0 22px 20px; font-size: 15px; line-height: 1.6; color: #444; }
.detalles strong { display: block; margin-bottom: 6px; font-size: 17px; color: #1a1a1a; }

/* ---------- FOOTER ---------- */
footer { background-color: #1a1a1a; color: #ddd; margin-top: auto; }

.footer-contenido {
    padding: 35px 5%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
}

.footer-marca { flex: 0 1 clamp(120px, 18vw, 400px); display: flex; flex-direction: column; align-items: stretch; text-align: center; }

.footer-logo { display: block; width: 100%; height: auto; padding: 8px; margin-bottom: 10px; background: #fff; }

.footer-marca p { padding: 10px 8px; font-size: clamp(11px, 1.2vw, 14px); line-height: 1.3; color: #ddd; }

.footer-col h3 {
    display: inline-block;
    margin-bottom: 12px;
    padding-bottom: 8px;
    font-size: 16px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
    border-bottom: 2px solid #d42a1f;
}

.footer-col a, .footer-col p { display: block; margin-bottom: 6px; font-size: 15px; line-height: 1.6; color: #ddd; text-decoration: none; }

.footer-col a { transition: color 0.3s ease, transform 0.3s ease; }
.footer-col a:hover { color: #d42a1f; transform: translateX(4px); }

.footer-marca a:hover { transform: none; }

.footer-sub { display: flex; flex-wrap: wrap; gap: 0 12px; margin: 0 0 10px 5px; padding-left: 15px; border-left: 2px solid #d42a1f; }
.footer-sub a { margin-bottom: 2px; font-size: 13px; color: #aaa; }

.footer-datos { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 40px; }
.footer-datos li { font-size: 15px; line-height: 1.5; color: #ddd; white-space: nowrap; }
.footer-datos strong { display: block; margin-bottom: 3px; font-size: 12px; font-weight: normal; letter-spacing: 1px; text-transform: uppercase; color: #999; }

.redes { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; }
.footer-col .redes a { display: inline-flex; align-items: center; gap: 8px; margin: 0; }

.footer-inferior { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; padding: 12px 5%; font-size: 14px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.footer-legal { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.footer-legal a, .gestion-cookies { padding: 0; font: inherit; color: #ddd; text-decoration: none; background: none; border: none; cursor: pointer; transition: color 0.3s ease; }
.footer-legal a:hover, .gestion-cookies:hover { color: #d42a1f; text-decoration: underline; }
.footer-legal a:focus-visible, .gestion-cookies:focus-visible { outline: 3px solid #d42a1f; outline-offset: 2px; }

/* ---------- GALERÍA ---------- */
.galeria { flex: 1; padding: 60px 3%; }

.galeria-caja { max-width: 1700px; margin: 0 auto; }

.mosaico { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.mosaico figure {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #e9e9e9;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.mosaico img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }

.mosaico figure:hover img { transform: scale(1.07); }

/* ---------- CONTACTO ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.contacto { flex: 1; padding: 70px 5%; }

.contacto-caja { max-width: 1400px; margin: 0 auto; text-align: center; }

.contacto h1 { font-size: 48px; text-transform: uppercase; color: #1a1a1a; }

.contacto h1::after { content: ""; display: block; width: 70px; height: 3px; margin: 20px auto 30px; background: #d42a1f; }

.contacto-texto { max-width: 1000px; margin: 0 auto 35px; font-size: 18px; line-height: 1.6; color: #333; }

.contacto h2 { margin-bottom: 35px; font-size: 26px; color: #1a1a1a; }

.formulario {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.form-fila { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 16px; }

.formulario input[type="text"],
.formulario input[type="email"],
.formulario input[type="tel"],
.formulario textarea {
    width: 100%;
    padding: 14px;
    font: inherit;
    font-size: 16px;
    color: #333;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.formulario textarea { display: block; flex: 1; min-height: 130px; resize: none; }

.formulario input[type="text"],
.formulario input[type="email"],
.formulario input[type="tel"],
.formulario textarea { transition: border-color 0.3s ease, box-shadow 0.3s ease; }

.formulario input[type="text"]:focus,
.formulario input[type="email"]:focus,
.formulario input[type="tel"]:focus,
.formulario textarea:focus { outline: none; border-color: #d42a1f; box-shadow: 0 0 0 1px #d42a1f; }

.formulario input[type="checkbox"]:focus-visible { outline: 2px solid rgba(212, 42, 31, 0.6); outline-offset: 2px; }

.aceptar { display: flex; align-items: flex-start; gap: 12px; margin: 22px 0 28px; font-size: 15px; line-height: 1.6; color: #444; }

.aceptar input { flex-shrink: 0; width: 18px; height: 18px; margin-top: 4px; accent-color: #d42a1f; }

.aceptar a { color: #d42a1f; }

.captcha { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 14px; }
.captcha label { font-size: 14px; line-height: 1.4; color: #444; }
.captcha label strong { color: #1a1a1a; }
.formulario .captcha input[type="text"] { width: 110px; padding: 8px 10px; font-size: 15px; }

.boton-enviar { align-self: center; width: auto; padding: 12px 36px; border: none; cursor: pointer; font-family: inherit; }

.form-aviso { max-width: 700px; margin: 0 auto 30px; padding: 14px 20px; font-size: 16px; font-weight: bold; line-height: 1.5; border-left: 5px solid; }
.form-aviso[hidden] { display: none; }
.form-aviso.ok { color: #1e6b35; background: #e8f5ec; border-color: #1e6b35; }
.form-aviso.error { color: #a81f16; background: #fdecea; border-color: #d42a1f; }

.contacto-layout { display: grid; grid-template-columns: 1fr 1.15fr; gap: 30px; align-items: stretch; }

.mapa { position: relative; min-height: 460px; overflow: hidden; background: #e9e9e9; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12); }
.mapa iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.mapa-ver { position: absolute; left: 10px; bottom: 10px; z-index: 2; padding: 9px 16px; font-size: 13px; font-weight: bold; color: #1a1a1a; text-decoration: none; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); transition: background-color 0.3s ease, color 0.3s ease; }
.mapa-ver:hover { background: #d42a1f; color: #fff; }
.mapa-aviso { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 30px; text-align: center; background: #1a1a1a; }
.mapa-aviso .icono { width: 46px; height: 46px; color: #d42a1f; }
.mapa-aviso p { max-width: 340px; font-size: 15px; line-height: 1.6; color: #ddd; }
.mapa-aviso .boton { border: none; cursor: pointer; font-family: inherit; padding: 14px 28px; }
.mapa-aviso .enlace { font-size: 14px; color: #fff; text-decoration: underline; }
.mapa-aviso .enlace:hover { color: #d42a1f; }

/* Banner con foto y bloque "Cómo trabajamos" bajo el formulario */
.contacto-banner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 340px;
    margin-top: 50px;
    padding: 50px 30px;
    background-size: cover;
    background-position: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

.contacto-banner::before { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); }

.contacto-banner-texto { position: relative; z-index: 1; max-width: 700px; color: #fff; }
.contacto-banner-texto h2 { margin-bottom: 16px; font-size: 38px; color: #fff; }
.contacto-banner-texto p { margin-bottom: 28px; font-size: 18px; line-height: 1.6; color: #fff; }

.contacto-pasos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 40px; }

.paso {
    padding: 30px 24px;
    background: #fff;
    border-top: 4px solid #d42a1f;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.paso-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 14px;
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    background: #d42a1f;
    border-radius: 50%;
}

.paso h3 { margin-bottom: 8px; font-size: 20px; color: #1a1a1a; }
.paso p { font-size: 15px; line-height: 1.6; color: #444; }

/* ---------- COOKIES ---------- */
.cookies-modal { position: fixed; inset: 0; z-index: 6000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0, 0, 0, 0.6); }
.cookies-modal[hidden] { display: none; }
.cookies-caja { width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; padding: 30px; background: #fff; border-top: 5px solid #d42a1f; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4); }
.cookies-caja h2 { margin-bottom: 12px; font-size: 24px; color: #1a1a1a; }
.cookies-caja > p { margin-bottom: 20px; font-size: 15px; line-height: 1.6; color: #444; }
.cookies-caja a { color: #d42a1f; }
.cookies-opcion { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 14px 0; border-top: 1px solid #eee; }
.cookies-opcion strong { display: block; margin-bottom: 4px; color: #1a1a1a; }
.cookies-opcion p { font-size: 14px; line-height: 1.5; color: #555; }
.cookies-opcion input { flex-shrink: 0; width: 22px; height: 22px; margin-top: 2px; accent-color: #d42a1f; }
.cookies-botones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.cookies-botones button { flex: 1 1 140px; padding: 13px 16px; font: inherit; font-size: 14px; font-weight: bold; color: #d42a1f; background: #fff; border: 2px solid #d42a1f; cursor: pointer; transition: background-color 0.3s ease, color 0.3s ease; }
.cookies-botones button.principal { color: #fff; background: #d42a1f; }
.cookies-botones button:hover { color: #fff; background: #a81f16; border-color: #a81f16; }
.cookies-botones button:focus-visible { outline: 3px solid #1a1a1a; outline-offset: 2px; }

/* ---------- PÁGINA LEGAL ---------- */
.legal { flex: 1; padding: 60px 5%; }
.legal-caja { max-width: 900px; margin: 0 auto; padding: 40px; background: #fff; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1); }
.legal h1 { font-size: 36px; color: #1a1a1a; }
.legal h1::after { content: ""; display: block; width: 70px; height: 3px; margin: 16px 0 12px; background: #d42a1f; }
.legal h2 { margin: 30px 0 10px; font-size: 22px; color: #1a1a1a; }
.legal h2[id] { scroll-margin-top: 110px; }
.legal h3 { margin: 22px 0 8px; font-size: 18px; color: #1a1a1a; }
.legal p, .legal li { font-size: 16px; line-height: 1.7; color: #444; }
.legal ul { margin: 10px 0; padding-left: 22px; }
.legal a, .legal .gestion-cookies { color: #d42a1f; }
.legal .gestion-cookies { text-decoration: underline; }
.legal-fecha { font-size: 14px !important; color: #777 !important; }
.tabla-scroll { overflow-x: auto; }
.legal table { width: 100%; margin: 14px 0; border-collapse: collapse; font-size: 15px; }
.legal th, .legal td { padding: 10px 12px; text-align: left; vertical-align: top; border: 1px solid #e3e3e3; }
.legal th { background: #f3f3f3; }

/* ---------- VISOR DE FOTOS ---------- */
.visor { position: fixed; inset: 0; z-index: 5000; display: flex; align-items: center; justify-content: center; gap: 36px; padding: 20px 80px; background: rgba(0, 0, 0, 0.92); touch-action: none; }
.visor[hidden] { display: none; }
.visor-marco { position: relative; line-height: 0; cursor: crosshair; }
.visor-img { display: block; max-width: min(82vw, 1300px); max-height: 80vh; }
.lupa { position: absolute; display: none; width: clamp(280px, 32vw, 480px); height: clamp(190px, 21vw, 320px); border-radius: 4px; background-repeat: no-repeat; box-shadow: 0 0 0 3px #fff, 0 8px 25px rgba(0, 0, 0, 0.6); pointer-events: none; }
.visor-cerrar, .visor-nav { position: absolute; border: none; color: #fff; background: rgba(255, 255, 255, 0.15); cursor: pointer; transition: background 0.3s ease; }
.visor-cerrar:hover, .visor-nav:hover { background: #d42a1f; }
.visor-cerrar { top: 15px; right: 15px; width: 48px; height: 48px; font-size: 32px; line-height: 1; }
.visor-nav { top: 50%; width: 50px; height: 50px; font-size: 22px; transform: translateY(-50%); }
.visor-ant { left: 15px; }
.visor-sig { right: 15px; }
.visor-pie { position: absolute; left: 0; right: 0; bottom: 18px; padding: 0 70px; text-align: center; font-size: 15px; color: #ddd; }
.visor button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.visor-minis { position: absolute; left: 0; right: 0; bottom: 52px; display: flex; justify-content: safe center; gap: 8px; padding: 0 70px; overflow-x: auto; }
.visor-mini { flex: 0 0 auto; width: 76px; height: 56px; padding: 0; border: 2px solid transparent; background: none; cursor: pointer; opacity: 0.6; transition: opacity 0.3s ease, border-color 0.3s ease; }
.visor-mini img { display: block; width: 100%; height: 100%; object-fit: cover; }
.visor-mini:hover, .visor-mini.activa { opacity: 1; }
.visor-mini.activa { border-color: #d42a1f; }
.visor.con-minis .visor-img { max-height: calc(100vh - 250px); }
.visor.con-texto .visor-img { max-width: calc(100vw - 560px); }
.visor-texto { flex: 0 0 340px; max-height: 70vh; overflow-y: auto; padding-left: 26px; border-left: 3px solid #d42a1f; font-size: 21px; line-height: 1.6; color: #ddd; }
.visor-texto strong { display: block; margin-bottom: 14px; font-size: 28px; line-height: 1.25; color: #fff; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1100px) {
    .footer-datos li { white-space: normal; }
}

@media (max-width: 1000px) {
    .visor { padding: 20px 15px; }
    .visor.con-texto { flex-direction: column; justify-content: center; gap: 12px; }
    .visor.con-texto .visor-img { max-width: 94vw; max-height: calc(100vh - 340px); }
    .visor-texto { flex: 0 0 auto; width: 100%; max-height: 100px; padding: 10px 0 0; border-left: none; border-top: 3px solid #d42a1f; font-size: 16px; }
    .visor-texto strong { margin-bottom: 6px; font-size: 19px; }
    .contacto-layout { grid-template-columns: 1fr; }
    .mapa { min-height: 320px; }
}

/* Tablet: el teléfono pasa a ser solo el icono para que quepa junto al menú */
@media (min-width: 769px) and (max-width: 1000px) {
    .header-contacto .tel { justify-content: center; width: 30px; height: 30px; color: #fff; background: #d42a1f; border-radius: 50%; }
    .header-contacto .tel .icono { color: #fff; }
    .header-contacto .tel span { display: none; }
}

@media (max-width: 768px) {
    header { position: relative; padding: 15px 5%; }

    .logo { width: 150px; }

    .menu-hamburguesa { display: block; order: -1; min-width: 44px; min-height: 44px; }

    nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 15px 5%;
        background-color: #fff;
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
        z-index: 1000;
    }

    nav.menu-abierto { display: flex; }

    nav a { width: 100%; padding: 14px 0; font-size: 18px; border-bottom: 1px solid #eee; }

    .dropdown { width: 100%; }

    .dropdown-content { position: static; box-shadow: none; opacity: 1; visibility: visible; transform: none; }

    .dropdown-content a { padding: 12px 0 12px 20px; }

    .inicio { padding: 50px 5%; }
    .inicio h1 { font-size: 32px; }
    .destacada { font-size: 18px; }
    .inicio-columnas { grid-template-columns: 1fr; }

    .carrusel { height: 500px; }
    .contenido-carrusel { width: 75%; }
    .contenido-carrusel h2 { font-size: 32px; }
    .contenido-carrusel p { font-size: 16px; }
    .flecha { width: 45px; height: 45px; font-size: 20px; }
    .flecha-izquierda { left: 10px; }
    .flecha-derecha { right: 10px; }

    .valores { padding: 10px 5% 50px; }
    .valores-grid { grid-template-columns: 1fr; }
    .valores h2 { font-size: 32px; margin-bottom: 40px; }
    .valor h3 { padding: 25px 20px; font-size: 20px; }
    .valor img { aspect-ratio: 4 / 3; }

    .catalogo { padding: 40px 5%; }
    .catalogo-intro h1 { font-size: 32px; }
    .categoria h2 { margin-left: 10px; font-size: 24px; }
    .galeria-grid figure { flex-basis: 100%; min-width: 0; }

    .footer-contenido { flex-direction: column; padding: 30px 5%; gap: 25px; }
    .footer-marca { flex: 0 1 auto; width: clamp(140px, 45vw, 220px); margin: 0 auto; }
    .footer-datos { grid-template-columns: 1fr; }

    .galeria { padding: 40px 5%; }
    .mosaico { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .visor-img { max-width: 94vw; max-height: 70vh; }
    .visor-nav { width: 40px; height: 40px; }
    .visor-pie { padding: 0 20px; }
    .visor-minis { padding: 0 15px; bottom: 56px; }
    .visor-mini { width: 60px; height: 44px; }
    .lupa { width: 230px; height: 150px; }
    .contacto { padding: 45px 5%; }
    .contacto h1 { font-size: 32px; }
    .contacto h2 { font-size: 20px; }
    .form-fila { grid-template-columns: 1fr; }

    .contacto-banner { min-height: 280px; margin-top: 35px; padding: 35px 20px; }
    .contacto-banner-texto h2 { font-size: 28px; }
    .contacto-banner-texto p { font-size: 16px; }
    .contacto-pasos { grid-template-columns: 1fr; gap: 20px; }

    .header-derecha { display: contents; }
    .header-contacto { --relleno: 15px; padding-right: 0; gap: 8px; }
    .header-contacto .tel { justify-content: center; width: 30px; height: 30px; color: #fff; background: #d42a1f; border-radius: 50%; }
    .header-contacto .tel .icono { color: #fff; }
    .header-contacto .tel span { display: none; }

    .inicio-img { height: 240px; min-height: 0; }
    .legal { padding: 40px 5%; }
    .legal-caja { padding: 24px; }
    .footer-inferior { justify-content: center; text-align: center; }
}
