/* TikTok Player XD — style gọn, ưu tiên biến --xd-* của theme nếu có */
.vinhxd-ttp-video,
.vinhxd-ttp-carousel,
.vinhxd-ttp-profile-card,
.vinhxd-ttp-stats-bar {
	--_ttp-font: var(--xd-font, 'Be Vietnam Pro', system-ui, sans-serif);
	--_ttp-primary: var(--xd-primary, #fe2c55);
	--_ttp-text: var(--xd-text, #161823);
	--_ttp-muted: var(--xd-muted, #758087);
	--_ttp-border: var(--xd-border, #e8e8e8);
	--_ttp-radius: var(--xd-radius, 12px);
	font-family: var(--_ttp-font);
	box-sizing: border-box;
}
.vinhxd-ttp-video,
.vinhxd-ttp-carousel *,
.vinhxd-ttp-profile-card * {
	box-sizing: border-box;
}

/* Video đơn */
.vinhxd-ttp-video {
	max-width: 605px;
	margin: 0 auto;
}
.vinhxd-ttp-video blockquote.tiktok-embed {
	margin: 0 auto !important;
}

/* Carousel */
.vinhxd-ttp-carousel__title {
	font-family: var(--_ttp-font);
	color: var(--_ttp-text);
	margin: 0 0 12px;
	font-size: 20px;
	font-weight: 600;
}
.vinhxd-ttp-carousel__wrap {
	position: relative;
}
.vinhxd-ttp-carousel__track {
	display: flex;
	gap: 16px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	padding: 4px 2px 12px;
	scrollbar-width: thin;
}
.vinhxd-ttp-carousel__track::-webkit-scrollbar {
	height: 6px;
}
.vinhxd-ttp-carousel__track::-webkit-scrollbar-thumb {
	background: var(--_ttp-border);
	border-radius: 4px;
}
.vinhxd-ttp-carousel__item {
	flex: 0 0 calc((100% - 3 * 16px) / 4);
	width: calc((100% - 3 * 16px) / 4);
	scroll-snap-align: start;
}
.vinhxd-ttp-carousel__item blockquote.tiktok-embed {
	margin: 0 !important;
	width: 100% !important;
	min-width: 0 !important;
}
/* Nút điều hướng — mặc định overlay lên thumbnail để đỡ tốn không gian */
.vinhxd-ttp-carousel__nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	transform: translateY(-50%);
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 0;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease;
}
.vinhxd-ttp-carousel__nav--prev {
	left: 8px;
}
.vinhxd-ttp-carousel__nav--next {
	right: 8px;
}
.vinhxd-ttp-carousel__nav:hover {
	background: rgba(0, 0, 0, 0.7);
}

@media (max-width: 768px) {
	.vinhxd-ttp-carousel__item {
		flex-basis: calc((100% - 2 * 16px) / 3);
		width: calc((100% - 2 * 16px) / 3);
	}
}
@media (max-width: 480px) {
	.vinhxd-ttp-carousel__item {
		flex-basis: calc((100% - 16px) / 2);
		width: calc((100% - 16px) / 2);
	}
	.vinhxd-ttp-stats-bar {
		flex-wrap: wrap;
	}
}

/* Profile card chính thức */
.vinhxd-ttp-profile-card {
	width: 100%; /* Đổi từ max-width: 720px sang 100% để Elementor có thể điều khiển */
	margin: 0 auto;
}
.vinhxd-ttp-profile-card blockquote.tiktok-embed {
	margin: 0 auto !important;
	max-width: 100% !important; /* Ghi đè max-width: 780px mặc định của blockquote TikTok */
}
.vinhxd-ttp-profile-card iframe {
	max-width: 100% !important; /* Đảm bảo iframe bên trong cũng phình to được theo blockquote */
}

/* Stats bar tự thiết kế */
.vinhxd-ttp-stats-bar {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 16px;
	border: 1px solid var(--_ttp-border);
	border-radius: var(--_ttp-radius);
	max-width: 480px;
}
.vinhxd-ttp-stats-bar__avatar {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	object-fit: cover;
	flex: 0 0 auto;
}
.vinhxd-ttp-stats-bar__info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1;
	min-width: 0;
}
.vinhxd-ttp-stats-bar__name {
	color: var(--_ttp-text);
	font-weight: 600;
	font-size: 14px;
}
.vinhxd-ttp-stats-bar__stat {
	color: var(--_ttp-muted);
	font-size: 13px;
}
.vinhxd-ttp-stats-bar__stat strong {
	color: var(--_ttp-text);
}
.vinhxd-ttp-stats-bar__follow {
	flex: 0 0 auto;
	background: var(--_ttp-primary);
	color: #fff;
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
	padding: 8px 16px;
	border-radius: 999px;
	transition: opacity 0.15s ease;
}
.vinhxd-ttp-stats-bar__follow:hover {
	opacity: 0.85;
	color: #fff;
}

@media (max-width: 480px) {
	.vinhxd-ttp-carousel__item {
		width: 240px;
	}
	.vinhxd-ttp-stats-bar {
		flex-wrap: wrap;
	}
}

/* Thumbnail + nút play (mode=lightbox) */
.vinhxd-ttp-thumb {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 9 / 16;
	padding: 0;
	border: 0;
	background: #000;
	border-radius: var(--_ttp-radius);
	overflow: hidden;
	cursor: pointer;
	text-align: left;
}
.vinhxd-ttp-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.vinhxd-ttp-thumb__play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 26px;
	color: #fff;
	background: rgba(0, 0, 0, 0.18);
	transition: background 0.15s ease;
}
.vinhxd-ttp-thumb:hover .vinhxd-ttp-thumb__play,
.vinhxd-ttp-thumb:focus-visible .vinhxd-ttp-thumb__play {
	background: rgba(0, 0, 0, 0.4);
}
.vinhxd-ttp-thumb__stats {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	gap: 10px;
	padding: 18px 10px 8px;
	font-size: 12px;
	font-weight: 600;
	color: #fff;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
	pointer-events: none;
}
.vinhxd-ttp-thumb__caption {
	display: block;
	margin-top: 6px;
	font-size: 12px;
	line-height: 1.4;
	color: var(--_ttp-muted);
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

/* Modal lightbox — 2 cột: video trái, thông tin phải */
.vinhxd-ttp-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	font-family: var(--xd-font, 'Be Vietnam Pro', system-ui, sans-serif);
}
.vinhxd-ttp-modal.is-open {
	display: flex;
}
.vinhxd-ttp-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.8);
}
.vinhxd-ttp-modal__box {
	position: relative;
	z-index: 1;
	display: flex;
	width: 92vw;
	max-width: 920px;
	max-height: 88vh;
	background: #fff;
	border-radius: 14px;
	overflow: hidden;
}
.vinhxd-ttp-modal__video {
	flex: 1 1 55%;
	min-width: 0;
	max-height: 88vh;
	overflow-y: auto;
	background: #000;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
}
.vinhxd-ttp-modal__video blockquote.tiktok-embed {
	margin: 0 auto !important;
	width: 100% !important;
}
.vinhxd-ttp-modal__info {
	flex: 1 1 45%;
	min-width: 260px;
	max-height: 88vh;
	overflow-y: auto;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.vinhxd-ttp-modal__author {
	display: flex;
	align-items: center;
	gap: 10px;
}
.vinhxd-ttp-modal__author img {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
}
.vinhxd-ttp-modal__author span {
	font-weight: 600;
	color: var(--_ttp-text);
	font-size: 14px;
}
.vinhxd-ttp-modal__caption {
	font-size: 14px;
	line-height: 1.6;
	color: var(--_ttp-text);
	white-space: pre-line;
}
.vinhxd-ttp-modal__caption a {
	color: var(--_ttp-primary);
	text-decoration: none;
}
.vinhxd-ttp-modal__stats {
	display: flex;
	gap: 16px;
	font-size: 13px;
	color: var(--_ttp-muted);
	font-weight: 600;
}
.vinhxd-ttp-modal__cta {
	margin-top: auto;
	display: inline-block;
	text-align: center;
	background: var(--_ttp-primary);
	color: #fff;
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
	padding: 10px 16px;
	border-radius: 999px;
}
.vinhxd-ttp-modal__close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 0;
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}
.vinhxd-ttp-modal__arrow {
	display: none;
	flex: 0 0 auto;
	z-index: 1;
	width: 44px;
	height: 44px;
	margin: 0 12px;
	border-radius: 50%;
	border: 0;
	background: rgba(255, 255, 255, 0.9);
	color: #161823;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}
.vinhxd-ttp-modal.has-nav .vinhxd-ttp-modal__arrow {
	display: block;
}
body.vinhxd-ttp-modal-open {
	overflow: hidden;
}

@media (max-width: 720px) {
	.vinhxd-ttp-modal__box {
		flex-direction: column;
		width: 94vw;
		max-height: 92vh;
	}
	.vinhxd-ttp-modal__video,
	.vinhxd-ttp-modal__info {
		max-height: none;
		flex: 0 0 auto;
	}
	.vinhxd-ttp-modal__arrow {
		width: 36px;
		height: 36px;
		margin: 0 4px;
	}
}

/* =====================================================================
   TikTok Widget — thẻ thông tin kênh tự thiết kế
   [vinhxd_ttp_tiktok_widget]
   ===================================================================== */
.vinhxd-ttp-tw {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 18px 20px 20px;
	border: 1px solid #e8e8e8;
	border-radius: 16px;
	background: #fff;
	max-width: 420px;
	font-family: var(--_ttp-font, 'Be Vietnam Pro', system-ui, sans-serif);
	box-sizing: border-box;
}

/* Header: icon + username */
.vinhxd-ttp-tw__header {
	display: flex;
	align-items: center;
	gap: 10px;
}
.vinhxd-ttp-tw__header-icon {
	width: 24px;
	height: 24px;
	flex: 0 0 auto;
	fill: #161823;
	opacity: 0.7;
}
.vinhxd-ttp-tw__header-name {
	font-size: 15px;
	font-weight: 700;
	color: #161823;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Body: avatar + stats */
.vinhxd-ttp-tw__body {
	display: flex;
	align-items: center;
	gap: 20px;
}
.vinhxd-ttp-tw__avatar {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	object-fit: cover;
	flex: 0 0 auto;
	background: #e8e8e8;
}
.vinhxd-ttp-tw__avatar--placeholder {
	background: #e8e8e8;
}
.vinhxd-ttp-tw__stats-wrap {
	display: flex;
	gap: 18px;
	flex-wrap: wrap;
}
.vinhxd-ttp-tw__stat {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
}
.vinhxd-ttp-tw__stat-num {
	font-size: 18px;
	font-weight: 700;
	color: #161823;
	line-height: 1.2;
}
.vinhxd-ttp-tw__stat-label {
	font-size: 12px;
	color: #758087;
	line-height: 1.3;
}

/* Nút Follow */
.vinhxd-ttp-tw__btn {
	display: block;
	text-align: center;
	padding: 12px 16px;
	border: 2px solid #fe2c55;
	border-radius: 8px;
	background: #fff;
	color: #fe2c55;
	font-size: 15px;
	font-weight: 700;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
	box-sizing: border-box;
}
.vinhxd-ttp-tw__btn:hover {
	background: #fe2c55;
	color: #fff;
}

