.header,
.header.opacity,
.header.fx {
	background: #0b0a0f !important;
	border-bottom: 1px solid rgba(0, 0, 0, 0.35);
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Al hacer scroll (clase .fx) queremos un poco de transparencia */
.header.fx,
.header.fx.opacity {
	background: rgba(0, 0, 0, 0.62) !important;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* El tema base pinta una capa azul con `header:after` */
.header:after,
.header.opacity:after,
.header.fx.opacity:after {
	background: #000 !important;
	opacity: 1 !important;
	/* Evitar que en la portada se vea una franja más alta al inicio */
	height: 56px !important;
}

.header.fx:after,
.header.fx.opacity:after {
	background: rgba(0, 0, 0, 0.62) !important;
	opacity: 1 !important;
}

/* El CSS base fija `height:70px` en `.header__content` (no min-height). */
.header .header__content {
	height: 56px !important;
	min-height: 56px !important;
}

/* Boton Entrar: estilo oscuro/plano como referencia del usuario */
.header .header__sign-in--cta {
	display: inline-flex !important;
	align-items: center !important;
	gap: 8px !important;
	padding: 10px 18px !important;
	border-radius: 8px !important;
	background: #00afd1 !important;
	color: #070b10 !important;
	border: 1px solid rgba(0, 0, 0, 0.35) !important;
	box-shadow: none !important;
	text-decoration: none !important;
}

.header .header__sign-in--cta:hover,
.header .header__sign-in--cta:focus {
	background: #00afd1 !important;
	color: #070b10 !important;
	border-color: rgba(0, 0, 0, 0.42) !important;
	box-shadow: none !important;
}

.header .header__sign-in--cta .header__sign-in-icon svg {
	stroke: #070b10 !important;
}

@media (max-width: 1199px) {
	/* En pantallas <1200px el tema base también deja el header alto. */
	.header .header__content {
		height: 56px !important;
		min-height: 56px !important;
	}
}

.header .header__quick-list {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	height: auto;
	margin: 0 12px 0 14px;
	color: #00d084 !important;
	border: 0;
	background: transparent;
	text-decoration: none !important;
}

.header .header__quick-list:hover {
	color: #34d399 !important;
	background: transparent;
}

.header .header__quick-list svg {
	width: 16px;
	height: 16px;
	display: block;
}

.header .header__sign-in.logged .avatarx {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	position: relative;
}

.header .header__sign-in.logged .avatarx img {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: block !important;
	object-fit: cover;
	border: 1px solid rgba(34, 211, 238, 0.25);
}

.header .header__sign-in.logged .avatarx::after {
	content: "";
	position: absolute;
	left: 26px;
	bottom: 0;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #00d084;
	border: 2px solid #0b0a0f;
}

@media (min-width: 1200px) {
	.header .header__content {
		display: flex;
		align-items: center;
		flex-wrap: nowrap;
		justify-content: flex-start !important;
		gap: 0;
		min-height: 48px;
		width: 100%;
		max-width: 100%;
	}

	.header .header__left {
		display: flex;
		align-items: center;
		flex: 1 1 auto;
		min-width: 0;
		gap: 4px;
		max-width: calc(100% - 420px);
	}

	.header .header__right {
		display: flex;
		align-items: center;
		justify-content: flex-end;
		flex: 0 1 auto;
		min-width: 0;
		margin-left: 12px;
	}

	.header .header__btn {
		display: none;
	}

	.header .header__logo {
		flex: 0 0 auto;
		margin: 0 !important;
		padding: 6px 10px 6px 0;
		width: auto;
		height: auto;
	}

	.header .header__logo img {
		height: 26px;
		width: auto;
		max-width: 200px;
		object-fit: contain;
	}

	.header .header__search--desktop {
		display: inline-flex;
		align-items: center;
		gap: 10px;
		flex: 1 1 auto;
		width: 100%;
		max-width: 520px;
		min-width: 200px;
		height: 42px;
		margin: 0 8px 0 4px;
		padding: 0 16px 0 14px;
		position: relative;
		border: 1px solid rgba(255, 255, 255, 0.1);
		border-radius: 999px;
		background: rgba(255, 255, 255, 0.08);
		transition:
			max-width 0.32s ease,
			flex 0.32s ease,
			border-color 0.22s ease,
			background 0.22s ease,
			box-shadow 0.22s ease;
	}

	.header .header__search--desktop:hover,
	.header .header__search--desktop:focus-within {
		border-color: rgba(38, 198, 218, 0.45);
	}

	/* Buscador expandido + menú solo iconos */
	.header .header__content.header__content--search-expanded .header__left,
	.header .header__content:has(.header__search--desktop:focus-within) .header__left {
		flex: 1 1 auto;
		max-width: calc(100% - 280px);
		min-width: 0;
	}

	.header .header__content.header__content--search-expanded .header__search--desktop,
	.header .header__search--desktop.header__search--expanded,
	.header .header__content:has(.header__search--desktop:focus-within) .header__search--desktop {
		flex: 1 1 0;
		max-width: 100%;
		width: auto;
		min-width: 0;
		margin-right: 6px;
		border-color: rgba(34, 211, 238, 0.55);
		background: rgba(255, 255, 255, 0.1);
		box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.12);
	}

	.header .header__content.header__content--search-expanded .header__search-kbd,
	.header .header__content:has(.header__search--desktop:focus-within) .header__search-kbd {
		opacity: 0;
		width: 0;
		margin: 0;
		overflow: hidden;
	}

	.header .header__content.header__content--search-expanded .header__right,
	.header .header__content:has(.header__search--desktop:focus-within) .header__right {
		flex: 0 0 auto;
		margin-left: 10px;
	}

	.header .header__content.header__content--search-expanded .header__nav-item .header__nav-link,
	.header .header__content:has(.header__search--desktop:focus-within) .header__nav-item .header__nav-link {
		gap: 4px;
		padding: 10px 11px;
		border-radius: 10px;
	}

	.header .header__content.header__content--search-expanded .header__nav-item .header__nav-link span[itemprop='name'],
	.header .header__content:has(.header__search--desktop:focus-within) .header__nav-item .header__nav-link span[itemprop='name'] {
		display: inline-block;
		max-width: 0;
		opacity: 0;
		overflow: hidden;
		margin: 0;
		padding: 0;
		white-space: nowrap;
		transition: max-width 0.28s ease, opacity 0.2s ease, margin 0.28s ease;
	}

	.header .header__content.header__content--search-expanded .header__nav-caret,
	.header .header__content:has(.header__search--desktop:focus-within) .header__nav-caret {
		display: block !important;
		width: 11px;
		height: 11px;
		margin-left: 0;
	}

	.header .header__content.header__content--search-expanded .header__sign-in.logged .avatarx > span,
	.header .header__content:has(.header__search--desktop:focus-within) .header__sign-in.logged .avatarx > span {
		display: none !important;
	}

	.header .header__content.header__content--search-expanded .header__sign-in.logged .avatarx svg,
	.header .header__content:has(.header__search--desktop:focus-within) .header__sign-in.logged .avatarx svg {
		display: block;
	}

	.header .header__search--desktop .header__search-button {
		position: static;
		flex: 0 0 auto;
		width: 18px;
		height: 18px;
		margin: 0;
		padding: 0;
		border: 0;
		background: transparent;
		color: rgba(255, 255, 255, 0.65);
		cursor: pointer;
	}

	.header .header__search--desktop .header__search-button svg {
		width: 16px;
		height: 16px;
		display: block;
	}

	.header .header__search--desktop .header__search-button:hover {
		color: #26c6da;
	}

	.header .header__search--desktop .header__search-input {
		flex: 1 1 auto;
		width: auto;
		min-width: 0;
		height: 100%;
		border: 0;
		background: transparent;
		color: #f5f5f5;
		caret-color: #f5f5f5;
		font-size: 14px;
		line-height: 20px;
		padding: 0 2px 0 6px;
	}

	.header .header__search--desktop .header__search-input::placeholder {
		color: rgba(255, 255, 255, 0.45);
	}

	.header .header__search--desktop .header__search-kbd {
		flex: 0 0 auto;
		margin-left: 8px;
		color: rgba(255, 255, 255, 0.35);
		font-size: 13px;
		font-weight: 500;
		line-height: 1;
		user-select: none;
		pointer-events: none;
	}

	.header .header__search--desktop .header__search-close {
		display: none;
	}

	.header .header__search--desktop .search_ajax_container {
		top: calc(100% + 8px);
		left: 0;
		right: 0;
	}

	.header .header__nav {
		display: flex !important;
		align-items: center;
		justify-content: flex-end;
		flex: 0 0 auto;
		position: relative !important;
		top: auto !important;
		right: auto !important;
		bottom: auto !important;
		width: auto !important;
		min-width: 0;
		margin: 0 !important;
		padding: 0 !important;
		transform: none !important;
		flex-direction: row !important;
		border: 0 !important;
		box-shadow: none !important;
		background: transparent !important;
	}

	.header .header__nav-item {
		margin: 0 !important;
		width: auto !important;
		display: flex;
		align-items: center;
	}

	.header .header__nav-item .header__nav-link {
		display: inline-flex;
		align-items: center;
		gap: 0.5rem;
		font-size: 14px;
		font-weight: 500;
		color: #9ca3af !important;
		padding: 8px 12px;
		line-height: 1.2;
		letter-spacing: 0.02em;
		text-transform: none;
		white-space: nowrap;
		border: 0;
		background: transparent;
		border-radius: 8px;
		transition: gap 0.28s ease, padding 0.28s ease, color 0.2s ease, background 0.2s ease;
	}

	.header .header__nav-item .header__nav-link span[itemprop='name'] {
		transition: max-width 0.28s ease, opacity 0.2s ease, color 0.2s ease;
		color: inherit;
	}

	.header .header__nav-item .header__nav-link:hover,
	.header .header__nav-item.show .header__nav-link,
	.header .header__nav-item .header__nav-link[aria-expanded='true'] {
		color: #ffffff !important;
		background: rgba(255, 255, 255, 0.1);
	}

	.header .header__nav-icon {
		display: block;
		flex-shrink: 0;
		width: 20px;
		height: 20px;
	}

	.header .header__nav-caret {
		width: 10px;
		height: 10px;
		margin-left: 2px;
		color: #9ca3af;
		flex-shrink: 0;
		transition: color 0.2s ease;
	}

	.header .header__nav-item .header__nav-link:hover .header__nav-caret,
	.header .header__nav-item.show .header__nav-link .header__nav-caret,
	.header .header__nav-item .header__nav-link[aria-expanded='true'] .header__nav-caret {
		color: rgba(255, 255, 255, 0.85);
	}

	.header .header__auth {
		flex: 0 0 auto !important;
		width: auto !important;
		min-width: 0 !important;
		margin: 0 0 0 4px !important;
		display: flex;
		align-items: center;
		justify-content: flex-end !important;
	}

	.header .header__sign-in.logged {
		display: inline-flex;
		align-items: center;
		width: auto !important;
		min-width: 0 !important;
		height: auto;
		min-height: 38px;
		padding: 0 0 0 2px;
		border-radius: 0;
		border: 0;
		background: transparent;
		margin: 0 0 0 8px !important;
	}

	.header .header__sign-in.logged .avatarx {
		gap: 9px;
		padding-right: 1px;
	}

	.header .header__sign-in.logged .avatarx span {
		display: inline;
		color: #f8fafc;
		font-size: 14px;
		font-weight: 600;
		line-height: 1;
	}

	.header .header__sign-in.logged .avatarx svg {
		width: 10px;
		height: 10px;
		color: rgba(148, 163, 184, 0.95);
	}

	.header .header__auth .header__search-btn {
		display: none;
	}

	.header .header__auth .header__user-actions {
		display: flex;
		align-items: center;
	}

	.header .header__sign-in--cta span,
	.header .header__sign-in.logged .avatarx span {
		display: inline !important;
	}

	.header .header__sign-in--cta {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		width: auto !important;
		min-width: 0 !important;
		margin: 0 0 0 8px !important;
		padding: 10px 18px !important;
		border-radius: 8px;
		background: #00b7db;
		color: #091018 !important;
		font-size: 14px !important;
		font-weight: 600 !important;
		line-height: 1.2 !important;
		text-transform: none;
		text-decoration: none !important;
		border: 1px solid rgba(0, 214, 255, 0.28);
		box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
	}

	.header .header__sign-in--cta:hover {
		background: #09c0e2;
		color: #071018 !important;
	}

	.header .header__sign-in--cta .header__sign-in-icon {
		display: inline-flex;
		line-height: 0;
		flex-shrink: 0;
	}

	.header .header__sign-in--cta .header__sign-in-icon svg {
		display: block;
		width: 20px;
		height: 20px;
	}

	.header .header__sign-in.logged > img {
		display: none !important;
	}

	.header .header__sign-in.logged .avatarx img {
		display: block !important;
	}

	.header .header__nav-item.menu-item-has-children > .header__dropdown-menu {
		top: 100% !important;
	}
}

@media (min-width: 1440px) {
	.header .header__auth {
		width: auto !important;
	}

	.header .header__left {
		max-width: calc(100% - 460px);
	}

	.header .header__search--desktop {
		max-width: 580px;
	}

	.header .header__content.header__content--search-expanded .header__left,
	.header .header__content:has(.header__search--desktop:focus-within) .header__left {
		max-width: calc(100% - 300px);
	}

	.header .header__content.header__content--search-expanded .header__search--desktop,
	.header .header__search--desktop.header__search--expanded,
	.header .header__content:has(.header__search--desktop:focus-within) .header__search--desktop {
		max-width: 100%;
	}
}

@media (max-width: 1199px) {
	.header .header__search--desktop {
		display: none;
	}

	.header .header__search--desktop.header__search--active {
		display: flex;
	}
}

@media only screen and (max-width: 1100px) {
	.header .header__left {
		max-width: calc(100% - 380px);
	}

	.header .header__search--desktop {
		max-width: 320px;
		min-width: 140px;
	}

	.header .header__nav-item .header__nav-link {
		padding: 10px 11px;
		font-size: 13px;
	}
}

@media only screen and (max-width: 900px) {
	.header .header__search--desktop {
		max-width: 260px;
	}
}

/* Submenús del header — panel oscuro + pill al hover (React Node) */
.header .header__dropdown-menu {
	position: absolute;
	display: flex !important;
	flex-direction: column;
	align-items: stretch;
	justify-content: flex-start;
	gap: 0.2rem;
	min-width: 210px;
	width: auto;
	padding: 0.45rem !important;
	margin-top: 0 !important;
	background: rgba(18, 22, 30, 0.96) !important;
	border: 1px solid rgba(255, 255, 255, 0.08) !important;
	border-radius: 12px !important;
	box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5) !important;
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	overflow: hidden;
	z-index: -1;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transform: none !important;
	transition: opacity 0.2s ease, visibility 0.2s ease, margin 0.2s ease;
}

