/**
 * Harappa Interactive WooCommerce Hero
 * Scoped styles — no global element resets.
 */

.harappa-iwh-hero {
	--harappa-iwh-cream: #f7f1ea;
	--harappa-iwh-ivory: #fbf7f2;
	--harappa-iwh-ink: #3b2a24;
	--harappa-iwh-muted: #6b5348;
	--harappa-iwh-border: rgba(59, 42, 36, 0.16);
	--harappa-iwh-accent: #5c3d32;
	--harappa-iwh-marker: rgba(59, 42, 36, 0.55);
	--harappa-iwh-marker-ring: rgba(247, 241, 234, 0.92);
	--harappa-iwh-shadow: 0 10px 28px rgba(45, 32, 26, 0.14);
	--harappa-iwh-radius: 4px;
	--harappa-iwh-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--harappa-iwh-duration: 220ms;
	/* Matches the artwork studio wall so side bleed never reads as white page chrome. */
	--harappa-iwh-stage: #ebe2d6;

	position: relative;
	isolation: isolate;
	line-height: 1.4;
	color: var(--harappa-iwh-ink);
	font-size: 16px;
	box-sizing: border-box;
	background-color: var(--harappa-iwh-stage);
	width: 100%;
	max-width: none;
}

/*
 * Let the hero escape Divi module/row clipping.
 * (:has is supported in current Chrome/Safari/Firefox/Edge)
 */
.et_pb_section:has(.harappa-iwh-hero),
.et_pb_row:has(.harappa-iwh-hero),
.et_pb_row_inner:has(.harappa-iwh-hero),
.et_pb_column:has(.harappa-iwh-hero),
.et_pb_module:has(.harappa-iwh-hero),
.et_pb_code:has(.harappa-iwh-hero),
.et_pb_code_inner:has(.harappa-iwh-hero),
.et_pb_text:has(.harappa-iwh-hero) {
	overflow: visible !important;
}

.et_pb_row:has(.harappa-iwh-hero),
.et_pb_column:has(.harappa-iwh-hero) {
	max-width: none;
}

.harappa-iwh-hero *,
.harappa-iwh-hero *::before,
.harappa-iwh-hero *::after {
	box-sizing: border-box;
}

.harappa-iwh-hero__media {
	position: relative;
	width: 100%;
	max-width: 100%;
	aspect-ratio: var(--harappa-iwh-aspect, 1.7778);
	overflow: visible;
	background-color: var(--harappa-iwh-stage);
}

.harappa-iwh-hero__media > .harappa-iwh-hero__hotspots,
.harappa-iwh-hero__media > .harappa-iwh-hero__cards {
	position: absolute;
	inset: 0;
}

.harappa-iwh-hero-image {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	aspect-ratio: var(--harappa-iwh-aspect, 1.7778);
	object-fit: contain;
	object-position: center center;
	user-select: none;
	pointer-events: none;
	vertical-align: middle;
}

.harappa-iwh-hero__hotspots,
.harappa-iwh-hero__cards {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.harappa-iwh-hero__cards {
	z-index: 4;
}

.harappa-iwh-hero__hotspots {
	z-index: 3;
}

/* Hotspot hit areas */
.harappa-iwh-hotspot {
	position: absolute;
	pointer-events: auto;
	z-index: 1;
}

.harappa-iwh-hotspot.is-active {
	z-index: 2;
}

.harappa-iwh-hotspot__trigger {
	appearance: none;
	-webkit-appearance: none;
	display: block;
	position: relative;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	border-radius: 2px;
}

.harappa-iwh-hotspot__hit {
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: transparent;
	transition: background var(--harappa-iwh-duration) var(--harappa-iwh-ease),
		box-shadow var(--harappa-iwh-duration) var(--harappa-iwh-ease);
}

.harappa-iwh-hotspot__trigger:hover .harappa-iwh-hotspot__hit,
.harappa-iwh-hotspot__trigger:focus-visible .harappa-iwh-hotspot__hit,
.harappa-iwh-hotspot.is-active .harappa-iwh-hotspot__hit {
	background: rgba(247, 241, 234, 0.08);
	box-shadow: inset 0 0 0 1px rgba(59, 42, 36, 0.12);
}

.harappa-iwh-hotspot__trigger:focus {
	outline: none;
}

.harappa-iwh-hotspot__trigger:focus-visible {
	outline: 2px solid var(--harappa-iwh-accent);
	outline-offset: 3px;
}

.harappa-iwh-hotspot__marker {
	position: absolute;
	left: 50%;
	top: 58%;
	width: 14px;
	height: 14px;
	margin: 0;
	border-radius: 50%;
	transform: translate(-50%, -50%) scale(0.92);
	background: var(--harappa-iwh-marker);
	box-shadow:
		0 0 0 2px var(--harappa-iwh-marker-ring),
		0 2px 8px rgba(45, 32, 26, 0.22);
	opacity: 0.72;
	pointer-events: none;
	transition:
		opacity var(--harappa-iwh-duration) var(--harappa-iwh-ease),
		transform var(--harappa-iwh-duration) var(--harappa-iwh-ease);
}

.harappa-iwh-hotspot__marker::after {
	content: '';
	position: absolute;
	inset: 4px;
	border-radius: 50%;
	background: #fff;
	opacity: 0.95;
}

.harappa-iwh-hotspot__trigger:hover .harappa-iwh-hotspot__marker,
.harappa-iwh-hotspot__trigger:focus-visible .harappa-iwh-hotspot__marker,
.harappa-iwh-hotspot.is-active .harappa-iwh-hotspot__marker {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1.08);
}

