/**
 * Video Library — section review video trang chủ.
 * Layout: video YouTube nền full-bleed + overlay chữ bên trái,
 * panel danh sách video bên phải (search, thumbnail, PREV/NEXT).
 */

.video-library {
	position: relative;
	width: 100%;
	overflow: hidden;
	background: #1e1b16;
	isolation: isolate;
	color: #fff;
	/* Tách khỏi banner slider phía trên, không để dính sát */
	margin-top: 46px;
}

/* ============================================================
   Tiêu đề section
   ============================================================ */

.video-library__header {
	padding: 44px 20px 30px;
	text-align: center;
}

.video-library__header h2 {
	margin: 0 0 12px;
	font-size: 30px;
	font-weight: 700;
	line-height: 1.25;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #fff;
}

/* gạch đỏ dưới tiêu đề */
.video-library__header h2:after {
	content: '';
	display: block;
	width: 54px;
	height: 3px;
	margin: 14px auto 0;
	background: #de2d13;
}

.video-library__subtitle {
	max-width: 640px;
	margin: 0 auto;
	font-size: 15px;
	line-height: 1.7;
	color: rgba(255, 255, 255, .62);
}

@media (max-width: 991px) {
	.video-library {
		margin-top: 28px;
	}

	.video-library__header {
		padding: 30px 16px 20px;
	}

	.video-library__header h2 {
		font-size: 21px;
	}

	.video-library__subtitle {
		font-size: 14px;
	}
}

/* ============================================================
   Desktop
   ============================================================ */

.video-library__stage {
	position: relative;
	display: none;
	height: clamp(640px, 82vh, 980px);
}

@media (min-width: 992px) {
	.video-library__stage {
		display: block;
	}
}

/* ---------- Video nền ---------- */

.video-library__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	background: #1e1b16;
	pointer-events: none;
}

.video-library__bg iframe {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	/* phủ kín khung dù tỉ lệ nào */
	width: max(100%, 177.78vh);
	height: max(100%, 56.25vw);
	border: 0;
	pointer-events: none;
}

/* Ảnh poster hiện trước khi iframe nạp -> không thấy nền đen trống */
.video-library__poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 1;
	transition: opacity .6s ease;
}

.video-library__bg.is-playing .video-library__poster {
	opacity: 0;
}

/* ---------- Lớp phủ gradient ---------- */

.video-library__scrim {
	position: absolute;
	inset: 0;
	z-index: 10;
	pointer-events: none;
	background: radial-gradient(140% 95% at 0% 100%,
			rgba(0, 0, 0, .92) 0%,
			rgba(0, 0, 0, .78) 18%,
			rgba(0, 0, 0, .45) 38%,
			rgba(0, 0, 0, .10) 65%,
			rgba(0, 0, 0, 0) 100%);
}

.video-library__scrim--top {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	height: 128px;
	z-index: 10;
	pointer-events: none;
	background: linear-gradient(rgba(0, 0, 0, .45) 0%, rgba(0, 0, 0, 0) 100%);
}

/* ---------- Nút tạm dừng video nền ---------- */

.video-library__pause {
	position: absolute;
	top: 28px;
	left: 28px;
	z-index: 30;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, .2);
	background: rgba(0, 0, 0, .4);
	color: #fff;
	cursor: pointer;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
	transition: background-color .3s ease;
}

.video-library__pause:hover {
	background: rgba(0, 0, 0, .65);
}

.video-library__pause svg {
	width: 15px;
	height: 15px;
	fill: currentColor;
}

.video-library__pause .icon-play {
	display: none;
	margin-left: 2px;
}

.video-library__pause.is-paused .icon-pause {
	display: none;
}

.video-library__pause.is-paused .icon-play {
	display: block;
}

/* ---------- Overlay chữ bên trái ---------- */

.video-library__caption {
	position: absolute;
	z-index: 20;
	left: 0;
	bottom: 0;
	max-width: 620px;
	padding: 0 40px 68px 56px;
}

.video-library__eyebrow {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 18px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .22em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .75);
}

.video-library__eyebrow:before {
	content: '';
	width: 22px;
	height: 1px;
	background: #de2d13;
}

.video-library__title {
	margin: 0 0 16px;
	font-size: 44px;
	font-style: italic;
	line-height: 1.05;
	color: #fff;
	text-shadow: 0 2px 24px rgba(0, 0, 0, .5);
}

.video-library__desc {
	margin: 0 0 26px;
	max-width: 520px;
	font-size: 15px;
	line-height: 1.65;
	color: rgba(255, 255, 255, .82);
}

/* Hàng nút: Xem video (primary) + Xem sản phẩm (secondary) */
.video-library__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

