/**
 * Bitsaturno Tour Card — bubble flotante y modal del asistente.
 * Los colores y medidas llegan como variables desde los ajustes.
 */

.bst-bb {
	--bst-bb-size: 60px;
	--bst-bb-offset-y: 24px;
	--bst-bb-offset-x: 24px;
	--bst-bb-modal-height: 620px;
	--bst-bb-z: 9980;
	--bst-bb-button-bg: #1f3d36;
	--bst-bb-button-text: #ffffff;
	--bst-bb-panel-bg: #f0efeb;
	--bst-bb-panel-text: #1f3d36;
	--bst-bb-card-bg: #ffffff;
	--bst-bb-accent: #c3bd1d;
	--bst-bb-accent-text: #1f3d36;
	--bst-bb-panel-width: 390px;
	--bst-bb-gap: 16px;

	position: fixed;
	z-index: var(--bst-bb-z);
	font-family: inherit;
	line-height: 1.4;
	color: var(--bst-bb-panel-text);
}

.bst-bb *,
.bst-bb *::before,
.bst-bb *::after {
	box-sizing: border-box;
}

.bst-bb[hidden] {
	display: none;
}

/* Posiciones ------------------------------------------------------------ */

.bst-bb--bottom-right,
.bst-bb--bottom-left {
	bottom: var(--bst-bb-offset-y);
}

.bst-bb--bottom-right { right: var(--bst-bb-offset-x); }
.bst-bb--bottom-left  { left: var(--bst-bb-offset-x); }

.bst-bb--middle-right,
.bst-bb--middle-left {
	top: 50%;
	transform: translateY(-50%);
}

.bst-bb--middle-right { right: var(--bst-bb-offset-x); }
.bst-bb--middle-left  { left: var(--bst-bb-offset-x); }

/* Botón ----------------------------------------------------------------- */

.bst-bb .bst-bb__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: var(--bst-bb-size);
	height: var(--bst-bb-size);
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background-color: var(--bst-bb-button-bg);
	color: var(--bst-bb-button-text);
	box-shadow: 0 6px 20px rgba(31, 61, 54, 0.3);
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.bst-bb--with-label .bst-bb__button {
	width: auto;
	padding: 0 22px 0 18px;
}

.bst-bb .bst-bb__button:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 26px rgba(31, 61, 54, 0.36);
}

.bst-bb .bst-bb__button:focus-visible {
	outline: 3px solid var(--bst-bb-accent);
	outline-offset: 3px;
}

.bst-bb .bst-bb__icon {
	width: calc(var(--bst-bb-size) * 0.46);
	height: calc(var(--bst-bb-size) * 0.46);
	flex: 0 0 auto;
}

.bst-bb--with-label .bst-bb__icon {
	width: 22px;
	height: 22px;
}

.bst-bb__button-label {
	white-space: nowrap;
}

.bst-bb.is-open .bst-bb__button {
	transform: scale(0.92);
}

/* Modal ----------------------------------------------------------------- */

.bst-bb__backdrop {
	position: fixed;
	inset: 0;
	z-index: -1;
	background: rgba(14, 26, 23, 0.4);
	animation: bst-bb-fade 0.2s ease;
}

.bst-bb__backdrop[hidden] {
	display: none;
}

.bst-bb__panel {
	position: absolute;
	display: flex;
	flex-direction: column;
	width: min(var(--bst-bb-panel-width), calc(100vw - 32px));
	max-height: min(
		var(--bst-bb-modal-height),
		calc(100vh - var(--bst-bb-offset-y) - var(--bst-bb-size) - 40px)
	);
	overflow: hidden;
	border-radius: 18px;
	background-color: var(--bst-bb-panel-bg);
	box-shadow: 0 18px 50px rgba(14, 26, 23, 0.3);
	animation: bst-bb-rise 0.22s ease;
}

.bst-bb__panel[hidden] {
	display: none;
}

.bst-bb--bottom-right .bst-bb__panel,
.bst-bb--bottom-left .bst-bb__panel {
	bottom: calc(var(--bst-bb-size) + var(--bst-bb-gap));
}

