/*
 * HSH Deals — [hsh_deals] shortcode.
 *
 * White split cards (promo image left, content right) on a scroll-snap track
 * with arrows top-right and JS-built page dots. Scoped under .hsh-deals;
 * overridable custom properties:
 * --hsh-d-pv (cards per view, set inline by the per_view attribute),
 * --hsh-d-card-bg, --hsh-d-title, --hsh-d-text, --hsh-d-btn-bg,
 * --hsh-d-btn-color, --hsh-d-arrow-bg, --hsh-d-arrow-color,
 * --hsh-d-dot, --hsh-d-dot-active, --hsh-d-gap.
 */

.hsh-deals {
	--hsh-d-pv: 2;
	--hsh-d-gap: 28px;
	--hsh-d-card-bg: #ffffff;
	--hsh-d-title: #2f4b3f;
	--hsh-d-text: #5b5b5b;
	--hsh-d-btn-bg: #eec95c;
	--hsh-d-btn-color: #3a3a1f;
	--hsh-d-arrow-bg: #2f4b3f;
	--hsh-d-arrow-color: #ffffff;
	--hsh-d-dot: #ddd6c4;
	--hsh-d-dot-active: #2f4b3f;
	position: relative;
}

/* ---- Arrows (top right, like the design) ---- */

.hsh-deals__nav {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-bottom: 22px;
}

.hsh-deals button.hsh-deals__arrow {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	min-width: 44px;
	min-height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--hsh-d-arrow-bg);
	color: var(--hsh-d-arrow-color);
	font-size: 0;
	line-height: 0;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.hsh-deals button.hsh-deals__arrow svg {
	width: 18px;
	height: 18px;
}

.hsh-deals button.hsh-deals__arrow[disabled] {
	opacity: 0.35;
	cursor: default;
}

/* ---- Track & cards ---- */

.hsh-deals__track {
	display: flex;
	gap: var(--hsh-d-gap);
	margin: 0;
	padding: 4px;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.hsh-deals__track::-webkit-scrollbar {
	display: none;
}

.hsh-deals__track:focus-visible {
	outline: 2px solid var(--hsh-d-title);
	outline-offset: 4px;
}

.hsh-deals__card {
	/* Containing block for abs-positioned descendants — prevents
	   screen-reader-text spans escaping the track and widening the page. */
	position: relative;
	flex: 0 0 calc((100% - (var(--hsh-d-pv) - 1) * var(--hsh-d-gap)) / var(--hsh-d-pv));
	scroll-snap-align: start;
	display: grid;
	grid-template-columns: 44% minmax(0, 1fr);
	background: var(--hsh-d-card-bg);
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 3px 14px rgba(0, 0, 0, 0.07);
}

.hsh-deals__image {
	position: relative;
	min-height: 230px;
	background: #e8e4da;
}

.hsh-deals__image img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.hsh-deals__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	padding: 26px 28px 24px;
}

.hsh-deals__title {
	margin: 0 0 16px;
	font-family: Georgia, "Times New Roman", serif;
	font-size: clamp(20px, 1.8vw, 26px);
	font-weight: 500;
	line-height: 1.25;
	color: var(--hsh-d-title);
}

.hsh-deals__includes-label {
	font-size: 14px;
	font-weight: 600;
	color: var(--hsh-d-text);
	margin-bottom: 8px;
}

.hsh-deals__includes {
	margin: 0 0 16px;
	padding-left: 18px;
	color: var(--hsh-d-text);
	font-size: 14px;
	line-height: 1.7;
}

.hsh-deals__terms {
	margin: 0 0 18px;
	font-size: 12px;
	line-height: 1.55;
	color: #8a8a8a;
}

.hsh-deals__btn {
	display: inline-block;
	margin-top: auto;
	background: var(--hsh-d-btn-bg);
	color: var(--hsh-d-btn-color);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	border-radius: 999px;
	padding: 13px 28px;
	transition: filter 0.2s ease;
}

.hsh-deals__btn:hover,
.hsh-deals__btn:focus-visible {
	filter: brightness(0.94);
	color: var(--hsh-d-btn-color);
}

/* ---- Dots (built by JS; one per page) ---- */

.hsh-deals__dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 24px;
}

.hsh-deals button.hsh-deals__dot {
	appearance: none;
	-webkit-appearance: none;
	box-sizing: border-box;
	flex: 0 0 auto;
	width: 9px;
	height: 9px;
	min-width: 9px;
	min-height: 9px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--hsh-d-dot);
	font-size: 0;
	line-height: 0;
	box-shadow: none;
	cursor: pointer;
	transition: background 0.2s ease;
}

.hsh-deals button.hsh-deals__dot.is-active {
	background: var(--hsh-d-dot-active);
}

/* Nothing to page through: hide the chrome. */
.hsh-deals.no-overflow .hsh-deals__nav,
.hsh-deals.no-overflow .hsh-deals__dots {
	display: none;
}

/* ---- Responsive: 2 → 1 (capped by the per_view attribute) ---- */

@media (max-width: 1024px) {
	.hsh-deals {
		--hsh-d-pv: 1;
	}
}

@media (max-width: 640px) {
	.hsh-deals__card {
		grid-template-columns: 1fr;
	}

	.hsh-deals__image {
		min-height: 0;
		aspect-ratio: 16 / 10;
	}

	.hsh-deals__image img {
		position: absolute;
	}
}

/* ---- Reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
	.hsh-deals__track {
		scroll-behavior: auto;
	}
}