/* Nút chính — nền trắng, chữ tối */
.video-library__watch {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 14px 32px 14px 28px;
	border: 1px solid #fff;
	background: #fff;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .22em;
	text-transform: uppercase;
	color: #1e1b16;
	text-decoration: none;
	transition: background-color .3s ease, border-color .3s ease;
}

.video-library__watch:hover,
.video-library__watch:focus {
	background: #f2ede6;
	border-color: #f2ede6;
	color: #1e1b16;
	text-decoration: none;
}

.video-library__watch svg {
	width: 13px;
	height: 13px;
	fill: currentColor;
	flex: 0 0 auto;
}

.video-library__cta {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 14px 28px;
	border: 1px solid rgba(255, 255, 255, .35);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .22em;
	text-transform: uppercase;
	color: #fff;
	text-decoration: none;
	transition: background-color .3s ease, border-color .3s ease, color .3s ease;
}

.video-library__cta:hover,
.video-library__cta:focus {
	background: #fff;
	border-color: #fff;
	color: #1e1b16;
	text-decoration: none;
}

.video-library__cta svg {
	width: 14px;
	height: 14px;
	fill: currentColor;
	transition: transform .3s ease;
}

.video-library__cta:hover svg {
	transform: translateX(4px);
}

/* ============================================================
   Panel phải
   ============================================================ */

.video-library__panel {
	position: absolute;
	z-index: 20;
	top: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	width: 400px;
	padding: 26px 0 0;
	background: linear-gradient(180deg, rgba(16, 12, 9, .93) 0%, rgba(10, 8, 7, .96) 100%);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-left: 1px solid rgba(255, 255, 255, .07);
}

.video-library__panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 22px;
	margin-bottom: 16px;
}

.video-library__panel-title {
	display: flex;
	align-items: center;
	gap: 9px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .22em;
	text-transform: uppercase;
	color: #fff;
}

.video-library__panel-title:before {
	content: '';
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #de2d13;
}

.video-library__counter {
	font-size: 11px;
	letter-spacing: .12em;
	color: rgba(255, 255, 255, .45);
}

.video-library__counter b {
	font-weight: 600;
	color: #fff;
}

/* ---------- Ô tìm kiếm ---------- */

.video-library__search {
	position: relative;
	margin: 0 22px 16px;
}

.video-library__search svg {
	position: absolute;
	top: 50%;
	left: 14px;
	width: 14px;
	height: 14px;
	transform: translateY(-50%);
	fill: rgba(255, 255, 255, .4);
	pointer-events: none;
}

.video-library__search input {
	width: 100%;
	height: 42px;
	padding: 0 14px 0 38px;
	border-radius: 4px;
	border: 1px solid rgba(255, 255, 255, .12);
	background: rgba(255, 255, 255, .05);
	font-size: 13px;
	color: #fff;
	outline: none;
	transition: border-color .25s ease, background-color .25s ease;
}

.video-library__search input::placeholder {
	color: rgba(255, 255, 255, .38);
}

.video-library__search input:focus {
	border-color: rgba(222, 45, 19, .6);
	background: rgba(255, 255, 255, .08);
}

/* ---------- Danh sách video ---------- */

.video-library__list {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 0 14px 8px;
	list-style: none;
	margin: 0;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, .18) transparent;
}

.video-library__list::-webkit-scrollbar {
	width: 5px;
}

.video-library__list::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, .18);
	border-radius: 3px;
}

.video-library__list li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.video-library__item {
	position: relative;
	display: flex;
	gap: 12px;
	width: 100%;
	padding: 8px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	text-align: left;
	cursor: pointer;
	transition: background-color .3s ease;
}

.video-library__item:hover {
	background: rgba(255, 255, 255, .04);
}

.video-library__item.is-active {
	background: rgba(255, 255, 255, .06);
}

/* vạch đỏ bên trái mục đang phát */
.video-library__item:before {
	content: '';
	position: absolute;
	left: 0;
	top: 8px;
	bottom: 8px;
	width: 2px;
	background: #de2d13;
	opacity: 0;
	transition: opacity .3s ease;
}

.video-library__item.is-active:before {
	opacity: 1;
}

.video-library__thumb {
	position: relative;
	flex: 0 0 auto;
	width: 124px;
	height: 70px;
	border-radius: 3px;
	overflow: hidden;
	background: #000;
	transition: box-shadow .3s ease;
}

.video-library__item.is-active .video-library__thumb {
	box-shadow: 0 0 0 1px rgba(222, 45, 19, .8),
	            0 4px 18px -2px rgba(222, 45, 19, .45);
}

.video-library__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s ease;
}

