/* =============================================================================
   On Sale Carousel Block
   BEM namespace: .on-sale-carousel
   ============================================================================= */

.on-sale-carousel {
	padding: 60px 0;
	overflow: hidden;
	background: #f5f5f5;
}

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

.on-sale-carousel__header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 32px;
}

.on-sale-carousel__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) {
	.on-sale-carousel__heading {
		font-size: 40px;
	}
}

.on-sale-carousel__see-all {
	color: #e74111;
	font-family: 'HelveticaNowDisplay', Helvetica, Arial, sans-serif;
	font-size: 15px;
	font-weight: bold;
	text-decoration: none;
	white-space: nowrap;
	flex-shrink: 0;
}

.on-sale-carousel__see-all:hover {
	text-decoration: underline;
}

/* ── Outer: flex row so arrows sit outside the track ────────────────────── */

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

/* ── Arrow buttons ───────────────────────────────────────────────────────── */

.on-sale-carousel__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) {
	.on-sale-carousel__arrow {
		display: flex;
	}
}

.on-sale-carousel__arrow:hover {
	background-color: #e74111;
	border-color: #e74111;
	color: #ffffff;
}

.on-sale-carousel__arrow:disabled {
	opacity: 0.35;
	cursor: not-allowed;
	pointer-events: none;
}

/* ── Scrollable track ────────────────────────────────────────────────────── */

.on-sale-carousel__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;
}

.on-sale-carousel__track::-webkit-scrollbar {
	display: none;
}

.on-sale-carousel__track.is-dragging {
	cursor: grabbing;
	scroll-snap-type: none;
	user-select: none;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */

/* Mobile: ~1.2 cards */
.on-sale-carousel__card {
	flex: 0 0 83vw;
	scroll-snap-align: start;
	background: #ffffff;
	display: flex;
	flex-direction: column;
}

/* Tablet: ~2.2 cards */
@media (min-width: 640px) {
	.on-sale-carousel__card {
		flex: 0 0 calc(44vw - 66px);
	}
}

/* Desktop: 4 cards */
@media (min-width: 960px) {
	.on-sale-carousel__card {
		flex: 0 0 calc(25% - 62px);
	}
}

/* Large: fixed width */
@media (min-width: 1440px) {
	.on-sale-carousel__card {
		flex: 0 0 296px;
	}
}

.on-sale-carousel__card-link {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	text-decoration: none;
	color: inherit;
}

/* ── Card image ──────────────────────────────────────────────────────────── */

.on-sale-carousel__card-image {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #f0f0f0;
}

.on-sale-carousel__card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

.on-sale-carousel__card-link:hover .on-sale-carousel__card-image img {
	transform: scale(1.04);
}

/* ── On Sale badge ───────────────────────────────────────────────────────── */

.on-sale-carousel__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;
}

/* ── Card body ───────────────────────────────────────────────────────────── */

.on-sale-carousel__card-body {
	padding: 14px 14px 10px;
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 4px;
	text-align: center;
}

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

.on-sale-carousel__card-meta {
	font-size: 12px;
	color: #888888;
	margin: 0;
}

.on-sale-carousel__card-price {
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: 8px;
	margin-top: 4px;
}

.on-sale-carousel__card-regular-price {
	font-size: 13px;
	color: #aaaaaa;
	text-decoration: line-through;
}

.on-sale-carousel__card-sale-price {
	font-size: 15px;
	font-weight: bold;
	color: #e74111;
}

.on-sale-carousel__card-uom {
	font-size: 12px;
	font-weight: normal;
}

.on-sale-carousel__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;
}

/* ── Card footer (add-to-cart) ───────────────────────────────────────────── */

.on-sale-carousel__card-footer {
	padding: 0 14px 14px;
	text-align: center;
}

.on-sale-carousel__card-footer .button,
.on-sale-carousel__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;
}

.on-sale-carousel__card-footer .button:hover,
.on-sale-carousel__card-footer .add_to_cart_button:hover {
	background: #c73610;
	color: #ffffff;
}

/* ── Editor preview ──────────────────────────────────────────────────────── */

.block-editor .on-sale-carousel {
	overflow: visible;
}
