/* =========================================================================
   Cursa de les Empreses de la Safor — hoja de estilos principal
   Paleta tomada del logotipo:
     petroli  #157A88   ·   taronja #EC681C   ·   llima #CAD52E
   ========================================================================= */

:root {
  --teal-950: #062A30;
  --teal-900: #07333A;
  --teal-800: #0B4A54;
  --teal-700: #0F5F6C;
  --teal-600: #157A88;
  --teal-500: #1D93A3;
  --teal-100: #DCEEF1;
  --teal-50:  #F0F8F9;

  --orange:      #EC681C;
  --orange-dark: #CE550F;
  --orange-100:  #FDEADD;

  --lime:      #CAD52E;
  --lime-dark: #A3AD1F;
  --lime-100:  #F5F8DC;

  --ink:     #0A1618;
  --body:    #33474B;
  --muted:   #6B8085;
  --line:    #DEE7E8;
  --surface: #F3F7F7;
  --white:   #FFFFFF;

  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --wrap: 1180px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 8px rgba(7, 51, 58, .06);
  --shadow: 0 12px 34px rgba(7, 51, 58, .10);
  --shadow-lg: 0 26px 60px rgba(7, 51, 58, .16);
  --header-h: 78px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--body);
  background: var(--white);
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--teal-600); text-decoration: none; }
a:hover { color: var(--orange); }
ul { margin: 0; padding: 0; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.05;
  margin: 0 0 .5em;
  font-weight: 800;
  letter-spacing: -.01em;
  text-transform: uppercase;
}
h1 { font-size: clamp(2.6rem, 6.2vw, 4.6rem); }
h2 { font-size: clamp(2rem, 4.2vw, 3.1rem); }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); }
p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

/* ---------- utilidades ---------- */
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.section { padding: clamp(4rem, 8vw, 7rem) 0; }
.section--tight { padding: clamp(3rem, 5vw, 4.5rem) 0; }
.section--surface { background: var(--surface); }
.section--teal { background: var(--teal-900); color: #C9DDE0; }
.section--teal h2, .section--teal h3 { color: #fff; }
.center { text-align: center; }
.lead { font-size: 1.18rem; color: var(--muted); max-width: 62ch; }
.center .lead { margin-inline: auto; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-display);
  font-size: .95rem; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--orange);
  margin-bottom: .9rem;
}
.eyebrow::before {
  content: ""; width: 28px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--orange), var(--lime));
}
.center .eyebrow::before { display: none; }
.section--teal .eyebrow { color: var(--lime); }

.section-head { max-width: 760px; margin-bottom: 3rem; }
.section-head.center { margin-inline: auto; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  font-family: var(--font-display);
  font-size: 1.12rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .95rem 1.9rem;
  border: 2px solid transparent; border-radius: 999px;
  cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
  line-height: 1;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--orange); color: #fff; box-shadow: 0 10px 24px rgba(236, 104, 28, .32); }
