/* Hallmark · component: off-canvas mobile nav drawer · genre: editorial/luxury
 * theme: "Lujo cálido" (reutiliza tokens del sitio) · Prosingladura
 * states: default · hover · focus · active · disabled · loading(n/a) · error(n/a) · current
 * contrast: pass
 *
 * Rediseño del drawer #group-icon-header (.ts-floating-sidebar). NO se toca el tema
 * padre ni su JS: solo se sobrescribe la capa visual desde el hijo y se añade el
 * drill-down con js/mobile-menu-drilldown.js. Ámbito acotado con .yoo-mm (clase que
 * el JS añade al body) para no afectar a otros floating-sidebar (buscador, carrito).
 */

/* ------------------------------------------------------------------ *
 * Tokens locales (heredan del sistema del sitio; fallback incluido)
 * ------------------------------------------------------------------ */
:root {
	/* Fondo BLANCO/neutro (nada de crema): el cliente lo pidió blanco. Se usan
	 * grises neutros propios, NO se hereda la paleta cálida de /mi-cuenta. */
	--mm-paper:        #ffffff;
	--mm-surface:      #ffffff;
	--mm-surface-2:    #f5f6f8;   /* gris neutro muy claro para cápsulas/hover */
	--mm-ink:          #1a1d21;   /* tinta gris azulada neutra */
	--mm-body:         #3d4149;
	--mm-muted:        #8b9098;
	--mm-accent:       var(--yoo-color-primary, #125bc9);
	--mm-accent-hover: var(--yoo-color-primary-hover, #0f4ea8);
	--mm-accent-soft:  var(--yoo-color-primary-soft, #eaf1fd);
	/* La marca Singladura es AZUL: el "acento de detalle" es el propio azul,
	 * no dorado. Se mantienen los nombres --mm-gold* como alias del azul para no
	 * reescribir cada regla; visualmente todo el menú es azul + neutros. */
	--mm-gold:         var(--yoo-color-primary, #125bc9);
	--mm-gold-soft:    color-mix(in srgb, var(--yoo-color-primary, #125bc9) 30%, transparent);
	--mm-line:         #e7e9ee;   /* borde gris neutro (antes beige) */
	/* SIEMPRE la fuente del sitio (Poppins vía --ts-font-family). Nada de serif
	 * ajena: display y body usan la misma familia; el énfasis va por PESO. */
	--mm-font-display: var(--ts-font-family, var(--yoo-font-family, "Poppins", sans-serif));
	--mm-font-body:    var(--ts-font-family, var(--yoo-font-family, "Poppins", sans-serif));
	--mm-shadow:       -8px 0 48px -12px rgba(20, 24, 31, 0.28);
	--mm-radius:       16px;
	--mm-radius-sm:    12px;
	--mm-ease:         var(--yoo-ease-in-out, cubic-bezier(0.4, 0, 0.2, 1));
	--mm-ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
	--mm-dur:          0.42s;
	--mm-dur-fast:     0.18s;
}

/* ================================================================== *
 * PANEL — solo cuando el drawer está activo y es el nuestro
 * ================================================================== */
#group-icon-header.ts-floating-sidebar .ts-sidebar-content {
	width: min(88vw, 420px);
	padding: 0;
	background: var(--mm-paper);
	transition: transform var(--mm-dur) var(--mm-ease-out);
	overflow: hidden;               /* el scroll lo lleva el cuerpo interno */
	display: flex;
	flex-direction: column;
}

#group-icon-header.ts-floating-sidebar.active .ts-sidebar-content {
	box-shadow: var(--mm-shadow);
}

/* Overlay con desenfoque suave */
#group-icon-header.ts-floating-sidebar div.overlay {
	background: rgba(20, 24, 31, 0.42);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
}

/* (Sin franja lateral: el cliente pidió NUNCA bordes a la izquierda.) */

/* ------------------------------------------------------------------ *
 * CABECERA de marca
 * ------------------------------------------------------------------ */
.yoo-mm-head {
	position: relative;
	padding: 22px 20px 18px;
	background: linear-gradient(180deg, var(--mm-surface) 0%, var(--mm-paper) 100%);
	border-bottom: 1px solid var(--mm-line);
	flex: 0 0 auto;
}
.yoo-mm-brand {
	font-family: var(--mm-font-display);
	font-weight: 600;
	font-size: 1.42rem;
	line-height: 1;
	color: var(--mm-ink);
	letter-spacing: -0.01em;
	margin: 0;
}
.yoo-mm-brand span { color: var(--mm-accent); }

/* Logo de marca */
.yoo-mm-logo {
	display: inline-block;
	max-width: 190px;
	line-height: 0;
}
.yoo-mm-logo img {
	display: block;
	max-width: 100%;
	height: auto;
	max-height: 46px;
	width: auto;
}

.yoo-mm-greeting {
	margin: 7px 0 0;
	font-family: var(--mm-font-body);
	font-size: 0.82rem;
	color: var(--mm-muted);
	letter-spacing: 0.01em;
}
.yoo-mm-greeting strong { color: var(--mm-body); font-weight: 600; }

/* Botón cerrar — círculo perfecto (dimensiones fijas + no encoger) con aspa AZUL */
#group-icon-header .yoo-mm-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 42px;
	height: 42px;
	min-width: 42px;
	min-height: 42px;
	flex: 0 0 42px;
	padding: 0;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1.5px solid var(--mm-accent-soft);
	border-radius: 50%;
	aspect-ratio: 1 / 1;      /* fuerza círculo aunque el padre estire */
	background: var(--mm-accent-soft);
	color: var(--mm-accent);  /* aspa azul */
	cursor: pointer;
	transition: transform var(--mm-dur-fast) var(--mm-ease),
	            border-color var(--mm-dur-fast) var(--mm-ease),
	            background var(--mm-dur-fast) var(--mm-ease);
	z-index: 3;
	-webkit-tap-highlight-color: transparent;
}
#group-icon-header .yoo-mm-close:hover,
#group-icon-header .yoo-mm-close.is-hover { background: var(--mm-accent); color: #fff; border-color: var(--mm-accent); }
#group-icon-header .yoo-mm-close:active,
#group-icon-header .yoo-mm-close.is-active { transform: scale(0.92); }
#group-icon-header .yoo-mm-close:focus-visible {
	outline: 2px solid var(--mm-accent);
	outline-offset: 2px;
}
#group-icon-header .yoo-mm-close svg {
	width: 20px; height: 20px;
	stroke: currentColor; stroke-width: 2.4;
	display: block;
}

