/* ==========================================================================
   HA Product Page – shared base
   Design tokens, resets and the primitives used by both the single product
   template and the shop/archive template. Loaded by each of them; never
   loaded outside a targeted page. Everything stays scoped to .ha-pp.
   ========================================================================== */

.ha-pp {
	--ha-purple: #7c3aed;
	--ha-purple-dark: #6d28d9;
	--ha-purple-soft: #f3eeff;
	--ha-lime: #a3e635;
	--ha-lime-soft: #d9f99d;
	--ha-dark: #111827;
	--ha-text: #374151;
	--ha-muted: #6b7280;
	--ha-border: #e5e7eb;
	--ha-surface: #f3f4f6;
	--ha-radius: 16px;
	--ha-radius-sm: 12px;
	--ha-max-width: 1440px;
	--ha-gutter: 24px;
	--ha-control-h: 56px;

	color: var(--ha-text);
	font-family: var(--ha-font, inherit);
	-webkit-font-smoothing: antialiased;
	box-sizing: border-box;
}

.ha-pp *,
.ha-pp *::before,
.ha-pp *::after {
	box-sizing: inherit;
}

.ha-pp img {
	max-width: 100%;
	height: auto;
	display: block;
}

.ha-pp button {
	font: inherit;
	cursor: pointer;
}

.ha-sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.ha-icon {
	display: inline-flex;
	line-height: 0;
}

.ha-icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

/* --------------------------------------------------------------------------
   Badge ("NEW" / "Sale")
   -------------------------------------------------------------------------- */

.ha-pp .ha-badge {
	align-self: flex-start;
	display: inline-block;
	padding: 5px 14px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.3;
	color: var(--ha-dark);
	background: var(--ha-lime-soft);
}

.ha-pp .ha-badge--new {
	background: var(--ha-lime);
	color: var(--ha-dark);
}

.ha-pp .ha-badge--sale {
	background: var(--ha-purple-soft);
	color: var(--ha-purple-dark);
}

/* --------------------------------------------------------------------------
   Star rating
   -------------------------------------------------------------------------- */

.ha-pp .ha-rating {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-top: -6px;
	text-decoration: none;
	color: var(--ha-dark);
}

.ha-pp a.ha-rating:hover .ha-rating__count {
	text-decoration: underline;
}

.ha-pp .ha-stars {
	position: relative;
	display: inline-block;
	line-height: 0;
}

.ha-pp .ha-stars__base,
.ha-pp .ha-stars__fill {
	display: flex;
	gap: 2px;
}

.ha-pp .ha-stars__fill {
	position: absolute;
	top: 0;
	left: 0;
	overflow: hidden;
	width: var(--ha-rating, 0%);
	white-space: nowrap;
}

.ha-pp .ha-stars svg {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	fill: var(--ha-border);
}

.ha-pp .ha-stars__fill svg {
	fill: var(--ha-purple);
}

.ha-pp .ha-rating__avg {
	font-weight: 600;
	font-size: 16px;
}

.ha-pp .ha-rating__count {
	font-size: 16px;
	color: var(--ha-muted);
}

/* --------------------------------------------------------------------------
   Trust badges (shared partial: templates/trust-badges.php)
   -------------------------------------------------------------------------- */

.ha-pp .ha-trust {
	list-style: none;
	margin: 4px 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 12px 24px;
}

.ha-pp .ha-trust__item {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-size: 15px;
	color: var(--ha-text);
}

.ha-pp .ha-trust__icon {
	width: 26px;
	height: 26px;
	color: var(--ha-dark);
	flex: 0 0 auto;
}

.ha-pp .ha-trust__body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.ha-pp .ha-trust__label {
	line-height: 1.35;
}

.ha-pp .ha-trust__text {
	font-size: 14px;
	line-height: 1.4;
	color: var(--ha-muted);
}

/* --------------------------------------------------------------------------
   Responsive / motion
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
	.ha-pp {
		--ha-gutter: 16px;
		--ha-control-h: 52px;
	}

	.ha-pp .ha-trust {
		flex-direction: column;
		gap: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ha-pp * {
		transition: none !important;
	}
}