.header .header__nav-item.menu-item-has-children > .header__dropdown-menu.show,
.header .header__user-actions .header__dropdown-menu.show {
	margin-top: 0.45rem !important;
}

.header .header__dropdown-menu.show {
	top: 100% !important;
	z-index: 1050;
	pointer-events: auto;
	opacity: 1;
	visibility: visible;
}

.header .header__dropdown-menu::before,
.header .header__dropdown-menu::after {
	display: none !important;
}

.header .header__dropdown-menu li,
.header .header__dropdown-menu > div {
	width: 100%;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none;
}

.header .header__dropdown-menu a,
.header .header__dropdown-menu .dropdown-item {
	display: block;
	width: 100%;
	box-sizing: border-box;
	margin: 0;
	padding: 0.55rem 0.72rem !important;
	border-radius: 8px !important;
	border: 0 !important;
	font-size: 0.9rem !important;
	font-weight: 500 !important;
	line-height: 1.35;
	color: #cbd5e1 !important;
	text-transform: none !important;
	text-decoration: none !important;
	background: transparent !important;
	transition: background 0.18s ease, color 0.18s ease;
}

.header .header__dropdown-menu a:hover,
.header .header__dropdown-menu a:focus,
.header .header__dropdown-menu .dropdown-item:hover,
.header .header__dropdown-menu .dropdown-item:focus {
	color: #ffffff !important;
	background: rgba(255, 255, 255, 0.1) !important;
}

