/* ==========================================================
   Grupo Medusa — sistema global
   Menú flotante, desplegable de empresas, efectos compartidos.
   Cada empresa carga además su propio css/co/<empresa>.css
   ========================================================== */
@view-transition { navigation: auto; }

:root {
  --navy-950: #01141f; --navy-900: #021e2d; --navy-800: #04435f; --navy-700: #0a5578;
  --snake: #9dbccb; --red: #e5252a; --paper: #f4f8fa;
  --ease: cubic-bezier(.2,.8,.2,1);
  --spring: cubic-bezier(.34,1.56,.64,1);
  --wrap: 1240px;
  --gutter: clamp(20px, 4vw, 56px);
  /* tokens de página (cada empresa los redefine) */
  --bg: var(--paper); --ink: #0c2230; --muted: #4a6272; --line: #d3dee5; --surface: #fff;
  --brand: var(--navy-800); --brand-ink: #fff; --accent: var(--red); --accent-ink: #fff;
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.6 var(--font-body); text-rendering: optimizeLegibility; overflow-x: hidden; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: .22em; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.06; margin: 0; letter-spacing: -.025em; text-wrap: balance; }
p { margin: 0 0 1em; max-width: 66ch; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
html { scrollbar-color: var(--brand) var(--bg); }
[id] { scroll-margin-top: 96px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.skip { position: absolute; left: -999px; top: 8px; z-index: 200; background: #fff; color: #000; padding: 10px 16px; border-radius: 8px; }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(56px, 9vw, 120px); position: relative; }
.title { font-size: clamp(1.9rem, 4vw, 3.2rem); margin-bottom: .5em; max-width: 20ch; }
.lead { font-size: clamp(1.08rem, 1.5vw, 1.28rem); color: var(--muted); max-width: 56ch; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Revelado al hacer scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(30px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal-x { opacity: 0; transform: translateX(-36px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal-x.in { opacity: 1; transform: none; }

/* titulares que entran por líneas */
.line { display: block; overflow: hidden; padding-bottom: .1em; }
.line > span { display: block; animation: rise 1s var(--ease) backwards; animation-delay: var(--d, 0s); }
@keyframes rise { from { transform: translateY(105%); } }
@keyframes fade { from { opacity: 0; transform: translateY(14px); } }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 12px 26px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 700 1rem/1 var(--font-body); text-decoration: none; border: 2px solid var(--accent); cursor: pointer; position: relative; overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s; }
.btn:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,.28); }
.btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%); transform: translateX(-120%); transition: transform .7s var(--ease); }
.btn:hover::after { transform: translateX(120%); }
.btn--ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn--ghost:hover { background: currentColor; }
.btn--ghost:hover span { color: var(--bg); }
.btn svg { width: 20px; height: 20px; flex: none; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

/* ---------- Menú flotante ---------- */
.hdr { position: fixed; top: 14px; left: 0; right: 0; z-index: 100; padding-inline: clamp(12px, 3vw, 40px); pointer-events: none; font-family: "Hanken Grotesk", system-ui, sans-serif; }
.hdr-in { pointer-events: auto; position: relative; max-width: var(--wrap); margin: auto; height: 66px; padding: 0 10px 0 12px; border-radius: 999px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: rgba(2,30,45,.68); -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5); border: 1px solid rgba(255,255,255,.16); box-shadow: 0 12px 40px rgba(0,0,0,.3); color: #fff; transition: background .3s; }
.hdr.scrolled .hdr-in { background: rgba(2,24,36,.88); }
.logo-pill { display: block; text-decoration: none; }
.logo-pill .plate { display: block; background: #fff; border-radius: 999px; padding: 3px 14px; }
.logo-pill img { height: 40px; width: auto; }
.panel { display: contents; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a, .nav button { background: none; border: 0; color: #fff; font: 600 .98rem "Hanken Grotesk", system-ui, sans-serif; padding: 10px 14px; border-radius: 999px; cursor: pointer; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; transition: background .2s; }
.nav a:hover, .nav button:hover, .nav button[aria-expanded="true"], .nav a[aria-current="page"] { background: rgba(255,255,255,.14); }
.nav .ext::after { content: "↗"; font-size: .8em; opacity: .7; }
.nav .caret { width: 10px; height: 10px; transition: transform .3s var(--ease); }
.nav button[aria-expanded="true"] .caret { transform: rotate(180deg); }
.nav .cta { background: var(--red); font-weight: 700; padding-inline: 20px; }
.nav .cta:hover { background: #b9141a; }
.menu-btn { display: none; min-height: 46px; padding: 0 18px; border-radius: 999px; border: 1.5px solid rgba(255,255,255,.5); background: transparent; color: #fff; font: 700 .95rem "Hanken Grotesk", system-ui, sans-serif; cursor: pointer; }

.mega { position: absolute; top: calc(100% + 12px); left: 50%; width: min(900px, calc(100vw - 28px)); padding: 22px; border-radius: 26px; background: rgba(2,26,39,.94); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); border: 1px solid rgba(255,255,255,.16); box-shadow: 0 30px 80px rgba(0,0,0,.5); opacity: 0; visibility: hidden; transform: translate(-50%, -10px) scale(.98); transition: opacity .25s, transform .35s var(--ease), visibility .25s; color: #fff; }
.mega.open { opacity: 1; visibility: visible; transform: translate(-50%, 0) scale(1); }
.mega-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 18px; }
.mega h4 { margin: 0 0 8px; padding-left: 10px; font: 700 .78rem "Hanken Grotesk", sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--snake); }
.mega a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 16px; text-decoration: none; transition: background .2s, transform .25s var(--ease); }
.mega a:hover, .mega a:focus-visible { background: rgba(255,255,255,.1); transform: translateX(4px); }
.mega a[aria-current="page"] { background: rgba(255,255,255,.14); }
.mega .th { width: 46px; height: 46px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; padding: 5px; box-shadow: 0 0 0 2px var(--c, #fff); }
.mega .th img { max-height: 34px; width: auto; object-fit: contain; }
.mega b { display: block; font: 700 .98rem "Bricolage Grotesque", sans-serif; line-height: 1.15; }
.mega small { display: block; color: #a9c3d1; font-size: .8rem; line-height: 1.25; }

@media (max-width: 960px) {
  .menu-btn { display: inline-block; }
  .panel { display: none; position: absolute; top: calc(100% + 10px); left: 0; right: 0; max-height: 78vh; overflow: auto; padding: 14px; border-radius: 26px; background: rgba(2,26,39,.97); border: 1px solid rgba(255,255,255,.16); box-shadow: 0 30px 80px rgba(0,0,0,.5); }
  .hdr.open .panel { display: block; }
  .nav { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav a, .nav button { padding: 14px; justify-content: space-between; }
  .mega { position: static; width: 100%; transform: none; opacity: 1; visibility: visible; display: none; background: transparent; border: 0; box-shadow: none; padding: 6px 0 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .mega.open { display: block; transform: none; }
  .mega-grid { grid-template-columns: 1fr; }
}

/* ---------- Marquesina ---------- */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: var(--gap, 56px); width: max-content; animation: marq var(--dur, 40s) linear infinite; }
.marquee.rev .marquee-track { animation-direction: reverse; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marq { to { transform: translateX(-50%); } }
.marquee-track > * { flex: none; }

/* ---------- Foco de luz que sigue al cursor ---------- */
.spot { position: relative; overflow: hidden; isolation: isolate; }
.spot::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--spot, rgba(255,255,255,.16)), transparent 60%); opacity: 0; transition: opacity .35s; }
.spot:hover::before { opacity: 1; }

/* ---------- Otras empresas (pie de cada página) ---------- */
.others { padding-block: clamp(48px, 7vw, 88px) 0; }
.others h2 { font-size: clamp(1.4rem, 2.4vw, 2rem); margin-bottom: 24px; }
.others .marquee-track { gap: 18px; --dur: 46s; }
.others a { display: grid; place-items: center; width: 150px; aspect-ratio: 5 / 3; background: #fff; border-radius: 18px; padding: 14px; border: 1px solid var(--line); text-decoration: none; transition: transform .3s var(--ease), box-shadow .3s; }
.others a:hover { transform: translateY(-6px) scale(1.04); box-shadow: 0 18px 36px rgba(0,0,0,.18); }
.others img { max-height: 62px; width: auto; object-fit: contain; }

/* ---------- Pie de página ---------- */
.footer { background: var(--navy-950); color: #cfe0ea; padding-block: 72px 36px; margin-top: clamp(56px, 8vw, 110px); position: relative; font-family: "Hanken Grotesk", system-ui, sans-serif; font-size: 1rem; }
.footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, #04435f, #9dbccb, #e5252a, #04435f); background-size: 200% 100%; animation: slide 8s linear infinite; }
@keyframes slide { to { background-position: 200% 0; } }
.footer a { color: #fff; }
.footer .cols { display: grid; gap: 40px; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; }
@media (max-width: 900px) { .footer .cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer .cols { grid-template-columns: 1fr; } }
.footer h3 { font: 800 1rem "Hanken Grotesk", sans-serif; color: #fff; margin-bottom: 14px; letter-spacing: 0; }
.footer li { margin-bottom: 8px; }
.footer .about { max-width: 34ch; font-size: .98rem; }
.footer .logo-plate { background: #fff; padding: 10px 16px; border-radius: 14px; display: inline-block; margin-bottom: 18px; }
.footer .logo-plate img { height: 58px; width: auto; }
.footer .legal { margin-top: 48px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.16); font-size: .9rem; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.wa-float { position: fixed; right: 18px; bottom: 18px; z-index: 90; width: 58px; height: 58px; border-radius: 50%; background: #1fa855; color: #fff; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.35); transition: transform .3s var(--spring); }
.wa-float:hover { transform: scale(1.12) rotate(-6deg); }
.wa-float::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #1fa855; animation: ping 2.6s ease-out infinite; }
@keyframes ping { from { transform: scale(1); opacity: .8; } to { transform: scale(1.7); opacity: 0; } }
.wa-float svg { width: 30px; height: 30px; }

/* ---------- Tarjeta flotante ---------- */
.tip { position: fixed; z-index: 150; pointer-events: none; width: 262px; background: #fff; color: #0c2230; border-radius: 18px; padding: 14px 16px; box-shadow: 0 22px 54px rgba(0,0,0,.45); opacity: 0; transform: translateY(8px) scale(.97); transition: opacity .2s, transform .3s var(--ease); font-family: "Hanken Grotesk", system-ui, sans-serif; }
.tip.on { opacity: 1; transform: none; }
.tip .lg { height: 40px; margin-bottom: 8px; }
.tip .lg img { height: 100%; width: auto; }
.tip b { display: block; font: 800 1.05rem "Bricolage Grotesque", sans-serif; line-height: 1.15; }
.tip span { display: block; font-size: .86rem; color: #4a6272; line-height: 1.35; margin-top: 4px; }
.tip i { display: block; font-style: normal; font-weight: 700; font-size: .82rem; margin-top: 8px; color: var(--c, #04435f); }

/* ---------- Pestañas, enrutador, carrusel (usados por empresas) ---------- */
[role="tab"] { cursor: pointer; }
[hidden] { display: none !important; }
.copy-btn { cursor: pointer; }
.carousel { position: relative; }
.car-track { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-block: 8px; }
.car-track::-webkit-scrollbar { display: none; }
.car-track > * { scroll-snap-align: start; flex: none; }
.car-ctrl { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.car-ctrl button { width: 50px; height: 50px; border-radius: 50%; border: 2px solid currentColor; background: transparent; color: inherit; cursor: pointer; display: grid; place-items: center; transition: background .2s, color .2s, transform .2s; }
.car-ctrl button:hover { background: currentColor; transform: scale(1.06); }
.car-ctrl button:hover svg { color: var(--bg); }
.car-ctrl svg { width: 20px; height: 20px; }
.car-bar { flex: 1; height: 4px; border-radius: 4px; background: color-mix(in srgb, currentColor 22%, transparent); overflow: hidden; }
.car-bar i { display: block; height: 100%; width: 0; background: currentColor; border-radius: 4px; transition: width .2s; }

.note-pending { margin-top: 24px; padding: 16px 20px; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--muted); max-width: 62ch; font-size: .98rem; }

/* ---------- Bloque de contacto compartido ---------- */
.contact-box { background: var(--brand); color: var(--brand-ink); border-radius: calc(var(--radius) * 2); padding: clamp(28px, 5vw, 64px); display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; position: relative; overflow: hidden; }
.contact-box h2 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); }
.contact-box a { color: inherit; }
.contact-box li { padding: 7px 0; }
.contact-box .btn { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
@media (max-width: 760px) { .contact-box { grid-template-columns: 1fr; } }
.facts { display: grid; }
.facts li { display: flex; justify-content: space-between; gap: 18px; padding: 13px 0; border-top: 1px solid var(--line); font-size: 1rem; }
.facts b { font-weight: 700; }
.facts span { color: var(--muted); text-align: right; }

/* ==========================================================
   PÁGINAS GENERALES (equipo, contacto)
   ========================================================== */
body.group { background: var(--navy-950); color: #fff; --ink: #fff; --muted: #a9c3d1; --line: rgba(255,255,255,.16); --accent: var(--red); }
.page-hero { position: relative; padding: 150px 0 60px; overflow: hidden; background: radial-gradient(120% 90% at 50% 0%, var(--navy-900), var(--navy-950)); }
.page-hero h1 { font-size: clamp(2.3rem, 5vw, 4.2rem); max-width: 18ch; font-weight: 800; }
.page-hero .lead { color: #b9d0dc; margin-top: 18px; }
.mesh { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.mesh i { position: absolute; border-radius: 50%; filter: blur(90px); animation: drift 20s ease-in-out infinite alternate; }
.mesh i:nth-child(1) { width: 55vw; height: 55vw; left: -15%; top: -25%; background: #0a5578; opacity: .6; }
.mesh i:nth-child(2) { width: 38vw; height: 38vw; right: -10%; top: 5%; background: #b8232a; opacity: .38; animation-duration: 26s; }
.mesh i:nth-child(3) { width: 46vw; height: 46vw; left: 25%; bottom: -35%; background: #1b8a96; opacity: .3; animation-duration: 23s; }
@keyframes drift { to { transform: translate3d(7vw, 5vw, 0) scale(1.18); } }
.gridlines { position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); background-size: 64px 64px; -webkit-mask-image: radial-gradient(75% 65% at 50% 45%, #000, transparent); mask-image: radial-gradient(75% 65% at 50% 45%, #000, transparent); }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }
.person { padding: 28px; border-radius: 24px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); transition: transform .35s var(--ease), border-color .3s; --spot: rgba(157,188,203,.2); }
.person:hover { transform: translateY(-6px); border-color: rgba(255,255,255,.4); }
.person .mono { width: 72px; height: 72px; border-radius: 50%; background: radial-gradient(circle at 30% 25%, #fff, #cfdde6 60%, #9dbccb); color: var(--navy-800); display: grid; place-items: center; font: 800 1.5rem var(--font-display); margin-bottom: 18px; box-shadow: 0 10px 24px rgba(0,0,0,.35); }
.person h3 { font-size: 1.35rem; }
.person p { color: #a9c3d1; margin: 6px 0 0; }
.mail-list { display: grid; gap: 12px; }
.mail-item { display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; align-items: center; padding: 22px 26px; border-radius: 22px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); --spot: rgba(157,188,203,.18); }
.mail-item h3 { font-size: 1.2rem; }
.mail-item a { font-weight: 700; word-break: break-all; }
.mail-item p { grid-column: 1; margin: 4px 0 0; color: #a9c3d1; font-size: .98rem; }
.mail-item .btn { grid-column: 2; grid-row: 1 / span 2; min-height: 44px; padding: 8px 20px; font-size: .92rem; }
@media (max-width: 640px) { .mail-item { grid-template-columns: 1fr; } .mail-item .btn { grid-column: 1; grid-row: auto; } }
.wa-big { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: clamp(26px, 4vw, 48px); border-radius: 28px; background: linear-gradient(120deg, #0c6b3c, #1fa855); color: #fff; margin-bottom: 40px; }
.wa-big h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); }
.wa-big .btn { background: #fff; color: #0c5a32; border-color: #fff; }
@media (max-width: 700px) { .wa-big { grid-template-columns: 1fr; } }
