/**
 * Mapa de destinos — widget flotante y página completa.
 */
:root {
	--tb-map-header: #1a4d7c;
	--tb-map-marker: #f7db48;
	--tb-map-accent: #2f998f;
	--tb-map-cta: #1a4d7c;
}

/* —— Widget flotante (esquina inferior derecha) —— */
.tb-map-widget {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99990;
	width: min(380px, calc(100vw - 32px));
	font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.tb-map-widget__card {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
	overflow: hidden;
}

.tb-map-widget__header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 12px 14px;
	background: var(--tb-map-header);
	color: #fff;
}

.tb-map-widget__header-icon {
	display: flex;
	flex-shrink: 0;
}

.tb-map-widget__title {
	flex: 1;
	margin: 0;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.3;
}

.tb-map-widget__close {
	flex-shrink: 0;
	border: none;
	background: transparent;
	color: #fff;
	font-size: 1.35rem;
	line-height: 1;
	cursor: pointer;
	opacity: 0.85;
	padding: 0 4px;
}

.tb-map-widget__close:hover {
	opacity: 1;
}

.tb-map-widget__body {
	position: relative;
	display: flex;
	min-height: 200px;
}

.tb-map-widget__map {
	flex: 1;
	min-height: 200px;
	min-width: 0;
	height: 200px;
	z-index: 0;
}

