/* ==========================================================================
   RESERVA INSTANTÁNEA — modal conversacional del Bike Tour
   ========================================================================== */

html.bk-lock,
html.bk-lock body {
	overflow: hidden;
}

.bk-modal {
	position: fixed;
	inset: 0;
	z-index: 2147482000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.bk-modal[hidden] {
	display: none;
}

.bk-modal.is-open {
	opacity: 1;
}

.bk-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(2, 7, 14, 0.72);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.bk-dialog {
	position: relative;
	width: min(520px, 100%);
	height: min(680px, calc(100dvh - 2rem));
	display: flex;
	flex-direction: column;
	border-radius: 26px;
	overflow: hidden;
	color: var(--color-white);
	background:
		radial-gradient(circle at 0% 0%, hsla(var(--accent-hue), 95%, 55%, 0.22) 0%, transparent 45%),
		radial-gradient(circle at 100% 100%, hsla(var(--primary-hue), 85%, 45%, 0.3) 0%, transparent 50%),
		linear-gradient(160deg, #0a1b2e 0%, #050b18 100%);
	border: 1px solid rgba(255, 255, 255, 0.14);
	box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
	transform: translateY(24px) scale(0.96);
	transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.2);
	outline: none;
}

.bk-modal.is-open .bk-dialog {
	transform: none;
}

.bk-close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 5;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.2);
	background: rgba(255, 255, 255, 0.08);
	color: var(--color-white);
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	transition: var(--transition-fast);
}

.bk-close:hover {
	background: var(--color-accent);
	border-color: var(--color-accent);
}

/* ---- Escenas ---- */
.bk-stage {
	display: none;
	flex: 1;
	min-height: 0;
	flex-direction: column;
}

.bk-stage.is-active {
	display: flex;
	animation: bk-in 0.4s ease both;
}

@keyframes bk-in {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: none; }
}

/* ---- 1. Intro ---- */
.bk-stage-intro,
.bk-stage-processing,
.bk-stage-success,
.bk-stage-error {
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 2rem 1.75rem;
	gap: 1rem;
}