.harappa-iwh-hotspot--unavailable {
	opacity: 0.45;
	pointer-events: none;
}

/* Product card */
.harappa-iwh-product-card {
	position: absolute;
	z-index: 5;
	pointer-events: auto;
	width: min(320px, calc(100% - 24px));
	background: var(--harappa-iwh-ivory);
	border: 1px solid var(--harappa-iwh-border);
	border-radius: var(--harappa-iwh-radius);
	box-shadow: var(--harappa-iwh-shadow);
	padding: 14px 16px 16px;
	opacity: 0;
	transform: translateY(6px);
	transition:
		opacity var(--harappa-iwh-duration) var(--harappa-iwh-ease),
		transform var(--harappa-iwh-duration) var(--harappa-iwh-ease);
}

.harappa-iwh-product-card.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.harappa-iwh-product-card--above {
	transform: translateY(-4px);
}

.harappa-iwh-product-card--above.is-visible {
	transform: translateY(0);
}

.harappa-iwh-product-card--mobile {
	width: min(340px, calc(100% - 20px));
	padding: 16px;
	box-shadow: 0 12px 32px rgba(45, 32, 26, 0.2);
}

.harappa-iwh-product-card__close {
	appearance: none;
	-webkit-appearance: none;
	position: absolute;
	top: 6px;
	right: 8px;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--harappa-iwh-muted);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	border-radius: 2px;
}

.harappa-iwh-product-card__close:hover,
.harappa-iwh-product-card__close:focus-visible {
	color: var(--harappa-iwh-ink);
}

.harappa-iwh-product-card__close:focus-visible {
	outline: 2px solid var(--harappa-iwh-accent);
	outline-offset: 1px;
}

.harappa-iwh-product-card__inner {
	display: flex;
	align-items: center;
	gap: 14px;
	padding-right: 18px;
}

.harappa-iwh-product-card__image {
	flex: 0 0 auto;
	width: 72px;
	height: 72px;
	background: var(--harappa-iwh-cream);
	border: 1px solid var(--harappa-iwh-border);
	overflow: hidden;
}

.harappa-iwh-product-card__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.harappa-iwh-product-card__body {
	flex: 1 1 auto;
	min-width: 0;
}

.harappa-iwh-product-card__title {
	margin: 0 0 4px;
	padding: 0;
	font-family: Georgia, 'Times New Roman', Times, serif;
	font-size: clamp(0.95rem, 1.6vw, 1.1rem);
	font-weight: 600;
	letter-spacing: 0.01em;
	color: var(--harappa-iwh-ink);
	line-height: 1.25;
}

.harappa-iwh-product-card__price {
	margin: 0 0 10px;
	color: var(--harappa-iwh-muted);
	font-size: 0.95rem;
	font-weight: 600;
}

.harappa-iwh-product-card__price del {
	opacity: 0.65;
	margin-right: 0.35em;
	font-weight: 400;
}

.harappa-iwh-product-card__price ins {
	text-decoration: none;
	color: var(--harappa-iwh-ink);
}

.harappa-iwh-product-card__status {
	margin: 0;
	color: var(--harappa-iwh-muted);
	font-size: 0.875rem;
}

.harappa-iwh-product-card__error {
	margin: 8px 0 0;
	color: #8a2f2f;
	font-size: 0.8125rem;
}

.harappa-iwh-add-to-cart {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: 0.55em 1.15em;
	margin: 0;
	border: 1px solid var(--harappa-iwh-accent);
	border-radius: 2px;
	background: var(--harappa-iwh-accent);
	color: #fbf7f2;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	transition:
		background var(--harappa-iwh-duration) var(--harappa-iwh-ease),
		color var(--harappa-iwh-duration) var(--harappa-iwh-ease),
		opacity var(--harappa-iwh-duration) var(--harappa-iwh-ease);
}

.harappa-iwh-add-to-cart:hover,
.harappa-iwh-add-to-cart:focus-visible {
	background: #4a3129;
	border-color: #4a3129;
	color: #fff;
}

.harappa-iwh-add-to-cart:focus-visible {
	outline: 2px solid var(--harappa-iwh-ink);
	outline-offset: 2px;
}

.harappa-iwh-add-to-cart:disabled,
.harappa-iwh-add-to-cart.is-loading {
	opacity: 0.72;
	cursor: wait;
}

/* Mobile refinements */
@media (max-width: 767px) {
	.harappa-iwh-hotspot__marker {
		width: 16px;
		height: 16px;
		opacity: 0.85;
	}

	.harappa-iwh-product-card__inner {
		gap: 12px;
	}

	.harappa-iwh-product-card__image {
		width: 68px;
		height: 68px;
	}

	.harappa-iwh-add-to-cart {
		width: 100%;
		min-height: 44px;
	}
}

@media (max-width: 480px) {
	.harappa-iwh-product-card--mobile .harappa-iwh-product-card__inner {
		flex-direction: row;
		align-items: flex-start;
	}

	.harappa-iwh-product-card__title {
		font-size: 1rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.harappa-iwh-hero,
	.harappa-iwh-hero * {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}

	.harappa-iwh-product-card {
		transform: none;
	}
}

/* Divi Visual Builder: keep usable */
.et-fb .harappa-iwh-hero {
	min-height: 120px;
}
