/* Nút chuyển slide — lớp điều khiển luôn nằm trên nội dung carousel */
.hanoi26-carousel {
	position: relative;
	box-sizing: border-box;
	padding-inline: 3.75rem;
}

.hanoi26-carousel__viewport {
	position: relative;
	z-index: 1;
	width: 100%;
	overflow: hidden;
}

/*
 * Giữ đúng kích thước carousel ngay từ lần render đầu tiên. Trong lúc JS chưa
 * tính xong layout, che nội dung bằng skeleton để product card không phóng to.
 */
.hanoi26-carousel:not(.is-ready) .hanoi26-carousel__viewport::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 10;
	border-radius: 0.75rem;
	background: linear-gradient(100deg, #f1f3f5 20%, #fafafa 38%, #f1f3f5 56%);
	background-size: 200% 100%;
	animation: hanoi26-carousel-skeleton 1.25s ease-in-out infinite;
	pointer-events: none;
}

.hanoi26-carousel:not(.is-ready) .hanoi26-carousel__track {
	visibility: hidden;
	opacity: 0;
}

.hanoi26-carousel:not(.is-ready) .hanoi26-carousel__nav {
	display: none;
}

.hanoi26-carousel.is-ready .hanoi26-carousel__track {
	visibility: visible;
	opacity: 1;
	transition: opacity 0.2s ease;
}

@keyframes hanoi26-carousel-skeleton {
	to {
		background-position: -200% 0;
	}
}

.hanoi26-carousel__track {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	will-change: transform;
}

.hanoi26-carousel__nav {
	position: absolute;
	inset: 0;
	z-index: 20;
	pointer-events: none;
}

.hanoi26-carousel__btn {
	position: absolute;
	top: 50%;
	margin: 0;
	padding: 0;
	transform: translateY(-50%);
	width: 3rem;
	height: 3rem;
	border-radius: 9999px;
	border: 1px solid #e5e7eb;
	background: #ffffff;
	color: #111827;
	display: flex !important;
	align-items: center;
	justify-content: center;
	cursor: pointer !important;
	pointer-events: auto !important;
	z-index: 21;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
	opacity: 1;
	visibility: visible;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
	-webkit-tap-highlight-color: transparent;
}

.hanoi26-carousel__btn--prev {
	left: 0;
}

.hanoi26-carousel__btn--next {
	right: 0;
}

.hanoi26-carousel__btn i {
	pointer-events: none;
}

.hanoi26-carousel__btn:hover,
.hanoi26-carousel__btn:focus-visible {
	background: #e53e3e !important;
	color: #fff !important;
	border-color: #e53e3e !important;
	transform: translateY(-50%) scale(1.08);
	box-shadow: 0 6px 18px rgba(229, 62, 62, 0.35);
	outline: none;
}

.hanoi26-carousel__btn:active {
	transform: translateY(-50%) scale(0.96);
}

.hanoi26-carousel__btn.is-hidden {
	display: none !important;
}

/* Sản phẩm mới */
.hanoi26-carousel--products .hanoi26-carousel__viewport {
	padding-top: 0.75rem;
	padding-bottom: 1.25rem;
	border-radius: 0.75rem;
	cursor: grab;
	touch-action: pan-y pinch-zoom;
}

.hanoi26-carousel--products .product-card__link {
	position: relative;
	z-index: 6;
	pointer-events: auto;
}

.hanoi26-carousel--products .product-card__swatches {
	position: relative;
	z-index: 18;
}

.hanoi26-carousel--products.is-dragging .hanoi26-carousel__viewport {
	cursor: grabbing;
	user-select: none;
	-webkit-user-select: none;
	touch-action: none;
}

.hanoi26-carousel--products.is-dragging .product-card {
	cursor: grabbing;
}

.hanoi26-carousel--products.is-dragging .product-card a.product-card__link {
	pointer-events: none;
}

