.ds-home-popular {
	--ds-popular-blue: #3A8DFF;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	justify-content: center;
	width: 100vw;
	max-width: 100vw;
	min-height: 88vh;
	min-height: 88dvh;
	margin: 0 0 0 calc(50% - 50vw);
	padding: 48px 15px;
	background: var(--ds-popular-blue);
	text-align: center;
}

.ds-home-popular__head {
	max-width: var(--wd-container-w);
	width: 100%;
	margin: 0 auto 36px;
}

.ds-home-popular__title {
	margin: 0 0 8px;
	font-size: clamp(24px, 2.4vw, 30px);
	font-weight: 800;
	color: #fff;
}

.ds-home-popular__sub {
	margin: 0;
	font-size: 14px;
	color: rgba(255, 255, 255, 0.88);
}

.ds-home-popular__viewport {
	position: relative;
	width: 100%;
	max-width: var(--wd-container-w);
	margin: 0 auto;
	overflow: hidden;
	padding: 20px 44px 28px;
}

.ds-home-popular__viewport::before,
.ds-home-popular__viewport::after {
	display: none;
}

.ds-home-popular__track {
	display: flex;
	gap: 36px;
	overflow-x: auto;
	scroll-behavior: smooth;
	scrollbar-width: none;
	padding: 28px 0;
	align-items: center;
	scroll-snap-type: x mandatory;
}

.ds-home-popular__track::-webkit-scrollbar {
	display: none;
}

.ds-home-popular__card {
	/* Three complete cards plus half a card at each edge. */
	flex: 0 0 calc((100% - 108px) / 4);
	min-width: 0;
	scroll-snap-align: center;
	transform: scale(.96);
	filter: none;
	opacity: 1;
	transition: transform .3s ease, filter .3s ease, opacity .3s ease;
}

.ds-home-popular--resetting .ds-home-popular__card {
	transition: none !important;
}

.ds-home-popular__card.is-center {
	z-index: 2;
	transform: scale(1.18);
	filter: none;
	opacity: 1;
}

.ds-home-popular__card.is-near {
	transform: scale(1);
	filter: none;
	opacity: 1;
}

.ds-home-popular__card.is-edge {
	filter: none;
	opacity: 1;
}

.ds-home-popular__card.is-before-edge {
	-webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .5) 58%, #000 100%);
	mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .5) 58%, #000 100%);
}

.ds-home-popular__card.is-after-edge {
	-webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, .5) 42%, transparent 100%);
	mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, .5) 42%, transparent 100%);
}

.ds-home-popular__card-link {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 14px 14px 16px;
	border-radius: 12px;
	background: #fff;
	color: #222;
	text-decoration: none !important;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.ds-home-popular__card-link:hover {
	box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
	color: #222;
}

.ds-home-popular__bag {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
	color: #333;
}

.ds-home-popular__image {
	display: block;
	flex: 1 1 auto;
	margin-bottom: 12px;
	overflow: hidden;
	border-radius: 8px;
	background: #f7f7f7;
}

.ds-home-popular__image img {
	display: block;
	width: 100%;
	height: 180px;
	object-fit: contain;
}

.ds-home-popular__meta {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 0 0 12px;
	min-width: 0;
	text-align: center;
}

.ds-home-popular__name {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	color: #222;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.3;
}

.ds-home-popular__price {
	color: #444;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
}

.ds-home-popular__price del {
	opacity: 0.55;
	margin-right: 4px;
}

.ds-home-popular__price ins {
	text-decoration: none;
	color: #222;
}

.ds-home-popular__cta {
	display: block;
	margin: 0 auto;
	padding: 8px 16px;
	border-radius: 6px;
	background: #f3f5f8;
	font-size: 12px;
	font-weight: 600;
	color: #333;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
	transition: color .2s ease, background-color .2s ease;
}

.ds-home-popular__card-link:hover .ds-home-popular__cta,
.ds-home-popular__card-link:focus-visible .ds-home-popular__cta {
	color: var(--ds-popular-blue);
	background: #fff;
}

.ds-home-popular__more-wrap {
	margin: 28px 0 0;
	text-align: center;
}

.ds-home-popular__more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 160px;
	min-height: 44px;
	padding: 0 28px;
	border-radius: 999px;
	background: #fff;
	color: var(--ds-popular-blue) !important;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-decoration: none !important;
	text-transform: uppercase;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
	transition: background-color .2s ease, color .2s ease, transform .2s ease;
}

.ds-home-popular__more:hover,
.ds-home-popular__more:focus-visible {
	background: #f4f8ff;
	color: #2769c4 !important;
	transform: translateY(-1px);
}

.ds-home-popular__arrow {
	z-index: 4;
	position: absolute;
	top: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 34px;
	height: 34px;
	min-width: 34px;
	min-height: 34px;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50%;
	background: #111;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	transform: translateY(-50%);
}

.ds-home-popular__arrow--prev {
	left: 0;
	background: #fff;
	color: var(--ds-popular-blue);
}

.ds-home-popular__arrow--next {
	right: 0;
	background: #111;
}

.ds-home-popular__progress {
	position: relative;
	height: 3px;
	margin: 8px auto 0;
	max-width: 320px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.35);
	overflow: hidden;
}

.ds-home-popular__progress-bar {
	display: block;
	height: 100%;
	width: 30%;
	border-radius: inherit;
	background: #fff;
	transition: transform 0.2s ease, width 0.2s ease;
	transform: translateX(0);
}

@media (max-width: 900px) {
	.ds-home-popular {
		min-height: 0;
		padding: 48px 15px;
	}

	.ds-home-popular__card {
		flex: 0 0 calc((100% - 20px) / 3);
		min-width: 160px;
	}

	.ds-home-popular__image img {
		height: 140px;
	}
}

@media (max-width: 768px) {
	.ds-home-popular {
		padding: 40px 16px;
		margin-bottom: 0;
	}

	.ds-home-popular__viewport {
		padding: 0 36px;
	}

	.ds-home-popular__track {
		padding: 20px 0;
	}

	.ds-home-popular__card {
		flex-basis: calc((100% - 20px) / 2);
	}
}

/*
 * Transform carousel: the viewport clips a continuously translated track.
 * It does not use native horizontal scrolling, so left and right animations
 * share the same positioning model.
 */
.ds-home-popular__track {
	width: max-content;
	overflow: visible;
	padding: 28px 0;
	scroll-snap-type: none;
	will-change: transform;
}

.ds-home-popular__card {
	flex: 0 0 var(--ds-popular-card-width, 200px);
	min-width: var(--ds-popular-card-width, 200px);
}
