/**
 * Header Design 2 — Consolidados
 */

.hexfly-d2-header {
	--hexfly-d2-primary: #0057d9;
	--hexfly-d2-primary-hover: #003e9c;
	--hexfly-d2-primary-rgb: 0, 87, 217;
	--hexfly-d2-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
	--hexfly-d2-sans: 'DM Sans', system-ui, sans-serif;

	position: relative;
	z-index: 50;
	width: 100%;
	height: 4rem;
	background: rgba(0, 62, 156, 0.96);
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	backdrop-filter: blur(12px);
	font-family: var(--hexfly-d2-sans);
}

.hexfly-d2-header--sticky {
	position: sticky;
	top: 0;
}

.hexfly-d2-header a {
	color: inherit;
	text-decoration: none;
}

.hexfly-d2-header img {
	display: block;
	max-width: 100%;
	height: auto;
}

.hexfly-d2-container {
	width: min(1160px, 92vw);
	margin-inline: auto;
}

.hexfly-d2-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	height: 100%;
}

.hexfly-d2-header__brand img {
	height: 36px;
	width: auto;
}

.hexfly-d2-header__toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	margin-left: auto;
	color: #f8fafc;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.2s var(--hexfly-d2-ease-out);
}

.hexfly-d2-header__toggle:hover {
	background: rgba(255, 255, 255, 0.08);
}

.hexfly-d2-header__toggle-icon {
	display: block;
	width: 1.125rem;
	height: 2px;
	background: currentColor;
	position: relative;
	transition: background 0.2s var(--hexfly-d2-ease-out);
}

.hexfly-d2-header__toggle-icon::before,
.hexfly-d2-header__toggle-icon::after {
	content: '';
	position: absolute;
	left: 0;
	width: 100%;
	height: 2px;
	background: currentColor;
	transition: transform 0.2s var(--hexfly-d2-ease-out);
}

.hexfly-d2-header__toggle-icon::before {
	top: -6px;
}

.hexfly-d2-header__toggle-icon::after {
	top: 6px;
}

.hexfly-d2-header.is-open .hexfly-d2-header__toggle-icon {
	background: transparent;
}

.hexfly-d2-header.is-open .hexfly-d2-header__toggle-icon::before {
	transform: translateY(6px) rotate(45deg);
}

.hexfly-d2-header.is-open .hexfly-d2-header__toggle-icon::after {
	transform: translateY(-6px) rotate(-45deg);
}

.hexfly-d2-nav {
	display: none;
	gap: 1.35rem;
	font-size: 0.875rem;
	font-weight: 500;
}

.hexfly-d2-nav a {
	color: rgba(248, 250, 252, 0.65);
	transition: color 0.2s var(--hexfly-d2-ease-out);
}

.hexfly-d2-nav a:hover {
	color: #f8fafc;
}

.hexfly-d2-header__cta {
	display: none;
	white-space: nowrap;
}

.hexfly-d2-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.7rem 1.15rem;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	border-radius: 8px;
	border: 1px solid transparent;
	cursor: pointer;
	white-space: nowrap;
	transition:
		background 0.2s var(--hexfly-d2-ease-out),
		color 0.2s var(--hexfly-d2-ease-out),
		transform 0.15s var(--hexfly-d2-ease-out);
}

.hexfly-d2-btn:active {
	transform: scale(0.98);
}

.hexfly-d2-btn--cta {
	background: var(--hexfly-d2-primary);
	color: #fff;
}

.hexfly-d2-btn--cta:hover {
	background: var(--hexfly-d2-primary-hover);
	color: #fff;
}

@media (min-width: 640px) {
	.hexfly-d2-header__cta {
		display: inline-flex;
	}

	.hexfly-d2-header__account--guest .hexfly-d2-header__login {
		display: inline-flex;
	}
}

/* Menú de cuenta de usuario */
.hexfly-d2-header__account {
	position: relative;
	flex-shrink: 0;
}

