/**
 * [tb_header_utilities] — Selector idioma / moneda
 */

.tb-locale-picker {
	position: relative;
	color: #1f2937;
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.4;
}

/* —— Visibilidad desktop / mobile —— */

.tb-locale-picker__desktop {
	display: none;
}

.tb-locale-picker__mobile {
	display: block;
	width: 100%;
}

.tb-locale-picker--desktop-only .tb-locale-picker__desktop {
	display: inline-flex;
	align-items: center;
}

.tb-locale-picker--desktop-only .tb-locale-picker__mobile {
	display: none;
}

.tb-locale-picker--mobile-only .tb-locale-picker__desktop {
	display: none;
}

.tb-locale-picker--mobile-only .tb-locale-picker__mobile {
	display: block;
}

@media (min-width: 1025px) {
	.tb-locale-picker--all .tb-locale-picker__desktop {
		display: inline-flex;
		align-items: center;
	}

	.tb-locale-picker--all .tb-locale-picker__mobile {
		display: none;
	}
}

/* —— Desktop trigger —— */

.tb-locale-picker__trigger {
	display: inline-flex !important;
	align-items: center !important;
	gap: 8px;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	border: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	min-height: 0 !important;
	line-height: 1;
	transform: translateY(-2px);
	color: #ffffff !important;
	-webkit-text-fill-color: #ffffff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.tb-locale-picker__trigger:hover,
.tb-locale-picker__trigger:focus-visible {
	opacity: 0.88;
}

.tb-locale-picker__trigger-icon {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	color: #ffffff;
}

.tb-locale-picker__trigger-icon svg {
	display: block;
	width: 18px;
	height: 18px;
}

.tb-locale-picker__trigger-codes {
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	line-height: 1;
}

/* —— Mobile menu rows —— */

.tb-locale-picker__mobile-list {
	list-style: none;
	margin: 0;
	padding: 0;
	width: 100%;
}

.tb-locale-picker__mobile-row {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	padding: 16px 0;
	border: 0;
	border-bottom: 1px solid #e5e7eb;
	background: transparent !important;
	color: #1f2937 !important;
	font: inherit;
	font-weight: 600;
	text-align: left;
	cursor: pointer;
	-webkit-text-fill-color: #1f2937 !important;
}

.tb-locale-picker__mobile-row:last-child {
	border-bottom: 0;
}

.tb-locale-picker__mobile-icon {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid #d1d5db;
	color: #1f2937;
}

.tb-locale-picker__mobile-icon svg {
	width: 20px;
	height: 20px;
}

.tb-locale-picker__mobile-label {
	flex: 1;
	font-weight: 600;
	color: #1f2937;
}

.tb-locale-picker__mobile-right {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	flex-shrink: 0;
}

.tb-locale-picker__mobile-value {
	color: #6b7280;
	font-weight: 500;
}

.tb-locale-picker__mobile-chevron {
	display: inline-flex;
	flex-shrink: 0;
	color: #9ca3af;
}

.tb-locale-picker__mobile-chevron svg {
	width: 18px;
	height: 18px;
}

/* —— Overlay —— */

.tb-locale-picker__overlay {
	display: none !important;
}

.tb-locale-picker__overlay.is-open {
	display: block !important;
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.45);
	z-index: 99998;
	cursor: pointer;
}

/* —— Desktop modal (centrado) —— */

.tb-locale-picker__modal {
	display: none !important;
}

.tb-locale-picker__modal.is-open {
	display: flex !important;
	position: fixed;
	inset: 0;
	z-index: 99999;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
	pointer-events: none;
}

.tb-locale-picker__modal.is-open .tb-locale-picker__modal-inner {
	pointer-events: auto;
}

.tb-locale-picker__modal-inner {
	position: relative;
	width: min(100%, 640px);
	max-height: min(85vh, 560px);
	background: #ffffff !important;
	border-radius: 12px;
	box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	color: #1f2937;
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.4;
}

.tb-locale-picker__close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 2;
	width: 36px;
	height: 36px;
	border: 0 !important;
	border-radius: 50%;
	background: transparent !important;
	box-shadow: none !important;
	color: #374151 !important;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 !important;
	min-height: 0 !important;
}

.tb-locale-picker__close:hover {
	background: #f3f4f6 !important;
}