.btn--primary:hover { background: var(--orange-dark); color: #fff; box-shadow: 0 14px 30px rgba(236, 104, 28, .4); }
.btn--lime { background: var(--lime); color: var(--teal-900); box-shadow: 0 10px 24px rgba(202, 213, 46, .3); }
.btn--lime:hover { background: var(--lime-dark); color: var(--teal-900); }
.btn--ghost { border-color: rgba(255, 255, 255, .45); color: #fff; }
.btn--ghost:hover { background: #fff; color: var(--teal-900); border-color: #fff; }
.btn--outline { border-color: var(--teal-600); color: var(--teal-600); }
.btn--outline:hover { background: var(--teal-600); color: #fff; }
.btn--sm { padding: .7rem 1.3rem; font-size: 1rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .9rem; }
.center .btn-row { justify-content: center; }

/* ---------- barra superior ---------- */
.topbar {
  background: var(--teal-900); color: #A9C8CD;
  font-size: .87rem; letter-spacing: .02em;
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 42px; }
.topbar__facts { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.topbar__facts span { display: inline-flex; align-items: center; gap: .45rem; }
.topbar__facts svg { width: 15px; height: 15px; opacity: .8; }
.topbar a { color: #A9C8CD; }
.topbar a:hover { color: var(--lime); }
.topbar__social { display: flex; gap: .9rem; align-items: center; }
.topbar__social svg { width: 17px; height: 17px; }

/* ---------- cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 90;
  background: #fff;
  border-bottom: 1px solid var(--line);
  transition: box-shadow .25s ease;
}
.site-header.is-stuck { box-shadow: var(--shadow-sm); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: var(--header-h); }
.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand img { height: 52px; width: auto; }

.nav { display: flex; align-items: center; gap: 1.9rem; }
.nav a {
  font-family: var(--font-display); text-transform: uppercase;
  font-size: 1.06rem; font-weight: 700; letter-spacing: .05em;
  color: var(--teal-900); position: relative; padding: .3rem 0;
  white-space: nowrap;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 3px;
  border-radius: 2px; background: var(--orange); transition: right .25s ease;
}
.nav a:hover::after, .nav a.is-active::after { right: 0; }
.nav a.is-active { color: var(--teal-600); }

.header-actions { display: flex; align-items: center; gap: .9rem; }
.nav-toggle {
  display: none; width: 46px; height: 46px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; cursor: pointer;
  align-items: center; justify-content: center; padding: 0;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--teal-900); position: relative; transition: .2s; }
.nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; left: 0; width: 20px; height: 2px; background: var(--teal-900); transition: .2s;
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, var(--teal-950) 0%, var(--teal-800) 55%, var(--teal-700) 100%);
  color: #fff;
  padding: clamp(4rem, 9vw, 7.5rem) 0 0;
}
.hero__waves { position: absolute; inset: auto 0 0 0; width: 100%; height: 190px; opacity: .16; pointer-events: none; }
.hero__glow {
  position: absolute; width: 720px; height: 720px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(236, 104, 28, .38) 0%, rgba(236, 104, 28, 0) 68%);
  top: -280px; right: -180px;
}
.hero__glow--lime {
  background: radial-gradient(circle, rgba(202, 213, 46, .26) 0%, rgba(202, 213, 46, 0) 68%);
  top: auto; bottom: -380px; right: auto; left: -260px; width: 620px; height: 620px;
}
.hero__inner { position: relative; z-index: 2; }
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3.5rem; align-items: center; }
.hero h1 { color: #fff; margin-bottom: 1.1rem; }
.hero h1 em { font-style: normal; color: var(--lime); }
.hero__sub { font-size: 1.2rem; color: #BFD9DD; max-width: 54ch; margin-bottom: 2rem; }

.badge-edition {
  display: inline-flex; align-items: center; gap: .7rem;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px; padding: .45rem 1.1rem .45rem .5rem;
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: .12em;
  font-size: .95rem; font-weight: 700; color: #fff; margin-bottom: 1.6rem;
}
.badge-edition b {
  background: var(--orange); border-radius: 999px; padding: .25rem .75rem;
  font-size: .95rem; letter-spacing: .08em;
}

/* cuenta atrás */
.countdown {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius-lg);
  padding: 1.9rem 1.6rem;
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-lg);
}
.countdown__title {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: .16em;
  font-size: .9rem; color: var(--lime); text-align: center; margin-bottom: 1.2rem; font-weight: 700;
}
.countdown__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
.countdown__cell { text-align: center; background: rgba(255, 255, 255, .06); border-radius: 12px; padding: .9rem .3rem; }
.countdown__num {
  font-family: var(--font-display); font-size: clamp(1.9rem, 4vw, 2.7rem); font-weight: 800;
  color: #fff; line-height: 1; display: block; font-variant-numeric: tabular-nums;
}
.countdown__label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: #9FBFC4; margin-top: .35rem; display: block;
}
.countdown__date {
  margin-top: 1.3rem; text-align: center; font-size: .95rem; color: #BFD9DD;
  border-top: 1px solid rgba(255, 255, 255, .14); padding-top: 1rem;
}
.countdown__date strong { color: #fff; display: block; font-size: 1.05rem; }

/* franja de datos bajo el hero */
.hero__facts {
  position: relative; z-index: 3; margin-top: clamp(3rem, 6vw, 4.5rem);
  border-top: 1px solid rgba(255, 255, 255, .14);
  background: linear-gradient(180deg, rgba(6, 42, 48, .55), rgba(6, 42, 48, .88));
  backdrop-filter: blur(2px);
}
.hero__facts .wrap { display: grid; grid-template-columns: repeat(4, 1fr); }
.fact { padding: 1.9rem 1rem; text-align: center; border-right: 1px solid rgba(255, 255, 255, .14); }
.fact:last-child { border-right: 0; }
.fact__num {
  font-family: var(--font-display); font-size: clamp(2.1rem, 4vw, 3rem); font-weight: 800; color: #fff; line-height: 1;
}
.fact__num span { color: var(--lime); }
.fact__label { font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; color: #92B3B9; margin-top: .5rem; }

/* ---------- cabecera de página interior ---------- */
.page-hero {
  background: linear-gradient(140deg, var(--teal-900), var(--teal-700));
  color: #fff; padding: clamp(3.5rem, 7vw, 5.5rem) 0 clamp(3rem, 6vw, 4.5rem);
  position: relative; overflow: hidden;
}
.page-hero__waves { position: absolute; inset: auto 0 -2px 0; opacity: .22; }
.page-hero h1 { color: #fff; margin-bottom: .6rem; }
.page-hero p { color: #BFD9DD; font-size: 1.15rem; max-width: 62ch; }
.breadcrumb { font-size: .85rem; color: #8FB2B8; margin-bottom: 1.2rem; letter-spacing: .05em; }
.breadcrumb a { color: #8FB2B8; }
.breadcrumb a:hover { color: var(--lime); }

/* ---------- tarjetas ---------- */
.grid { display: grid; gap: 1.6rem; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
/* Rejilla que se adapta al número de tarjetas: con 3 salen 3 columnas,
   con 4 salen 4, y al estrechar la pantalla se reorganiza sola. */
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 2rem 1.8rem; transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  position: relative; overflow: hidden;
}
.card::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--teal-600), var(--lime));
  transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: transparent; }
.card:hover::after { transform: scaleX(1); }
.card__icon {
  width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center;
  background: var(--teal-50); color: var(--teal-600); margin-bottom: 1.2rem;
}
.card__icon svg { width: 26px; height: 26px; }
.card:nth-child(2) .card__icon { background: var(--orange-100); color: var(--orange); }
.card:nth-child(3) .card__icon { background: var(--lime-100); color: var(--lime-dark); }
.card h3 { margin-bottom: .6rem; }
.card p { font-size: .98rem; color: var(--muted); }

/* ---------- bloque de texto + imagen ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.split__media { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }

/* ---------- contenido enriquecido ---------- */
.prose { max-width: 74ch; }
.prose h2 { margin-top: 2.6rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 2rem; color: var(--teal-700); }
.prose ul { list-style: none; margin: 0 0 1.3rem; }
.prose ul li { position: relative; padding-left: 1.8rem; margin-bottom: .6rem; }
.prose ul li::before {
  content: ""; position: absolute; left: 0; top: .62em; width: 9px; height: 9px;
  border-radius: 50%; background: var(--lime);
}

/* ---------- artículos del reglamento ---------- */
.rules { display: grid; gap: 1rem; max-width: 900px; }
.rule {
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden;
}
.rule__head {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.15rem 1.4rem; background: none; border: 0; cursor: pointer; text-align: left;
  font-family: var(--font-display); font-size: 1.22rem; font-weight: 700; text-transform: uppercase;
  color: var(--teal-900); letter-spacing: .01em;
}
.rule__head:hover { color: var(--orange); }
.rule__head .chev { width: 20px; height: 20px; flex: 0 0 20px; transition: transform .25s ease; color: var(--teal-600); }
.rule.is-open .rule__head .chev { transform: rotate(180deg); }
.rule__body { padding: 0 1.4rem 1.4rem; display: none; color: var(--body); }
.rule.is-open .rule__body { display: block; }
.rule.is-open { border-color: var(--teal-500); box-shadow: var(--shadow-sm); }

/* ---------- programa del fin de semana (dos columnas) ---------- */
.programa {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(2.2rem, 5vw, 4.5rem);
  align-items: start;
}
.programa--solo { grid-template-columns: 1fr; max-width: 760px; }
.programa__fecha {
  font-size: 1.35rem; letter-spacing: .06em; color: #fff;
  margin: 0 0 1.6rem; padding-bottom: .9rem;
  border-bottom: 2px solid rgba(255, 255, 255, .16);
}
.programa__fecha::before {
  content: ""; display: inline-block; vertical-align: middle;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--lime); margin-right: .7rem; margin-top: -.2rem;
}
.programa__dia:nth-child(2) .programa__fecha::before { background: var(--orange); }
.programa .timeline { max-width: none; }
@media (max-width: 820px) {
  .programa { grid-template-columns: 1fr; gap: 2.8rem; }
}

/* ---------- bloque destacado (IMPORTANTE) ---------- */
.destacado {
  background: var(--orange-100); border-left: 4px solid var(--orange);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.2rem; margin: 1.2rem 0;
}
.destacado p { font-size: .96rem; }
.destacado p:last-child { margin-bottom: 0; }
.section--teal .destacado { background: rgba(236, 104, 28, .14); color: #E7F0F1; }

/* listas y encabezados dentro de un artículo del reglamento */
.rule__body h2 { font-size: 1.15rem; margin: 1.4rem 0 .6rem; color: var(--teal-700); }
.rule__body h3 { font-size: 1.02rem; margin: 1.2rem 0 .5rem; color: var(--ink); text-transform: none; letter-spacing: 0; }
.rule__body ul { list-style: none; margin: .4rem 0 1.1rem; }
.rule__body li { position: relative; padding-left: 1.5rem; margin-bottom: .45rem; }
.rule__body li::before {
  content: ""; position: absolute; left: 0; top: .6em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--lime);
}
.rule__body h2:first-child, .rule__body h3:first-child { margin-top: 0; }

/* ---------- programa / timeline ---------- */
.timeline { position: relative; max-width: 760px; padding-left: 2.6rem; }
.timeline::before {
  content: ""; position: absolute; left: 9px; top: .6rem; bottom: .6rem; width: 2px;
  background: linear-gradient(180deg, var(--orange), var(--teal-500), var(--lime));
}
.timeline__item { position: relative; padding-bottom: 1.9rem; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: ""; position: absolute; left: -2.6rem; top: .45rem; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; border: 3px solid var(--teal-600);
}
.timeline__hour {
  font-family: var(--font-display); font-size: 1.45rem; font-weight: 800; color: var(--orange);
  line-height: 1; margin-bottom: .25rem;
}
.timeline__text { color: var(--body); }
.section--teal .timeline__text { color: #C9DDE0; }
.section--teal .timeline__item::before { background: var(--teal-900); border-color: var(--lime); }

/* ---------- tarifas ---------- */
.prices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
/* El número de columnas se ajusta a las tarifas que haya. */
.prices--1 { grid-template-columns: 1fr; max-width: 420px; margin-inline: auto; }
.prices--2 { grid-template-columns: repeat(2, 1fr); max-width: 820px; margin-inline: auto; }
.prices--4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.price {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 2.2rem 1.8rem; text-align: center; position: relative;
}
.price--feat {
  border-color: var(--teal-600); box-shadow: var(--shadow);
  background: linear-gradient(180deg, var(--teal-50), #fff);
}
.price__tag {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--orange); color: #fff; font-family: var(--font-display);
  text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700;
  padding: .3rem 1rem; border-radius: 999px; white-space: nowrap;
}
.price__name {
  font-family: var(--font-display); text-transform: uppercase; font-weight: 700;
  font-size: 1.15rem; color: var(--teal-700); letter-spacing: .06em;
}
.price__amount {
  font-family: var(--font-display); font-size: 3.4rem; font-weight: 800; color: var(--ink);
  line-height: 1; margin: .6rem 0 .5rem;
}
.price__detail { color: var(--muted); font-size: .95rem; }
/* Tarjeta ancha bajo las cuotas (almuerzo, camiseta extra…) */
.price--wide {
  grid-column: 1 / -1;
  padding: 1.5rem 1.8rem;
  border-style: dashed;
  background: var(--teal-50);
}
.price--wide .price__amount { font-size: 2.6rem; margin: .35rem 0 0; }
.price--wide .price__detail { margin-top: .4rem; }
/* Extra (almuerzo) en la portada: mismo aspecto que la tarjeta ancha de inscripciones */
.price--extra { border-style: dashed; background: var(--teal-50); }

.price__mod {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  margin-top: 1.1rem; padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-display); text-transform: uppercase;
  font-size: .95rem; font-weight: 700; letter-spacing: .1em;
  color: var(--teal-600);
}
.price__mod svg { width: 19px; height: 19px; flex: 0 0 19px; }
.price--feat .price__mod { border-top-color: var(--teal-100); }

/* ---------- lista de check ---------- */
.checklist { display: grid; gap: .75rem; }
.checklist li { display: flex; gap: .8rem; align-items: flex-start; list-style: none; }
.checklist svg { width: 22px; height: 22px; flex: 0 0 22px; color: var(--lime-dark); margin-top: .18rem; }

/* ---------- puntos del recorrido ---------- */
.route { display: grid; gap: 1.2rem; }
.route__item {
  display: grid; grid-template-columns: 58px 1fr; gap: 1.2rem; align-items: start;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem;
}
.route__num {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: var(--teal-900); color: #fff; font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 800;
}
.route__item:nth-child(even) .route__num { background: var(--orange); }
.route__item h3 { margin-bottom: .25rem; font-size: 1.25rem; }
.route__item p { font-size: .97rem; color: var(--muted); }

/* ---------- datos clave (chips) ---------- */
.keyfacts { display: flex; flex-wrap: wrap; gap: 1rem; }
.keyfact {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.4rem; min-width: 150px;
}
.keyfact__label { font-size: .76rem; text-transform: uppercase; letter-spacing: .13em; color: var(--muted); }
.keyfact__value { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; color: var(--teal-700); line-height: 1.2; }

/* ---------- CTA ---------- */
.cta-band {
  background: linear-gradient(120deg, var(--orange) 0%, #F0872F 100%);
  color: #fff; position: relative; overflow: hidden;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255, 255, 255, .92); font-size: 1.15rem; }
.cta-band .btn--lime { box-shadow: 0 12px 28px rgba(0, 0, 0, .18); }
.cta-band__waves { position: absolute; inset: auto 0 -1px 0; opacity: .25; }

/* ---------- patrocinadores ---------- */
.partners {
  background: #fff; border-top: 1px solid var(--line);
  padding: clamp(2.8rem, 4.5vw, 4rem) 0 clamp(2.8rem, 4.5vw, 3.6rem);
}
/* Los tres bloques (patrocinador · organiza · colaboran) van apilados,
   centrados y con una separación amplia entre ellos. */
.partners__bloque { text-align: center; }
.partners__bloque + .partners__bloque {
  margin-top: clamp(1.7rem, 2.8vw, 2.4rem);
  padding-top: clamp(1.7rem, 2.8vw, 2.4rem);
  border-top: 1px solid var(--line);
}
.partners__bloque .eyebrow { margin-bottom: 1.1rem; }
.eyebrow--teal { color: var(--teal-600); }
.eyebrow--teal::before { background: linear-gradient(90deg, var(--teal-600), var(--lime)); }

.sponsors { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2rem 3.5rem; }
.sponsor { display: block; }
.sponsor img {
  width: auto; max-height: 56px; opacity: 1;
  transition: transform .25s ease, filter .25s ease;
}
a.sponsor:hover img {
  transform: translateY(-4px) scale(1.05);
  filter: drop-shadow(0 10px 18px rgba(7, 51, 58, .18));
}
.sponsor--xl img { max-height: 74px; }
.sponsor__name {
  font-family: var(--font-display); text-transform: uppercase; font-weight: 700;
  font-size: 1.25rem; color: var(--teal-700); letter-spacing: .04em;
}
@media (max-width: 760px) {
  .sponsors { gap: 1.8rem 2.4rem; }
}

/* ---------- formulario embebido de inscripciones ---------- */
.embed {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(1.2rem, 3vw, 2.4rem);
  box-shadow: var(--shadow-sm);
  max-width: 900px; margin-inline: auto;
}
.embed iframe { width: 100%; border: 0; display: block; }
.embed :is(input, select, textarea) { max-width: 100%; }
/* deja sitio a la cabecera fija al saltar con el ancla #formulario */
#formulario { scroll-margin-top: calc(var(--header-h) + 20px); }

/* ---------- formulario ---------- */
.form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .4rem; }
.field label {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: .1em;
  font-size: .88rem; font-weight: 700; color: var(--teal-800);
}
.field input, .field textarea, .field select {
  font-family: inherit; font-size: 1rem; color: var(--ink);
  padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  transition: border-color .18s, box-shadow .18s;
  width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--teal-500); box-shadow: 0 0 0 4px rgba(29, 147, 163, .14);
}
.field textarea { min-height: 150px; resize: vertical; }
.field--check { display: flex; gap: .7rem; align-items: flex-start; }
.field--check input { width: auto; margin-top: .25rem; }
.field--check label { text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-weight: 400; font-size: .92rem; color: var(--muted); }
.hp { position: absolute; left: -9999px; }

.alert { border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1.4rem; font-size: .97rem; }
.alert--ok { background: var(--lime-100); border: 1px solid var(--lime); color: #4E5A00; }
.alert--err { background: #FDECEC; border: 1px solid #F3B7B7; color: #8E2020; }
.alert--info { background: var(--teal-50); border: 1px solid var(--teal-100); color: var(--teal-800); }

/* ---------- banner de cookies ---------- */
.cookies {
  position: fixed; inset: auto 0 0 0; z-index: 120;
  padding: 1rem; display: flex; justify-content: center;
  animation: cookiesEntra .35s ease;
}
@keyframes cookiesEntra { from { transform: translateY(100%); } to { transform: none; } }
.cookies__caja {
  background: var(--teal-950); color: #C9DDE0;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 1.4rem 1.6rem; width: min(100%, 720px);
  border: 1px solid rgba(255, 255, 255, .12);
}
.cookies__titulo { color: #fff; font-size: 1.25rem; margin-bottom: .5rem; }
.cookies__texto { font-size: .93rem; line-height: 1.6; margin-bottom: 1rem; }
.cookies__texto a { color: var(--lime); text-decoration: underline; }
.cookies__opciones { display: grid; gap: .7rem; margin-bottom: 1.1rem; }
.cookies__op { display: flex; gap: .7rem; align-items: flex-start; font-size: .9rem; line-height: 1.5; }
.cookies__op input { margin-top: .3rem; flex: 0 0 auto; accent-color: var(--lime); }
.cookies__op strong { color: #fff; }
.cookies__botones { display: flex; flex-wrap: wrap; gap: .6rem; }
.cookies__botones .btn--outline { border-color: rgba(255, 255, 255, .65); color: #fff; background: rgba(255, 255, 255, .06); }
.cookies__botones .btn--outline:hover { background: #fff; color: var(--teal-900); border-color: #fff; }
@media (max-width: 560px) {
  .cookies { padding: .6rem; }
  .cookies__botones .btn { flex: 1 1 100%; }
}

/* ---------- vídeos de YouTube ---------- */
.yt {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  border-radius: var(--radius-lg); overflow: hidden;
  background: var(--teal-900); margin: 1.6rem 0;
}
.yt iframe { width: 100%; height: 100%; border: 0; display: block; }
.video__aviso {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .6rem;
  text-align: center; padding: 1.5rem; color: #C9DDE0;
}
.video__aviso p { margin: 0; font-size: .95rem; max-width: 46ch; }
.video__aviso strong { color: #fff; font-family: var(--font-display); font-size: 1.2rem; text-transform: uppercase; letter-spacing: .04em; }
.video__aviso .btn { margin-top: .4rem; }

/* ---------- páginas legales ---------- */
.legal-nav {
  display: flex; flex-wrap: wrap; gap: .6rem;
  margin-bottom: 3rem; padding-bottom: 1.6rem; border-bottom: 1px solid var(--line);
}
.legal-nav a {
  font-family: var(--font-display); text-transform: uppercase; font-weight: 700;
  font-size: 1rem; letter-spacing: .06em;
  padding: .5rem 1.1rem; border: 1px solid var(--line); border-radius: 999px;
  color: var(--teal-700); background: #fff;
}
.legal-nav a:hover { background: var(--teal-600); border-color: var(--teal-600); color: #fff; }

.legal-doc { max-width: 78ch; }
.legal-doc--sep { margin-top: 4rem; padding-top: 3rem; border-top: 2px solid var(--line); }
.legal-doc__titulo {
  font-size: clamp(1.8rem, 3.2vw, 2.4rem); color: var(--teal-700);
  padding-bottom: .5rem; border-bottom: 3px solid var(--lime); display: inline-block;
}
.legal-doc h2 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); margin-top: 2.6rem; color: var(--ink); }
.legal-doc h3 {
  font-size: 1.12rem; margin-top: 1.8rem; color: var(--teal-700);
  letter-spacing: .02em;
}
.legal-doc p, .legal-doc li { font-size: .99rem; }
.legal-fecha {
  margin-top: 3rem; padding-top: 1.4rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .9rem;
}

.bases__titulo {
  font-size: clamp(1.3rem, 2.4vw, 1.75rem); color: var(--teal-700);
  margin-top: 2.8rem; padding-bottom: .4rem;
  border-bottom: 2px solid var(--lime); display: inline-block;
}
.bases__titulo:first-child { margin-top: 0; }
.legal-doc h2[id] { scroll-margin-top: calc(var(--header-h) + 24px); }

/* tabla (cookies) */
.tabla-scroll { overflow-x: auto; margin: 1.6rem 0 2rem; -webkit-overflow-scrolling: touch; }
.tabla {
  border-collapse: collapse; width: 100%; min-width: 660px;
  font-size: .92rem; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.tabla th {
  background: var(--teal-900); color: #fff; text-align: left;
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: .08em;
  font-size: .9rem; font-weight: 700; padding: .8rem 1rem; white-space: nowrap;
}
.tabla td { padding: .8rem 1rem; border-top: 1px solid var(--line); vertical-align: top; }
.tabla tr:nth-child(even) td { background: var(--teal-50); }
.tabla code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88rem;
  background: var(--surface); padding: .12rem .4rem; border-radius: 5px; white-space: nowrap;
}

.site-footer__legal { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }

/* ---------- pie ---------- */
.site-footer { background: var(--teal-950); color: #8FB2B8; padding: clamp(3rem, 6vw, 4.5rem) 0 0; }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 2.5rem; padding-bottom: 3rem; }
.site-footer h4 {
  color: #fff; font-size: 1.1rem; letter-spacing: .1em; margin-bottom: 1.1rem;
}
.site-footer a { color: #8FB2B8; }
.site-footer a:hover { color: var(--lime); }
.site-footer ul li { list-style: none; margin-bottom: .55rem; }
.site-footer__logo { background: #fff; border-radius: 12px; padding: .9rem 1rem; display: inline-block; margin-bottom: 1.2rem; }
.site-footer__logo img { height: 46px; }
.site-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, .1); padding: 1.4rem 0;
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
  font-size: .87rem;
}
.social-row { display: flex; gap: .8rem; }
.social-row a {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .07); transition: .2s;
}
.social-row a:hover { background: var(--orange); color: #fff; }
.social-row svg { width: 18px; height: 18px; }

.nav-overlay {
  position: fixed; inset: 0; background: rgba(6, 42, 48, .5);
  opacity: 0; transition: opacity .28s ease; z-index: 80;
}
.nav-overlay.is-open { opacity: 1; }

/* ---------- animación de entrada ---------- */
html.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
html.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
/* el menú tiene 7 enlaces: en pantallas intermedias hay que apretarlo */
@media (max-width: 1320px) {
  .nav { gap: 1.15rem; }
  .nav a { font-size: .98rem; letter-spacing: .02em; }
  .header-actions .btn--sm { padding: .6rem 1rem; font-size: .92rem; }
  .brand img { height: 44px; }
}

@media (max-width: 1000px) {
  .hero__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1120px) {
  .nav {
    position: fixed; inset: 0 0 0 auto; width: min(320px, 84vw);
    background: #fff; flex-direction: column; align-items: flex-start;
    padding: calc(var(--header-h) + 1.5rem) 1.8rem 2rem; gap: 1.2rem;
    transform: translateX(100%); transition: transform .28s ease;
    box-shadow: -20px 0 50px rgba(7, 51, 58, .18); z-index: 95;
    overflow-y: auto;
  }

  .nav.is-open { transform: none; }
  .nav a { font-size: 1.3rem; }
  .nav-toggle { display: inline-flex; }
  .topbar__facts span:nth-child(n+3) { display: none; }
  .grid--3, .grid--2, .prices, .prices--1, .prices--2, .prices--4, .split { grid-template-columns: 1fr; }
  .hero__facts .wrap { grid-template-columns: repeat(2, 1fr); }
  .fact:nth-child(2) { border-right: 0; }
  .fact:nth-child(-n+2) { border-bottom: 1px solid rgba(255, 255, 255, .14); }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .grid--4, .grid--auto { grid-template-columns: 1fr; }
  .site-footer__grid { grid-template-columns: 1fr; }
  .countdown__grid { gap: .4rem; }
  .topbar__facts span:nth-child(n+2) { display: none; }
  .route__item { grid-template-columns: 46px 1fr; gap: .9rem; }
  .route__num { width: 46px; height: 46px; font-size: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- impresión ---------- */
@media print {
  .topbar, .site-header, .cta-band, .site-footer, .btn { display: none !important; }
  body { font-size: 12pt; color: #000; }
  .rule__body { display: block !important; }
}

.nav__cta { display: none; }

/* ---------- cabecera en móvil ---------- */
@media (max-width: 1120px) {
  .nav__cta { display: inline-flex; margin-top: .6rem; }
}
@media (max-width: 620px) {
  .header-actions > .btn--primary { display: none; }
  .brand img { height: 42px; }
  :root { --header-h: 66px; }
}

/* ---------- ajuste de las ondas sobre fondo naranja ---------- */
.cta-band__waves { opacity: 1; }
.cta-band__waves path { fill: #fff; }
.cta-band__waves path:nth-child(1) { opacity: .14; }
.cta-band__waves path:nth-child(2) { opacity: .22; }
.cta-band__waves path:nth-child(3) { opacity: .34; }

/* ---------- ondas sobre las cabeceras oscuras ---------- */
.page-hero__waves, .hero__waves { opacity: 1; }
.page-hero__waves path, .hero__waves path { fill: #fff; }
.page-hero__waves path:nth-child(1), .hero__waves path:nth-child(1) { opacity: .05; }
.page-hero__waves path:nth-child(2), .hero__waves path:nth-child(2) { opacity: .08; }
.page-hero__waves path:nth-child(3), .hero__waves path:nth-child(3) { opacity: .13; }

/* ---------- submenú de la cabecera (La Cursa ▸ Inscripciones / Recorrido / Reglamento) ---------- */
.nav__grupo { position: relative; display: flex; align-items: center; gap: .2rem; }
.nav__abrir {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--teal-900); border-radius: 6px;
}
.nav__abrir svg { width: 16px; height: 16px; transition: transform .2s ease; }
.nav__abrir:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.nav__sub {
  position: absolute; top: calc(100% + 14px); left: -1rem; min-width: 220px; z-index: 60;
  display: flex; flex-direction: column; gap: .1rem; padding: .55rem;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
/* puente invisible para que el ratón no «caiga» en el hueco entre el enlace y el panel */
.nav__sub::before { content: ""; position: absolute; left: 0; right: 0; top: -16px; height: 16px; }
.nav__grupo:hover .nav__sub,
.nav__grupo:focus-within .nav__sub,
.nav__grupo.is-open .nav__sub { opacity: 1; visibility: visible; transform: none; }
.nav__grupo:hover .nav__abrir svg,
.nav__grupo.is-open .nav__abrir svg { transform: rotate(180deg); }
.nav .nav__sub a { padding: .6rem .85rem; border-radius: 9px; font-size: 1rem; }
.nav .nav__sub a::after { display: none; }
.nav .nav__sub a:hover, .nav .nav__sub a.is-active { background: var(--teal-50); color: var(--teal-600); }

@media (max-width: 1120px) {
  .nav__grupo { flex-wrap: wrap; width: 100%; }
  .nav__abrir { display: none; }
  .nav__sub {
    position: static; flex-basis: 100%; min-width: 0; margin-top: .7rem;
    opacity: 1; visibility: visible; transform: none; box-shadow: none;
    border: 0; border-left: 2px solid var(--line); border-radius: 0;
    padding: 0 0 0 1rem; gap: .7rem; background: none;
  }
  .nav__sub::before { display: none; }
  .nav .nav__sub a { font-size: 1.1rem; padding: 0; background: none; color: var(--muted); }
  .nav .nav__sub a.is-active { color: var(--teal-600); background: none; }
}

/* ---------- página ASG ---------- */
.asg-hero__titulo { max-width: 24ch; font-size: clamp(2.2rem, 4.6vw, 3.8rem); line-height: 1.02; }
.asg-rueda { margin: 0; justify-self: center; max-width: 440px; }
.asg-rueda img { width: 100%; height: auto; display: block; }

.asg-ods-logo { width: min(340px, 80%); height: auto; margin: 0 auto 1.4rem; display: block; }
.asg-ods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem; max-width: 1000px; margin-inline: auto; }
.asg-ods__item {
  display: grid; grid-template-columns: auto 1fr; gap: 1.4rem; align-items: center;
  background: #fff; border-radius: var(--radius-lg); padding: 1.6rem;
  border: 1px solid var(--line); border-left: 6px solid var(--ods); box-shadow: var(--shadow-sm);
}
.asg-ods__num {
  width: 92px; height: 92px; border-radius: 16px; background: var(--ods); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 2.7rem; line-height: .9;
}
.asg-ods__num span { font-size: .85rem; letter-spacing: .14em; font-weight: 700; opacity: .9; margin-bottom: .2rem; }
.asg-ods__item h3 { color: var(--ods); margin-bottom: .35rem; }
.asg-ods__item p { color: var(--muted); margin: 0; }

.asg-cert { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.asg-cert__card { position: sticky; top: calc(var(--header-h) + 1.5rem); padding: 2.2rem; }
.asg-cert__mail { margin-top: .8rem; font-size: .9rem; color: var(--muted); word-break: break-all; }

.asg-marco__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.asg-marco__n {
  font-family: var(--font-display); font-weight: 800; font-size: 2.6rem; line-height: 1;
  color: var(--teal-100, #D5ECEF);
}
.asg-marco__texto p { font-size: .98rem; color: var(--muted); }
.asg-marco__texto p + p, .asg-marco__texto ul { margin-top: .7rem; }
.asg-marco__texto ul { padding-left: 1.1rem; color: var(--muted); font-size: .98rem; }
.asg-marco__texto li + li { margin-top: .45rem; }

.asg-cierre { color: rgba(255, 255, 255, .92); margin: 0 auto 1rem; max-width: 60ch; }
.asg-lema { color: #fff; }

@media (max-width: 1120px) {
  .asg-cert { grid-template-columns: 1fr; }
  .asg-cert__card { position: static; }
}
@media (max-width: 760px) {
  .asg-ods { grid-template-columns: 1fr; }
  .asg-ods__num { width: 76px; height: 76px; font-size: 2.2rem; }
}
@media (max-width: 1120px) {
  .nav a.nav__cta { font-size: 1.05rem; padding: .85rem 1.7rem; }
  .nav a.nav__cta::after { display: none; }
}
/* la sombra del menú lateral solo cuando está abierto (si no, asoma por el borde derecho) */
@media (max-width: 1120px) {
  .nav { box-shadow: none; }
  .nav.is-open { box-shadow: -20px 0 50px rgba(7, 51, 58, .18); }
}
