/**
 * Header Opción Médica.
 * Escritorio (>= 1280 px): topbar + barra con megamenú.
 * Por debajo: topbar compacta + barra móvil con menú a pantalla completa.
 * Medidas y textos según Figma (Header v2, Topbar, Header móvil, Menú abierto).
 */

.psw-header {
	position: relative;
	z-index: 1000;
	--psw-bar-h: 82px;
	--psw-top-offset: 0px;
}

body.admin-bar .psw-header {
	--psw-top-offset: 32px;
}

@media (max-width: 782px) {
	body.admin-bar .psw-header {
		--psw-top-offset: 46px;
	}
}

.psw-header .psw-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	max-width: calc(var(--psw-content) + 2 * var(--psw-gutter));
	margin-inline: auto;
	padding-inline: var(--psw-gutter);
}

.psw-header [hidden] {
	display: none !important;
}

/*
 * Los botones del header no son "botones" visuales: el estilo de botón global
 * del kit (píldora oliva) se aplica a cualquier <button>, así que aquí se
 * neutraliza con más especificidad que .elementor-kit-N button(:hover).
 */
.psw-header button[class*="psw-header__"],
.psw-header button[class*="psw-header__"]:hover,
.psw-header button[class*="psw-header__"]:focus {
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	text-transform: none;
}

/* --- Topbar --- */

.psw-header .psw-header__topbar {
	position: relative;
	z-index: 2;
	background-color: var(--psw-surface-sand);
	color: var(--psw-primary);
	font-size: var(--e-global-typography-om_texto_s-font-size, 14px);
	line-height: var(--e-global-typography-om_texto_s-line-height, 22px);
}

.psw-header .psw-header__topbar .psw-header__inner {
	min-height: 44px;
	padding-block: 11px;
}

.psw-header .psw-header__topbar-left,
.psw-header .psw-header__topbar-right {
	display: flex;
	align-items: center;
	gap: 22px;
	min-width: 0;
}

.psw-header .psw-header__topbar-text em {
	font-style: normal;
	font-weight: 500;
	color: var(--psw-secondary);
}

.psw-header .psw-header__topbar-phone {
	color: inherit;
	text-decoration: none;
}

.psw-header .psw-header__langs {
	display: flex;
	gap: 8px;
}

.psw-header .psw-header__lang {
	color: inherit;
	text-decoration: none;
}

.psw-header .psw-header__lang.is-active {
	font-weight: 500;
}

.psw-header a.psw-header__lang:hover,
.psw-header .psw-header__topbar-phone:hover {
	color: var(--psw-secondary);
}

/* --- Barra principal --- */

.psw-header .psw-header__bar {
	position: relative;
	z-index: 2;
	background-color: var(--psw-surface-soft);
}

.psw-header .psw-header__bar > .psw-header__inner {
	min-height: var(--psw-bar-h);
	padding-block: 17px;
}

.psw-header .psw-header__logo {
	display: inline-flex;
	flex-shrink: 0;
}

.psw-header .psw-header__logo-img {
	display: block;
	width: auto;
	height: 22px;
	max-width: 202px;
}

.psw-header .psw-header__menu {
	display: flex;
	align-items: center;
	gap: 2px;
}

.psw-header .psw-header__pill {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 10px 13px;
	border-radius: 999px;
	transition: background-color 0.2s ease;
}

.psw-header .psw-header__item:hover > .psw-header__pill,
.psw-header .psw-header__item.is-open > .psw-header__pill,
.psw-header .psw-header__item.is-current > .psw-header__pill {
	background-color: var(--psw-surface-sand);
}

.psw-header .psw-header__link {
	color: var(--psw-foreground);
	font-size: var(--e-global-typography-om_texto_m_med-font-size, 17px);
	font-weight: 500;
	line-height: var(--e-global-typography-om_texto_m_med-line-height, 28px);
	text-decoration: none;
	white-space: nowrap;
}

.psw-header .psw-header__link:hover {
	color: var(--psw-foreground);
}

.psw-header button.psw-header__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 28px;
	margin: 0 -6px 0 -4px;
	color: var(--psw-foreground);
	cursor: pointer;
}

