/* Componentes compartidos: selector de idioma, footer, banner de cookies, chat y página legal.
   Los tokens (colores/tipografía) se repiten aquí para que privacy-policy.html funcione sola. */
:root {
  --black: #000; --navy: #1A2241; --gold: #EFA531; --grey: #E5E5E5; --paper: #F5F5F5; --white: #fff; --muted: #5B6070;
  --display: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: clamp(20px, 5vw, 72px);
  --ease: cubic-bezier(.22,1,.36,1);
  --r-btn: 8px;
}

.wrap { max-width: 1280px; margin: 0 auto; padding-inline: var(--gutter); }

/* ---------- Selector de idioma ---------- */
.hdr-right { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 32px); }
.lang { display: flex; gap: 2px; }
.lang button { background: none; border: 0; border-bottom: 1px solid transparent; font: 500 12px var(--body); letter-spacing: .14em; padding: 6px 7px; color: var(--muted); cursor: pointer; transition: color .2s; }
.lang button:hover { color: var(--black); }
.lang button[aria-pressed="true"] { color: var(--black); border-bottom-color: var(--gold); }

/* ---------- Footer ---------- */
footer.site-footer { background: var(--black); color: #9aa0b4; padding: clamp(56px, 7vw, 96px) 0 0; font-size: 15px; letter-spacing: 0; text-transform: none; line-height: 1.7; }
.site-footer .fgrid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr 1.2fr; gap: clamp(28px, 4vw, 64px); padding-bottom: clamp(40px, 5vw, 64px); }
.site-footer .flogo { font: 600 16px var(--display); letter-spacing: .28em; text-transform: uppercase; color: var(--white); text-decoration: none; }
.site-footer p { margin: 14px 0 0; max-width: 32ch; }
.site-footer h4 { margin: 0 0 14px; font: 500 12px var(--body); letter-spacing: .2em; text-transform: uppercase; color: var(--white); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0 0 6px; }
.site-footer a { color: #c4c9d8; text-decoration: none; transition: color .2s; }
.site-footer a:hover { color: var(--gold); }
.site-footer address { font-style: normal; }
.site-footer .fname { margin: 0 0 8px; max-width: none; color: #c4c9d8; }
.site-footer dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; }
.site-footer dt { color: #7f869c; }
.site-footer dd { margin: 0; color: #c4c9d8; }
.site-footer .fbar { border-top: 1px solid rgba(255,255,255,.12); padding-block: 22px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; font-size: 13px; color: #7f869c; }
.site-footer .fbar nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.site-footer .fbar button { background: none; border: 0; padding: 0; font: inherit; color: #c4c9d8; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.site-footer .fbar button:hover { color: var(--gold); }
@media (max-width: 900px) { .site-footer .fgrid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .site-footer .fgrid { grid-template-columns: 1fr; } }

/* ---------- Banner de cookies (franja inferior) ---------- */
.cookie { position: fixed; z-index: 120; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px 32px; padding: 14px var(--gutter); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--grey); color: #3a3f50; font-size: 13px; line-height: 1.55; transform: translateY(100%); visibility: hidden; transition: transform .5s var(--ease), visibility 0s .5s; }
.cookie.show { transform: none; visibility: visible; transition: transform .5s var(--ease); }
.cookie p { margin: 0; max-width: 78ch; }
.cookie a { color: var(--navy); text-decoration-color: var(--gold); text-underline-offset: 3px; }
.cookie-actions { display: flex; gap: 8px; flex: none; }
.cookie-actions button { border-radius: var(--r-btn); font: 400 11px var(--body); letter-spacing: .16em; text-transform: uppercase; padding: 9px 18px; cursor: pointer; border: 1px solid #1a1d29; background: transparent; color: #1a1d29; transition: background .25s, color .25s, border-color .25s; }
.cookie-actions button:hover { background: #1a1d29; color: var(--white); }
.cookie-actions button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (max-width: 640px) { .cookie { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 16px 14px; } .cookie-actions button { flex: 1; } }
@media (prefers-reduced-motion: reduce) { .cookie, .cookie.show { transition: none; } }

/* ---------- Página legal ---------- */
.legal { max-width: 820px; margin: 0 auto; padding: clamp(48px, 7vw, 96px) var(--gutter) clamp(64px, 8vw, 120px); }
.legal .back { display: inline-block; margin-bottom: 28px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
.legal .back:hover { color: var(--black); }
.legal h1 { font-size: clamp(32px, 4.4vw, 52px); margin-bottom: 10px; }
.legal .updated { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.legal .note { background: var(--paper); border-left: 3px solid var(--gold); padding: 14px 18px; margin: 0 0 28px; font-size: 15px; }
.legal h2 { font-size: 20px; font-weight: 600; margin: 40px 0 12px; letter-spacing: -.01em; }
.legal p { margin: 0 0 14px; color: #2b2f3d; }
.legal a { color: var(--navy); text-underline-offset: 3px; }
.legal code { background: var(--paper); padding: 1px 6px; font-size: .9em; }

/* ---------- Chat (burbuja) + WhatsApp ---------- */
.fab-wa, .fab-chat { position: fixed; right: clamp(14px, 2vw, 28px); z-index: 100; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; box-shadow: 0 14px 34px -10px rgba(0,0,0,.5); transition: transform .25s var(--ease), opacity .25s; }
.fab-chat { bottom: calc(clamp(14px, 2vw, 28px) + var(--cookie-h, 0px)); transition: transform .25s var(--ease), opacity .25s, bottom .5s var(--ease); width: 60px; height: 60px; background: var(--navy); color: var(--gold); }
.fab-wa { bottom: calc(clamp(14px, 2vw, 28px) + 72px + var(--cookie-h, 0px)); transition: transform .25s var(--ease), opacity .25s, bottom .5s var(--ease); width: 48px; height: 48px; background: #25D366; color: #fff; text-decoration: none; }
.fab-chat:hover, .fab-wa:hover { transform: translateY(-3px) scale(1.04); }
.fab-chat svg, .fab-wa svg { width: 26px; height: 26px; }
.fab-chat .x { display: none; }
.chat-open .fab-chat .ic { display: none; } .chat-open .fab-chat .x { display: block; }
.chat-open .fab-wa { opacity: 0; pointer-events: none; }
.chat { position: fixed; z-index: 110; right: clamp(14px, 2vw, 28px); bottom: calc(clamp(14px, 2vw, 28px) + 76px + var(--cookie-h, 0px)); width: min(390px, calc(100vw - 28px)); height: min(560px, calc(100svh - 130px - var(--cookie-h, 0px))); display: none; flex-direction: column; background: var(--white); box-shadow: 0 30px 80px -20px rgba(0,0,0,.55); overflow: hidden; border-radius: 6px; }
.chat.open { display: flex; }
.chat-h { background: var(--navy); color: var(--white); padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chat-h strong { display: block; font: 600 15px var(--display); }
.chat-h span { font-size: 12px; color: rgba(255,255,255,.7); }
.chat-wa { background: #25D366; color: #fff; text-decoration: none; font: 500 12px var(--body); padding: 8px 12px; border-radius: 999px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.chat-wa svg { width: 15px; height: 15px; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px; background: var(--paper); display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.msg { max-width: 86%; padding: 10px 14px; font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; word-wrap: break-word; }
.msg.bot { align-self: flex-start; background: var(--white); color: #1e2230; border: 1px solid var(--grey); border-radius: 4px 14px 14px 14px; }
.msg.me { align-self: flex-end; background: var(--navy); color: var(--white); border-radius: 14px 4px 14px 14px; }
.msg a { color: inherit; text-decoration: underline; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #9aa0b4; animation: bl 1.1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bl { 0%, 80%, 100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 12px; background: var(--paper); }
.chips button { font: 400 13px var(--body); padding: 8px 12px; border: 1px solid var(--navy); background: var(--white); color: var(--navy); border-radius: 999px; cursor: pointer; transition: background .2s, color .2s; }
.chips button:hover { background: var(--navy); color: var(--white); }
.chat-f { display: flex; border-top: 1px solid var(--grey); background: var(--white); }
.chat-f input { flex: 1; border: 0; padding: 15px 16px; font: 400 15px var(--body); background: transparent; color: #111; min-width: 0; }
.chat-f input:focus { outline: 0; box-shadow: inset 0 -2px 0 var(--gold); }
.chat-f button { border: 0; background: var(--gold); color: var(--black); padding: 0 18px; font: 500 12px var(--body); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.chat-f button:disabled { opacity: .5; cursor: default; }
.chat-n { font-size: 11px; color: var(--muted); padding: 8px 16px; background: var(--white); border-top: 1px solid var(--grey); line-height: 1.4; }
@media (max-width: 560px) { .chat { right: 8px; bottom: 8px; width: calc(100vw - 16px); height: calc(100svh - 16px); border-radius: 0; } .chat-open .fab-chat { opacity: 0; pointer-events: none; } }
@media (prefers-reduced-motion: reduce) { .chat-log { scroll-behavior: auto; } .typing i { animation: none; } }

/* ---------- Enlace de WhatsApp (contacto y footer) ---------- */
.wa-link { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.wa-link .ic { width: 38px; height: 38px; border-radius: 50%; background: #25D366; color: #fff; display: grid; place-items: center; flex: none; transition: transform .25s var(--ease); }
.wa-link .ic svg { width: 20px; height: 20px; }
.wa-link:hover .ic { transform: scale(1.08); }
.info a.wa-link { font: 500 17px/1.3 var(--display); margin-top: 6px; }
.info a.wa-link:hover { color: var(--black); text-decoration: none; }
.site-footer a.wa-link { margin-top: 6px; color: #c4c9d8; }
.site-footer a.wa-link .ic { width: 28px; height: 28px; }
.site-footer a.wa-link .ic svg { width: 15px; height: 15px; }
