/* ══════════════════════════════════════════
   ICC — Header & Navigation
   ══════════════════════════════════════════ */

header.site-header {
	position: sticky;
	top: 0;
	z-index: 1000;
	width: 100%;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

/* ── Topbar ── */
.header-topbar {
	background: var(--accent-dark);
	color: rgba(255, 255, 255, 0.8);
	font-size: 0.78rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.45rem 0;
	min-height: 38px;
}

.header-topbar__left,
.header-topbar__right {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	flex-wrap: wrap;
}

.header-topbar__link {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	color: rgba(255, 255, 255, 0.75) !important;
	text-decoration: none;
	font-weight: 500;
	transition: color 0.2s;
	white-space: nowrap;
}

.header-topbar__link:hover {
	color: #fff !important;
	text-decoration: none;
}

.header-topbar__link i {
	font-size: 0.85rem;
	opacity: 0.8;
}

.header-topbar__link--wa i {
	color: #25d366;
	opacity: 1;
}

.header-topbar__social {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding-left: 0.5rem;
	border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.header-topbar__social a {
	width: 26px;
	height: 26px;
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: rgba(255, 255, 255, 0.65) !important;
	background: rgba(255, 255, 255, 0.06);
	font-size: 0.75rem;
	transition: background 0.2s, color 0.2s, transform 0.2s;
}

.header-topbar__social a:hover {
	background: rgba(255, 234, 0, 0.15);
	color: var(--main-color) !important;
	transform: translateY(-1px);
}

.header-topbar__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.3rem 0.85rem;
	background: var(--main-color);
	color: #1a1040 !important;
	font-size: 0.72rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	border-radius: 6px;
	text-decoration: none;
	transition: transform 0.2s, box-shadow 0.2s;
}

.header-topbar__cta:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(255, 234, 0, 0.35);
	color: #1a1040 !important;
	text-decoration: none;
}

.header-topbar__exam {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.3rem 0.75rem;
	background: rgba(59, 130, 246, 0.15);
	border: 1px solid rgba(59, 130, 246, 0.3);
	color: #93c5fd !important;
	font-size: 0.72rem;
	font-weight: 600;
	border-radius: 6px;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.2s, border-color 0.2s;
}

.header-topbar__exam:hover {
	background: rgba(59, 130, 246, 0.25);
	border-color: rgba(59, 130, 246, 0.5);
	color: #fff !important;
	text-decoration: none;
}

.header-topbar__currency {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 6px;
	padding: 0 0.5rem 0 0.6rem;
}

.header-topbar__currency > i {
	font-size: 0.65rem;
	color: var(--main-color);
	opacity: 0.8;
}

.header-topbar__currency select,
#topbar #tasa_moneda {
	background: transparent;
	border: none;
	color: #fff;
	font-size: 0.75rem;
	font-weight: 600;
	padding: 0.3rem 0.2rem;
	cursor: pointer;
	outline: none;
	height: auto;
}

.header-topbar__currency select option {
	background: var(--accent-dark);
	color: #fff;
}

/* ── Main navbar ── */
.header-navbar {
	background: linear-gradient(180deg, #2e286e 0%, var(--accent-purple) 100%);
}

.header-navbar__inner {
	display: flex;
	align-items: center;
	padding: 0.6rem 0;
	gap: 1rem;
}

.header-brand {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	padding: 0;
	margin-right: 0.5rem;
}

.header-brand img {
	width: 105px;
	height: auto;
	transition: transform 0.25s ease, filter 0.25s;
}

.header-brand:hover img {
	transform: scale(1.04);
	filter: brightness(1.08);
}

/* ── Hamburger ── */
.header-toggler {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 40px;
	height: 40px;
	padding: 8px;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.15) !important;
	border-radius: 10px !important;
	cursor: pointer;
	margin-left: auto;
}

.header-toggler__bar {
	display: block;
	width: 100%;
	height: 2px;
	background: #fff;
	border-radius: 2px;
	transition: transform 0.3s, opacity 0.3s;
}

.header-toggler[aria-expanded="true"] .header-toggler__bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.header-toggler[aria-expanded="true"] .header-toggler__bar:nth-child(2) {
	opacity: 0;
}

.header-toggler[aria-expanded="true"] .header-toggler__bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* ── Nav collapse ── */
@media (min-width: 992px) {
	.header-nav-collapse {
		display: flex !important;
		align-items: center;
		flex: 1;
		justify-content: space-between;
	}
}

.header-nav {
	display: flex;
	align-items: center;
	gap: 0.15rem;
	flex-wrap: wrap;
	margin: 0;
	padding: 0;
	list-style: none;
}

.header-nav .nav-item {
	position: relative;
}

.header-nav__link {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.5rem 0.75rem !important;
	color: rgba(255, 255, 255, 0.85) !important;
	font-size: 0.8rem !important;
	font-weight: 600 !important;
	letter-spacing: 0.01em;
	text-decoration: none;
	border-radius: 8px;
	transition: color 0.2s, background 0.2s;
	white-space: nowrap;
	box-shadow: none !important;
}

.header-nav__link:hover,
.header-nav__link:focus {
	color: var(--main-color) !important;
	background: rgba(255, 255, 255, 0.08);
}

.header-nav__link--highlight {
	color: var(--main-color) !important;
	position: relative;
}