.video-library__item:hover .video-library__thumb img,
.video-library__item.is-active .video-library__thumb img {
	transform: scale(1.05);
}

/* badge NOW trên mục đang phát */
.video-library__now {
	position: absolute;
	left: 6px;
	bottom: 6px;
	display: none;
	align-items: center;
	gap: 4px;
	padding: 2px 6px;
	border-radius: 2px;
	background: rgba(0, 0, 0, .7);
	font-size: 8px;
	font-weight: 700;
	letter-spacing: .14em;
	color: #fff;
}

.video-library__item.is-active .video-library__now {
	display: flex;
}

.video-library__now:before {
	content: '';
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: #de2d13;
	animation: video-library-pulse 1.8s ease-in-out infinite;
}

@keyframes video-library-pulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50%      { opacity: .4; transform: scale(.85); }
}

.video-library__meta {
	flex: 1 1 auto;
	min-width: 0;
	padding-top: 2px;
}

.video-library__item-title {
	margin: 0 0 8px;
	font-size: 13px;
	line-height: 1.35;
	color: rgba(255, 255, 255, .92);
	/* gọn 2 dòng */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.video-library__item.is-active .video-library__item-title {
	color: #fff;
}

.video-library__item-sub {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	font-size: 10px;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .45);
}

.video-library__item.is-active .video-library__item-sub {
	color: #de2d13;
}

.video-library__item-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.video-library__item-num {
	flex: 0 0 auto;
	color: rgba(255, 255, 255, .35);
}

/* trạng thái không tìm thấy khi search */
.video-library__empty {
	display: none;
	padding: 28px 12px;
	text-align: center;
	font-size: 12px;
	color: rgba(255, 255, 255, .4);
}

.video-library__list.is-empty .video-library__empty {
	display: block;
}

/* ---------- PREV / NEXT ---------- */

.video-library__nav {
	flex: 0 0 auto;
	display: flex;
	gap: 10px;
	padding: 14px 22px 20px;
	background: linear-gradient(180deg, rgba(16, 12, 9, 0) 0%, rgba(10, 8, 7, .9) 40%);
}

.video-library__nav button {
	flex: 1 1 0;
	height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: 1px solid rgba(255, 255, 255, .15);
	background: transparent;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .8);
	cursor: pointer;
	transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}

.video-library__nav button:hover {
	background: rgba(255, 255, 255, .07);
	border-color: rgba(255, 255, 255, .3);
	color: #fff;
}

.video-library__nav svg {
	width: 12px;
	height: 12px;
	fill: currentColor;
}

/* ============================================================
   Mobile / tablet (<992px): xếp dọc
   ============================================================ */

.video-library__mobile {
	display: block;
	padding: 0 0 40px;
	background: #1e1b16;
}

@media (min-width: 992px) {
	.video-library__mobile {
		display: none;
	}
}

.video-library__mobile .video-library__panel-head {
	padding: 0 16px;
	margin-bottom: 14px;
}

.video-library__player {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	overflow: hidden;
}

/* fallback cho trình duyệt cũ không hỗ trợ aspect-ratio */
@supports not (aspect-ratio: 16 / 9) {
	.video-library__player {
		height: 0;
		padding-bottom: 56.25%;
	}
}

.video-library__player iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.video-library__mobile-caption {
	padding: 18px 16px 22px;
}

.video-library__mobile-caption .video-library__title {
	font-size: 22px;
	margin-bottom: 10px;
}

.video-library__mobile-caption .video-library__desc {
	font-size: 14px;
	margin-bottom: 18px;
}

.video-library__mobile-caption .video-library__cta {
	padding: 12px 22px;
	font-size: 10px;
}

/* danh sách ngang, cuộn bằng tay */
.video-library__strip {
	display: flex;
	gap: 12px;
	padding: 4px 16px 8px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.video-library__strip::-webkit-scrollbar {
	display: none;
}

.video-library__strip .video-library__item {
	flex: 0 0 auto;
	flex-direction: column;
	gap: 8px;
	width: 180px;
	padding: 0;
	scroll-snap-align: start;
	background: transparent;
}

.video-library__strip .video-library__item:before {
	display: none;
}

.video-library__strip .video-library__thumb {
	width: 180px;
	height: 101px;
}

.video-library__strip .video-library__item-title {
	font-size: 12px;
	margin-bottom: 4px;
}

/* Mobile: nút gọn lại cho vừa màn hình hẹp */
@media (max-width: 991px) {
	.video-library__actions {
		gap: 10px;
	}

	.video-library__watch {
		padding: 12px 24px 12px 20px;
		font-size: 10px;
		letter-spacing: .18em;
	}

	.video-library__watch svg {
		width: 11px;
		height: 11px;
	}
}
