/* ==========================================================================
   HA Product Page – single product template
   Scoped to .ha-pp, never loaded outside targeted products.
   Design tokens, resets, badge, star rating and trust badges live in
   ha-base.css, which this file depends on.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.ha-pp .ha-product {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 32px;
	max-width: var(--ha-max-width);
	margin: 0 auto;
	padding: 24px var(--ha-gutter) 64px;
}

@media (min-width: 960px) {
	.ha-pp .ha-product {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 40px;
		padding-top: 32px;
	}
}

@media (min-width: 1200px) {
	.ha-pp .ha-product {
		gap: 48px;
	}
}

.ha-pp .ha-product__reviews {
	grid-column: 1 / -1;
	padding-top: 24px;
	border-top: 1px solid var(--ha-border);
}

/* Notices printed by WooCommerce above the product. */
.ha-pp .woocommerce-notices-wrapper {
	max-width: var(--ha-max-width);
	margin: 0 auto;
	padding: 0 var(--ha-gutter);
}

/* --------------------------------------------------------------------------
   Gallery
   -------------------------------------------------------------------------- */

.ha-pp .ha-gallery__main {
	position: relative;
}

.ha-pp .ha-gallery__stage {
	position: relative;
	aspect-ratio: 6 / 5;
	border-radius: var(--ha-radius);
	overflow: hidden;
	background: var(--ha-surface);
}

.ha-pp .ha-gallery__slide {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.ha-pp .ha-gallery__slide.is-active {
	opacity: 1;
	visibility: visible;
	transition-delay: 0s;
}

.ha-pp .ha-gallery__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ha-pp .ha-gallery__arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	width: 44px;
	height: 44px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: var(--ha-dark);
	box-shadow: 0 2px 10px rgba(17, 24, 39, 0.18);
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ha-pp .ha-gallery__arrow:hover {
	transform: translateY(-50%) scale(1.06);
	box-shadow: 0 4px 14px rgba(17, 24, 39, 0.24);
}

.ha-pp .ha-gallery__arrow:focus-visible {
	outline: 3px solid var(--ha-purple);
	outline-offset: 2px;
}

.ha-pp .ha-gallery__arrow--prev {
	left: 20px;
}

.ha-pp .ha-gallery__arrow--next {
	right: 20px;
}

.ha-pp .ha-gallery__arrow .ha-icon {
	width: 20px;
	height: 20px;
}

.ha-pp .ha-gallery__thumbs {
	display: flex;
	gap: 12px;
	margin-top: 16px;
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	padding: 3px;
}

.ha-pp .ha-gallery__thumbs::-webkit-scrollbar {
	display: none;
}

/* Desktop: wrap onto a second row rather than hiding extra images. */
@media (min-width: 960px) {
	.ha-pp .ha-gallery__thumbs {
		flex-wrap: wrap;
		overflow: visible;
	}
}

.ha-pp .ha-gallery__thumb {
	flex: 0 0 auto;
	width: calc((100% - 5 * 12px) / 6);
	min-width: 84px;
	aspect-ratio: 1 / 1;
	padding: 0;
	margin: 0;
	border: 2px solid transparent;
	border-radius: var(--ha-radius-sm);
	background: var(--ha-surface);
	overflow: hidden;
	transition: border-color 0.15s ease;
}

.ha-pp .ha-gallery__thumb:hover {
	border-color: #c4b5fd;
}

.ha-pp .ha-gallery__thumb.is-active {
	border-color: var(--ha-purple);
}

.ha-pp .ha-gallery__thumb:focus-visible {
	outline: 3px solid var(--ha-purple);
	outline-offset: 2px;
}

.ha-pp .ha-gallery__thumb-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: calc(var(--ha-radius-sm) - 2px);
}

/* --------------------------------------------------------------------------
   Summary column
   -------------------------------------------------------------------------- */

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

.ha-pp .ha-product__heading {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
}

.ha-pp .ha-product__title {
	margin: 0;
	font-size: clamp(30px, 3.2vw, 46px);
	font-weight: 800;
	line-height: 1.08;
	letter-spacing: -0.02em;
	color: var(--ha-dark);
	max-width: 12ch;
}

.ha-pp .ha-price {
	flex: 0 0 auto;
	font-size: clamp(24px, 2.4vw, 32px);
	font-weight: 700;
	line-height: 1.2;
	color: var(--ha-purple);
	white-space: nowrap;
	text-align: right;
	padding-top: 0.15em;
}

.ha-pp .ha-price .amount {
	color: inherit;
	font-weight: inherit;
}

.ha-pp .ha-price__regular {
	display: block;
	font-size: 0.6em;
	font-weight: 500;
	color: var(--ha-muted);
	text-decoration: line-through;
}

.ha-pp .ha-price del .amount {
	color: var(--ha-muted);
}