/* ------------------------------------------------------------------ *
 * CUERPO deslizante (pistas de niveles: raíz + drill-down)
 * ------------------------------------------------------------------ */
.yoo-mm-body {
	position: relative;
	flex: 1 1 auto;
	overflow: hidden;
}
.yoo-mm-track {
	display: flex;
	width: 200%;
	height: 100%;
	transform: translateX(0);
	transition: transform var(--mm-dur) var(--mm-ease-out);
}
.yoo-mm-body.is-drilled .yoo-mm-track { transform: translateX(-50%); }

.yoo-mm-pane {
	width: 50%;
	height: 100%;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 10px 14px 24px;
}
.yoo-mm-pane--sub { padding-top: 6px; }

/* Cabecera "Volver" del subpanel */
.yoo-mm-back {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 12px 12px;
	margin-bottom: 6px;
	border: none;
	background: transparent;
	font-family: var(--mm-font-body);
	font-size: 0.86rem;
	font-weight: 600;
	color: var(--mm-accent);
	cursor: pointer;
	border-radius: var(--mm-radius-sm);
	transition: background var(--mm-dur-fast) var(--mm-ease);
}
.yoo-mm-back:hover, .yoo-mm-back.is-hover { background: var(--mm-accent-soft); }
.yoo-mm-back:active, .yoo-mm-back.is-active { transform: translateX(-2px); }
.yoo-mm-back:focus-visible { outline: 2px solid var(--mm-accent); outline-offset: 2px; }
.yoo-mm-back svg { width: 18px; height: 18px; }
.yoo-mm-sub-title {
	font-family: var(--mm-font-display);
	font-weight: 700;
	font-size: 1.05rem;
	color: var(--mm-ink);
	padding: 2px 12px 10px;
	margin: 0 0 4px;
	border-bottom: 1px solid var(--mm-line);
}

/* ------------------------------------------------------------------ *
 * ITEMS de menú — "tarjetas" táctiles
 * ------------------------------------------------------------------ */
.yoo-mm-list { list-style: none; margin: 0; padding: 0; }
.yoo-mm-list li::before,
.yoo-mm-list li::marker { content: none !important; }
.yoo-mm-item {
	list-style: none !important;
	margin: 0 0 2px;
}
.yoo-mm-item::before,
.yoo-mm-item::marker { content: none !important; display: none !important; }