.hexfly-d2-header__account-toggle {
	display: none;
	align-items: center;
	gap: 0.5rem;
	padding: 0.35rem 0.5rem 0.35rem 0.35rem;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 500;
	color: #f8fafc;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.2s var(--hexfly-d2-ease-out);
}

.hexfly-d2-header__account-toggle:hover,
.hexfly-d2-header__account.is-open .hexfly-d2-header__account-toggle {
	background: rgba(255, 255, 255, 0.14);
}

.hexfly-d2-header__account-avatar {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	overflow: hidden;
	flex-shrink: 0;
}

.hexfly-d2-header__account-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hexfly-d2-header__account-name {
	max-width: 8rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hexfly-d2-header__account-chevron {
	width: 0.4rem;
	height: 0.4rem;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translateY(-2px);
	transition: transform 0.2s var(--hexfly-d2-ease-out);
	flex-shrink: 0;
}

.hexfly-d2-header__account.is-open .hexfly-d2-header__account-chevron {
	transform: rotate(-135deg) translateY(2px);
}

.hexfly-d2-header__account-menu {
	display: none;
	position: absolute;
	top: calc(100% + 0.5rem);
	right: 0;
	min-width: 12.5rem;
	margin: 0;
	padding: 0.35rem 0;
	list-style: none;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 10px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
	overflow: hidden;
	z-index: 100;
}

.hexfly-d2-header__account.is-open .hexfly-d2-header__account-menu {
	display: block;
}

.hexfly-d2-header__account-link {
	display: block;
	padding: 0.6rem 1rem;
	font-size: 0.875rem;
	font-weight: 500;
	color: #1f2937;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.hexfly-d2-header__account-link:hover {
	background: #f5f7fa;
	color: var(--hexfly-d2-primary);
}

.hexfly-d2-header__account-item--logout {
	margin-top: 0.25rem;
	padding-top: 0.25rem;
	border-top: 1px solid #e5e7eb;
}

.hexfly-d2-header__account-link--logout {
	color: #6b7280;
}

.hexfly-d2-header__account-link--logout:hover {
	color: #dc2626;
	background: #fef2f2;
}

.hexfly-d2-header__account--guest .hexfly-d2-header__login {
	display: none;
	padding: 0.5rem 1rem;
	font-size: 0.875rem;
}

@media (min-width: 900px) {
	.hexfly-d2-header__account-toggle {
		display: inline-flex;
	}
}

@media (max-width: 899px) {
	.hexfly-d2-header__account {
		order: 3;
		margin-left: auto;
	}

	.hexfly-d2-header__account-toggle {
		display: inline-flex;
		padding: 0.25rem;
		border-radius: 8px;
	}

	.hexfly-d2-header__account-name,
	.hexfly-d2-header__account-chevron {
		display: none;
	}

	.hexfly-d2-header__account-menu {
		right: 0;
		left: auto;
	}

	.hexfly-d2-header.is-open .hexfly-d2-header__account-menu {
		display: block;
		position: fixed;
		top: 4.5rem;
		right: 4vw;
		left: auto;
	}
}

@media (min-width: 900px) {
	.hexfly-d2-header__toggle {
		display: none;
	}

	.hexfly-d2-nav {
		display: flex;
	}
}

@media (max-width: 899px) {
	.hexfly-d2-header.is-open .hexfly-d2-nav {
		display: flex;
		flex-direction: column;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		gap: 0;
		padding: 0.75rem 4vw 1rem;
		background: rgba(0, 62, 156, 0.98);
		border-bottom: 1px solid rgba(255, 255, 255, 0.08);
		box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
	}

	.hexfly-d2-header.is-open .hexfly-d2-nav a {
		padding: 0.75rem 0;
		border-bottom: 1px solid rgba(255, 255, 255, 0.06);
		color: rgba(248, 250, 252, 0.85);
	}

	.hexfly-d2-header.is-open .hexfly-d2-nav a:last-child {
		border-bottom: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hexfly-d2-header *,
	.hexfly-d2-header *::before,
	.hexfly-d2-header *::after {
		transition-duration: 0.01ms !important;
	}
}