.bk-intro-scene {
	position: relative;
	width: 100%;
	max-width: 360px;
	height: 170px;
	border-radius: 20px;
	overflow: hidden;
	background: linear-gradient(180deg, #2b2357 0%, #e0604f 70%, #ffb36b 100%);
}

.bk-intro-sun {
	position: absolute;
	left: 50%;
	bottom: 36px;
	width: 70px;
	height: 70px;
	margin-left: -35px;
	border-radius: 50%;
	background: #ffd98f;
	box-shadow: 0 0 60px 20px rgba(255, 200, 120, 0.5);
}

.bk-intro-city {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 34px;
	height: 60px;
	background:
		linear-gradient(#2a1838, #2a1838) 8% 100% / 26px 34px no-repeat,
		linear-gradient(#2a1838, #2a1838) 18% 100% / 14px 56px no-repeat,
		linear-gradient(#2a1838, #2a1838) 30% 100% / 40px 28px no-repeat,
		linear-gradient(#2a1838, #2a1838) 66% 100% / 22px 48px no-repeat,
		linear-gradient(#2a1838, #2a1838) 78% 100% / 36px 30px no-repeat,
		linear-gradient(#2a1838, #2a1838) 92% 100% / 18px 42px no-repeat;
	animation: bk-city 6s linear infinite;
}

@keyframes bk-city {
	from { background-position-x: 8%, 18%, 30%, 66%, 78%, 92%; }
	to   { background-position-x: -92%, -82%, -70%, -34%, -22%, -8%; }
}

.bk-intro-road {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 34px;
	background:
		repeating-linear-gradient(90deg, rgba(255, 214, 160, 0.6) 0 24px, transparent 24px 56px) 0 18px / 100% 3px no-repeat,
		#150d24;
	animation: bk-road 0.6s linear infinite;
}

@keyframes bk-road {
	to { background-position: -56px 18px, 0 0; }
}

.bk-intro-bike {
	position: absolute;
	left: 50%;
	bottom: 26px;
	width: 78px;
	margin-left: -39px;
	animation: bt-bounce 0.35s ease-in-out infinite alternate;
}

.bk-intro-bike svg,
.bk-orbit svg {
	display: block;
	width: 100%;
}

.bk-wheel {
	transform-box: fill-box;
	transform-origin: center;
	animation: bk-spin 0.5s linear infinite;
}

@keyframes bk-spin {
	to { transform: rotate(360deg); }
}

.bk-intro-title {
	font-family: var(--font-display);
	font-size: 1.15rem;
	font-weight: 700;
	margin: 0.5rem 0 0;
}

.bk-intro-bar {
	width: 220px;
	height: 5px;
	border-radius: 5px;
	background: rgba(255, 255, 255, 0.1);
	overflow: hidden;
}

.bk-intro-bar span {
	display: block;
	width: 0;
	height: 100%;
	background: linear-gradient(90deg, #00c8ff, var(--color-accent));
	transition: width 1.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- 2. Formulario ---- */
.bk-head {
	padding: 1.5rem 1.5rem 1rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	flex-shrink: 0;
}

.bk-eyebrow {
	display: inline-block;
	font-family: var(--font-display);
	font-size: 0.7rem;
	font-weight: 800;
	letter-spacing: 1.5px;
	color: var(--color-accent-light);
}

.bk-head h3 {
	color: var(--color-white) !important;
	font-size: 1.35rem;
	margin: 0.25rem 2.5rem 0.75rem 0;
	line-height: 1.2;
}

.bk-progress {
	height: 4px;
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.1);
	overflow: hidden;
}

.bk-progress-fill {
	display: block;
	height: 100%;
	width: 0;
	background: linear-gradient(90deg, #00c8ff, var(--color-accent));
	transition: width 0.5s ease;
}

.bk-body {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	position: relative; /* referencia para offsetTop en bike-booking.js */
	padding: 1.25rem 1.5rem 1.5rem;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.bk-body::-webkit-scrollbar {
	width: 6px;
}

.bk-body::-webkit-scrollbar-track {
	background: transparent;
}

.bk-body::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.22);
	border-radius: 10px;
}

.bk-body::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.4);
}

.bk-step {
	display: none;
	margin-bottom: 1.5rem;
}

.bk-step.is-visible {
	display: block;
	animation: bk-step-in 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.1) both;
}

@keyframes bk-step-in {
	from { opacity: 0; transform: translateY(16px) scale(0.98); }
	to   { opacity: 1; transform: none; }
}

.bk-q {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	margin: 0 0 0.75rem;
	font-family: var(--font-display);
	font-size: 1.02rem;
	font-weight: 600;
	line-height: 1.35;
	color: var(--color-white);
}

.bk-q > span:last-child {
	background: rgba(255, 255, 255, 0.07);
	border: 1px solid rgba(255, 255, 255, 0.1);
	padding: 0.55rem 0.9rem;
	border-radius: 4px 16px 16px 16px;
}

.bk-avatar {
	flex-shrink: 0;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: hsla(var(--accent-hue), 95%, 55%, 0.2);
	border: 1px solid hsla(var(--accent-hue), 95%, 55%, 0.45);
	font-size: 1rem;
}

.bk-step.is-done .bk-q > span:last-child {
	border-color: rgba(124, 218, 36, 0.35);
}

.bk-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	padding-left: 2.6rem;
}

.bk-chips-routes {
	display: grid;
	grid-template-columns: 1fr 1fr;
}

.bk-chip {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.6rem 0.8rem;
	border-radius: 14px;
	border: 1.5px solid rgba(255, 255, 255, 0.15);
	background: rgba(255, 255, 255, 0.05);
	color: var(--color-white);
	font-family: var(--font-display);
	font-size: 0.88rem;
	font-weight: 600;
	cursor: pointer;
	text-align: left;
	transition: var(--transition-fast);
}

.bk-chip:hover {
	border-color: var(--route-color, var(--color-accent));
	background: rgba(255, 255, 255, 0.09);
}

.bk-chip input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.bk-chip:has(input:checked),
.bk-chip.is-picked {
	border-color: var(--route-color, var(--color-accent));
	background: color-mix(in srgb, var(--route-color, var(--color-accent)) 22%, transparent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--route-color, var(--color-accent)) 25%, transparent);
}

.bk-chip:focus-within {
	outline: 2px solid var(--color-accent-light);
	outline-offset: 2px;
}

.bk-chip-icon {
	font-size: 1.3rem;
}

.bk-chip-text {
	display: flex;
	flex-direction: column;
	line-height: 1.25;
}

.bk-chip-text small {
	font-family: var(--font-primary);
	font-size: 0.72rem;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.6);
}

.bk-chip-sm {
	border-radius: 50px;
	padding: 0.5rem 1rem;
	font-size: 0.85rem;
}

.bk-chip-round {
	width: 46px;
	height: 46px;
	padding: 0;
	justify-content: center;
	border-radius: 50%;
	font-size: 1rem;
}

.bk-chips-quickdate {
	margin-bottom: 0.6rem;
}

.bk-input {
	display: block;
	width: calc(100% - 2.6rem);
	margin-left: 2.6rem;
	padding: 0.85rem 1rem;
	border-radius: 14px;
	border: 1.5px solid rgba(255, 255, 255, 0.18);
	background: rgba(255, 255, 255, 0.06);
	color: var(--color-white);
	font-family: var(--font-primary);
	font-size: 1rem; /* 16px evita el zoom automático en iPhone */
	transition: var(--transition-fast);
	color-scheme: dark;
}

.bk-input::placeholder {
	color: rgba(255, 255, 255, 0.35);
}

.bk-input:focus {
	outline: none;
	border-color: var(--color-accent);
	box-shadow: 0 0 0 3px hsla(var(--accent-hue), 95%, 55%, 0.25);
}

.bk-step.is-done .bk-input {
	border-color: rgba(124, 218, 36, 0.6);
}

.bk-step.is-invalid .bk-input {
	border-color: #ff5a5a;
	animation: bk-shake 0.35s ease;
}

@keyframes bk-shake {
	25% { transform: translateX(-5px); }
	75% { transform: translateX(5px); }
}

.bk-hint {
	margin: 0.5rem 0 0 2.6rem;
	font-size: 0.75rem;
	color: rgba(255, 255, 255, 0.5);
}

.bk-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---- 3. Procesando ---- */
.bk-orbit {
	position: relative;
	width: 130px;
	height: 130px;
}

.bk-orbit-ring {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 3px dashed rgba(255, 255, 255, 0.18);
	border-top-color: var(--color-accent);
	animation: bk-spin 1.4s linear infinite;
}

.bk-orbit-bike {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 2.6rem;
	animation: bt-bounce 0.35s ease-in-out infinite alternate;
}

.bk-processing-title {
	font-family: var(--font-display);
	font-size: 1.2rem;
	font-weight: 700;
	margin: 0;
}

.bk-checklist {
	list-style: none;
	margin: 0;
	padding: 0;
	text-align: left;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

.bk-checklist li {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	font-size: 0.95rem;
	color: rgba(255, 255, 255, 0.5);
	transition: color 0.3s;
}

.bk-check {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.25);
	position: relative;
	flex-shrink: 0;
	transition: all 0.3s;
}

.bk-checklist li.is-done {
	color: var(--color-white);
}

.bk-checklist li.is-done .bk-check {
	background: #2fbf71;
	border-color: #2fbf71;
}

.bk-checklist li.is-done .bk-check::after {
	content: "";
	position: absolute;
	left: 6px;
	top: 2px;
	width: 6px;
	height: 11px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* ---- 4. Éxito ---- */
.bk-success-badge {
	width: 84px;
	height: 84px;
}

.bk-success-badge svg {
	width: 100%;
	height: 100%;
	fill: none;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.bk-success-badge circle {
	stroke: #2fbf71;
	stroke-width: 3;
	stroke-dasharray: 151;
	stroke-dashoffset: 151;
	animation: bk-draw 0.6s ease forwards;
}

.bk-success-badge path {
	stroke: #ffffff;
	stroke-width: 4;
	stroke-dasharray: 40;
	stroke-dashoffset: 40;
	animation: bk-draw 0.4s 0.5s ease forwards;
}

.bk-stage-success.is-active .bk-success-badge {
	animation: bk-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.5) both;
}

@keyframes bk-draw {
	to { stroke-dashoffset: 0; }
}

@keyframes bk-pop {
	from { transform: scale(0.5); opacity: 0; }
	to   { transform: scale(1); opacity: 1; }
}

.bk-success-title {
	color: var(--color-white) !important;
	font-size: 1.5rem;
	margin: 0;
}

.bk-success-text {
	color: rgba(255, 255, 255, 0.75);
	margin: 0;
	max-width: 380px;
}

.bk-summary {
	width: 100%;
	max-width: 380px;
	margin: 0.25rem 0;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
	text-align: left;
}

.bk-summary > div {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 12px;
	padding: 0.5rem 0.75rem;
}

.bk-summary > div:first-child {
	grid-column: 1 / -1;
}

.bk-summary dt {
	font-size: 0.68rem;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: rgba(255, 255, 255, 0.5);
}

.bk-summary dd {
	margin: 0;
	font-family: var(--font-display);
	font-weight: 700;
}

.bk-wa-confirm {
	width: 100%;
	max-width: 380px;
	justify-content: center;
}

.bk-link-btn {
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.65);
	font-family: var(--font-display);
	font-size: 0.9rem;
	text-decoration: underline;
	cursor: pointer;
}

.bk-link-btn:hover {
	color: var(--color-white);
}

/* ---- 5. Error ---- */
.bk-error-icon {
	font-size: 3rem;
}

.bk-error-text {
	color: rgba(255, 255, 255, 0.85);
	max-width: 360px;
	margin: 0;
}

/* ---- Móvil: hoja inferior a pantalla casi completa ---- */
@media (max-width: 600px) {
	.bk-modal {
		padding: 0;
		align-items: flex-end;
	}
	.bk-dialog {
		width: 100%;
		height: calc(100dvh - 24px);
		border-radius: 24px 24px 0 0;
		transform: translateY(100%);
	}
	.bk-chips-routes {
		grid-template-columns: 1fr;
	}
	.bk-chips,
	.bk-hint {
		padding-left: 0;
		margin-left: 0;
	}
	.bk-input {
		width: 100%;
		margin-left: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bk-modal *,
	.bk-modal *::before,
	.bk-modal *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