.psw-header .psw-header__toggle svg {
	width: 10px;
	height: 6px;
	transition: transform 0.2s ease;
}

.psw-header .psw-header__item.is-open .psw-header__toggle svg {
	transform: rotate(180deg);
}

.psw-header .psw-header__badge {
	display: inline-block;
	padding: 2px 7px;
	border-radius: 99px;
	background-color: var(--psw-primary);
	color: var(--psw-primary-foreground);
	font-size: var(--e-global-typography-om_etiqueta-font-size, 13px);
	font-weight: 500;
	line-height: var(--e-global-typography-om_etiqueta-line-height, 20px);
	letter-spacing: var(--e-global-typography-om_etiqueta-letter-spacing, 1.6px);
	text-transform: uppercase;
	white-space: nowrap;
}

.psw-header .psw-header__actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

.psw-header .psw-header__phone {
	color: var(--psw-primary);
	font-size: var(--e-global-typography-om_texto_m_med-font-size, 17px);
	font-weight: 500;
	line-height: var(--e-global-typography-om_texto_m_med-line-height, 28px);
	text-decoration: none;
	white-space: nowrap;
}

.psw-header .psw-header__phone:hover {
	color: var(--psw-secondary);
}

.psw-header .psw-header__notice {
	font-size: 14px;
	color: var(--psw-muted-foreground);
}

/* --- Megamenú --- */

.psw-header .psw-header__panel {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background-color: var(--psw-surface-raised);
	box-shadow: var(--psw-shadow-panel);
	animation: psw-header-in 0.18s ease-out;
}

.psw-header .psw-header__panel-inner {
	align-items: flex-start;
	gap: 48px;
	padding-block: 44px 48px;
}

.psw-header .psw-header__groups {
	display: flex;
	flex: 1 1 auto;
	flex-wrap: wrap;
	gap: 48px;
	min-width: 0;
}

.psw-header .psw-header__group {
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: 236px;
}

.psw-header .psw-header__group--desc {
	width: 320px;
}

.psw-header .psw-header__group--cols-2 {
	width: calc(2 * 236px + 48px);
}

.psw-header .psw-header__group-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--psw-primary);
}

.psw-header .psw-header__group-title,
.psw-header .psw-header__promo-eyebrow {
	color: var(--psw-label);
	font-size: var(--e-global-typography-om_etiqueta-font-size, 13px);
	font-weight: 500;
	line-height: var(--e-global-typography-om_etiqueta-line-height, 20px);
	letter-spacing: var(--e-global-typography-om_etiqueta-letter-spacing, 1.6px);
	text-transform: uppercase;
}

.psw-header .psw-header__group-all {
	color: var(--psw-foreground);
	font-size: var(--e-global-typography-om_texto_s-font-size, 14px);
	line-height: var(--e-global-typography-om_texto_s-line-height, 22px);
	text-decoration: none;
	white-space: nowrap;
}

.psw-header .psw-header__group-all:hover {
	color: var(--psw-secondary);
}

.psw-header .psw-header__links > li {
	margin-bottom: 10px;
	break-inside: avoid;
}

.psw-header .psw-header__group--desc .psw-header__links > li {
	margin-bottom: 14px;
}

.psw-header .psw-header__group--cols-2 .psw-header__links {
	column-count: 2;
	column-gap: 48px;
}

.psw-header .psw-header__sublink {
	display: flex;
	flex-direction: column;
	gap: 2px;
	color: var(--psw-foreground);
	text-decoration: none;
}

.psw-header .psw-header__sublink-title {
	font-size: var(--e-global-typography-om_texto_m-font-size, 17px);
	line-height: var(--e-global-typography-om_texto_m-line-height, 28px);
}

.psw-header .psw-header__group--desc .psw-header__sublink-title {
	font-weight: 500;
}

.psw-header .psw-header__sublink-desc {
	color: var(--psw-muted-foreground);
	font-size: var(--e-global-typography-om_texto_s-font-size, 14px);
	line-height: var(--e-global-typography-om_texto_s-line-height, 22px);
}

