/* ==========================================================================
   AI360 Theme — navegación principal (0.5.0)
   Marcado propio del tema (.ai360-nav): menú en línea en escritorio y panel
   desplegable accesible por debajo de 1200px. Sin dependencias externas.
   ========================================================================== */

.ai360-head {
	position: sticky;
	top: 0;
	z-index: 50;
	width: 100%;
	background: var(--wp--preset--color--base, #fff);
	border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.ai360-head__main {
	width: min(100%, 1240px);
	margin-inline: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: clamp(8px, 1.5vw, 20px);
	padding: 12px clamp(16px, 3vw, 40px);
	box-sizing: border-box;
}

.ai360-head__main > .ai360-brand {
	flex: 0 1 auto;
	min-width: 0;
	max-width: 220px;
}

/* --------------------------------------------------------------------------
   Escritorio (>=1200px): menú en fila, compacto
   -------------------------------------------------------------------------- */
.ai360-nav {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	justify-content: flex-end;
}

.ai360-nav__toggle { display: none; }

.ai360-nav__panel[hidden] { display: none; }

.ai360-nav__panel { display: flex; justify-content: flex-end; }

.ai360-nav__list {
	display: flex;
	flex-wrap: wrap;
	max-width: 100%;
	align-items: center;
	justify-content: flex-end;
	gap: clamp(8px, 1vw, 16px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.ai360-nav__list li { position: relative; }

.ai360-nav__list a {
	display: inline-block;
	padding: 8px 1px;
	font-size: .875rem;
	font-weight: 500;
	line-height: 1.3;
	color: inherit;
	text-decoration: none;
	border-bottom: 2px solid transparent;
	transition: border-color .18s ease, color .18s ease;
}

.ai360-nav__list a:hover,
.ai360-nav__list a:focus-visible {
	border-bottom-color: currentColor;
	outline: none;
}

.ai360-nav__list .current-menu-item > a,
.ai360-nav__list .current_page_item > a,
.ai360-nav__list a[aria-current="page"] {
	border-bottom-color: currentColor;
	font-weight: 600;
}

/* Submenús en escritorio */
.ai360-nav__list .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 20;
	display: none;
	min-width: 220px;
	margin: 0;
	padding: 8px;
	list-style: none;
	background: var(--wp--preset--color--base, #fff);
	border-radius: 12px;
	box-shadow: 0 18px 40px rgba(0, 0, 0, .14);
}

.ai360-nav__list li:hover > .sub-menu,
.ai360-nav__list li:focus-within > .sub-menu { display: block; }

.ai360-nav__list .sub-menu a {
	display: block;
	width: 100%;
	padding: 10px 12px;
	border: 0;
	border-radius: 8px;
	white-space: normal;
}

.ai360-nav__list .sub-menu a:hover { background: rgba(0, 0, 0, .05); }

/* --------------------------------------------------------------------------
   Móvil / tablet (<1200px): botón y panel a pantalla completa
   -------------------------------------------------------------------------- */
@media (max-width: 1199px) {
	.ai360-nav { justify-content: flex-end; }

	.ai360-nav__toggle {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		min-height: 44px;
		padding: 0 16px;
		border: 1px solid rgba(0, 0, 0, .18);
		border-radius: 999px;
		background: transparent;
		color: inherit;
		font: inherit;
		font-weight: 600;
		cursor: pointer;
	}

	.ai360-nav__toggle:focus-visible {
		outline: 3px solid currentColor;
		outline-offset: 3px;
	}

	.ai360-nav__icon-close { display: none; }
	.ai360-nav.is-open .ai360-nav__icon-open { display: none; }
	.ai360-nav.is-open .ai360-nav__icon-close { display: block; }

	.ai360-nav__panel {
		position: fixed;
		inset: 0;
		z-index: 100000;
		display: block;
		padding: 88px clamp(20px, 6vw, 44px) 48px;
		box-sizing: border-box;
		background: var(--wp--preset--color--base, #fff);
		overflow-y: auto;
		overscroll-behavior: contain;
	}

	.ai360-nav__list {
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;
		gap: 0;
	}

	.ai360-nav__list a {
		display: block;
		padding: 15px 2px;
		font-size: 1.125rem;
		font-weight: 600;
		border-bottom: 1px solid rgba(0, 0, 0, .08);
	}

	.ai360-nav__list .sub-menu {
		position: static;
		display: block;
		padding: 2px 0 6px 16px;
		box-shadow: none;
		background: transparent;
	}

	.ai360-nav__list .sub-menu a {
		font-size: 1rem;
		font-weight: 500;
		padding: 10px 2px;
		border-bottom: 1px solid rgba(0, 0, 0, .05);
	}

	body.ai360-nav-open { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
	.ai360-nav__list a { transition: none; }
}

/* Escritorio: el panel es siempre visible aunque el atributo hidden
   siga en el marcado (solo se usa para el modo móvil). */
@media (min-width: 1200px) {
	.ai360-nav__panel,
	.ai360-nav__panel[hidden] { display: flex !important; }
}

/* --------------------------------------------------------------------------
   Home: cabecera flotante sobre el banner (estilo editorial)
   -------------------------------------------------------------------------- */
body.home .ai360-head,
body.page-template-page-full .ai360-head {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	background: transparent;
	border-bottom: 1px solid rgba(255, 255, 255, .18);
	color: #fff;
}
body.home .ai360-head .ai360-brand__text,
body.home .ai360-head .ai360-nav__list a { color: #fff; }
body.home .ai360-head .ai360-nav__toggle { border-color: rgba(255,255,255,.55); color:#fff; }
@media (max-width:1199px){body.home .ai360-nav__panel{background:#10140d}}

/* Logotipo en cabecera: el PNG del cliente es cuadrado con círculo,
   así que se limita por altura para no romper la barra. */
.ai360-head .ai360-brand__img{max-height:56px;width:auto;height:auto;display:block}
@media(max-width:860px){.ai360-head .ai360-brand__img{max-height:44px}}