.header-nav__link--highlight::after {
	content: '';
	position: absolute;
	bottom: 2px;
	left: 50%;
	transform: translateX(-50%);
	width: 4px;
	height: 4px;
	background: var(--main-color);
	border-radius: 50%;
}

.header-nav__dropdown .dropdown-toggle::after {
	margin-left: 0.35rem;
	vertical-align: middle;
	border-top-color: rgba(255, 255, 255, 0.6);
}

/* ── Dropdown ── */
.header-dropdown {
	background: #fff;
	border: none;
	border-radius: 12px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
	padding: 0.5rem;
	margin-top: 0.5rem;
	min-width: 220px;
}

.header-dropdown .dropdown-item {
	font-size: 0.82rem;
	font-weight: 500;
	color: #444;
	padding: 0.55rem 0.85rem;
	border-radius: 8px;
	transition: background 0.15s, color 0.15s;
}

.header-dropdown .dropdown-item:hover {
	background: rgba(40, 34, 98, 0.08);
	color: var(--accent-purple);
}

/* ── Action buttons ── */
.header-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-shrink: 0;
	margin-left: 0.75rem;
}

.header-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.55rem 1rem;
	border: none;
	border-radius: 10px;
	font-size: 0.78rem;
	font-weight: 700;
	cursor: pointer;
	transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
	white-space: nowrap;
}

.header-btn--login {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.2);
}

.header-btn--login:hover {
	background: rgba(255, 255, 255, 0.18);
	transform: translateY(-1px);
}

.header-btn--register {
	background: var(--main-color);
	color: #1a1040;
	box-shadow: 0 4px 14px rgba(255, 234, 0, 0.3);
}

.header-btn--register:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(255, 234, 0, 0.4);
}

.header-btn--logout {
	background: rgba(239, 68, 68, 0.15);
	color: #fca5a5;
	border: 1px solid rgba(239, 68, 68, 0.3);
}

.header-btn--logout:hover {
	background: rgba(239, 68, 68, 0.25);
	color: #fff;
	transform: translateY(-1px);
}

/* ── Responsive ── */
@media (max-width: 991px) {
	.header-navbar__inner {
		flex-wrap: wrap;
		align-items: center;
		padding: 0.5rem 0;
	}

	.header-brand {
		flex: 1;
	}

	.header-toggler {
		display: flex;
		flex-shrink: 0;
	}

	/* Cerrado por defecto — respeta Bootstrap collapse */
	.header-nav-collapse.collapse:not(.show) {
		display: none !important;
	}

	.header-nav-collapse.collapsing,
	.header-nav-collapse.collapse.show {
		display: flex !important;
		flex-direction: column;
		align-items: stretch !important;
		width: 100%;
		flex-basis: 100%;
		order: 10;
		padding: 0.75rem 0 1rem;
		margin-top: 0.25rem;
		border-top: 1px solid rgba(255, 255, 255, 0.12);
		max-height: calc(100vh - 180px);
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	.header-nav {
		flex-direction: column;
		align-items: stretch;
		width: 100%;
		gap: 0.25rem;
	}

	.header-nav__link {
		padding: 0.85rem 1rem !important;
		width: 100%;
		justify-content: flex-start;
		font-size: 0.9rem !important;
		border-radius: 10px;
	}

	.header-nav__link--highlight::after {
		display: none;
	}

	.header-actions {
		flex-direction: column;
		width: 100%;
		margin: 0.75rem 0 0;
		padding-top: 0.75rem;
		border-top: 1px solid rgba(255, 255, 255, 0.1);
	}

	.header-btn {
		width: 100%;
		justify-content: center;
		padding: 0.85rem;
		font-size: 0.85rem;
	}

	.header-nav__dropdown .dropdown-menu {
		position: static !important;
		float: none;
		transform: none !important;
	}

	.header-dropdown {
		position: static !important;
		float: none;
		box-shadow: none;
		background: rgba(0, 0, 0, 0.15);
		margin: 0.25rem 0 0.5rem;
		border: none;
		border-radius: 10px;
		padding: 0.35rem;
		min-width: 0;
		width: 100%;
	}

	.header-dropdown .dropdown-item {
		color: rgba(255, 255, 255, 0.9);
		padding: 0.65rem 1rem;
	}

	.header-dropdown .dropdown-item:hover {
		background: rgba(255, 255, 255, 0.1);
		color: var(--main-color);
	}
}

@media (max-width: 768px) {
	.header-topbar__inner {
		flex-direction: column;
		align-items: flex-start;
		padding: 0.5rem 0;
		gap: 0.5rem;
	}

	.header-topbar__left,
	.header-topbar__right {
		width: 100%;
		justify-content: flex-start;
		flex-wrap: wrap;
		gap: 0.5rem;
	}

	.header-topbar__social {
		border-left: none;
		padding-left: 0;
	}

	/* Topbar más compacta en móvil */
	.header-topbar__link span,
	.header-topbar__link {
		font-size: 0.72rem;
	}

	.header-topbar__cta,
	.header-topbar__exam {
		font-size: 0.68rem;
		padding: 0.35rem 0.65rem;
	}
}

@media (min-width: 992px) {
	.header-navbar__inner {
		flex-wrap: nowrap;
	}

	.header-toggler {
		display: none !important;
	}
}