.bst-bb--middle-right .bst-bb__panel,
.bst-bb--middle-left .bst-bb__panel {
	top: 50%;
	transform: translateY(-50%);
	max-height: min(var(--bst-bb-modal-height), calc(100vh - 48px));
}

.bst-bb--bottom-right .bst-bb__panel,
.bst-bb--middle-right .bst-bb__panel { right: 0; }

.bst-bb--bottom-left .bst-bb__panel,
.bst-bb--middle-left .bst-bb__panel { left: 0; }

.bst-bb__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	flex: 0 0 auto;
	padding: 10px 12px 0;
}

.bst-bb .bst-bb__back,
.bst-bb .bst-bb__close {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 6px 10px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: inherit;
	font-family: inherit;
	font-size: 14px;
	cursor: pointer;
	opacity: 0.75;
}

.bst-bb .bst-bb__back:hover,
.bst-bb .bst-bb__close:hover {
	opacity: 1;
	background: rgba(31, 61, 54, 0.08);
}

.bst-bb .bst-bb__back:focus-visible,
.bst-bb .bst-bb__close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 1px;
	opacity: 1;
}

.bst-bb__back[hidden] {
	display: none;
}

.bst-bb__close {
	margin-left: auto;
}

.bst-bb__back svg,
.bst-bb__close svg {
	width: 18px;
	height: 18px;
}

.bst-bb__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 6px 22px 24px;
	-webkit-overflow-scrolling: touch;
}

.bst-bb__body:focus {
	outline: none;
}

/* Contenido -------------------------------------------------------------- */

.bst-bb .bst-bb__title {
	margin: 6px 0 0;
	padding: 0;
	color: inherit;
	font-family: inherit;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
}

.bst-bb .bst-bb__intro {
	margin: 8px 0 0;
	font-size: 15px;
	opacity: 0.8;
}

.bst-bb .bst-bb__step {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	opacity: 0.65;
}

.bst-bb .bst-bb__notice {
	margin: 10px 0 0;
	padding: 10px 12px;
	border-radius: 10px;
	background: rgba(31, 61, 54, 0.07);
	font-size: 14px;
}

.bst-bb__actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 22px;
}

.bst-bb .bst-bb__action {
	width: 100%;
	padding: 14px 18px;
	border: 1px solid transparent;
	border-radius: 12px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	text-align: center;
	cursor: pointer;
	transition: background-color 0.18s ease, border-color 0.18s ease;
}

.bst-bb .bst-bb__action--primary {
	background-color: var(--bst-bb-accent);
	color: var(--bst-bb-accent-text);
}

.bst-bb .bst-bb__action--ghost {
	border-color: currentColor;
	background: transparent;
	color: inherit;
}

.bst-bb .bst-bb__action--ghost:hover {
	background: rgba(31, 61, 54, 0.07);
}

.bst-bb .bst-bb__action:focus-visible {
	outline: 2px solid var(--bst-bb-panel-text);
	outline-offset: 2px;
}

/* Opciones de una pregunta ----------------------------------------------- */

.bst-bb__options {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 18px;
}

.bst-bb .bst-bb__option {
	display: flex;
	flex-direction: column;
	gap: 2px;
	width: 100%;
	padding: 14px 16px;
	border: 1px solid rgba(31, 61, 54, 0.18);
	border-radius: 12px;
	background-color: var(--bst-bb-card-bg);
	color: inherit;
	font-family: inherit;
	text-align: left;
	cursor: pointer;
	transition: border-color 0.18s ease, transform 0.18s ease;
}

.bst-bb .bst-bb__option:hover {
	border-color: var(--bst-bb-accent);
	transform: translateX(2px);
}

.bst-bb .bst-bb__option:focus-visible {
	outline: 2px solid var(--bst-bb-accent);
	outline-offset: 2px;
}

.bst-bb__option-label {
	font-size: 16px;
	font-weight: 600;
}

.bst-bb__option-note {
	font-size: 13px;
	opacity: 0.7;
}

/* Tarjetas de tour -------------------------------------------------------- */

.bst-bb__cards {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 18px;
}

.bst-bb__card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: 14px;
	background-color: var(--bst-bb-card-bg);
	box-shadow: 0 2px 8px rgba(14, 26, 23, 0.1);
}

.bst-bb__card-media {
	aspect-ratio: 16 / 9;
	background: rgba(31, 61, 54, 0.08);
}

