/* SMC Translate · Selector de idiomas
 * Variables: --smct-flag-w, --smct-fs, --smct-ff, --smct-fw, --smct-tt, --smct-color, --smct-color-h,
 * --smct-bg, --smct-bg-h, --smct-bc, --smct-radius, --smct-gap, --smct-py, --smct-px,
 * --smct-dd-bg, --smct-dd-color, --smct-dd-w. Sin definir, tipografía y color se heredan de la web.
 * En menús, el script copia la tipografía y el color de los enlaces vecinos (--smct-auto-*).
 */
.smct-sw {
	--_fw: var(--smct-flag-w, 22px);
	--_fh: calc(var(--_fw) * 2 / 3);
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	max-width: 100%;
	font-family: var(--smct-ff, var(--smct-auto-ff, inherit));
	font-size: var(--smct-fs, var(--smct-auto-fs, inherit));
	font-weight: var(--smct-fw, var(--smct-auto-fw, inherit));
	letter-spacing: var(--smct-auto-ls, inherit);
	line-height: 1.2;
	text-align: left;
	color: inherit;
}
.smct-sw *, .smct-sw *::before, .smct-sw *::after { box-sizing: border-box; }
.smct-sw.smct-shape-square, .smct-sw.smct-shape-round { --_fh: var(--_fw); }
.smct-sw.smct-align-center { justify-content: center; }
.smct-sw.smct-align-right { justify-content: flex-end; }

/* Lista en línea */
.smct-sw .smct-sw__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--smct-gap, 10px);
	margin: 0;
	padding: 0;
}
.smct-sw.smct-align-center .smct-sw__list { justify-content: center; }
.smct-sw.smct-align-right .smct-sw__list { justify-content: flex-end; }
.smct-sw .smct-sw__item { display: block; margin: 0; padding: 0; }

/* Enlace y botón */
.smct-sw .smct-sw__link,
.smct-sw .smct-sw__toggle {
	display: inline-flex;
	align-items: center;
	gap: .45em;
	width: auto;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: var(--smct-py, 4px) var(--smct-px, 6px);
	border: 1px solid var(--smct-bc, transparent);
	border-radius: var(--smct-radius, 4px);
	background: var(--smct-bg, transparent);
	box-shadow: none;
	color: var(--smct-color, var(--smct-auto-color, inherit));
	font: inherit;
	line-height: 1.2;
	text-decoration: none;
	text-transform: var(--smct-tt, var(--smct-auto-tt, none));
	letter-spacing: inherit;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease, opacity .15s ease, border-color .15s ease, box-shadow .2s ease, transform .2s ease;
	-webkit-tap-highlight-color: transparent;
}
.smct-sw .smct-sw__link::before, .smct-sw .smct-sw__link::after { display: none !important; }
.smct-sw .smct-sw__link:hover,
.smct-sw .smct-sw__link:focus-visible,
.smct-sw .smct-sw__toggle:hover,
.smct-sw .smct-sw__toggle:focus-visible {
	background: var(--smct-bg-h, var(--smct-bg, transparent));
	color: var(--smct-color-h, var(--smct-color, var(--smct-auto-color, inherit)));
	text-decoration: none;
}
.smct-sw .smct-sw__link:focus-visible,
.smct-sw .smct-sw__toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* Bandera */
.smct-sw .smct-sw__flag {
	display: block;
	flex: none;
	width: var(--_fw) !important;
	height: var(--_fh) !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	object-fit: cover;
	border-radius: 2px;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
}
.smct-sw.smct-shape-round .smct-sw__flag { border-radius: 50%; }
.smct-sw.smct-shape-square .smct-sw__flag { border-radius: 3px; }