.ha-pp .ha-product__short {
	font-size: 17px;
	line-height: 1.6;
	color: var(--ha-text);
}

.ha-pp .ha-product__short p {
	margin: 0 0 0.75em;
}

.ha-pp .ha-product__short p:last-child {
	margin-bottom: 0;
}

/* Feature icons */
.ha-pp .ha-features {
	list-style: none;
	margin: 4px 0 0;
	padding: 20px 0 24px;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-around;
	gap: 16px;
	border-bottom: 1px solid var(--ha-border);
}

.ha-pp .ha-features__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	flex: 1 1 120px;
	margin: 0;
	text-align: center;
}

.ha-pp .ha-features__icon {
	width: 40px;
	height: 40px;
	color: var(--ha-dark);
}

.ha-pp .ha-features__label {
	font-size: 15px;
	font-weight: 500;
	color: var(--ha-dark);
}

/* --------------------------------------------------------------------------
   Variation swatches
   -------------------------------------------------------------------------- */

.ha-pp .ha-form {
	display: flex;
	flex-direction: column;
	gap: 24px;
	margin: 0;
}

.ha-pp .ha-swatch-groups {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.ha-pp .ha-swatch-group {
	position: relative;
}

.ha-pp .ha-swatch-group__label {
	margin: 0 0 12px;
	font-size: 17px;
	color: var(--ha-text);
}

.ha-pp .ha-swatch-group__name {
	font-weight: 700;
	color: var(--ha-dark);
}

.ha-pp .ha-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 22px 28px;
	padding: 4px;
}

.ha-pp .ha-swatch {
	position: relative;
	width: 72px;
	height: 72px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: var(--ha-surface);
	overflow: hidden;
	box-shadow: 0 0 0 2px #fff, 0 0 0 3px transparent;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.ha-pp .ha-swatch:hover {
	transform: scale(1.04);
}

.ha-pp .ha-swatch.is-selected {
	box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ha-purple);
}

.ha-pp .ha-swatch:focus-visible {
	outline: 3px solid var(--ha-purple);
	outline-offset: 5px;
}

.ha-pp .ha-swatch__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

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

.ha-pp .ha-swatch__text {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 4px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.15;
	text-align: center;
	overflow: hidden;
}

.ha-pp .ha-swatch.is-unavailable,
.ha-pp .ha-swatch.is-out-of-stock {
	opacity: 0.4;
}

.ha-pp .ha-swatch.is-unavailable::after,
.ha-pp .ha-swatch.is-out-of-stock::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 120%;
	height: 2px;
	background: var(--ha-dark);
	transform: translate(-50%, -50%) rotate(-45deg);
}

/* Woo's own select is kept for the variation script but hidden visually. */
.ha-pp .ha-form .reset_variations {
	display: none !important;
}

.ha-pp .ha-variation-notes:empty {
	display: none;
}

.ha-pp .ha-variation-notes .woocommerce-variation-price,
.ha-pp .ha-variation-notes .woocommerce-variation-description:empty {
	display: none;
}

.ha-pp .ha-variation-notes .woocommerce-variation-availability p {
	margin: 0 0 12px;
	font-size: 14px;
}

.ha-pp .ha-variation-notes .stock.out-of-stock {
	color: #b91c1c;
}

.ha-pp .ha-form .wc-no-matching-variations,
.ha-pp .ha-form p.stock.out-of-stock {
	margin: 0;
	padding: 12px 16px;
	border-radius: var(--ha-radius-sm);
	background: #fef2f2;
	color: #b91c1c;
	font-size: 15px;
}

/* --------------------------------------------------------------------------
   Quantity + Add to cart
   -------------------------------------------------------------------------- */

.ha-pp .ha-buy {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 16px;
}

/* The promo box sits inside the buy row but always takes a full line of its
   own, under the quantity stepper and the button. */
.ha-pp .ha-buy .ha-promo {
	flex: 1 1 100%;
}

