/* =========================================================================
   Agonza Sports — Header
   Paleta:  verde #084734 / verde oscuro #08281f / lima #cef17b
            verde claro #edeabf / crema #fdf7eb / negro #000202
   Fuentes: Darker Grotesque (titulares) · Poppins (texto)
   ========================================================================= */

:root {
	--ag-green:        #084734;
	--ag-green-dark:   #08281f;
	--ag-lime:         #cef17b;
	--ag-sand:         #edeabf;
	--ag-cream:        #fdf7eb;
	--ag-black:        #000202;
	--ag-white:        #ffffff;

	--ag-font-head: "Darker Grotesque", system-ui, sans-serif;
	--ag-font-body: "Poppins", system-ui, sans-serif;

	--ag-header-h: 84px;
	--ag-radius:   999px;
	--ag-radius-mega: 20px;
	--ag-shadow:   0 18px 50px rgba(8, 40, 31, .14);
	--ag-ease:     cubic-bezier(.22, 1, .36, 1);
	--ag-maxw:     1280px;
	--ag-maxw-wide: 1410px;
}

/* ----- Accesibilidad ----- */

/* Foco visible global.
   Sin esto el navegador pinta su anillo por defecto (negro) en todo lo que no
   tenga estilo propio: botones, campos de formulario, acordeones, flechas…
   Va con :where() para que no suba la especificidad y cualquier componente
   pueda seguir definiendo el suyo. El anillo verde se ve sobre fondos claros y
   el halo lima sobre los oscuros, así vale en todo el sitio.
   Solo se activa con teclado (:focus-visible), no al hacer clic. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--ag-green);
	outline-offset: 2px;
	box-shadow: 0 0 0 4px rgba(206, 241, 123, .55);
}

/* Los botones son pastillas: el anillo debe seguir su forma. */
.ag-btn:focus-visible {
	outline: 2px solid var(--ag-green);
	outline-offset: 3px;
	border-radius: var(--ag-radius);
	box-shadow: 0 0 0 4px rgba(206, 241, 123, .55);
}
/* Sobre fondo oscuro el verde se pierde: manda el lima. */
.ag-btn--light:focus-visible,
.ag-btn--ghost:focus-visible {
	outline-color: var(--ag-lime);
	box-shadow: 0 0 0 4px rgba(255, 255, 255, .35);
}


.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 1000;
	background: var(--ag-green);
	color: #fff;
	padding: 10px 16px;
	border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* =========================================================================
   HEADER BASE
   ========================================================================= */
.ag-header {
	position: sticky;
	top: 0;
	z-index: 200;
	background: var(--ag-white);
	border-bottom: 1px solid rgba(8, 40, 31, .06);
}

.ag-header__inner {
	max-width: var(--ag-maxw-wide);
	margin: 0 auto;
	min-height: var(--ag-header-h);
	padding: 12px 24px;
	display: flex;
	align-items: center;
	gap: 24px;
}

.ag-header__logo { flex: 0 0 auto; display: flex; align-items: center; }

/* Logo SVG inline (tintable con currentColor) */
.ag-logo {
	display: inline-flex;
	align-items: center;
	color: var(--ag-green);          /* tinta el SVG vía currentColor */
	text-decoration: none;
	transition: color .2s var(--ag-ease);
}
.ag-logo p{margin-bottom:0!important;}
.ag-logo svg { display: block; height: 48px; width: auto; }
.ag-logo img { max-height: 48px; width: auto; height: auto; display: block; }
.ag-logo__text {
	font-family: var(--ag-font-head);
	font-weight: 800;
	font-size: 1.6rem;
	color: var(--ag-green);
}
.ag-logo--mobile svg { height: 40px; }
.ag-logo--mobile img { max-height: 40px; }

/* =========================================================================
   NAV ESCRITORIO
   ========================================================================= */
.ag-nav { flex: 1 1 auto; display: flex; justify-content: center; }

.ag-nav__menu {
	display: flex;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ag-nav__menu > li { position: relative; }

.ag-nav__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--ag-font-body);
	font-weight: 500;
	font-size: .98rem;
	line-height: 1;
	color: var(--ag-green-dark);
	text-decoration: none;
	padding: 12px 14px;
	border-radius: 12px;
	white-space: nowrap;
	transition: color .2s var(--ag-ease), background .2s var(--ag-ease);
}
.ag-nav__link:hover,
.ag-nav__link:focus-visible { color: var(--ag-green); background: rgba(206, 241, 123, .22); }

