/* =============================================================================
   Trending Products Carousel
   BEM namespace: .trending-products  (chrome: header / arrows / track)
   Cards are the shared .product-card component (styled below, reusable).
   ============================================================================= */

.trending-products {
	padding: 88px 0;
	overflow: hidden;
}

@media (max-width: 800px) {
	.trending-products {
		padding: 56px 0;
	}
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.trending-products__header {
	text-align: center;
	margin-bottom: 32px;
}

.trending-products__heading {
	color: #e74111;
	font-family: 'HelveticaNowDisplay', Helvetica, Arial, sans-serif;
	font-size: 34px;
	font-weight: bold;
	line-height: 1.2;
	letter-spacing: 0.5px;
	margin: 0;
}

@media (min-width: 960px) {
	.trending-products__heading {
		font-size: 40px;
	}
}

.trending-products__intro {
	max-width: 640px;
	margin: 12px auto 0;
	color: #555555;
	font-size: 16px;
	line-height: 1.5;
}

/* ── Outer: arrows outside the track ─────────────────────────────────────── */

.trending-products__outer {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	max-width: 1440px;
	margin: 0 auto;
}

.trending-products__arrow {
	display: none; /* hidden on mobile */
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border: 1px solid #cfcfcf;
	background: #ffffff;
	cursor: pointer;
	font-size: 26px;
	line-height: 1;
	align-items: center;
	justify-content: center;
	padding: 0;
	color: #444444;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

@media (min-width: 640px) {
	.trending-products__arrow {
		display: flex;
	}
}

.trending-products__arrow:hover {
	background-color: #e74111;
	border-color: #e74111;
	color: #ffffff;
}

.trending-products__arrow:disabled {
	opacity: 0.35;
	cursor: not-allowed;
	pointer-events: none;
}

/* ── Track ───────────────────────────────────────────────────────────────── */

.trending-products__track {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	gap: 16px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
	padding: 0 16px 16px;
	cursor: grab;
}

.trending-products__track::-webkit-scrollbar {
	display: none;
}

.trending-products__track.is-dragging {
	cursor: grabbing;
	scroll-snap-type: none;
	user-select: none;
}

/* Card sizing within the track (mirrors On Sale carousel breakpoints) */
.trending-products__track .product-card {
	flex: 0 0 83vw; /* mobile: ~1.2 cards */
	scroll-snap-align: start;
}

@media (min-width: 640px) {
	.trending-products__track .product-card {
		flex: 0 0 calc(44vw - 66px); /* tablet: ~2.2 cards */
	}
}

@media (min-width: 960px) {
	.trending-products__track .product-card {
		flex: 0 0 calc(25% - 62px); /* desktop: 4 cards */
	}
}

@media (min-width: 1440px) {
	.trending-products__track .product-card {
		flex: 0 0 296px;
	}
}

/* =============================================================================
   Shared .product-card component (reusable across carousels/grids)
   ============================================================================= */

.product-card {
	background: #ffffff;
	display: flex;
	flex-direction: column;
}

.product-card__link {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	text-decoration: none;
	color: inherit;
}

.product-card__image {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #f0f0f0;
}

.product-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

.product-card__link:hover .product-card__image img {
	transform: scale(1.04);
}

.product-card__badge {
	position: absolute;
	top: 0;
	left: 0;
	background: #e74111;
	color: #ffffff;
	font-family: 'HelveticaNowDisplay', Helvetica, Arial, sans-serif;
	font-size: 11px;
	font-weight: bold;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	padding: 5px 10px;
	z-index: 1;
}

.product-card__body {
	padding: 14px 14px 10px;
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 4px;
	text-align: center;
}

.product-card__title {
	font-family: 'HelveticaNowDisplay', Helvetica, Arial, sans-serif;
	font-size: 15px;
	font-weight: bold;
	line-height: 1.3;
	color: #222222;
	margin: 0;
}

.product-card__meta {
	font-size: 12px;
	color: #888888;
	margin: 0;
}

.product-card__price {
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: 8px;
	margin-top: 4px;
}

.product-card__regular-price {
	font-size: 13px;
	color: #aaaaaa;
	text-decoration: line-through;
}

.product-card__price-now {
	font-size: 15px;
	font-weight: bold;
	color: #222222;
}

.product-card--on-sale .product-card__price-now {
	color: #e74111;
}

.product-card__uom {
	font-size: 12px;
	font-weight: normal;
}

.product-card__save {
	display: inline-block;
	align-self: center;
	background: #e74111;
	color: #ffffff;
	font-size: 11px;
	font-weight: bold;
	letter-spacing: 0.3px;
	padding: 3px 10px;
	border-radius: 2px;
	margin-top: 4px;
}

.product-card__footer {
	padding: 0 14px 14px;
	text-align: center;
}

.product-card__footer .button,
.product-card__footer .add_to_cart_button {
	display: block;
	width: 100%;
	background: #e74111;
	color: #ffffff;
	border: none;
	padding: 10px 12px;
	font-size: 13px;
	font-weight: bold;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease;
	text-align: center;
}

.product-card__footer .button:hover,
.product-card__footer .add_to_cart_button:hover {
	background: #c73610;
	color: #ffffff;
}

/* Editor preview */
.block-editor .trending-products {
	overflow: visible;
}
