/* Header y navegación responsive. Se carga en todo el sitio. */
.erasmo-header {
	border-bottom: 1px solid var(--erasmo-gray-100);
	background: rgb(255 255 255 / 82%);
	-webkit-backdrop-filter: blur(18px);
	backdrop-filter: blur(18px);
}

.erasmo-announcement {
	padding-block: 0.5rem;
	background: var(--erasmo-black);
	color: var(--erasmo-white);
	font-size: 0.75rem;
	text-align: center;
}

.erasmo-announcement p {
	margin-block: 0;
}

.erasmo-header-main {
	max-width: 1180px;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 2rem;
	min-height: var(--erasmo-header-height);
	padding-block: 0;
}

.erasmo-brand {
	align-self: start;
	min-width: 0;
	max-width: 10rem;
}

.erasmo-brand-text {
	color: var(--erasmo-black);
	font-size: 2rem;
	font-weight: 700;
	letter-spacing: -0.06em;
	line-height: 1;
	text-decoration: none;
}

.erasmo-brand .custom-logo-link {
	display: block;
}

.erasmo-brand .custom-logo {
	display: block;
	width: auto;
	max-height: 3rem;
	object-fit: contain;
}

.erasmo-navigation {
	min-width: 0;
}

.erasmo-menu,
.erasmo-menu .sub-menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.erasmo-menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.25rem 1.25rem;
}

.erasmo-menu a {
	display: block;
	padding-block: 0.65rem;
	color: var(--erasmo-gray-600);
	font-size: 1rem;
	font-weight: 600;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.erasmo-menu a:hover,
.erasmo-menu a:focus-visible,
.erasmo-menu .current-menu-item > a,
.erasmo-menu .current-menu-ancestor > a {
	color: var(--erasmo-black);
	text-decoration: none;
	text-decoration-color: var(--erasmo-orange);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.4rem;
}

/* Subniveles accesibles por teclado, sin reemplazar el walker nativo. */
.erasmo-menu > li {
	position: relative;
}

.erasmo-menu > li > .sub-menu {
	position: absolute;
	z-index: 5;
	left: 0;
	min-width: 17rem;
	max-width: min(24rem, 80vw);
	max-height: 70vh;
	overflow-y: auto;
	padding: 0.75rem 1rem;
	border: 1px solid var(--erasmo-gray-300);
	border-radius: var(--erasmo-radius-small);
	background: var(--erasmo-white);
	visibility: hidden;
}

.erasmo-menu > li:hover > .sub-menu,
.erasmo-menu > li:focus-within > .sub-menu,
.erasmo-menu > li.is-submenu-open > .sub-menu {
	visibility: visible;
}

.erasmo-menu .sub-menu .sub-menu {
	padding-inline-start: 1rem;
}

.erasmo-header-actions {
	grid-column: 3;
	display: flex;
	align-items: center;
	gap: 0.125rem;
}

.erasmo-icon {
	display: block;
	flex-shrink: 0;
}

.erasmo-cart-count {
	position: absolute;
	top: -0.125rem;
	right: -0.25rem;
	min-width: 1.125rem;
	padding-inline: 0.2rem;
	border-radius: var(--erasmo-radius-medium);
	color: var(--erasmo-black);
	background: var(--erasmo-orange);
	font-size: 0.625rem;
	font-weight: 700;
	line-height: 1.125rem;
}

.erasmo-mobile-menu {
	inset: 0 0 0 auto;
	width: min(100%, 28rem);
	max-width: 100%;
	height: 100%;
	height: 100dvh;
	max-height: 100%;
	margin: 0;
	padding: 1.5rem var(--erasmo-gutter);
	padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
	border: 0;
	color: var(--erasmo-black);
	background: var(--erasmo-white);
	overflow-y: auto;
	overscroll-behavior: contain;
}

.erasmo-mobile-menu:not([open]) {
	display: none;
}

.erasmo-mobile-menu::backdrop {
	background: rgb(17 17 17 / 30%);
}

.erasmo-mobile-menu-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.5rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--erasmo-gray-100);
}

.erasmo-mobile-menu-heading h2 {
	margin: 0;
	font-size: 1.25rem;
}

.erasmo-mobile-account {
	display: block;
	margin-top: 1.5rem;
	padding-block: 1rem;
	border-top: 1px solid var(--erasmo-gray-100);
	color: var(--erasmo-black);
}

html.erasmo-menu-open,
html.erasmo-menu-open body {
	overflow: hidden;
}