.ag-caret { transition: transform .25s var(--ag-ease); }

/* ----- Dropdown clásico (nivel 1 / 2) ----- */
.ag-sub-menu {
	list-style: none;
	margin: 0;
	padding: 8px;
	position: absolute;
	top: calc(100% + 10px);
	left: 0;
	min-width: 240px;
	background: var(--ag-white);
	border-radius: 16px;
	box-shadow: var(--ag-shadow);
	border: 1px solid rgba(8, 40, 31, .06);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(8px);
	transition: opacity .22s var(--ag-ease), transform .22s var(--ag-ease), visibility .22s;
	z-index: 50;
}

/* Submenú de 3er nivel: se abre al lado */
.ag-sub-menu .ag-sub-menu {
	top: -8px;
	left: calc(100% + 6px);
	transform: translateX(8px);
}

.ag-sub-menu > li { position: relative; }

/* Puente invisible entre el item y el dropdown (evita zona muerta al cruzar) */
.ag-nav__menu > li > .ag-sub-menu::before {
	content: "";
	position: absolute;
	top: -12px;
	left: 0;
	right: 0;
	height: 12px;
}

.ag-sub-menu .ag-nav__link {
	display: flex;
	justify-content: space-between;
	width: 100%;
	padding: 10px 12px;
	border-radius: 10px;
	font-size: .92rem;
}

/* Mostrar dropdown: nivel 0 por JS (is-open), niveles internos por hover */
.ag-nav__menu > li.is-open > .ag-sub-menu,
.ag-nav__menu .ag-sub-menu li:hover > .ag-sub-menu,
.ag-nav__menu .ag-sub-menu li:focus-within > .ag-sub-menu,
.ag-nav__menu li:focus-within > .ag-sub-menu {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
}
.ag-sub-menu .ag-sub-menu { } /* override transform en 3er nivel */
.ag-nav__menu .ag-sub-menu li:hover > .ag-sub-menu,
.ag-nav__menu .ag-sub-menu li:focus-within > .ag-sub-menu {
	transform: translateX(0);
}

.ag-nav__menu li:hover > .ag-nav__link .ag-caret,
.ag-nav__menu li.is-open > .ag-nav__link .ag-caret { transform: rotate(180deg); }

/* =========================================================================
   MEGA MENÚ  (items de nivel 0 con data-mega="true")
   El submenú de nivel 1 se convierte en panel ancho multicolumna.
   ========================================================================= */
/* El li mega mantiene position relative para anclar su propio panel,
   pero el panel se centra respecto al header con left fijo. */
.ag-nav__menu > li[data-mega] { position: relative; }

li[data-mega] > .ag-sub-menu {
	position: fixed;
	top: calc(var(--ag-header-h) - 6px);
	left: 50%;
	transform: translate(-50%, 28px);
	width: min(var(--ag-maxw), calc(100vw - 48px));
	max-width: var(--ag-maxw);
	border-radius: var(--ag-radius-mega);
	padding: 28px;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 8px 28px;
	background: linear-gradient(180deg, var(--ag-cream) 0%, var(--ag-white) 60%);
}
/* Puente del mega: zona invisible bajo el item Formación que conecta
   con el panel, sin tapar el resto del header. */
li[data-mega] > .ag-nav__link::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	height: 18px;
}
li[data-mega].is-open > .ag-sub-menu {
	transform: translate(-50%, 0);
}

/* Cada columna = item de nivel 1 dentro del mega */
li[data-mega] > .ag-sub-menu > li {
	break-inside: avoid;
	min-width: 0;
}
li[data-mega] > .ag-sub-menu > li > .ag-nav__link span { white-space: normal; }
li[data-mega] .ag-sub-menu .ag-sub-menu .ag-nav__link span { white-space: normal; }

li[data-mega] > .ag-sub-menu > li > .ag-nav__link {
	font-family: var(--ag-font-head);
	font-weight: 700;
	font-size: 1.18rem;
	color: var(--ag-green);
	padding: 6px 8px;
	pointer-events: auto;
}
li[data-mega] > .ag-sub-menu > li > .ag-nav__link .ag-caret { display: none; }