.psw-header .psw-header__sublink:hover .psw-header__sublink-title,
.psw-header .psw-header__sublink[aria-current] .psw-header__sublink-title {
	color: var(--psw-secondary);
}

.psw-header .psw-header__promo {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	flex: 0 0 380px;
	padding: 28px;
	border-radius: var(--psw-radius-card);
	background-color: var(--psw-surface);
}

.psw-header .psw-header__promo-title {
	color: var(--psw-foreground-strong);
	font-family: var(--psw-font-display);
	font-size: var(--e-global-typography-om_display_s-font-size, 36px);
	font-weight: var(--e-global-typography-om_display_s-font-weight, 300);
	line-height: var(--e-global-typography-om_display_s-line-height, 1.14);
}

.psw-header .psw-header__promo-title em {
	color: var(--psw-secondary);
	font-style: italic;
}

.psw-header .psw-header__promo-text {
	color: var(--psw-muted-foreground);
	font-size: var(--e-global-typography-om_texto_s-font-size, 14px);
	line-height: var(--e-global-typography-om_texto_s-line-height, 22px);
}

.psw-header .psw-header__overlay {
	position: fixed;
	inset: 0;
	z-index: 1;
	background-color: rgba(38, 41, 34, 0.45);
	animation: psw-header-fade 0.18s ease-out;
}

/* --- Botón de menú y menú móvil --- */

.psw-header button.psw-header__burger,
.psw-header button.psw-header__close,
.psw-header button.psw-header__burger:hover,
.psw-header button.psw-header__close:hover,
.psw-header button.psw-header__burger:focus,
.psw-header button.psw-header__close:focus {
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	border: 1px solid var(--psw-border);
	border-radius: 22px;
	background-color: var(--psw-surface-raised);
	color: var(--psw-primary);
	cursor: pointer;
}

.psw-header button.psw-header__burger {
	display: none;
}

.psw-header .psw-header__burger-lines {
	display: block;
	width: 16px;
	height: 1.5px;
	background-color: currentColor;
	box-shadow: 0 5px 0 currentColor, 0 -5px 0 currentColor;
}

.psw-header button.psw-header__close {
	display: inline-flex;
}

.psw-header .psw-header__close-icon {
	position: relative;
	width: 18px;
	height: 18px;
}

.psw-header .psw-header__close-icon::before,
.psw-header .psw-header__close-icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	width: 100%;
	height: 1.5px;
	background-color: currentColor;
	transform: rotate(45deg);
}

.psw-header .psw-header__close-icon::after {
	transform: rotate(-45deg);
}

.psw-header .psw-header__drawer {
	position: fixed;
	inset: var(--psw-top-offset) 0 0 0;
	z-index: 100000;
	display: flex;
	flex-direction: column;
	background-color: var(--psw-background);
	overflow-y: auto;
	overscroll-behavior: contain;
	animation: psw-header-fade 0.18s ease-out;
}

.psw-header .psw-header__drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 66px;
	padding-inline: 20px;
	border-bottom: 1px solid var(--psw-border);
}

.psw-header .psw-header__drawer-nav {
	flex: 1 0 auto;
	padding: 0 20px 24px;
}

.psw-header .psw-header__acc-item {
	border-bottom: 1px solid var(--psw-border);
}

.psw-header .psw-header__acc-toggle,
.psw-header button.psw-header__acc-toggle,
.psw-header button.psw-header__acc-toggle:hover,
.psw-header button.psw-header__acc-toggle:focus {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 26px 0;
	color: var(--psw-foreground-strong);
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}

.psw-header .psw-header__acc-title {
	flex: 1 1 auto;
	font-family: var(--psw-font-display);
	font-size: 28px;
	font-weight: 400;
	line-height: 1.15;
}

.psw-header .psw-header__acc-icon {
	position: relative;
	flex: 0 0 14px;
	width: 14px;
	height: 14px;
}

.psw-header .psw-header__acc-icon::before,
.psw-header .psw-header__acc-icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	width: 100%;
	height: 1.25px;
	background-color: currentColor;
}