.hanoi26-carousel--products .hanoi26-carousel__track {
	align-items: stretch;
	gap: 12px;
	transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hanoi26-carousel--products .hanoi26-carousel__slide {
	flex: 0 0 auto;
	width: calc((100% - 12px) / 2);
	min-width: calc((100% - 12px) / 2);
	max-width: calc((100% - 12px) / 2);
	box-sizing: border-box;
	padding-top: 4px;
	display: flex;
	overflow: visible;
}

.hanoi26-carousel--products .hanoi26-carousel__slide .product-card {
	overflow: visible;
	flex: 1 1 auto;
	width: 100%;
	cursor: pointer;
}

.hanoi26-carousel--products .hanoi26-carousel__btn {
	top: 42%;
}

/* Danh mục thương hiệu */
.hanoi26-carousel--brands .hanoi26-carousel__track {
	gap: 16px;
}

.hanoi26-carousel--brands .hanoi26-carousel__viewport {
	min-height: 8rem;
	cursor: grab;
	touch-action: pan-y;
}

.hanoi26-carousel--brands.is-dragging .hanoi26-carousel__viewport {
	cursor: grabbing;
	user-select: none;
	-webkit-user-select: none;
}

.hanoi26-carousel--brands.is-dragging .h26-brand-carousel__link {
	pointer-events: none;
}

.hanoi26-carousel--brands .hanoi26-carousel__slide {
	flex: 0 0 auto;
	width: calc((100% - 16px) / 2);
	min-width: calc((100% - 16px) / 2);
	max-width: calc((100% - 16px) / 2);
	box-sizing: border-box;
	display: flex;
	justify-content: center;
	pointer-events: none;
}

.hanoi26-carousel--brands .h26-brand-carousel__link {
	pointer-events: auto;
	width: 100%;
	max-width: 9rem;
	margin-inline: auto;
}

.hanoi26-carousel--brands .hanoi26-carousel__btn {
	top: 38%;
}

@media (min-width: 768px) {
	.hanoi26-carousel--products .hanoi26-carousel__track {
		gap: 24px;
	}

	.hanoi26-carousel--products .hanoi26-carousel__slide {
		width: calc((100% - 72px) / 4);
		min-width: calc((100% - 72px) / 4);
		max-width: calc((100% - 72px) / 4);
	}

	.hanoi26-carousel--brands .hanoi26-carousel__track {
		gap: 24px;
	}

	.hanoi26-carousel--brands .h26-brand-carousel__link {
		max-width: 10rem;
	}
}

@media (min-width: 640px) and (max-width: 767px) {
	.hanoi26-carousel--brands .hanoi26-carousel__slide {
		width: calc((100% - 32px) / 3);
		min-width: calc((100% - 32px) / 3);
		max-width: calc((100% - 32px) / 3);
	}
}

@media (min-width: 768px) and (max-width: 1023px) {
	.hanoi26-carousel--brands .hanoi26-carousel__slide {
		width: calc((100% - 48px) / 3);
		min-width: calc((100% - 48px) / 3);
		max-width: calc((100% - 48px) / 3);
	}
}

@media (min-width: 1024px) {
	.hanoi26-carousel--brands .hanoi26-carousel__slide {
		width: calc((100% - 144px) / 7);
		min-width: calc((100% - 144px) / 7);
		max-width: calc((100% - 144px) / 7);
	}

	.hanoi26-carousel--brands .h26-brand-carousel__link {
		max-width: 7.5rem;
		gap: 0.5rem;
	}

	.hanoi26-carousel--brands .h26-brand-carousel__link > div:first-child {
		width: 5rem !important;
		height: 5rem !important;
	}

	.hanoi26-carousel--brands .h26-brand-carousel__link span {
		font-size: 0.75rem;
		line-height: 1.2;
	}
}

@media (min-width: 1600px) {
	.hanoi26-carousel--products .hanoi26-carousel__slide {
		width: calc((100% - 96px) / 5);
		min-width: calc((100% - 96px) / 5);
		max-width: calc((100% - 96px) / 5);
	}
}

@media (max-width: 767px) {
	.hanoi26-carousel {
		padding-inline: 3rem;
	}

	.hanoi26-carousel--products {
		padding-inline: 0;
	}

	.hanoi26-carousel--products .hanoi26-carousel__btn {
		top: 28%;
	}

	.hanoi26-carousel--products .hanoi26-carousel__btn--prev {
		left: 0.25rem;
	}

	.hanoi26-carousel--products .hanoi26-carousel__btn--next {
		right: 0.25rem;
	}

	.hanoi26-carousel__btn {
		width: 2.5rem;
		height: 2.5rem;
		font-size: 0.8125rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hanoi26-carousel:not(.is-ready) .hanoi26-carousel__viewport::before {
		animation: none;
	}
}