/* Dentro del mega, el 3er nivel se aplana como lista vertical (no flotante) */
li[data-mega] .ag-sub-menu .ag-sub-menu {
	position: static;
	opacity: 1;
	visibility: visible;
	transform: none;
	box-shadow: none;
	border: 0;
	background: transparent;
	min-width: 0;
	padding: 0 0 8px 8px;
}
/* Nivel 3 = subtítulo de grupo (solo hijo directo, no afecta al nivel 4) */
li[data-mega] .ag-sub-menu .ag-sub-menu > li > .ag-nav__link {
	font-family: var(--ag-font-head);
	font-weight: 600;
	font-size: 1.2rem;
	color: var(--ag-green);
	opacity: 1;
	text-transform: none;
	padding: 6px 8px;
}
li[data-mega] .ag-sub-menu .ag-sub-menu > li > .ag-nav__link:hover { opacity: 1; color: var(--ag-green); }
li[data-mega] .ag-sub-menu .ag-sub-menu > li > .ag-nav__link .ag-caret { display: none; }

/* Nivel 4: colapsado por defecto, se despliega al pasar el ratón
   (o enfocar) el item de nivel 3 que lo contiene. */
li[data-mega] .ag-sub-menu .ag-sub-menu .ag-sub-menu {
	position: static;
	opacity: 0 !important;
	visibility: hidden !important;
	transform: none;
	box-shadow: none;
	border: 0;
	background: transparent;
	min-width: 0;
	padding: 0 0 0 10px;
	margin: 0 0 0 4px;
	border-left: 0;
	max-height: 0 !important;
	overflow: hidden;
	transition: max-height .3s var(--ag-ease), opacity .25s var(--ag-ease), padding .3s var(--ag-ease), margin-top .3s var(--ag-ease);
}
/* Al pasar el ratón / enfocar el li de nivel 3, se expande su nivel 4 */
li[data-mega] .ag-sub-menu .ag-sub-menu > li:hover > .ag-sub-menu,
li[data-mega] .ag-sub-menu .ag-sub-menu > li:focus-within > .ag-sub-menu {
	opacity: 1 !important;
	visibility: visible !important;
	max-height: 600px !important;
	padding: 2px 0 6px 10px;
	margin-top: 2px;
}
li[data-mega] .ag-sub-menu .ag-sub-menu .ag-sub-menu .ag-nav__link {
	font-family: var(--ag-font-body);
	font-weight: 400;
	font-size: 1rem;
	color: var(--ag-green-dark);
	opacity: .8;
	padding: 4px 8px;
}
li[data-mega] .ag-sub-menu .ag-sub-menu .ag-sub-menu .ag-nav__link:hover { opacity: 1; color: var(--ag-green); }

/* El nivel 3 con hijos muestra su caret (indica que es desplegable) y lo gira */
li[data-mega] .ag-sub-menu .ag-sub-menu > li.menu-item-has-children > .ag-nav__link .ag-caret {
	display: inline-block;
	width: 10px; height: 10px;
	margin-left: 4px;
	transition: transform .25s var(--ag-ease);
}
li[data-mega] .ag-sub-menu .ag-sub-menu > li.menu-item-has-children:hover > .ag-nav__link .ag-caret,
li[data-mega] .ag-sub-menu .ag-sub-menu > li.menu-item-has-children:focus-within > .ag-nav__link .ag-caret {
	transform: rotate(180deg);
}

/* =========================================================================
   BOTONES
   Estructura: <a class="ag-btn ag-btn--primary"><div class="ag-btn__text">..</div><div class="ag-btn__icon">svg</div></a>
   El relleno va en __text y __icon, no en el <a>.
   ========================================================================= */
.ag-header__cta { flex: 0 0 auto; }

.ag-btn {
	display: inline-flex;
	align-items: center;
	gap: 0px;
	font-family: var(--ag-font-body);
	font-weight: 400;
	font-size: 16px;
	text-decoration: none;
	transition: transform .2s var(--ag-ease), background .2s var(--ag-ease), box-shadow .2s var(--ag-ease);
}

.ag-btn__text { line-height: 1; white-space: nowrap; }
.ag-btn__icon svg { display: block; }

/* ----- Icono (círculo/pastilla) ----- */
.ag-btn__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 8px;
	flex: 0 0 auto;
	border-radius: var(--ag-radius);
	transition: transform .3s var(--ag-ease), background .2s var(--ag-ease), box-shadow .2s var(--ag-ease);
}