/* Qué se muestra */
.smct-sw[data-display="flag"] .smct-sw__code,
.smct-sw[data-display="flag"] .smct-sw__name,
.smct-sw[data-display="flag-code"] .smct-sw__name,
.smct-sw[data-display="flag-name"] .smct-sw__code,
.smct-sw[data-display="code"] .smct-sw__flag,
.smct-sw[data-display="code"] .smct-sw__name,
.smct-sw[data-display="name"] .smct-sw__flag,
.smct-sw[data-display="name"] .smct-sw__code { display: none !important; }
.smct-sw[data-display="flag"] .smct-sw__list .smct-sw__link { padding: var(--smct-py, 4px); }

/* Idioma actual */
.smct-sw.smct-cur-highlight .smct-sw__list .is-current .smct-sw__link { font-weight: 700; }
.smct-sw.smct-cur-highlight .smct-sw__list .smct-sw__item:not(.is-current) .smct-sw__link { opacity: .7; }
.smct-sw.smct-cur-highlight .smct-sw__list .smct-sw__item:not(.is-current) .smct-sw__link:hover { opacity: 1; }
.smct-sw.smct-cur-highlight[data-display="flag"] .smct-sw__list .is-current .smct-sw__flag { box-shadow: 0 0 0 2px currentColor; }
.smct-sw.smct-cur-hide .smct-sw__list .is-current { display: none !important; }