.header .header__dropdown-menu a:active,
.header .header__dropdown-menu .dropdown-item:active {
	background: rgba(255, 255, 255, 0.14) !important;
	color: #ffffff !important;
}

/* Idiomas en submenú: bandera + nombre */
.header .header__dropdown-menu .pelisen-lang-menu__link {
	display: flex !important;
	align-items: center;
	gap: 0.6rem;
}

.header .header__dropdown-menu .pelisen-lang-menu__flag {
	flex: 0 0 auto;
	width: 22px;
	height: 16px;
	min-width: 22px;
	max-width: none !important;
	max-height: none !important;
	object-fit: cover;
	border-radius: 2px;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.header .header__dropdown-menu .pelisen-lang-menu__link span[itemprop='name'] {
	flex: 1 1 auto;
	min-width: 0;
}

/* Descubrir: Colecciones + Ayuda con icono */
.header .header__dropdown-menu .pelisen-discover-menu__link {
	display: flex !important;
	align-items: center;
	gap: 0.6rem;
}

.header .header__dropdown-menu .pelisen-discover-menu__link span[itemprop='name'] {
	flex: 1 1 auto;
	min-width: 0;
}

.header .header__dropdown-icon {
	flex: 0 0 auto;
	width: 1rem;
	height: 1rem;
	stroke: currentColor;
	fill: none;
	transition: color 0.18s ease;
}

.header__dropdown-icon--colecciones {
	color: rgba(236, 72, 153, 0.7);
}

.header .header__dropdown-menu .pelisen-discover-menu__link:hover .header__dropdown-icon--colecciones,
.header .header__dropdown-menu .pelisen-discover-menu__link:focus .header__dropdown-icon--colecciones {
	color: #ec4899;
}

.header__dropdown-icon--ayuda {
	color: rgba(248, 113, 113, 0.7);
}

.header .header__dropdown-menu .pelisen-discover-menu__link:hover .header__dropdown-icon--ayuda,
.header .header__dropdown-menu .pelisen-discover-menu__link:focus .header__dropdown-icon--ayuda {
	color: #f87171;
}

/* Perfil: mismo efecto */
.header .header__user-actions .header__dropdown-menu {
	right: 0;
	left: auto !important;
}

/* Menú principal — pill tipo botón al hover (como referencia) */
.header .header__nav-item.show .header__nav-link,
.header .header__nav-item.show .header__nav-link:hover,
.header .header__nav-link--active {
	color: #ffffff !important;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 8px;
}

.header .header__nav-item .header__nav-link:hover,
.header .header__nav-item .header__nav-link[aria-expanded='true'] {
	color: #ffffff !important;
	background: rgba(255, 255, 255, 0.1) !important;
	border-radius: 8px;
}

/* Iconos del menú: cian al hover (sin rosa del style.css) */
.header .header__nav-item .header__nav-link:hover svg.header__nav-icon,
.header .header__nav-item .header__nav-link[aria-expanded='true'] svg.header__nav-icon,
.header .header__nav-item.show .header__nav-link svg.header__nav-icon {
	opacity: 1 !important;
	visibility: visible !important;
	fill: none !important;
	stroke: unset !important;
	color: #22d3ee !important;
}

.header .header__nav-item .header__nav-link:hover .header__nav-icon path,
.header .header__nav-item .header__nav-link:hover .header__nav-icon circle,
.header .header__nav-item .header__nav-link:hover .header__nav-icon rect,
.header .header__nav-item .header__nav-link:hover .header__nav-icon line,
.header .header__nav-item .header__nav-link:hover .header__nav-icon polyline,
.header .header__nav-item .header__nav-link[aria-expanded='true'] .header__nav-icon path,
.header .header__nav-item .header__nav-link[aria-expanded='true'] .header__nav-icon circle,
.header .header__nav-item .header__nav-link[aria-expanded='true'] .header__nav-icon rect,
.header .header__nav-item .header__nav-link[aria-expanded='true'] .header__nav-icon line,
.header .header__nav-item .header__nav-link[aria-expanded='true'] .header__nav-icon polyline,
.header .header__nav-item.show .header__nav-link .header__nav-icon path,
.header .header__nav-item.show .header__nav-link .header__nav-icon circle,
.header .header__nav-item.show .header__nav-link .header__nav-icon rect,
.header .header__nav-item.show .header__nav-link .header__nav-icon line,
.header .header__nav-item.show .header__nav-link .header__nav-icon polyline {
	opacity: 1 !important;
	visibility: visible !important;
	stroke: #22d3ee !important;
	fill: none !important;
}

.header .header__nav-item .header__nav-link:hover .header__nav-caret,
.header .header__nav-item .header__nav-link[aria-expanded='true'] .header__nav-caret {
	color: rgba(255, 255, 255, 0.85) !important;
	stroke: currentColor !important;
	fill: none !important;
}

@media (min-width: 1200px) {
	.header .header__nav-item.menu-item-has-children {
		position: relative;
	}

	.header .header__nav-item.menu-item-has-children > .header__dropdown-menu {
		top: 100% !important;
		left: 0 !important;
		right: auto !important;
	}

	.header .header__user-actions .header__dropdown-menu {
		top: 100% !important;
	}
}

@media (max-width: 1199px) {
	.header .header__nav .header__dropdown-menu {
		position: static;
		min-width: 0;
		width: 100%;
		margin: 0 !important;
		padding: 0.35rem !important;
		box-shadow: none !important;
		background: rgba(0, 0, 0, 0.25) !important;
		border-color: rgba(255, 255, 255, 0.06) !important;
	}

	.header .header__nav .header__dropdown-menu.show {
		margin: 0.35rem 0 0.5rem !important;
	}

	.header .header__nav .header__dropdown-menu a,
	.header .header__nav .header__dropdown-menu .dropdown-item {
		padding: 0.5rem 0.65rem !important;
		font-size: 0.88rem !important;
	}
}