.yoo-mm-link {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 14px;
	border-radius: var(--mm-radius-sm);
	background: transparent;
	color: var(--mm-ink);
	font-family: var(--mm-font-body);
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	border: 1px solid transparent;
	transition: background var(--mm-dur-fast) var(--mm-ease),
	            border-color var(--mm-dur-fast) var(--mm-ease),
	            transform var(--mm-dur-fast) var(--mm-ease);
	-webkit-tap-highlight-color: transparent;
	min-width: 0;
}
.yoo-mm-link:hover,
.yoo-mm-link.is-hover {
	background: var(--mm-surface);
	border-color: var(--mm-line);
}
.yoo-mm-link:active,
.yoo-mm-link.is-active { transform: scale(0.985); background: var(--mm-surface-2); }
.yoo-mm-link:focus-visible {
	outline: 2px solid var(--mm-accent);
	outline-offset: 1px;
}

/* Icono en cápsula */
.yoo-mm-ico {
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	display: grid;
	place-items: center;
	border-radius: 10px;
	background: var(--mm-surface-2);
	border: 1px solid var(--mm-line);
	color: var(--mm-body);
	transition: background var(--mm-dur-fast) var(--mm-ease), color var(--mm-dur-fast) var(--mm-ease);
}
.yoo-mm-ico svg, .yoo-mm-ico img { width: 20px; height: 20px; display: block; }
.yoo-mm-label { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }

/* Chevron para items con hijos */
.yoo-mm-chevron {
	flex: 0 0 auto;
	color: var(--mm-muted);
	display: grid;
	place-items: center;
	transition: transform var(--mm-dur-fast) var(--mm-ease), color var(--mm-dur-fast) var(--mm-ease);
}
.yoo-mm-chevron svg { width: 18px; height: 18px; }
.yoo-mm-link:hover .yoo-mm-chevron { color: var(--mm-accent); transform: translateX(2px); }

/* Estado ACTIVO (página actual) — SIN borde izquierdo (prohibido). Marca con
 * fondo + filo dorado inferior y el icono acentuado. */
.yoo-mm-item.is-current > .yoo-mm-link {
	background: var(--mm-surface);
	border-color: var(--mm-gold-soft);
	box-shadow: inset 0 -2px 0 var(--mm-gold);
	color: var(--mm-ink);
	font-weight: 600;
}
.yoo-mm-item.is-current > .yoo-mm-link .yoo-mm-ico {
	background: var(--mm-accent-soft);
	border-color: transparent;
	color: var(--mm-accent);
}

/* Separador entre secciones */
.yoo-mm-divider {
	height: 1px;
	background: var(--mm-line);
	margin: 14px 8px;
	border: none;
}
.yoo-mm-section-label {
	font-family: var(--mm-font-body);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--mm-muted);
	padding: 4px 14px 8px;
}

/* ------------------------------------------------------------------ *
 * PIE fijo — meta (deseos/cuenta) + CTA presupuesto
 * ------------------------------------------------------------------ */
.yoo-mm-foot {
	position: relative;
	flex: 0 0 auto;
	padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px));
	background: linear-gradient(180deg, transparent 0%, var(--mm-surface) 26%);
	border-top: 1px solid var(--mm-line);
}
/* Catálogo 2026 — bloque destacado en el pie */
.yoo-mm-catalog {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 13px 14px;
	margin-bottom: 12px;
	border-radius: var(--mm-radius);
	text-decoration: none;
	color: var(--mm-ink);
	background:
		linear-gradient(135deg, color-mix(in srgb, var(--mm-accent) 12%, var(--mm-surface)) 0%, var(--mm-surface) 62%);
	border: 1px solid color-mix(in srgb, var(--mm-accent) 26%, transparent);
	box-shadow: 0 6px 18px -12px color-mix(in srgb, var(--mm-accent) 45%, transparent);
	transition: transform var(--mm-dur-fast) var(--mm-ease), box-shadow var(--mm-dur-fast) var(--mm-ease);
}
.yoo-mm-catalog:hover, .yoo-mm-catalog.is-hover { transform: translateY(-1px); box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--mm-accent) 55%, transparent); }
.yoo-mm-catalog:active, .yoo-mm-catalog.is-active { transform: translateY(0) scale(0.99); }
.yoo-mm-catalog:focus-visible { outline: 2px solid var(--mm-accent); outline-offset: 2px; }
.yoo-mm-catalog-ico {
	flex: 0 0 auto;
	width: 40px; height: 40px;
	display: grid; place-items: center;
	border-radius: 10px;
	background: var(--mm-accent-soft);
	color: var(--mm-accent);
}
.yoo-mm-catalog-ico svg { width: 21px; height: 21px; }
.yoo-mm-catalog-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.yoo-mm-catalog-txt strong {
	font-family: var(--mm-font-display);
	font-weight: 700;
	font-size: 1.02rem;
	color: var(--mm-ink);
	line-height: 1.1;
}
.yoo-mm-catalog-txt span {
	font-size: 0.76rem;
	color: var(--mm-muted);
}
.yoo-mm-catalog-arrow { flex: 0 0 auto; color: var(--mm-accent); display: grid; place-items: center; }
.yoo-mm-catalog-arrow svg { width: 18px; height: 18px; }