.tb-map-widget__tours {
	position: absolute;
	top: 8px;
	right: 8px;
	bottom: 8px;
	width: 46%;
	max-width: 172px;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-y: auto;
	z-index: 500;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.tb-map-widget__tour-card {
	display: flex;
	gap: 6px;
	align-items: center;
	padding: 5px 6px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
	text-decoration: none;
	color: inherit;
	transition: transform 0.15s ease;
	overflow: hidden;
}

.tb-map-widget__tour-card:hover {
	transform: translateY(-1px);
}

.tb-map-widget__tour-thumb {
	width: 50px;
	height: 42px;
	border-radius: 6px;
	object-fit: cover;
	flex-shrink: 0;
	background: #eee;
}

.tb-map-widget__tour-info {
	flex: 1;
	min-width: 0;
	overflow: hidden;
}

.tb-map-widget__tour-price {
	display: block;
	font-size: 0.68rem;
	font-weight: 700;
	color: #c9a000;
	line-height: 1.2;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tb-map-widget__tour-price .woocommerce-Price-amount {
	color: inherit;
}

.tb-map-widget__tour-title {
	display: block;
	font-size: 0.62rem;
	line-height: 1.25;
	color: #333;
	margin-top: 2px;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.tb-map-widget__footer {
	padding: 10px 12px 12px;
	text-align: center;
}

.tb-map-widget__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 12px 16px;
	border-radius: 999px;
	background: var(--tb-map-cta);
	color: #fff !important;
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: none !important;
	box-shadow: 0 4px 12px rgba(26, 77, 124, 0.35);
}

.tb-map-widget__cta:hover {
	filter: brightness(1.05);
	color: #fff !important;
}

/* Marcadores personalizados */
.tb-map-marker {
	background: var(--tb-map-marker);
	border: 2px solid #fff;
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
	width: 14px !important;
	height: 14px !important;
	margin-left: -7px !important;
	margin-top: -7px !important;
}

.tb-map-marker--user {
	background: #2f7cf6;
	border-color: #fff;
	width: 12px !important;
	height: 12px !important;
}

.tb-map-marker-label {
	background: #fff;
	border: none;
	border-radius: 6px;
	padding: 4px 8px;
	font-size: 0.75rem;
	font-weight: 600;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	white-space: nowrap;
}

/* —— Página completa del mapa —— */
body.tb-map-page-body {
	overflow-x: clip;
	--tb-map-header-offset: 0px;
}

body.tb-map-page-body .site-main,
body.tb-map-page-body #content,
body.tb-map-page-body .content-area,
body.tb-map-page-body .page-content,
body.tb-map-page-body article.page,
body.tb-map-page-body .hentry {
	max-width: none !important;
	width: 100% !important;
	padding: 0 !important;
	margin: 0 !important;
}

body.tb-map-page-body .entry-content,
body.tb-map-page-body .post-content {
	max-width: none !important;
	padding: 0 !important;
	margin: 0 !important;
}

body.tb-map-page-body .elementor-widget-shortcode:has(.tb-map-page-shell) > .elementor-widget-container,
body.tb-map-page-body .elementor-widget.tb-elementor-map-widget > .elementor-widget-container {
	padding: 0 !important;
	margin: 0 !important;
	max-width: none !important;
}

body.tb-map-page-body .elementor-element.tb-elementor-map-widget {
	margin-block: 0 !important;
}

body.tb-map-page-body .e-con:has(.tb-map-page-shell),
body.tb-map-page-body .e-con:has(.tb-map-page) {
	--padding-top: 0px;
	--padding-bottom: 0px;
	--padding-block-start: 0px;
	--padding-block-end: 0px;
	--padding-inline-start: 0px;
	--padding-inline-end: 0px;
	max-width: none !important;
	width: 100% !important;
}

body.tb-map-page-body .elementor-section:has(.tb-map-page-shell),
body.tb-map-page-body .elementor-section:has(.tb-map-page) {
	padding: 0 !important;
	margin: 0 !important;
}

body.tb-map-page-body .elementor-column:has(.tb-map-page-shell) > .elementor-widget-wrap,
body.tb-map-page-body .elementor-column:has(.tb-map-page) > .elementor-widget-wrap {
	padding: 0 !important;
}

.tb-map-page-shell {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	min-height: calc(100dvh - var(--tb-map-header-offset, 0px));
	height: calc(100dvh - var(--tb-map-header-offset, 0px));
	display: flex;
	flex-direction: column;
}

.tb-map-page {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	min-height: 70vh;
	background: #e8eef3;
	overflow: hidden;
}

.tb-map-page--fullscreen {
	flex: 1;
	min-height: 0;
	height: 100%;
	max-height: none;
}

.tb-map-filters-wrap {
	flex-shrink: 0;
	position: relative;
	z-index: 700;
}

.tb-map-filters-wrap.tb-product-loop-wrap .tb-product-loop__toolbar {
	margin: 0;
	border-radius: 0;
	border-left: 0;
	border-right: 0;
	border-top: 0;
	box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

.tb-map-filters-wrap .tb-product-loop__filters-sheet:not([hidden]),
.tb-map-filters-wrap .tb-product-loop__categories-sheet:not([hidden]),
body.tb-map-page-body .tb-product-loop__filters-sheet.tb-map-filters-sheet--portaled:not([hidden]),
body.tb-map-page-body .tb-product-loop__categories-sheet.tb-map-filters-sheet--portaled:not([hidden]) {
	display: flex !important;
}

body.tb-map-filters-sheet-open,
body.tb-map-categories-sheet-open {
	overflow: hidden;
}

body.tb-map-page-body.tb-map-filters-sheet-open .tb-map-filters-wrap .tb-product-loop__toolbar,
body.tb-map-page-body.tb-map-categories-sheet-open .tb-map-filters-wrap .tb-product-loop__toolbar {
	visibility: visible;
	pointer-events: auto;
}

@media (min-width: 1024px) {
	.tb-map-filters-wrap.tb-product-loop-wrap .tb-product-loop__toolbar {
		display: grid !important;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		width: 100%;
		margin: 0;
	}

	.tb-map-filters-wrap.tb-product-loop-wrap .tb-product-loop__toolbar--has-categories {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.tb-map-filters-wrap.tb-product-loop-wrap .tb-product-loop__toolbar-item--list,
	.tb-map-filters-wrap.tb-product-loop-wrap .tb-product-loop__toolbar-item--filter,
	.tb-map-filters-wrap.tb-product-loop-wrap .tb-product-loop__toolbar-item--category {
		display: flex !important;
	}

	.tb-map-filters-wrap.tb-product-loop-wrap .tb-product-loop__toolbar-btn {
		flex-direction: column;
		justify-content: center;
		gap: 6px;
		min-height: 52px;
		padding: 8px 10px;
		font-size: 13px;
	}

	.tb-map-filters-wrap .tb-product-loop__filters-sheet:not([hidden]),
	.tb-map-filters-wrap .tb-product-loop__categories-sheet:not([hidden]),
	body.tb-map-page-body .tb-product-loop__filters-sheet.tb-map-filters-sheet--portaled:not([hidden]),
	body.tb-map-page-body .tb-product-loop__categories-sheet.tb-map-filters-sheet--portaled:not([hidden]) {
		display: flex !important;
		align-items: center;
		justify-content: center;
		padding: 24px 16px;
	}

	body.tb-map-page-body .tb-product-loop__filters-sheet.tb-map-filters-sheet--portaled .tb-product-loop__filters-sheet-panel,
	body.tb-map-page-body .tb-product-loop__categories-sheet.tb-map-filters-sheet--portaled .tb-product-loop__filters-sheet-panel {
		width: min(100%, 520px);
		max-height: min(88vh, 760px);
		border-radius: 16px;
		box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
	}
}

.tb-map-page--has-toolbar .tb-map-page__list-toggle {
	display: none !important;
}

.tb-map-page--fullscreen .tb-map-page__canvas-wrap {
	flex: 1;
	min-height: 0;
}

.tb-map-page--has-toolbar .tb-map-page__sidebar {
	top: 68px;
}

@media (max-width: 640px) {
	.tb-map-page--has-toolbar .tb-map-page__sidebar {
		top: auto;
	}
}

.tb-map-page__canvas-wrap {
	flex: 1;
	position: relative;
	min-height: inherit;
}

.tb-map-page__canvas {
	flex: 1;
	min-height: inherit;
	height: 100%;
	width: 100%;
	z-index: 1;
}

.tb-map-page__locate {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 500;
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 8px;
	background: #fff;
	color: #333;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.tb-map-page__locate:hover {
	background: #f5f5f5;
}

.tb-map-page__locate[hidden] {
	display: none;
}

.tb-map-page__list-toggle {
	position: absolute;
	left: 12px;
	bottom: 12px;
	z-index: 550;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 16px;
	border: none;
	border-radius: 999px;
	background: var(--tb-map-header);
	color: #fff;
	font-size: 0.85rem;
	font-weight: 600;
	box-shadow: 0 4px 14px rgba(26, 77, 124, 0.35);
	cursor: pointer;
}

.tb-map-page__list-toggle[hidden] {
	display: none;
}

.tb-map-page__list-toggle:hover {
	filter: brightness(1.05);
}

.tb-map-page__loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.85);
	z-index: 10;
	font-size: 1rem;
	color: #444;
}

.tb-map-page__loading[hidden] {
	display: none;
}

.tb-map-page__sidebar {
	position: absolute;
	top: 16px;
	left: 16px;
	bottom: 16px;
	width: min(360px, calc(100% - 32px));
	z-index: 600;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.tb-map-page__sidebar[hidden] {
	display: none;
}

.tb-map-page__sidebar-close {
	position: absolute;
	top: 8px;
	right: 10px;
	z-index: 2;
	border: none;
	background: #fada47;
	border-radius: 8px;
	width: 32px;
	height: 32px;
	font-size: 1.35rem;
	line-height: 1;
	cursor: pointer;
	color: #1a1a1a;
	font-weight: 700;
}

.tb-map-page__sidebar-inner {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	padding-top: 36px;
}

.tb-map-page__dest-header {
	margin: 0 0 12px;
}

.tb-map-page__dest-title {
	margin: 0 0 4px;
	font-size: 1.15rem;
	font-weight: 700;
	color: #1a1a1a;
}

.tb-map-page__dest-meta {
	margin: 0;
	font-size: 0.85rem;
	color: #666;
}

.tb-map-page__tour-list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.tb-map-page__tour-item {
	display: flex;
	gap: 12px;
	padding: 10px;
	border: 1px solid #e8e8e8;
	border-radius: 10px;
	text-decoration: none;
	color: inherit;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tb-map-page__tour-item:hover {
	border-color: var(--tb-map-accent);
	box-shadow: 0 4px 12px rgba(47, 153, 143, 0.12);
}

.tb-map-page__tour-item img {
	width: 72px;
	height: 72px;
	object-fit: cover;
	border-radius: 8px;
	flex-shrink: 0;
	background: #f0f0f0;
}

.tb-map-page__tour-item h4 {
	margin: 0 0 4px;
	font-size: 0.95rem;
	font-weight: 600;
}

.tb-map-page__tour-item .tb-map-tour-price {
	font-size: 0.9rem;
	font-weight: 700;
	color: #c9a000;
}

.tb-map-page__tour-item .tb-map-tour-address {
	display: block;
	font-size: 0.82rem;
	color: #666;
	margin-bottom: 4px;
}

@media (max-width: 640px) {
	.tb-map-widget {
		right: 12px;
		bottom: 12px;
	}

	.tb-map-widget__tours {
		width: 46%;
	}

	.tb-map-page--fullscreen {
		min-height: 0;
		height: 100%;
		max-height: none;
	}

	.tb-map-page-shell {
		min-height: calc(100dvh - var(--tb-map-header-offset, 0px));
		height: calc(100dvh - var(--tb-map-header-offset, 0px));
	}

	.tb-map-page:not(.tb-map-page--fullscreen) {
		flex-direction: column;
		min-height: clamp(360px, 65vh, 720px);
		height: auto;
		max-height: none;
	}

	.tb-map-page:not(.tb-map-page--fullscreen) .tb-map-page__canvas-wrap {
		flex: 1;
		min-height: clamp(360px, 65vh, 720px);
		width: 100%;
	}

	.tb-map-page__canvas {
		position: absolute;
		inset: 0;
		min-height: 100%;
		height: 100%;
	}

	.tb-map-page__sidebar {
		position: absolute;
		top: auto;
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		max-height: min(62vh, 480px);
		border-radius: 16px 16px 0 0;
		box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
		transition: max-height 0.28s ease;
	}

	.tb-map-page__sidebar-handle {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 100%;
		padding: 8px 0 4px;
		border: none;
		background: #fff;
		cursor: pointer;
		flex-shrink: 0;
	}

	.tb-map-page__sidebar-handle-bar {
		display: block;
		width: 40px;
		height: 4px;
		border-radius: 999px;
		background: #c3c4c7;
	}

	.tb-map-page__sidebar--peek {
		max-height: 96px;
		overflow: hidden;
	}

	.tb-map-page__sidebar--peek .tb-map-page__sidebar-inner {
		display: block;
		padding-top: 0;
		overflow: hidden;
	}

	.tb-map-page__sidebar--peek .tb-map-page__tour-list,
	.tb-map-page__sidebar--peek .tb-map-page__sidebar-inner > p {
		display: none;
	}

	.tb-map-page__sidebar--peek .tb-map-page__dest-title {
		font-size: 1rem;
		margin-bottom: 2px;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.tb-map-page__sidebar--peek .tb-map-page__dest-meta {
		font-size: 0.78rem;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.tb-map-page__sidebar--expanded {
		max-height: min(62vh, 480px);
	}

	.tb-map-page__sidebar-inner {
		padding: 32px 12px 12px;
		max-height: calc(min(62vh, 480px) - 44px);
	}

	.tb-map-page__sidebar--expanded .tb-map-page__dest-header {
		margin-bottom: 8px;
	}

	.tb-map-page__sidebar--expanded .tb-map-page__dest-title {
		font-size: 1.05rem;
		margin-bottom: 2px;
	}

	.tb-map-page__sidebar--expanded .tb-map-page__dest-meta {
		font-size: 0.78rem;
	}

	.tb-map-page__sidebar--expanded .tb-map-page__tour-list {
		gap: 6px;
	}

	.tb-map-page__sidebar--expanded .tb-map-page__tour-item {
		gap: 10px;
		padding: 8px;
		border-radius: 8px;
	}

	.tb-map-page__sidebar--expanded .tb-map-page__tour-item img {
		width: 56px;
		height: 56px;
		border-radius: 6px;
	}

	.tb-map-page__sidebar--expanded .tb-map-page__tour-item h4 {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		overflow: hidden;
		font-size: 0.875rem;
		line-height: 1.3;
		margin-bottom: 2px;
	}

	.tb-map-page__sidebar--expanded .tb-map-page__tour-item .tb-map-tour-price {
		font-size: 0.82rem;
	}

	.tb-map-page__sidebar--expanded .tb-map-page__tour-item .tb-map-tour-address {
		font-size: 0.75rem;
		margin-bottom: 2px;
	}

	.tb-map-page__list-toggle {
		bottom: 16px;
		left: 50%;
		transform: translateX(-50%);
		max-width: calc(100% - 32px);
	}

	.tb-map-page__locate {
		right: 12px;
		top: 12px;
		bottom: auto;
	}

	.tb-map-page__sidebar-close {
		top: 6px;
	}
}

@media (min-width: 641px) {
	.tb-map-page__sidebar-handle {
		display: none;
	}
}