.psw-header .psw-header__acc-icon::after {
	transform: rotate(90deg);
	transition: transform 0.2s ease;
}

.psw-header .psw-header__acc-toggle[aria-expanded="true"] .psw-header__acc-icon::after {
	transform: rotate(0deg);
}

.psw-header .psw-header__acc-panel {
	padding-bottom: 20px;
}

.psw-header .psw-header__acc-hub {
	display: inline-block;
	margin-bottom: 6px;
	color: var(--psw-primary);
	font-size: var(--e-global-typography-om_texto_s_med-font-size, 14px);
	font-weight: 500;
	line-height: var(--e-global-typography-om_texto_s_med-line-height, 22px);
	text-decoration: none;
}

.psw-header .psw-header__acc-group {
	margin-top: 14px !important;
	color: var(--psw-label);
	font-size: var(--e-global-typography-om_etiqueta-font-size, 11px);
	font-weight: 500;
	line-height: var(--e-global-typography-om_etiqueta-line-height, 16px);
	letter-spacing: var(--e-global-typography-om_etiqueta-letter-spacing, 1.4px);
	text-transform: uppercase;
}

.psw-header .psw-header__acc-links a {
	display: block;
	padding-block: 10px;
	color: var(--psw-foreground);
	font-size: var(--e-global-typography-om_texto_m-font-size, 15.5px);
	line-height: var(--e-global-typography-om_texto_m-line-height, 25px);
	text-decoration: none;
}

.psw-header .psw-header__acc-links a[aria-current] {
	color: var(--psw-secondary);
}

.psw-header .psw-header__drawer-cta {
	position: sticky;
	bottom: 0;
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 1fr;
	gap: 10px;
	padding: 16px 20px;
	background-color: var(--psw-surface);
}

html.psw-no-scroll,
html.psw-no-scroll body {
	overflow: hidden;
}

/* --- Barra fija --- */

.psw-header.is-stuck {
	padding-bottom: var(--psw-bar-h);
}

.psw-header.is-stuck .psw-header__bar {
	position: fixed;
	top: var(--psw-top-offset);
	left: 0;
	right: 0;
	box-shadow: 0 1px 0 var(--psw-border);
}

/* --- Por debajo de 1280 px: versión móvil --- */

@media (max-width: 1279px) {
	.psw-header {
		--psw-bar-h: 66px;
	}

	.psw-header .psw-header__nav,
	.psw-header .psw-header__actions {
		display: none;
	}

	.psw-header button.psw-header__burger {
		display: inline-flex;
	}

	.psw-header .psw-header__bar {
		background-color: rgba(249, 246, 242, 0.88);
		-webkit-backdrop-filter: blur(16px);
		backdrop-filter: blur(16px);
	}

	.psw-header .psw-header__bar > .psw-header__inner {
		padding-block: 11px;
	}

	.psw-header .psw-header__overlay {
		display: none !important;
	}
}

/*
 * Portátiles (1280–1439 px): la barra completa necesita ~1430 px. Se quita el
 * teléfono de la barra (sigue en la topbar) y se compacta el espaciado.
 */
@media (min-width: 1280px) and (max-width: 1439px) {
	.psw-header .psw-header__bar > .psw-header__inner {
		gap: 16px;
	}

	.psw-header .psw-header__pill {
		padding-inline: 10px;
	}

	.psw-header .psw-header__phone {
		display: none;
	}
}

@media (min-width: 1280px) {
	.psw-header .psw-header__drawer {
		display: none !important;
	}
}

@media (max-width: 767px) {
	.psw-header .psw-header__topbar .psw-header__inner {
		min-height: 38px;
		padding-block: 9px;
	}

	.psw-header .psw-header__topbar-text--secondary,
	.psw-header .psw-header__topbar-phone {
		display: none;
	}

	.psw-header .psw-header__drawer-head {
		padding-inline: 16px;
	}
}

@keyframes psw-header-in {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: none; }
}

@keyframes psw-header-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.psw-header *,
	.psw-header .psw-header__panel,
	.psw-header .psw-header__overlay,
	.psw-header .psw-header__drawer {
		animation: none !important;
		transition: none !important;
	}
}
