.epc-ttl-widget {
	position: relative;
	width: 100%;
	max-width: 420px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	background: #000;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.epc-ttl-empty-notice {
	padding: 40px 20px;
	text-align: center;
	background: #f5f5f5;
	border: 1px dashed #ccc;
	color: #666;
	border-radius: 8px;
}

/* Video vertical estilo TikTok (9:16) */
.epc-ttl-video-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 9 / 16;
	background: #000;
	overflow: hidden;
}

.epc-ttl-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ---- Video externo (YouTube / Vimeo / TikTok / embed) ---- */
.epc-ttl-embed {
	position: absolute;
	inset: 0;
	overflow: hidden;
	background: #000 center / cover no-repeat;
}

.epc-ttl-embed-frame {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 100%;
	height: 100%;
	transform: translate(-50%, -50%);
}

.epc-ttl-embed-frame iframe {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	border: 0;
	display: block;
}

/* Los reproductores controlados no reciben toques: así funciona el
 * TAP TAP de corazones y nadie puede pausar el LIVE. */
.epc-ttl-embed-youtube .epc-ttl-embed-frame,
.epc-ttl-embed-vimeo .epc-ttl-embed-frame,
.epc-ttl-embed-tiktok .epc-ttl-embed-frame {
	pointer-events: none;
}

/* ---- Indicador de "cargando" cuando el video se queda sin datos ---- */
.epc-ttl-buffering {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 44px;
	height: 44px;
	margin: -22px 0 0 -22px;
	z-index: 3;
	pointer-events: none;
}

.epc-ttl-buffering[hidden] {
	display: none;
}

.epc-ttl-spinner {
	display: block;
	width: 100%;
	height: 100%;
	box-sizing: border-box;
	border: 4px solid rgba(255, 255, 255, 0.35);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: epc-ttl-spin 0.8s linear infinite;
}

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

/* ---- Botón de activar sonido (superposición central) ---- */
.epc-ttl-sound-prompt {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 100px;
	height: 100px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.45);
	border: none;
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 4;
}

.epc-ttl-sound-prompt[hidden] {
	display: none;
}

.epc-ttl-overlay {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 2;
}

.epc-ttl-overlay .epc-ttl-no-tap {
	pointer-events: auto;
}