.bst-bb__card-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bst-bb__card-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 14px 16px 16px;
}

.bst-bb .bst-bb__card-title {
	margin: 0;
	padding: 0;
	color: inherit;
	font-family: inherit;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.2;
}

.bst-bb .bst-bb__card-subtitle {
	margin: 0;
	font-size: 14px;
	opacity: 0.75;
}

.bst-bb .bst-bb__card-price {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 4px;
	margin: 4px 0 0;
	font-size: 15px;
}

.bst-bb__card-from {
	opacity: 0.7;
}

.bst-bb__card-amount {
	font-size: 19px;
	font-weight: 700;
}

.bst-bb__card-unit {
	opacity: 0.7;
}

.bst-bb a.bst-bb__card-link {
	display: inline-block;
	margin-top: 10px;
	padding: 9px 18px;
	border-radius: 9px;
	background-color: var(--bst-bb-accent);
	color: var(--bst-bb-accent-text);
	font-size: 15px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	align-self: flex-start;
}

.bst-bb a.bst-bb__card-link:hover,
.bst-bb a.bst-bb__card-link:focus-visible {
	color: var(--bst-bb-accent-text);
	text-decoration: none;
	filter: brightness(0.93);
}

.bst-bb a.bst-bb__card-link:focus-visible {
	outline: 2px solid var(--bst-bb-panel-text);
	outline-offset: 2px;
}

.bst-bb .bst-bb__restart {
	margin-top: 18px;
	padding: 8px 2px;
	border: 0;
	background: transparent;
	color: inherit;
	font-family: inherit;
	font-size: 14px;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
	opacity: 0.8;
}

.bst-bb .bst-bb__restart:hover {
	opacity: 1;
}

/* Móvil: el modal pasa a hoja inferior a pantalla casi completa ----------- */

@media (max-width: 600px) {
	.bst-bb__panel,
	.bst-bb--middle-right .bst-bb__panel,
	.bst-bb--middle-left .bst-bb__panel {
		position: fixed;
		inset: auto 0 0 0;
		width: 100%;
		max-height: min(var(--bst-bb-modal-height), 88vh);
		transform: none;
		border-radius: 18px 18px 0 0;
		animation: bst-bb-sheet 0.24s ease;
	}

	.bst-bb__body {
		padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
	}

	/* La hoja llega al borde: el botón estorbaría sobre el contenido. */
	.bst-bb.is-open .bst-bb__button {
		opacity: 0;
		pointer-events: none;
	}
}

/* Animaciones ------------------------------------------------------------ */

@keyframes bst-bb-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes bst-bb-rise {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; }
}

@keyframes bst-bb-sheet {
	from { transform: translateY(16px); opacity: 0; }
	to   { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.bst-bb__panel,
	.bst-bb__backdrop {
		animation: none;
	}

	.bst-bb .bst-bb__button,
	.bst-bb .bst-bb__option,
	.bst-bb .bst-bb__action {
		transition: none;
	}

	.bst-bb .bst-bb__button:hover,
	.bst-bb .bst-bb__option:hover {
		transform: none;
	}
}

/* Vista previa en el admin ------------------------------------------------ */

.bst-bb__button--preview {
	position: static;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: var(--bst-bb-size, 60px);
	height: var(--bst-bb-size, 60px);
	border-radius: 999px;
	background-color: var(--bst-bb-button-bg, #1f3d36);
	color: var(--bst-bb-button-text, #fff);
	box-shadow: 0 6px 20px rgba(31, 61, 54, 0.3);
	font-size: 15px;
	font-weight: 600;
}

.bst-bb__button--preview:has(.bst-bb__button-label:not([hidden])) {
	width: auto;
	padding: 0 22px 0 18px;
}

.bst-bb__button--preview .bst-bb__icon {
	width: calc(var(--bst-bb-size, 60px) * 0.46);
	height: calc(var(--bst-bb-size, 60px) * 0.46);
}

.bst-bb__button--preview:has(.bst-bb__button-label:not([hidden])) .bst-bb__icon {
	width: 22px;
	height: 22px;
}

.bst-bb__button--preview .bst-bb__button-label[hidden] {
	display: none;
}