/* "Ver todo" en subpanel + contador de subcategoría */
.yoo-mm-item--all > .yoo-mm-link {
	color: var(--mm-accent);
	font-weight: 600;
}
.yoo-mm-item--all > .yoo-mm-link .yoo-mm-ico {
	background: var(--mm-accent-soft);
	border-color: transparent;
	color: var(--mm-accent);
}
.yoo-mm-count {
	flex: 0 0 auto;
	font-size: 0.74rem;
	font-weight: 600;
	color: var(--mm-muted);
	background: var(--mm-surface-2);
	border: 1px solid var(--mm-line);
	border-radius: 999px;
	padding: 2px 9px;
	min-width: 26px;
	text-align: center;
}

/* Subcategorías (drill-down): solo texto, compactas, poco alto entre ellas */
.yoo-mm-item--cat { margin: 0; }
.yoo-mm-link--cat {
	gap: 8px;
	padding: 9px 14px;          /* menos alto que un item normal (14px→9px) */
	border-radius: 10px;
	font-weight: 500;
	font-size: 0.95rem;
}
.yoo-mm-link--cat .yoo-mm-label { line-height: 1.15; }

/* Separador con título dentro del drill-down (p. ej. "Estancias" bajo Productos) */
.yoo-mm-sep {
	list-style: none;
	margin: 12px 0 4px;
	padding: 14px 14px 0;
	border-top: 1px solid var(--mm-line);
	pointer-events: none;
}
.yoo-mm-sep::before,
.yoo-mm-sep::marker { content: none !important; display: none !important; }
.yoo-mm-sep-label {
	display: block;
	font-family: var(--mm-font-display);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--mm-muted);
}

.yoo-mm-meta {
	display: flex;
	gap: 10px;
	margin-bottom: 12px;
}
.yoo-mm-meta-btn {
	flex: 1 1 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 8px;
	border-radius: var(--mm-radius-sm);
	background: var(--mm-surface-2);
	border: 1px solid var(--mm-line);
	color: var(--mm-body);
	font-family: var(--mm-font-body);
	font-size: 0.84rem;
	font-weight: 600;
	text-decoration: none;
	transition: background var(--mm-dur-fast) var(--mm-ease), border-color var(--mm-dur-fast) var(--mm-ease);
}
.yoo-mm-meta-btn:hover, .yoo-mm-meta-btn.is-hover { background: var(--mm-surface); border-color: var(--mm-gold); }
.yoo-mm-meta-btn:active, .yoo-mm-meta-btn.is-active { transform: scale(0.97); }
.yoo-mm-meta-btn:focus-visible { outline: 2px solid var(--mm-accent); outline-offset: 2px; }
.yoo-mm-meta-btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.yoo-mm-meta-btn .count { color: var(--mm-muted); font-weight: 500; }

.yoo-mm-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 15px 16px;
	border-radius: 999px;
	background: var(--mm-accent);
	color: #fff;
	font-family: var(--mm-font-body);
	font-size: 1rem;
	font-weight: 700;
	text-decoration: none;
	border: none;
	cursor: pointer;
	box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--mm-accent) 70%, transparent);
	transition: background var(--mm-dur-fast) var(--mm-ease), transform var(--mm-dur-fast) var(--mm-ease);
}
.yoo-mm-cta:hover, .yoo-mm-cta.is-hover { background: var(--mm-accent-hover); }
.yoo-mm-cta:active, .yoo-mm-cta.is-active { transform: translateY(1px) scale(0.99); }
.yoo-mm-cta:focus-visible { outline: 2px solid var(--mm-ink); outline-offset: 2px; }
.yoo-mm-cta[aria-disabled="true"], .yoo-mm-cta:disabled {
	opacity: 0.5; pointer-events: none;
}
.yoo-mm-cta svg { width: 20px; height: 20px; flex: 0 0 auto; }