@media (max-width: 74.99rem) {
	:root {
		--erasmo-gutter: var(--erasmo-gutter-tablet);
		--erasmo-header-height: 5rem;
	}

	.erasmo-header-main {
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 1rem;
	}

	.erasmo-header-actions {
		grid-column: 2;
		grid-row: 1;
	}

	.erasmo-header-main > .erasmo-navigation {
		grid-column: 1 / -1;
	}

	.erasmo-menu {
		display: block;
	}

	.erasmo-menu a {
		padding-block: 0.8rem;
		font-size: 1rem;
	}

	.erasmo-menu > li > .sub-menu {
		position: static;
		min-width: 0;
		max-width: none;
		max-height: none;
		padding: 0 0 0 1rem;
		border: 0;
		visibility: visible;
	}
}

@media (max-width: 47.99rem) {
	:root {
		--erasmo-gutter: var(--erasmo-gutter-mobile);
		--erasmo-header-height: 4.5rem;
	}

	.erasmo-header-main {
		gap: 0.5rem;
		padding-block: 0;
	}

	.erasmo-brand {
		max-width: 8rem;
	}

	.erasmo-brand-text {
		font-size: 1.75rem;
	}

	.erasmo-brand .custom-logo {
		max-height: 2.5rem;
	}

	.erasmo-action-account,
	.erasmo-action-favorites {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.erasmo-button,
	.erasmo-icon-button {
		transition: none;
	}
}

/* Logo cuadrado: misma posición y dimensiones antes y después del scroll. */
.erasmo-brand-logo { display: block; width: var(--erasmo-header-height); height: var(--erasmo-header-height); }
.erasmo-brand-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.erasmo-submenu-toggle { width: 36px; min-height: 44px; border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 1rem; }
.erasmo-menu .has-submenu-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.erasmo-menu .has-submenu-control > .sub-menu { grid-column: 1 / -1; }
.erasmo-menu > li.is-submenu-dismissed > .sub-menu { visibility: hidden; }
.erasmo-menu > .has-submenu-control:not(.is-submenu-open) > .sub-menu { visibility: hidden; }
@media (min-width: 75rem) { .erasmo-menu > li > .sub-menu { top: 100%; } }
@media (max-width: 74.99rem) {
 .erasmo-menu .has-submenu-control > .sub-menu { display: none; }
 .erasmo-menu .is-submenu-open > .sub-menu { display: block; visibility: visible; }
 .erasmo-menu > li { border-bottom: 1px solid var(--erasmo-gray-100); }
 .erasmo-menu .sub-menu a { font-size: 0.875rem; }
 .erasmo-submenu-toggle { width: 44px; }
}

/* Home: superposición y cambio de contraste por scroll. */
.erasmo-header { position: sticky; top: 0; z-index: 30; transition: background-color .2s, color .2s; }
.admin-bar .erasmo-header { top: 32px; }
.erasmo-header--overlay { position: fixed; inset-inline: 0; }
.erasmo-header--overlay.is-enhanced:not(.is-scrolled) { background: transparent; border-color: transparent; color: white; -webkit-backdrop-filter: none; backdrop-filter: none; }
.erasmo-header--overlay.is-enhanced:not(.is-scrolled) .erasmo-header-main > .erasmo-navigation > .erasmo-menu > li > a,
.erasmo-header--overlay.is-enhanced:not(.is-scrolled) .erasmo-header-actions > .erasmo-icon-button { color: white; }
.erasmo-header .erasmo-icon { width: 26px; height: 26px; stroke-width: 1.35; }
.erasmo-cart-count { top: 1px; right: 0; min-width: 15px; height: 15px; display: grid; place-items: center; line-height: 1; padding: 0 3px; font-size: 9px; }
.erasmo-header .sub-menu, .erasmo-mobile-menu { color: var(--erasmo-black); }
@media (max-width: 782px) { .admin-bar .erasmo-header { top: 46px; } }
@media (prefers-reduced-motion: reduce) { .erasmo-header { transition: none; } }

.erasmo-header .erasmo-icon-button:hover:not(:disabled):not([aria-disabled="true"]) { background: rgb(0 0 0 / 8%); }
.erasmo-header--overlay.is-enhanced:not(.is-scrolled) .erasmo-header-actions > .erasmo-icon-button:hover { background: rgb(0 0 0 / 25%); }

/* The full header scrolls away; the compact navigation takes its place. */
.erasmo-header.has-scroll-dock:not(.erasmo-header--overlay) { position:relative; top:auto; }
.erasmo-header.has-scroll-dock.is-scrolled { background:transparent; border-color:transparent; backdrop-filter:none; -webkit-backdrop-filter:none; pointer-events:none; }
.erasmo-header.has-scroll-dock.is-scrolled > .erasmo-header-main,
.erasmo-header.has-scroll-dock.is-scrolled > .erasmo-announcement { visibility:hidden; }
.erasmo-header.has-scroll-dock .erasmo-mobile-menu { pointer-events:auto; }
.erasmo-scroll-dock { position:fixed; z-index:35; left:clamp(.5rem,2vw,2rem); top:50%; transform:translateY(-50%); display:flex; flex-direction:column; gap:.25rem; max-height:calc(100dvh - 6rem); overflow-y:auto; padding:.6rem; background:#fff; color:#161616; border:1px solid #e8e8e8; border-radius:999px; box-shadow:0 8px 28px rgb(0 0 0 / 9%); scrollbar-width:none; }
@media (min-width:75rem) {
 .erasmo-scroll-dock { left:auto; right:clamp(.5rem,2vw,2rem); }
}
.erasmo-scroll-dock[hidden] { display:none; }
.erasmo-dock-item { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; flex-shrink:0; width:44px; min-height:44px; padding:.6rem; border:0; border-radius:50%; background:transparent; color:inherit; text-decoration:none; cursor:pointer; }
.erasmo-dock-item svg { width:24px; height:24px; flex-shrink:0; }
.erasmo-dock-item:hover, .erasmo-dock-item:focus-visible, .erasmo-dock-item[aria-current=page] { background:#fff0e6; color:#d64e00; }
.erasmo-dock-label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.erasmo-dock-more { display:none; }
.erasmo-whatsapp-float { position:fixed; right:clamp(1rem,2vw,2rem); bottom:max(1.25rem,env(safe-area-inset-bottom)); z-index:34; display:grid; place-items:center; width:64px; height:64px; border-radius:50%; background:#55c96a; color:#fff; box-shadow:0 5px 20px rgb(0 0 0 / 16%); transition:background 180ms ease, transform 180ms ease; }
.erasmo-whatsapp-float svg { width:38px; height:38px; }
.erasmo-whatsapp-float:hover { background:#28b84d; color:#fff; transform:translateY(-2px); }
.erasmo-whatsapp-float:focus-visible { outline:3px solid var(--erasmo-black); outline-offset:4px; }
@media (min-width:75rem) and (max-height:600px) {
 .erasmo-scroll-dock { top:1rem; transform:none; max-height:calc(100dvh - 7rem); }
}
@media (max-width:74.99rem) {
 .erasmo-whatsapp-float { width:56px; height:56px; right:1rem; bottom:calc(6rem + env(safe-area-inset-bottom)); }
 .erasmo-whatsapp-float svg { width:34px; height:34px; }
}
@media (prefers-reduced-motion:reduce) { .erasmo-whatsapp-float { transition:none; } }
@media(max-width:74.99rem){
 .erasmo-scroll-dock { inset:auto .75rem max(.5rem,env(safe-area-inset-bottom)); transform:none; flex-direction:row; justify-content:space-around; gap:0; max-width:34rem; margin-inline:auto; padding:.45rem .5rem; border-radius:1.5rem; overflow:visible; }
 .erasmo-scroll-dock > .erasmo-dock-item { display:none; }
 .erasmo-scroll-dock > .erasmo-dock-home, .erasmo-scroll-dock > .erasmo-dock-shop:not(.erasmo-dock-extra), .erasmo-scroll-dock > .erasmo-dock-search, .erasmo-scroll-dock > .erasmo-dock-cart, .erasmo-scroll-dock > .erasmo-dock-more { display:flex; }
 .erasmo-dock-item { width:auto; flex:1; min-width:0; padding:.35rem .2rem; gap:.25rem; border-radius:.85rem; }
 .erasmo-dock-label { position:static; width:auto; height:auto; clip-path:none; font-size:.625rem; line-height:1.2; font-weight:500; white-space:nowrap; }
 .erasmo-scroll-dock .erasmo-cart-count { right:calc(50% - 20px); top:0; }
 body:has(.erasmo-scroll-dock) { padding-bottom:calc(5.25rem + env(safe-area-inset-bottom)); }
 .erasmo-mobile-menu { inset:auto 0 0; width:100%; height:auto; max-height:85dvh; border-radius:1.5rem 1.5rem 0 0; }
}
