/* FES Habitat · hoja de estilos común
   Identidad propia de FES: naranja del logo, carbón y gris cálido.
   Las secciones de contenido llevan estilos en línea heredados de la maqueta;
   aquí van la base, la cabecera, el pie, los botones y los formularios. */

@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/archivo-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/archivo-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 800; font-display: swap; src: url('/fonts/archivo-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/source-sans-3-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/source-sans-3-latin-600-normal.woff2') format('woff2'); }

:root {
  --naranja: #B95214;
  --carbon: #222222;
  --gris: #F4F2EE;
  --linea: #E6E3DD;
  --texto-suave: #707070; /* solo sobre blanco */
  --borde-campo: #8A857D;
  --ok: #2E6B3A;
  --error: #A3261B;
  --wrap: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: #FFFFFF; color: var(--carbon);
  font-family: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 18px; line-height: 1.55;
}
img { max-width: 100%; height: auto; }
a { color: var(--carbon); }
a:hover { color: var(--naranja); }
:focus-visible { outline: 3px solid var(--naranja); outline-offset: 2px; }
[id] { scroll-margin-top: 96px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--carbon); color: #FFF; padding: 10px 16px; z-index: 100; }
.skip:focus { top: 12px; color: #FFF; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: 24px; padding-right: 24px; }
@media (max-width: 560px) { .wrap { padding-left: 16px; padding-right: 16px; } }

/* ---------- Cabecera ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: #FFFFFF; border-bottom: 1px solid var(--linea); }
.hdr { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.logo { display: flex; align-items: center; text-decoration: none; flex: 0 0 auto; }
.logo img { display: block; height: 34px; width: auto; }
.menu { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; font-size: 16px; font-weight: 600; }
.menu a { text-decoration: none; }
.menu a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--naranja); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.lang { font-weight: 400; white-space: nowrap; }
.lang a { padding: 6px 2px; }
.lang .on { font-weight: 600; }
.menu-btn { display: none; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; background: #FFFFFF; color: var(--carbon); border: 1.5px solid var(--carbon); font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; }
.menu-btn .bars { width: 18px; height: 2px; background: currentColor; position: relative; }
.menu-btn .bars::before, .menu-btn .bars::after { content: ''; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor; }
.menu-btn .bars::before { top: -6px; } .menu-btn .bars::after { top: 6px; }

@media (max-width: 1180px) {
  .js .menu-btn { display: inline-flex; }
  .js .menu { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #FFFFFF; border-bottom: 1px solid var(--linea); padding: 8px 16px 20px; flex-direction: column; align-items: stretch; gap: 0; box-shadow: 0 12px 24px rgba(0,0,0,.06); }
  .js .menu.open { display: flex; }
  .js .menu > a { padding: 14px 4px; border-bottom: 1px solid var(--linea); font-size: 18px; }
  .js .menu .lang { padding: 14px 4px; }
  .js .menu .btn { margin-top: 12px; justify-content: center; }
  .site-header { position: relative; }
  .hdr { position: relative; }
}
@media (max-width: 1180px) { .no-js .menu { justify-content: flex-start; } .no-js .hdr { flex-wrap: wrap; } }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 13px 24px; font-weight: 600; text-decoration: none; border: 2px solid transparent; font: inherit; font-weight: 600; cursor: pointer; line-height: 1.2; }
.btn-primary { background: var(--naranja); color: #FFFFFF; }
.btn-primary:hover { background: #9E4511; color: #FFFFFF; }
.btn-dark { background: var(--carbon); color: #FFFFFF; }
.btn-dark:hover { background: #000; color: #FFFFFF; }
.btn-outline { border-color: var(--carbon); color: var(--carbon); background: #FFFFFF; }
.btn-sm { min-height: 44px; padding: 9px 18px; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Pie ---------- */
.site-footer { background: var(--carbon); color: #E6E3DD; }
.site-footer .inner { padding-top: 48px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 18px; font-size: 15px; }
.site-footer a { color: #FFFFFF; }
.site-footer a:hover { color: #FFD9C2; }
.site-footer .brand { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.site-footer .brand img { display: block; height: 30px; width: auto; }
.site-footer .tag { font-family: 'Archivo', sans-serif; font-size: 17px; color: #FFFFFF; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.site-footer p { margin: 0; max-width: 84ch; }

/* ---------- Formularios ---------- */
.f-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.f-field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 16px; margin: 0; padding: 0; border: 0; min-width: 0; }
.f-field legend { padding: 0; margin-bottom: 6px; font-weight: 600; }
.f-hint { font-size: 15px; font-weight: 400; color: var(--carbon); }
.f-input, .f-select, .f-textarea {
  width: 100%; min-height: 48px; border: 1.5px solid var(--borde-campo); background: #FFFFFF; color: var(--carbon);
  padding: 10px 12px; font: inherit; font-weight: 400; font-size: 17px; border-radius: 0;
}
.f-textarea { min-height: 120px; resize: vertical; }
.f-select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--carbon) 50%), linear-gradient(135deg, var(--carbon) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.f-input:focus, .f-select:focus, .f-textarea:focus { outline: 3px solid var(--naranja); outline-offset: 0; border-color: var(--carbon); }
.f-suffix { display: flex; align-items: stretch; }
.f-suffix .f-input { border-right: 0; }
.f-suffix span { display: flex; align-items: center; padding: 0 12px; border: 1.5px solid var(--borde-campo); font-family: 'IBM Plex Mono', monospace; font-size: 15px; font-weight: 400; background: #FFFFFF; }
.f-field[aria-invalid="true"] .f-input, .f-input:user-invalid { border-color: var(--error); }

/* Botones de opción (radio / checkbox con aspecto de segmento) */
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; display: inline-flex; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: inline-flex; align-items: center; min-height: 48px; padding: 0 18px; border: 1.5px solid var(--borde-campo); background: #FFFFFF; font-weight: 600; font-size: 16px; cursor: pointer; }
.seg input:checked + span { background: var(--carbon); color: #FFFFFF; border-color: var(--carbon); }
.seg input:focus-visible + span { outline: 3px solid var(--naranja); outline-offset: 2px; }

.f-check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; font-weight: 400; }
.f-check input { width: 22px; height: 22px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--carbon); }
.f-legal { font-size: 14px; line-height: 1.45; color: var(--carbon); margin: 0; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.f-msg { margin: 0; padding: 12px 14px; font-weight: 600; border-left: 4px solid; }
.f-msg.ok { border-color: var(--ok); background: #EEF5EF; color: var(--ok); }
.f-msg.err { border-color: var(--error); background: #FBEDEB; color: var(--error); }
[hidden] { display: none !important; }

/* ---------- Calculadora ---------- */
.calc-out .big { font-family: 'IBM Plex Mono', monospace; font-size: clamp(34px, 6vw, 44px); font-weight: 500; color: var(--naranja); line-height: 1.1; }
.calc-out .rng { font-family: 'IBM Plex Mono', monospace; font-size: 17px; }
.calc-table { display: flex; flex-direction: column; font-size: 17px; border-top: 1px solid var(--carbon); }
.calc-table .row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--linea); }
.calc-table .row:last-child { border-bottom: 0; }
.calc-table .row.tot { font-weight: 600; }
.calc-table .num { font-family: 'IBM Plex Mono', monospace; white-space: nowrap; }
.calc-note { margin: 0; font-size: 15px; font-style: italic; color: var(--carbon); }

/* Detalles de las dudas */
details > summary::-webkit-details-marker { display: none; }

@media print {
  .site-header, .site-footer, .menu-btn { display: none !important; }
}

/* =====================================================================
   v6 · fotos grandes, franjas con titular, tarjetas de catálogo y botón de subir
   ===================================================================== */
.pre-line { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: 0.01em; }

/* Fotos: un solo sistema para todas. Enfoque por foto con --pos (escritorio) y --pos-m (móvil). */
.foto { display: block; overflow: hidden; background: #3A3836; }
.foto img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); }
picture.foto { height: 100%; }
@media (max-width: 700px) { .foto img { object-position: var(--pos-m, var(--pos, 50% 50%)); } }
/* Hueco de foto pendiente (sin foto real todavía) */
.foto-ph { display: flex; align-items: flex-start; justify-content: flex-end; padding: 14px; background: linear-gradient(135deg, #4A4743 0%, #2E2C2A 100%); border: 2px dashed #8F8A82; }
.foto-ph span { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: #E6E3DD; max-width: 32ch; text-align: right; }

/* Portada y franjas de las páginas interiores */
.hero { position: relative; display: flex; align-items: flex-end; background: #2E2C2A; }
.hero-home { min-height: clamp(520px, 82vh, 820px); }
.hero-sm { min-height: clamp(300px, 46vh, 480px); }
.hero > .foto { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after { content: ''; position: absolute; inset: 0; pointer-events: none; }
.hero-home::after { background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.22) 40%, rgba(0,0,0,.74) 100%); }
@media (min-width: 701px) { .hero-home::after { background: linear-gradient(90deg, rgba(0,0,0,.58) 0%, rgba(0,0,0,.42) 45%, rgba(0,0,0,.08) 80%, rgba(0,0,0,0) 100%), linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.22) 40%, rgba(0,0,0,.74) 100%); } }
.hero-sm::after { background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.5) 50%, rgba(0,0,0,.78) 100%); }
.hero-txt { position: relative; z-index: 2; width: 100%; max-width: var(--wrap); margin: 0 auto; }
.hero-home .hero-txt { padding-top: 120px; padding-bottom: 56px; }
.hero-sm .hero-txt { padding-top: 40px; padding-bottom: 32px; }
@media (min-width: 701px) {
  .hero-txt, .hero-txt h1, .hero-txt p, .hero-txt span { color: #FFFFFF !important; }
  .hero-txt a:not(.btn):not([style*="background"]) { color: #FFFFFF !important; }
  .hero-txt p[style*="border-left"] { border-left-color: #FFFFFF !important; }
  .hero > .foto-ph { align-items: flex-start; }
}
@media (max-width: 700px) {
  .hero, .hero-home, .hero-sm { display: block; min-height: 0; background: #FFFFFF; }
  .hero::after { display: none; }
  .hero > .foto { position: relative; inset: auto; }
  .hero-home > .foto { height: auto; aspect-ratio: 5 / 4; max-height: 520px; }
  .hero-sm > .foto { height: auto; aspect-ratio: 3 / 2; max-height: 400px; }
  .hero-home .hero-txt { padding-top: 28px; padding-bottom: 36px; }
  .hero-sm .hero-txt { padding-top: 24px; padding-bottom: 24px; }
  .foto-ph { align-items: center; justify-content: center; }
  .foto-ph span { text-align: center; }
}

/* Botón de subir */
.to-top { position: fixed; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  width: 48px; height: 48px; padding: 0; border: 0; border-radius: 0; background: var(--naranja); color: #FFFFFF; cursor: pointer;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.15);
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s, transform .2s, visibility .2s; }
.to-top.on { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: #9E4511; }
.to-top:focus-visible { outline: 3px solid var(--carbon); outline-offset: 2px; }
.to-top svg { width: 24px; height: 24px; }
@media (max-width: 700px) { .to-top { right: calc(12px + env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); } }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; transform: none; } }
@media print { .to-top { display: none !important; } }
@media (max-width: 700px) {
  .hero-sm + section { padding-top: 16px !important; padding-bottom: 20px !important; }
  #calculadora > .calc-wrap { padding-top: 28px !important; }
}
@media (max-width: 700px) {
  .hero-sm h1 { font-size: 32px !important; }
  .hero-sm + section p { font-size: 18px !important; }
}
.hero-txt.wrap { padding-left: 24px; padding-right: 24px; }

/* v6.1 · botón «Llamar» (el número se muestra al pulsar) */
.tel-box { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tel-link { white-space: nowrap; }
.tel-nojs { font-size: 15px; line-height: 1.4; }

/* Carrusel «Por dentro» */
.car { display: flex; flex-direction: column; gap: 16px; }
.car-track { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.car-track::-webkit-scrollbar { display: none; }
.car-track:focus-visible { outline: 3px solid #222222; outline-offset: 4px; }
.car-slide { flex: 0 0 calc((100% - 40px) / 3); margin: 0; scroll-snap-align: start; min-width: 0; }
@media (max-width: 900px) { .car-slide { flex-basis: calc((100% - 20px) / 2); } }
@media (max-width: 560px) { .car-slide { flex-basis: 88%; } }
.car-ctl { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.car-ctl[hidden] { display: none; }
.car-btn { min-width: 48px; min-height: 48px; padding: 0 16px; background: #FFFFFF; color: #222222; border: 2px solid #222222; font: inherit; font-size: 20px; font-weight: 600; cursor: pointer; }
.car-btn:hover { background: #222222; color: #FFFFFF; }
.car-play { font-size: 16px; margin-left: 6px; }
@media (prefers-reduced-motion: reduce) { .car-track { scroll-behavior: auto; } }

/* v6.16: carrusel — sin JavaScript se ve la barra de desplazamiento; el botón Pausar va antes en el orden de tabulación pero se muestra al final */
.no-js .car-track { scrollbar-width: auto; padding-bottom: 10px; }
.no-js .car-track::-webkit-scrollbar { display: block; height: 10px; }
.no-js .car-track::-webkit-scrollbar-thumb { background: #222222; }
/* v6.16: oscurecido lateral también en las cabeceras interiores (escritorio y tableta), para leer las líneas pequeñas de encima del titular */
@media (min-width: 701px) {
  .hero-sm::after { background: linear-gradient(90deg, rgba(0,0,0,.68) 0%, rgba(0,0,0,.54) 50%, rgba(0,0,0,.14) 82%, rgba(0,0,0,0) 100%), linear-gradient(180deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.5) 50%, rgba(0,0,0,.78) 100%); }
}
@media (max-width: 1047px) {
  .calc-left { display: contents !important; }
  .calc-in, .calc-contact { flex: 1 1 100%; }
  .calc-in { order: 1; }
  .calc-out { order: 2; }
  .calc-contact { order: 3; }
}

/* Quiénes somos: tira de 3 fotos reales */
.qs-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 1392px; margin: 0 auto; }
.qs-strip img { width: 100%; height: clamp(200px, 26vw, 400px); object-fit: cover; display: block; }
@media (max-width: 700px) { .qs-strip { grid-template-columns: 1fr 1fr; } .qs-strip img:nth-child(3) { display: none; } .qs-strip img { height: 46vw; } }