.tb-locale-picker__tabs {
	display: flex;
	gap: 0;
	padding: 0 24px;
	border-bottom: 1px solid #e5e7eb;
	margin-top: 8px;
	background: #ffffff !important;
}

.tb-locale-picker__tab {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 16px 12px 14px;
	border: 0 !important;
	border-bottom: 3px solid transparent;
	background: transparent !important;
	color: #6b7280 !important;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	min-height: 0 !important;
	-webkit-text-fill-color: #6b7280 !important;
}

.tb-locale-picker__tab.is-active {
	color: #2563eb !important;
	border-bottom-color: #2563eb;
	-webkit-text-fill-color: #2563eb !important;
}

.tb-locale-picker__tab-icon svg {
	width: 18px;
	height: 18px;
}

.tb-locale-picker__panel {
	display: none;
	flex: 1;
	min-height: 0;
	overflow: auto;
	padding: 8px 0 16px;
	background: #ffffff !important;
}

.tb-locale-picker__panel.is-active {
	display: block;
}

.tb-locale-picker__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.tb-locale-picker__list--langs {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0;
}

@media (max-width: 520px) {
	.tb-locale-picker__list--langs {
		grid-template-columns: 1fr;
	}
}

/* —— Mobile bottom sheets —— */

.tb-locale-picker__sheet {
	display: none !important;
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99999;
	max-height: 88vh;
	transform: translateY(100%);
	transition: transform 0.28s ease;
	pointer-events: none;
}

.tb-locale-picker__sheet.is-open {
	display: block !important;
	transform: translateY(0);
	pointer-events: auto;
}

.tb-locale-picker__sheet-inner {
	display: flex;
	flex-direction: column;
	max-height: 88vh;
	background: #ffffff;
	border-radius: 16px 16px 0 0;
	box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.12);
	overflow: hidden;
}

.tb-locale-picker__sheet-handle {
	flex-shrink: 0;
	width: 40px;
	height: 4px;
	margin: 10px auto 6px;
	border-radius: 999px;
	background: #d1d5db;
}

.tb-locale-picker__sheet-scroll {
	flex: 1;
	min-height: 0;
	overflow: auto;
	padding-bottom: 8px;
}

.tb-locale-picker__sheet-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* —— Opciones (desktop + mobile) —— */

.tb-locale-picker__option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	padding: 16px 20px;
	border: 0 !important;
	background: transparent !important;
	color: #1f2937 !important;
	text-decoration: none;
	font: inherit;
	font-weight: 600;
	text-align: left;
	cursor: pointer;
	min-height: 0 !important;
	-webkit-text-fill-color: #1f2937 !important;
}

.tb-locale-picker__option:hover {
	background: #f9fafb !important;
}

.tb-locale-picker__option.is-selected {
	color: #2563eb !important;
	-webkit-text-fill-color: #2563eb !important;
}

.tb-locale-picker__option-main {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	min-width: 0;
}

.tb-locale-picker__option-symbol {
	color: #6b7280;
	font-weight: 500;
}

.tb-locale-picker__option.is-selected .tb-locale-picker__option-symbol {
	color: #2563eb;
}

.tb-locale-picker__option-check {
	display: inline-flex;
	flex-shrink: 0;
	color: #2563eb;
	margin-left: 2px;
}

.tb-locale-picker__option-radio {
	display: inline-flex;
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	border: 2px solid #d1d5db;
	border-radius: 50%;
}

.tb-locale-picker__option.is-selected .tb-locale-picker__option-radio {
	display: none;
}

.tb-locale-picker__option:not(.is-selected) .tb-locale-picker__option-check {
	display: none;
}

/* Desktop modal: check a la derecha */
.tb-locale-picker__modal .tb-locale-picker__option-main .tb-locale-picker__option-check {
	display: none;
}

.tb-locale-picker__modal .tb-locale-picker__option.is-selected .tb-locale-picker__option-radio {
	display: none;
}

.tb-locale-picker__modal .tb-locale-picker__option:not(.is-selected) .tb-locale-picker__option-radio {
	display: none;
}

.tb-locale-picker__modal .tb-locale-picker__option.is-selected .tb-locale-picker__option-check--end {
	display: inline-flex;
}

.tb-locale-picker__option-check--end {
	display: none;
	flex-shrink: 0;
	color: #2563eb;
}

html.tb-locale-picker-open {
	overflow: hidden;
}
