/* BENIN-IMMO TikTok Property Video — public block and modal player. */

/*
 * Sizing without percentages. The block is a direct child of an Elementor flex
 * column: Chrome computes its flex base size from the content, and a player sized
 * with width: 100% + aspect-ratio (or padding-top %) got a too small height there,
 * so the next widget overlapped the player on mobile. A definite width
 * (min(340px, viewport - gutters)) and a height of 16/9 of that width are exact in
 * every sizing pass. The default (viewport minus the 83px mobile gutters of the
 * Houzez Studio template) works without JavaScript; the front-end script then
 * sets --bitpv-w to the real column width in px so the box is exactly 9:16.
 */
.bitpv-tiktok {
	--bitpv-w: min(340px, calc(100vw - 88px));
	flex-shrink: 0;
	max-width: 100%;
}

.bitpv-tiktok .bitpv-player {
	box-sizing: border-box;
	width: var(--bitpv-w);
	max-width: 100%;
	margin: 0 auto;
}

.bitpv-tiktok .bitpv-stage {
	position: relative;
	width: 100%;
	height: calc(var(--bitpv-w) * 16 / 9);
	overflow: hidden;
	border-radius: 8px;
	background: #111;
	color: #fff;
}

/* Poster: the property's featured image, cropped to the 9:16 box. */
.bitpv-tiktok .bitpv-poster {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center;
}

/* Fallback when the property has no featured image. */
.bitpv-tiktok .bitpv-noposter {
	background:
		radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, .14) 0%, rgba(255, 255, 255, 0) 60%),
		linear-gradient(165deg, #2b3a4f 0%, #16202d 55%, #0b1118 100%);
}

.bitpv-tiktok .bitpv-cover {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	/* The whole poster is the click/tap target (see bitpv-frontend.js). */
	cursor: pointer;
	/* Light veil so the button and the notice stay readable on any photo. */
	background: linear-gradient(180deg, rgba(0, 0, 0, .15) 0%, rgba(0, 0, 0, .35) 55%, rgba(0, 0, 0, .7) 100%);
}

.bitpv-tiktok .bitpv-play {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 16px 20px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #fff;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
	cursor: pointer;
}

.bitpv-tiktok .bitpv-play-icon {
	filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .45));
}

.bitpv-tiktok .bitpv-play:hover .bitpv-play-icon circle,
.bitpv-tiktok .bitpv-play:focus-visible .bitpv-play-icon circle {
	fill: rgba(0, 0, 0, .8);
}

.bitpv-tiktok .bitpv-play:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

.bitpv-tiktok .bitpv-notice {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	margin: 0;
	padding: 10px 14px 12px;
	font-size: 12px;
	line-height: 1.4;
	text-align: center;
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, .7);
}

.bitpv-tiktok .bitpv-fallback {
	margin: 12px 0 0;
	text-align: center;
}

/* ── Modal player (native <dialog>) ─────────────────────────────────────── */

html.bitpv-scroll-locked,
html.bitpv-scroll-locked body {
	overflow: hidden !important;
}

.bitpv-modal {
	/*
	 * Largest 9:16 box that fits the screen. The player is centred with the same
	 * reserve above and below (--bitpv-v): the top reserve keeps it clear of the
	 * close button, the bottom one holds the fallback link. Safe areas included.
	 */
	--bitpv-gap: 16px;
	--bitpv-v: max(68px, calc(env(safe-area-inset-top, 0px) + 64px), calc(env(safe-area-inset-bottom, 0px) + 56px));
	--bitpv-mw: min(
		480px,
		calc(100vw - 2 * var(--bitpv-gap) - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)),
		calc((100vh - 2 * var(--bitpv-v)) * 9 / 16)
	);
	position: fixed;
	inset: 0;
	box-sizing: border-box;
	width: 100vw;
	max-width: 100vw;
	height: 100vh;
	max-height: 100vh;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
	overflow: hidden;
}

@supports (height: 100dvh) {
	.bitpv-modal {
		height: 100dvh;
		max-height: 100dvh;
		--bitpv-mw: min(
			480px,
			calc(100vw - 2 * var(--bitpv-gap) - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)),
			calc((100dvh - 2 * var(--bitpv-v)) * 9 / 16)
		);
	}
}

.bitpv-modal::backdrop {
	background: rgba(0, 0, 0, .94);
}

.bitpv-modal[open] {
	display: flex;
	align-items: center;
	justify-content: center;
}

.bitpv-modal-title {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.bitpv-modal-body {
	position: relative;
}

.bitpv-modal-stage {
	position: relative;
	width: var(--bitpv-mw);
	height: calc(var(--bitpv-mw) * 16 / 9);
	overflow: hidden;
	border-radius: 10px;
	background: #000;
}

.bitpv-modal-stage iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.bitpv-modal-status {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 80%;
	margin: 0;
	transform: translate(-50%, -50%);
	font-size: 14px;
	text-align: center;
	color: rgba(255, 255, 255, .85);
}

/* Retry button, shown only after a player error (hidden otherwise via [hidden]). */
.bitpv-modal-retry {
	position: absolute;
	top: calc(50% + 28px);
	left: 50%;
	transform: translateX(-50%);
	padding: 10px 22px;
	border: 2px solid rgba(255, 255, 255, .9);
	border-radius: 8px;
	background: rgba(0, 0, 0, .55);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
}

.bitpv-modal-retry:hover {
	background: rgba(0, 0, 0, .85);
}

.bitpv-modal-retry:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

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

/* Below the player, inside the bottom reserve. */
.bitpv-modal-fallback {
	position: absolute;
	top: calc(100% + 14px);
	left: 50%;
	width: max-content;
	max-width: calc(100vw - 32px);
	margin: 0;
	transform: translateX(-50%);
	font-size: 15px;
	text-align: center;
}

.bitpv-modal-fallback a,
.bitpv-modal-fallback a:visited {
	color: #fff;
	text-decoration: underline;
}

.bitpv-modal.bitpv-error .bitpv-modal-fallback a {
	font-weight: 700;
}

.bitpv-modal-close {
	position: absolute;
	top: max(12px, calc(env(safe-area-inset-top, 0px) + 8px));
	right: max(12px, calc(env(safe-area-inset-right, 0px) + 8px));
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 2px solid rgba(255, 255, 255, .9);
	border-radius: 50%;
	background: rgba(0, 0, 0, .6);
	color: #fff;
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
}

.bitpv-modal-close:hover {
	background: rgba(0, 0, 0, .85);
}

.bitpv-modal-close:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}