/* ---- Barra superior: perfil + espectadores ---- */
.epc-ttl-top {
	position: absolute;
	top: 12px;
	left: 12px;
	right: 12px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.epc-ttl-profile {
	display: flex;
	align-items: center;
	gap: 8px;
}

.epc-ttl-avatar-ring {
	flex-shrink: 0;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	padding: 2px;
	background: conic-gradient(from 0deg, #fe2c55, #25f4ee, #fe2c55, #25f4ee, #fe2c55);
	display: flex;
	align-items: center;
	justify-content: center;
	animation: epc-ttl-ring-spin 3s linear infinite;
}

@keyframes epc-ttl-ring-spin {
	to {
		transform: rotate(360deg);
	}
}

.epc-ttl-avatar {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid #000;
	display: block;
}

.epc-ttl-profile-name-box {
	background: rgba(0, 0, 0, 0.45);
	backdrop-filter: blur(2px);
	padding: 5px 10px;
	border-radius: 14px;
	flex-shrink: 0;
}

.epc-ttl-profile-name {
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	display: block;
}

.epc-ttl-live-badge {
	display: flex;
	align-items: center;
	gap: 4px;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.5px;
	margin-top: 2px;
}

.epc-ttl-live-dot {
	width: 6px;
	height: 6px;
	flex-shrink: 0;
	border-radius: 50%;
	background: #fe2c55;
	display: inline-block;
}

.epc-ttl-viewers {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 4px;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	padding: 5px 10px;
	border-radius: 14px;
}

.epc-ttl-eye {
	flex-shrink: 0;
}

/* ---- Título del LIVE ---- */
.epc-ttl-title-row {
	position: absolute;
	top: 72px;
	left: 12px;
	right: 12px;
	display: flex;
}

.epc-ttl-title-badge {
	display: inline-block;
	width: fit-content;
	max-width: 100%;
	background: #fe2c55;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	padding: 5px 12px;
	border-radius: 6px;
	white-space: normal;
	word-break: break-word;
	line-height: 1.3;
}

/* ---- Corazones TAP TAP ---- */
.epc-ttl-hearts-layer {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	z-index: 3;
}

.epc-ttl-heart {
	position: absolute;
	font-size: 26px;
	color: #fe2c55;
	transform: translate(-50%, -50%);
	pointer-events: none;
	animation: epc-ttl-heart-rise 1s ease-out forwards;
	will-change: transform, opacity;
}

@keyframes epc-ttl-heart-rise {
	0% {
		transform: translate(-50%, -50%) scale(0.5);
		opacity: 1;
	}
	30% {
		transform: translate(-50%, calc(-50% - 40px)) scale(1.15);
		opacity: 1;
	}
	100% {
		transform: translate(-50%, calc(-50% - 150px)) scale(1);
		opacity: 0;
	}
}

/* ---- Feed de comentarios ---- */
.epc-ttl-comments-feed {
	position: absolute;
	left: 10px;
	right: 70px;
	bottom: 10px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	max-height: 55%;
	overflow: hidden;
	pointer-events: none;
}

.epc-ttl-comment-bubble {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	background: rgba(0, 0, 0, 0.35);
	border-radius: 14px;
	padding: 5px 10px 5px 5px;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.35s ease, transform 0.35s ease;
	max-width: 100%;
}

.epc-ttl-comment-bubble.epc-ttl-in {
	opacity: 1;
	transform: translateY(0);
}

.epc-ttl-comment-bubble.epc-ttl-out {
	opacity: 0;
	transform: translateY(-6px);
}

.epc-ttl-comment-avatar {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	border-radius: 50% !important;
	object-fit: cover !important;
	display: block;
}

.epc-ttl-comment-body {
	min-width: 0;
	word-break: break-word;
}

.epc-ttl-comment-username {
	font-size: 12px;
	font-weight: 700;
	color: #ffd54f;
	margin-right: 4px;
}

.epc-ttl-comment-text {
	font-size: 12px;
	color: #fff;
	font-weight: 400;
}

/* ---- Fichas de producto: superposición sobre el video, encima del
 * botón "Comprar ahora" ---- */
.epc-ttl-products-wrap {
	position: absolute;
	right: 12px;
	bottom: 20px;
	z-index: 3;
	max-width: calc(100% - 24px);
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.epc-ttl-products-wrap::-webkit-scrollbar {
	display: none;
}

.epc-ttl-products-track {
	display: flex;
	gap: 10px;
}

.epc-ttl-product-card {
	flex: 0 0 112.5px;
	width: 112.5px;
	height: 174px;
	scroll-snap-align: start;
	background: #ffffff;
	border-radius: 10px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
	cursor: pointer;
}

.epc-ttl-product-image {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	display: block;
}

.epc-ttl-product-info {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 3px;
	padding: 8px 10px;
	min-height: 0;
}

.epc-ttl-product-stock {
	font-size: 11px;
	color: #555;
}

.epc-ttl-product-custom-text {
	font-size: 12px;
	font-weight: 600;
	color: #000000;
	line-height: 1.2;
}

.epc-ttl-product-more {
	margin-top: auto;
	align-self: stretch;
	text-align: center;
	background: #fe2c55;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	padding: 6px 8px;
	border-radius: 14px;
	text-decoration: none;
}

.epc-ttl-product-more:hover,
.epc-ttl-product-more:focus {
	color: #fff;
	opacity: 0.9;
}

/* ---- Barra inferior negra ---- */
.epc-ttl-bottom-bar {
	position: relative;
	z-index: 1;
	margin-top: -15px;
	display: flex;
	align-items: center;
	gap: 8px;
	background: #000;
	padding: 10px 12px;
}

.epc-ttl-input-wrap {
	flex: 1;
	display: flex;
	align-items: center;
	background: rgba(130, 130, 130, 0.35);
	border-radius: 20px;
	padding: 6px 6px 6px 14px;
	min-width: 0;
}

.epc-ttl-comment-input {
	flex: 1;
	min-width: 0;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	-webkit-appearance: none;
	appearance: none;
	outline: none;
	color: #ffffff !important;
	font-size: 13px;
	padding: 4px 0;
}

.epc-ttl-comment-input::placeholder {
	color: rgba(255, 255, 255, 0.55);
}

.epc-ttl-comment-send {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: none !important;
	background: transparent !important;
	box-shadow: none !important;
	-webkit-appearance: none;
	appearance: none;
	color: #ffffff !important;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 15px;
}

.epc-ttl-cta-button {
	flex-shrink: 0;
	display: inline-block;
	background: #fe2c55;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	padding: 8px 18px;
	border-radius: 20px;
	text-decoration: none;
	white-space: nowrap;
}

.epc-ttl-cta-button:hover,
.epc-ttl-cta-button:focus {
	color: #fff;
	opacity: 0.9;
}

/* ---- Modal de checkout/enlace del botón (el video sigue detrás) ---- */
.epc-ttl-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.75);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 999999;
}

.epc-ttl-modal-overlay[hidden] {
	display: none;
}

.epc-ttl-modal-box {
	position: relative;
	width: 85vw;
	height: 85vh;
	background: #fff;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.epc-ttl-modal-close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 34px;
	height: 34px;
	border-radius: 6px;
	background: #fe2c55;
	color: #ffffff;
	border: none;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
}

.epc-ttl-modal-iframe {
	width: 100%;
	height: 100%;
	border: none;
	display: block;
}

/* ---- Bloqueo de scroll de toda la página (activado por el widget) ---- */
html.epc-ttl-scroll-locked,
body.epc-ttl-scroll-locked {
	overflow: hidden !important;
	height: 100% !important;
	overscroll-behavior: none !important;
}

@media (max-width: 480px) {
	.epc-ttl-widget {
		max-width: 100%;
		border-radius: 0;
	}
}