.ha-pp .ha-buy__qty {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ha-pp .ha-buy__label {
	font-size: 17px;
	font-weight: 700;
	color: var(--ha-dark);
}

.ha-pp .ha-buy .quantity {
	display: inline-flex;
	align-items: stretch;
	height: var(--ha-control-h);
	border: 1.5px solid var(--ha-border);
	border-radius: var(--ha-radius-sm);
	background: #fff;
	overflow: hidden;
	float: none;
	margin: 0;
}

.ha-pp .ha-buy .quantity .screen-reader-text {
	position: absolute;
	clip: rect(0, 0, 0, 0);
}

.ha-pp .ha-buy .quantity .qty {
	width: 64px;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	text-align: center;
	font-size: 18px;
	font-weight: 600;
	color: var(--ha-dark);
	-moz-appearance: textfield;
	appearance: textfield;
	box-shadow: none;
	outline: none;
}

.ha-pp .ha-buy .quantity .qty::-webkit-outer-spin-button,
.ha-pp .ha-buy .quantity .qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.ha-pp .ha-buy .ha-qty__btn {
	width: 52px;
	padding: 0;
	margin: 0;
	border: 0;
	background: transparent;
	color: var(--ha-dark);
	font-size: 22px;
	font-weight: 500;
	line-height: 1;
	border-radius: 0;
	transition: background-color 0.15s ease;
}

.ha-pp .ha-buy .ha-qty__btn:hover {
	background: var(--ha-surface);
}

.ha-pp .ha-buy .ha-qty__btn:focus-visible {
	outline: 3px solid var(--ha-purple);
	outline-offset: -3px;
}

/* Primary button – specificity beats WooCommerce's `.woocommerce button.button.alt` rules. */
.ha-pp .ha-form .ha-btn--primary,
.ha-pp .ha-form .ha-btn--primary:visited {
	flex: 1 1 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	min-height: var(--ha-control-h);
	padding: 0 28px;
	margin: 0;
	border: 0;
	border-radius: var(--ha-radius-sm);
	background: var(--ha-purple);
	color: #fff;
	font-size: 19px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	float: none;
	transition: background-color 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.ha-pp .ha-form .ha-btn--primary:hover,
.ha-pp .ha-form .ha-btn--primary:focus {
	background: var(--ha-purple-dark);
	color: #fff;
}

.ha-pp .ha-form .ha-btn--primary:focus-visible {
	outline: 3px solid var(--ha-purple);
	outline-offset: 3px;
}

.ha-pp .ha-form .ha-btn--primary:active {
	transform: translateY(1px);
}

.ha-pp .ha-form .ha-btn--primary.disabled,
.ha-pp .ha-form .ha-btn--primary:disabled,
.ha-pp .ha-form .ha-btn--primary.wc-variation-selection-needed,
.ha-pp .ha-form .ha-btn--primary.wc-variation-is-unavailable {
	background: var(--ha-purple);
	color: #fff;
	opacity: 0.5;
	cursor: not-allowed;
}

.ha-pp .ha-btn__sep {
	opacity: 0.8;
}

.ha-pp .ha-btn__price .amount {
	color: inherit;
	font-weight: inherit;
}

/* Fallback (grouped/external) uses Woo markup – light touch. */
.ha-pp .ha-form--fallback .button {
	background: var(--ha-purple);
	color: #fff;
	border-radius: var(--ha-radius-sm);
}

/* --------------------------------------------------------------------------
   Promo box
   -------------------------------------------------------------------------- */

.ha-pp .ha-promo {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 18px;
	padding: 18px 24px;
	border: 2px solid var(--ha-purple);
	border-radius: 14px;
	background: #fff;
}

.ha-pp .ha-promo__icon {
	width: 40px;
	height: 40px;
	color: var(--ha-purple);
	flex: 0 0 auto;
}

.ha-pp .ha-promo__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ha-pp .ha-promo__title {
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--ha-purple);
}

.ha-pp .ha-promo__title .amount {
	color: inherit;
	font-weight: inherit;
}

.ha-pp .ha-promo__sub {
	font-size: 15px;
	color: var(--ha-purple-dark);
}

/* --------------------------------------------------------------------------
   Responsive tweaks
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
	.ha-pp .ha-product__heading {
		flex-direction: column;
		gap: 8px;
	}

	.ha-pp .ha-price {
		text-align: left;
		padding-top: 0;
	}

	.ha-pp .ha-product__title {
		max-width: none;
	}

	.ha-pp .ha-gallery__arrow {
		width: 38px;
		height: 38px;
	}

	.ha-pp .ha-gallery__arrow--prev {
		left: 12px;
	}

	.ha-pp .ha-gallery__arrow--next {
		right: 12px;
	}

	.ha-pp .ha-gallery__thumb {
		width: 76px;
		min-width: 76px;
	}

	.ha-pp .ha-features {
		gap: 12px 8px;
	}

	.ha-pp .ha-features__item {
		flex-basis: 90px;
	}

	.ha-pp .ha-features__label {
		font-size: 14px;
	}

	.ha-pp .ha-swatches {
		gap: 16px 18px;
	}

	.ha-pp .ha-swatch {
		width: 60px;
		height: 60px;
	}

	.ha-pp .ha-buy {
		flex-wrap: wrap;
	}

	.ha-pp .ha-buy .quantity .qty {
		width: 52px;
	}

	.ha-pp .ha-buy .ha-qty__btn {
		width: 46px;
	}

	.ha-pp .ha-form .ha-btn--primary {
		flex-basis: 100%;
		font-size: 17px;
	}
}