/* ----- PRIMARIO: texto relleno verde + icono relleno verde ----- */
.ag-btn--primary .ag-btn__text {
	color: #fff;
	height: 40px;
	padding: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--ag-green);
	border-radius: var(--ag-radius);
}
.ag-btn--primary .ag-btn__icon { background: var(--ag-green); color: #fff; }
.ag-btn--primary:hover .ag-btn__text { background: var(--ag-lime); color: var(--ag-green-dark); box-shadow: var(--ag-shadow); }
.ag-btn--primary:hover .ag-btn__icon { background: var(--ag-lime); color: var(--ag-green-dark); transform: rotate(45deg); box-shadow: var(--ag-shadow); }

/* ----- SECUNDARIO: igual que el primario pero relleno transparente
        y flecha a la IZQUIERDA del texto ----- */
.ag-btn--secondary { flex-direction: row-reverse; }
.ag-btn--secondary .ag-btn__text {
	color: var(--ag-green-dark);
	height: 40px;
	padding: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	border-radius: var(--ag-radius);
}
.ag-btn--secondary .ag-btn__icon { background: var(--ag-green); color: #fff; }
.ag-btn--secondary:hover .ag-btn__text { background: var(--ag-lime); color: var(--ag-green-dark); border-color: var(--ag-lime); }
.ag-btn--secondary:hover .ag-btn__icon { background: var(--ag-lime); color: var(--ag-green-dark); transform: rotate(45deg); }

/* ----- GHOST (sobre imagen/oscuro): texto translúcido ----- */
.ag-btn--ghost .ag-btn__text {
	color: #fff;
	height: 40px;
	padding: 12px;
	display: inline-flex;
	align-items: center;
	background: rgba(255,255,255,.12);
	border-radius: var(--ag-radius);
}
.ag-btn--ghost .ag-btn__icon { background: rgba(255,255,255,.2); color: #fff; }
.ag-btn--ghost:hover .ag-btn__icon { background: var(--ag-lime); color: var(--ag-green-dark); transform: rotate(45deg); }

/* ----- LIGHT (sobre verde): texto blanco ----- */
.ag-btn--light .ag-btn__text {
	color: var(--ag-green-dark);
	height: 40px;
	padding: 12px;
	display: inline-flex;
	align-items: center;
	background: #fff;
	border-radius: var(--ag-radius);
}
.ag-btn--light .ag-btn__text:hover{ background: var(--ag-lime); color: var(--ag-green-dark); }
.ag-btn--light .ag-btn__icon { background: var(--ag-white); color: var(--ag-green); }
.ag-btn--light:hover .ag-btn__icon { background: var(--ag-lime); color: var(--ag-green-dark); transform: rotate(45deg); }

.ag-btn--block { width: 100%; }
.ag-btn--block .ag-btn__text { flex: 1 1 auto; }

/* Botón secundario sobre fondo oscuro (hero): texto e icono claros */
.ag-hero .ag-btn--secondary .ag-btn__text { color: #fff; border-color:none; }
.ag-hero .ag-btn--secondary .ag-btn__text:hover { color: var(--ag-green-dark); }

/* =========================================================================
   HAMBURGUESA + OFF-CANVAS (MÓVIL)
   ========================================================================= */
.ag-burger {
	display: none;
	flex-direction: column;
	gap: 5px;
	width: 46px;
	height: 46px;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 0;
	border-radius: 12px;
	cursor: pointer;
}
.ag-burger__line {
	width: 24px; height: 2px;
	background: var(--ag-green-dark);
	border-radius: 2px;
	transition: transform .3s var(--ag-ease), opacity .2s var(--ag-ease);
}

.ag-offcanvas {
	position: fixed;
	inset: 0;
	z-index: 300;
	visibility: hidden;
	pointer-events: none;
}
.ag-offcanvas.is-active { visibility: visible; pointer-events: auto; }

.ag-offcanvas__overlay {
	position: absolute;
	inset: 0;
	background: rgba(8, 40, 31, .45);
	opacity: 0;
	transition: opacity .3s var(--ag-ease);
}
.ag-offcanvas.is-active .ag-offcanvas__overlay { opacity: 1; }

.ag-offcanvas__panel {
	position: absolute;
	top: 0; right: 0;
	height: 100%;
	width: min(420px, 88vw);
	background: var(--ag-cream);
	box-shadow: var(--ag-shadow);
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform .35s var(--ag-ease);
	overflow-y: auto;
}
.ag-offcanvas.is-active .ag-offcanvas__panel { transform: translateX(0); }

.ag-offcanvas__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 22px;
	border-bottom: 1px solid rgba(8, 40, 31, .1);
}
.ag-offcanvas__head .ag-logo svg { height: 40px; }
.ag-offcanvas__head img,
.ag-offcanvas__head .custom-logo { max-height: 40px; width: auto; }
.ag-offcanvas__close {
	background: transparent; border: 0; cursor: pointer;
	color: var(--ag-green-dark); padding: 6px; border-radius: 10px;
}
.ag-offcanvas__close:hover { background: rgba(8, 40, 31, .08); }

/* ----- Acordeón móvil ----- */
.ag-offcanvas__nav { flex: 1 1 auto; padding: 10px 14px; }

.ag-mobile-menu, .ag-mobile-sub { list-style: none; margin: 0; padding: 0; }

.ag-mobile-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.ag-mobile-link {
	flex: 1 1 auto;
	display: block;
	font-family: var(--ag-font-body);
	font-weight: 500;
	font-size: 1.02rem;
	color: var(--ag-green-dark);
	text-decoration: none;
	padding: 14px 10px;
}
.ag-mobile-menu > .ag-mobile-item > .ag-mobile-row > .ag-mobile-link {
	font-family: var(--ag-font-head);
	font-weight: 700;
	font-size: 1.25rem;
	color: var(--ag-green);
}
.ag-mobile-toggle {
	flex: 0 0 auto;
	background: transparent; border: 0; cursor: pointer;
	color: var(--ag-green); padding: 10px; border-radius: 10px;
	transition: transform .25s var(--ag-ease);
}
.ag-mobile-toggle[aria-expanded="true"] { transform: rotate(180deg); }

.ag-mobile-item { border-bottom: 1px solid rgba(8, 40, 31, .08); }
.ag-mobile-sub .ag-mobile-item { border-bottom: 0; }

/* Submenús colapsados (cerrados por defecto) */
.ag-mobile-sub {
	overflow: hidden;
	max-height: 0;
	opacity: 0;
	visibility: hidden;
	padding-left: 14px;
	transition: max-height .35s var(--ag-ease), opacity .25s var(--ag-ease), visibility .35s;
}
.ag-mobile-item.is-open > .ag-mobile-sub {
	max-height: 2000px;
	opacity: 1;
	visibility: visible;
}

/* Sangrado por nivel */
.ag-mobile-sub[data-depth="2"] { padding-left: 22px; }
.ag-mobile-sub[data-depth="3"] { padding-left: 34px; }
.ag-mobile-sub[data-depth="4"] { padding-left: 46px; }
.ag-mobile-sub .ag-mobile-link { font-size: .95rem; font-weight: 400; }

.ag-offcanvas__cta { padding: 18px 22px 28px; }

/* =========================================================================
   BREAKPOINTS
   ========================================================================= */
@media (max-width: 1080px) {
	.ag-nav,
	.ag-header__cta { display: none; }
	.ag-burger { display: flex; }
	.ag-header__inner { justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
	* { transition-duration: .01ms !important; }
}
/* Ajustes mega menú: fondo del panel y tamaño de items de nivel 3 */
li[data-mega] > .ag-sub-menu { background: var(--ag-white); }
.ag-sub-menu--depth-2 > li { font-size: 12px; }

/* Badge de sección global (pill lima + punto verde) — sistema de diseño */
.ag-badge {
	display: inline-flex; align-items: center; gap: 8px;
	font-size: .82rem; font-weight: 600; color: var(--ag-green-dark);
	background: var(--ag-lime); padding: 8px 16px; border-radius: 999px;
	align-self: flex-start; margin-bottom: 14px;
}
.ag-badge__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ag-green); flex: 0 0 auto; }

/* Salvaguardas responsive globales */
/* OJO: overflow-x:hidden en <body> convierte el body en contenedor de scroll
   y anula el position:sticky del header. En <html> se propaga al viewport y no
   da problemas; en <body> se usa clip, que recorta sin crear ese contenedor. */
html { max-width: 100%; overflow-x: hidden; }
body { max-width: 100%; overflow-x: clip; }
img, svg, video { max-width: 100%; height: auto; }
* { box-sizing: border-box; }
