/**
 * ChaCha Home — DEV-19 Recently Viewed Products v1.0
 */

.chacha-recently-viewed[hidden] {
	display: none !important;
}

.chacha-recently-viewed {
	margin: 0;
	padding: 54px 0 66px;
	border-top: 1px solid var(--chacha-subtle, #D7CEC4);
	background: var(--chacha-surface, #FFFDFC);
}

.chacha-recently-viewed__inner {
	width: min(calc(100% - 48px), 1400px);
	margin-inline: auto;
}

.chacha-recently-viewed__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 28px;
	margin-bottom: 26px;
}

.chacha-recently-viewed__eyebrow,
.chacha-recently-viewed__title {
	margin: 0;
}

.chacha-recently-viewed__eyebrow {
	margin-bottom: 7px;
	font-family: var(--chacha-font-body, Inter, sans-serif);
	font-size: 10px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.16em;
	color: var(--chacha-accent, #B08D57);
}

.chacha-recently-viewed__title {
	font-family: var(--chacha-font-heading, "Cormorant Garamond", serif);
	font-size: clamp(30px, 3vw, 42px);
	font-weight: 500;
	line-height: 1.05;
	color: var(--chacha-text-strongest, #201A17);
}

.chacha-recently-viewed__nav {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 0 0 auto;
}

.chacha-recently-viewed__nav[hidden] {
	display: none !important;
}

.chacha-recently-viewed__arrow {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--chacha-subtle, #D7CEC4);
	border-radius: 50%;
	background: transparent;
	color: var(--chacha-espresso, #201A17);
	font-family: var(--chacha-font-body, Inter, sans-serif);
	font-size: 17px;
	line-height: 1;
	cursor: pointer;
	transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease, opacity 180ms ease;
}

.chacha-recently-viewed__arrow:hover:not(:disabled),
.chacha-recently-viewed__arrow:focus-visible:not(:disabled) {
	border-color: var(--chacha-accent, #B08D57);
	background: rgba(176, 141, 87, 0.06);
	color: var(--chacha-accent-dark, #8F6F3F);
}

.chacha-recently-viewed__arrow:focus-visible {
	outline: 2px solid var(--chacha-accent, #B08D57);
	outline-offset: 3px;
}

.chacha-recently-viewed__arrow:disabled {
	opacity: 0.34;
	cursor: default;
}

.chacha-recently-viewed__viewport {
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-inline: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.chacha-recently-viewed__viewport::-webkit-scrollbar {
	display: none;
}

.chacha-recently-viewed ul.products.chacha-recently-viewed__products {
	display: flex !important;
	flex-wrap: nowrap !important;
	align-items: stretch;
	gap: 18px;
	width: 100%;
	min-width: 100%;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none;
}

.chacha-recently-viewed ul.products.chacha-recently-viewed__products > li.product {
	float: none !important;
	flex: 0 0 calc((100% - 54px) / 4);
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	scroll-snap-align: start;
}

@media (max-width: 1024px) {
	.chacha-recently-viewed {
		padding: 46px 0 56px;
	}

	.chacha-recently-viewed ul.products.chacha-recently-viewed__products > li.product {
		flex-basis: calc((100% - 36px) / 3);
	}
}

@media (max-width: 767px) {
	.chacha-recently-viewed {
		padding: 38px 0 46px;
	}

	.chacha-recently-viewed__inner {
		width: calc(100% - 36px);
	}

	.chacha-recently-viewed__head {
		align-items: center;
		gap: 16px;
		margin-bottom: 20px;
	}

	.chacha-recently-viewed__eyebrow {
		font-size: 9px;
	}

	.chacha-recently-viewed__title {
		font-size: clamp(28px, 9vw, 36px);
	}

	.chacha-recently-viewed__arrow {
		width: 38px;
		height: 38px;
	}

	.chacha-recently-viewed ul.products.chacha-recently-viewed__products {
		gap: 12px;
	}

	.chacha-recently-viewed ul.products.chacha-recently-viewed__products > li.product {
		flex-basis: calc((100% - 12px) / 2);
	}
}

@media (prefers-reduced-motion: reduce) {
	.chacha-recently-viewed__arrow {
		transition: none;
	}

	.chacha-recently-viewed__viewport {
		scroll-behavior: auto;
	}
}

/**
 * DEV-UI-PDP-POLISH-01 - RECENT-ONLY SURFACE
 * Reuse the existing discovery state. DEV-19 owns availability/history.
 * Keep the accepted section spacing, border and product-card appearance.
 */
body.single-product
.chacha-product-discovery-enhanced:not(.chacha-product-discovery-has-tabs)
> .chacha-recently-viewed:not([hidden]) {
	background: #E8DFD4;
}