/* Desplegable */
.smct-sw .smct-sw__dd { position: relative; display: inline-block; margin: 0; padding: 0; }
.smct-sw.smct-sw--inline .smct-sw__dd { display: none; }
.smct-sw.smct-sw--dropdown .smct-sw__list { display: none; }
.smct-sw .smct-sw__dd > summary { list-style: none; }
.smct-sw .smct-sw__dd > summary::-webkit-details-marker { display: none; }
.smct-sw .smct-sw__dd > summary::marker { content: ""; }
.smct-sw .smct-sw__caret {
	flex: none;
	width: .42em;
	height: .42em;
	margin: 0 .05em 0 .15em;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateY(-25%) rotate(45deg);
	transition: transform .2s ease;
	opacity: .75;
}
.smct-sw .smct-sw__dd[open] .smct-sw__caret { transform: translateY(15%) rotate(-135deg); }
.smct-sw .smct-sw__menu {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: var(--smct-dd-w, 180px);
	max-height: min(70vh, 420px);
	overflow-y: auto;
	margin: 0;
	padding: 6px;
	background: var(--smct-dd-bg, #fff);
	color: var(--smct-dd-color, #1d2327);
	border-radius: calc(var(--smct-radius, 4px) + 4px);
	box-shadow: 0 12px 32px rgba(15, 23, 42, .16), 0 2px 6px rgba(15, 23, 42, .08);
	text-transform: none;
	animation: smct-in .16s ease-out;
}
.smct-sw.smct-sw--noshadow .smct-sw__menu { box-shadow: none; border: 1px solid rgba(0, 0, 0, .12); }
.smct-sw.smct-align-right .smct-sw__menu,
.smct-sw .smct-sw__dd.is-flip-x .smct-sw__menu { left: auto; right: 0; }
.smct-sw.smct-align-center .smct-sw__menu { left: 50%; transform: translateX(-50%); }
.smct-sw.smct-sw--up .smct-sw__menu,
.smct-sw .smct-sw__dd.is-up .smct-sw__menu { top: auto; bottom: calc(100% + 6px); animation-name: smct-in-up; }
.smct-sw.smct-sw--down .smct-sw__dd.is-up .smct-sw__menu { top: calc(100% + 6px); bottom: auto; }
.smct-sw .smct-sw__menu .smct-sw__item { display: block; }
.smct-sw .smct-sw__menu .smct-sw__link {
	display: flex;
	width: 100%;
	padding: .6em .75em;
	border: 0;
	border-radius: calc(var(--smct-radius, 4px) + 1px);
	background: transparent;
	color: var(--smct-dd-color, #1d2327);
	text-transform: none;
	opacity: 1 !important;
	font-weight: 400;
}
.smct-sw .smct-sw__menu .smct-sw__link:hover,
.smct-sw .smct-sw__menu .smct-sw__link:focus-visible { background: rgba(127, 127, 127, .12); color: var(--smct-dd-color, #1d2327); }
.smct-sw .smct-sw__menu .is-current .smct-sw__link { font-weight: 600; }
.smct-sw .smct-sw__check {
	flex: none;
	width: .38em;
	height: .7em;
	margin: -.15em .2em 0 auto;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
}
/* En el desplegable se muestra siempre el nombre */
.smct-sw[data-display="flag"] .smct-sw__menu .smct-sw__name,
.smct-sw[data-display="flag-code"] .smct-sw__menu .smct-sw__name,
.smct-sw[data-display="code"] .smct-sw__menu .smct-sw__name { display: inline !important; }
.smct-sw[data-display="flag-code"] .smct-sw__menu .smct-sw__code,
.smct-sw[data-display="code"] .smct-sw__menu .smct-sw__code { display: none !important; }

@keyframes smct-in { from { opacity: 0; translate: 0 -4px; } to { opacity: 1; translate: 0 0; } }
@keyframes smct-in-up { from { opacity: 0; translate: 0 4px; } to { opacity: 1; translate: 0 0; } }

/* ---------------------------------------------------------------
 * Menús de navegación
 * ------------------------------------------------------------- */
.smct-menu-item { display: flex; align-items: center; list-style: none; }
.smct-menu-item::before, .smct-menu-item::after { display: none !important; }
.smct-sw.smct-sw--menu { flex-wrap: nowrap; }
.smct-sw.smct-sw--menu .smct-sw__list { flex-wrap: wrap; }
.smct-sw.smct-sw--menu .smct-sw__toggle,
.smct-sw.smct-sw--menu .smct-sw__list .smct-sw__link { padding-left: var(--smct-px, .5em); padding-right: var(--smct-px, .5em); }
/* Menús verticales (móvil): el desplegable se abre en el flujo para no recortarse */
.smct-sw.smct-sw--menu.is-vertical-menu { padding-left: calc(var(--smct-auto-pl, 0px) - var(--smct-px, .5em)); }
.smct-sw.smct-sw--menu.is-vertical-menu .smct-sw__menu { position: static; box-shadow: none; transform: none; margin-top: 4px; background: transparent; color: inherit; padding: 0 0 0 4px; }
.smct-sw.smct-sw--menu.is-vertical-menu .smct-sw__menu .smct-sw__link { color: inherit; }

/* ---------------------------------------------------------------
 * Barras (superior y pie)
 * ------------------------------------------------------------- */
.smct-bar {
	position: relative;
	z-index: 9990;
	width: 100%;
	background: var(--smct-bar-bg, transparent);
	color: var(--smct-bar-color, inherit);
	font-size: 13px;
	line-height: 1.4;
}
.smct-bar__inner {
	display: flex;
	align-items: center;
	gap: 8px 16px;
	max-width: var(--smct-bar-max, 1200px);
	min-height: 38px;
	margin: 0 auto;
	padding: 4px 16px;
	box-sizing: border-box;
}
.smct-bar--right .smct-bar__inner { justify-content: space-between; }
.smct-bar--right .smct-bar__inner > .smct-sw:only-child { margin-left: auto; }
.smct-bar--left .smct-bar__inner { flex-direction: row-reverse; justify-content: space-between; }
.smct-bar--left .smct-bar__inner > .smct-sw:only-child { margin-right: auto; }
.smct-bar--center .smct-bar__inner { flex-direction: column; justify-content: center; gap: 4px; }
.smct-bar__text { min-width: 0; opacity: .9; }
.smct-bar .smct-sw { --smct-auto-color: var(--smct-bar-color, inherit); }
.smct-bar .smct-sw .smct-sw__list { gap: var(--smct-gap, 6px); }
.smct-bar--top.smct-bar--filled .smct-sw.smct-cur-highlight .smct-sw__list .is-current .smct-sw__link { background: rgba(255, 255, 255, .14); }
.smct-bar--footer { font-size: 14px; }
.smct-bar--footer .smct-bar__inner { padding: 14px 16px; }
.smct-bar--footer:not(.smct-bar--filled) { border-top: 1px solid rgba(127, 127, 127, .2); }
.smct-bar__group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.smct-bar--right .smct-bar__group { margin-left: auto; }
.smct-bar--left .smct-bar__group { margin-right: auto; }
.smct-bar--center .smct-bar__group { justify-content: center; }
.smct-bar__label { opacity: .75; }

/* ---------------------------------------------------------------
 * Selector flotante
 * ------------------------------------------------------------- */
.smct-float {
	--smct-float-bg: rgba(255, 255, 255, .94);
	--smct-float-color: #1d2327;
	--smct-float-border: rgba(15, 23, 42, .08);
	--smct-float-menu: #ffffff;
	--smct-float-hover: rgba(15, 23, 42, .06);
	position: fixed;
	z-index: 99990;
	opacity: 0;
	animation: smct-float-in .45s cubic-bezier(.2, .8, .2, 1) .35s forwards;
	font-size: 14px;
}
.smct-float--dark {
	--smct-float-bg: rgba(24, 26, 31, .92);
	--smct-float-color: #f5f6f7;
	--smct-float-border: rgba(255, 255, 255, .1);
	--smct-float-menu: #1f2228;
	--smct-float-hover: rgba(255, 255, 255, .08);
}
.smct-float--glass {
	--smct-float-bg: rgba(255, 255, 255, .62);
	--smct-float-color: #111418;
	--smct-float-border: rgba(255, 255, 255, .7);
	--smct-float-menu: rgba(255, 255, 255, .88);
	--smct-float-hover: rgba(15, 23, 42, .07);
}
.smct-float--custom { --smct-float-menu: var(--smct-float-bg); --smct-float-hover: rgba(127, 127, 127, .14); --smct-float-border: rgba(127, 127, 127, .18); }

.smct-float--bottom-right { right: calc(var(--smct-fx, 24px) + env(safe-area-inset-right, 0px)); bottom: calc(var(--smct-fy, 24px) + env(safe-area-inset-bottom, 0px)); }
.smct-float--bottom-left { left: calc(var(--smct-fx, 24px) + env(safe-area-inset-left, 0px)); bottom: calc(var(--smct-fy, 24px) + env(safe-area-inset-bottom, 0px)); }
.smct-float--top-right { right: calc(var(--smct-fx, 24px) + env(safe-area-inset-right, 0px)); top: calc(var(--smct-fy, 24px) + env(safe-area-inset-top, 0px)); }
.smct-float--top-left { left: calc(var(--smct-fx, 24px) + env(safe-area-inset-left, 0px)); top: calc(var(--smct-fy, 24px) + env(safe-area-inset-top, 0px)); }
.admin-bar .smct-float--top-right, .admin-bar .smct-float--top-left { top: calc(var(--smct-fy, 24px) + 32px); }

.smct-float .smct-sw .smct-sw__toggle {
	gap: 9px;
	padding: 7px 14px 7px 7px;
	border: 1px solid var(--smct-float-border);
	border-radius: 999px;
	background: var(--smct-float-bg);
	color: var(--smct-float-color);
	font-weight: 500;
	box-shadow: 0 10px 30px rgba(15, 23, 42, .14), 0 2px 8px rgba(15, 23, 42, .08);
	-webkit-backdrop-filter: saturate(180%) blur(14px);
	backdrop-filter: saturate(180%) blur(14px);
}
.smct-float .smct-sw .smct-sw__toggle:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(15, 23, 42, .18), 0 3px 10px rgba(15, 23, 42, .1); background: var(--smct-float-bg); color: var(--smct-float-color); }
.smct-float .smct-sw .smct-sw__toggle .smct-sw__flag { --_fw: 24px; }
.smct-float .smct-sw.smct-shape-rect .smct-sw__toggle .smct-sw__flag { height: 16px !important; }
.smct-float .smct-sw .smct-sw__toggle .smct-sw__name {
	display: inline-block;
	max-width: 12em;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: max-width .35s cubic-bezier(.2, .8, .2, 1), opacity .25s ease, margin .35s ease;
}
.smct-float .smct-sw .smct-sw__menu {
	min-width: 210px;
	padding: 6px;
	border: 1px solid var(--smct-float-border);
	border-radius: 16px;
	background: var(--smct-float-menu);
	color: var(--smct-float-color);
	box-shadow: 0 18px 44px rgba(15, 23, 42, .2), 0 3px 10px rgba(15, 23, 42, .08);
	-webkit-backdrop-filter: saturate(180%) blur(16px);
	backdrop-filter: saturate(180%) blur(16px);
}
.smct-float .smct-sw.smct-sw--up .smct-sw__menu { bottom: calc(100% + 10px); }
.smct-float .smct-sw.smct-sw--down .smct-sw__menu { top: calc(100% + 10px); }
.smct-float .smct-sw .smct-sw__menu .smct-sw__link { gap: 10px; padding: 9px 12px; border-radius: 11px; color: var(--smct-float-color); }
.smct-float .smct-sw .smct-sw__menu .smct-sw__link:hover,
.smct-float .smct-sw .smct-sw__menu .smct-sw__link:focus-visible { background: var(--smct-float-hover); color: var(--smct-float-color); }
.smct-float .smct-sw .smct-sw__menu .smct-sw__flag { --_fw: 22px; }
.smct-float .smct-sw.smct-shape-rect .smct-sw__menu .smct-sw__flag { height: 15px !important; }

/* Compactación al hacer scroll: solo bandera */
.smct-float.is-compact .smct-sw .smct-sw__toggle { gap: 6px; padding-right: 10px; }
.smct-float.is-compact .smct-sw .smct-sw__toggle .smct-sw__name { max-width: 0; opacity: 0; margin-left: -6px; }

.smct-float--preview { position: absolute; animation: none; opacity: 1; }
.smct-float--preview.smct-float--bottom-right, .smct-float--preview.smct-float--top-right { right: var(--smct-fx); }
.smct-float--preview.smct-float--bottom-left, .smct-float--preview.smct-float--top-left { left: var(--smct-fx); }
.smct-float--preview.smct-float--bottom-right, .smct-float--preview.smct-float--bottom-left { bottom: var(--smct-fy); }
.smct-float--preview.smct-float--top-right, .smct-float--preview.smct-float--top-left { top: var(--smct-fy); }

@keyframes smct-float-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }

@media (max-width: 600px) {
	.smct-float--bottom-right, .smct-float--top-right { right: calc(var(--smct-fxm, 16px) + env(safe-area-inset-right, 0px)); }
	.smct-float--bottom-left, .smct-float--top-left { left: calc(var(--smct-fxm, 16px) + env(safe-area-inset-left, 0px)); }
	.smct-float--bottom-right, .smct-float--bottom-left { bottom: calc(var(--smct-fym, 16px) + env(safe-area-inset-bottom, 0px)); }
	.smct-float--nomobile { display: none !important; }
	.smct-float .smct-sw .smct-sw__menu { min-width: 190px; }
}
@media print { .smct-float, .smct-bar { display: none !important; } }

/* Accesibilidad / movimiento reducido */
@media (prefers-reduced-motion: reduce) {
	.smct-sw *, .smct-float { animation: none !important; transition: none !important; }
	.smct-float { opacity: 1; }
}
@media (max-width: 480px) {
	.smct-sw .smct-sw__menu { min-width: min(var(--smct-dd-w, 180px), calc(100vw - 32px)); }
}
html.smct-editing .smct-float { display: none !important; }