/* ------------------------------------------------------------------ *
 * MOTION — entrada escalonada de items al abrir
 * ------------------------------------------------------------------ */
/* Solo los items del panel RAÍZ y el pie hacen la entrada escalonada.
 * Los del subpanel se muestran siempre (se rellenan al vuelo en el drill-down). */
.yoo-mm .yoo-mm-pane--root .yoo-mm-item,
.yoo-mm .yoo-mm-foot > * {
	opacity: 0;
	transform: translateY(10px);
}
body.menu-mobile-active.yoo-mm .yoo-mm-pane--root .yoo-mm-item,
body.menu-mobile-active.yoo-mm .yoo-mm-foot > * {
	animation: yoo-mm-in var(--mm-dur) var(--mm-ease-out) forwards;
}
/* El subpanel nunca queda invisible */
.yoo-mm .yoo-mm-pane--sub .yoo-mm-item { opacity: 1; transform: none; }
@keyframes yoo-mm-in {
	to { opacity: 1; transform: translateY(0); }
}
/* stagger (hasta 10 items) */
body.menu-mobile-active.yoo-mm .yoo-mm-pane--root .yoo-mm-item:nth-child(1) { animation-delay: 0.06s; }
body.menu-mobile-active.yoo-mm .yoo-mm-pane--root .yoo-mm-item:nth-child(2) { animation-delay: 0.10s; }
body.menu-mobile-active.yoo-mm .yoo-mm-pane--root .yoo-mm-item:nth-child(3) { animation-delay: 0.14s; }
body.menu-mobile-active.yoo-mm .yoo-mm-pane--root .yoo-mm-item:nth-child(4) { animation-delay: 0.18s; }
body.menu-mobile-active.yoo-mm .yoo-mm-pane--root .yoo-mm-item:nth-child(5) { animation-delay: 0.22s; }
body.menu-mobile-active.yoo-mm .yoo-mm-pane--root .yoo-mm-item:nth-child(6) { animation-delay: 0.26s; }
body.menu-mobile-active.yoo-mm .yoo-mm-pane--root .yoo-mm-item:nth-child(n+7) { animation-delay: 0.30s; }
body.menu-mobile-active.yoo-mm .yoo-mm-foot > *:nth-child(1) { animation-delay: 0.30s; }
body.menu-mobile-active.yoo-mm .yoo-mm-foot > *:nth-child(2) { animation-delay: 0.34s; }

/* ------------------------------------------------------------------ *
 * Ocultar el andamiaje original del tema padre cuando usamos el nuestro
 * ------------------------------------------------------------------ */
.yoo-mm #group-icon-header .tab-mobile-menu,
.yoo-mm #group-icon-header .menu-title,
.yoo-mm #group-icon-header .group-button-header { display: none !important; }

/* Ocultar TODO el contenido original del padre dentro del panel; solo se muestran
 * nuestras tres piezas (head/body/foot). Blindaje contra restos que asomen. */
.yoo-mm #group-icon-header .ts-sidebar-content > .sidebar-content,
.yoo-mm #group-icon-header .ts-sidebar-content > :not(.yoo-mm-head):not(.yoo-mm-body):not(.yoo-mm-foot):not(.overlay) {
	display: none !important;
}

/* ------------------------------------------------------------------ *
 * Ocultar la burbuja flotante global (yoo fixed-bottom / floating-message)
 * mientras el drawer está abierto — asomaba por detrás del CTA.
 * ------------------------------------------------------------------ */
body.menu-mobile-active .yoo-fm-bubble,
body.menu-mobile-active .yoo-floating-message,
body.menu-mobile-active .yoo-fixed-bottom-actions,
body.menu-mobile-active [class*="yoo-fm-bubble"] {
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
	transition: opacity 0.2s var(--mm-ease), visibility 0.2s var(--mm-ease);
}

/* ------------------------------------------------------------------ *
 * Reduced motion
 * ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
	#group-icon-header.ts-floating-sidebar .ts-sidebar-content,
	.yoo-mm-track { transition-duration: 0.12s; }
	.yoo-mm .yoo-mm-item,
	.yoo-mm .yoo-mm-foot > * { opacity: 1; transform: none; animation: none; }
	body.menu-mobile-active.yoo-mm .yoo-mm-pane--root .yoo-mm-item { animation: none; }
}
