/* =====================================================================
   DOMcommerce: single product page (classic WooCommerce template)
   Centered summary, fluid sizing, rounded swatches, touch-friendly controls.
   Everything is scoped to body.domc-sp, and wins over theme rules by specificity
   (plus !important only on colors that themes commonly force).
   ===================================================================== */

body.domc-sp {
	--dsp-accent: var(--domc-accent, currentColor);
	--dsp-r: 12px;        /* swatch / control radius */
	--dsp-touch: 48px;    /* minimum tap target */
	--dsp-measure: 36rem; /* width of the centered column */
}

/* ---------- Summary: one centered column ---------- */
body.domc-sp.single-product div.product div.summary {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: clamp(14px, 1.8vw, 22px);
	box-sizing: border-box;
	min-width: 0;
}
body.domc-sp.single-product div.product div.summary > * {
	box-sizing: border-box;
	width: 100%;
	max-width: min(100%, var(--dsp-measure));
	margin: 0 auto;
	float: none;
	clear: none;
}

/* ---------- Title, price, description ---------- */
body.domc-sp.single-product div.product div.summary .product_title {
	max-width: 100%;
	font-size: clamp(1.75rem, 1.15rem + 2.1vw, 2.75rem);
	line-height: 1.1;
	text-wrap: balance;
	overflow-wrap: anywhere;
}
body.domc-sp.single-product div.product div.summary :is(p.price, .price) {
	font-size: clamp(1.35rem, 1.1rem + 1vw, 1.9rem);
	line-height: 1.25;
	text-align: center;
}
body.domc-sp.single-product div.product div.summary .woocommerce-product-details__short-description {
	font-size: clamp(1rem, .94rem + .3vw, 1.1rem);
	line-height: 1.7;
	text-wrap: pretty;
}
body.domc-sp.single-product div.product div.summary .woocommerce-product-details__short-description > :first-child { margin-top: 0; }
body.domc-sp.single-product div.product div.summary .woocommerce-product-details__short-description > :last-child { margin-bottom: 0; }

/* ---------- Add to cart form ---------- */
body.domc-sp.single-product div.product div.summary form.cart {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: clamp(12px, 1.6vw, 18px);
	width: 100%;
	margin: 0 auto;
}
/* Simple products: quantity + button in one centered row */
body.domc-sp.single-product div.product div.summary form.cart:not(.variations_form),
body.domc-sp.single-product div.product div.summary .woocommerce-variation-add-to-cart {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: center;
	align-items: stretch;
	gap: 12px;
}
body.domc-sp.single-product div.product div.summary .woocommerce-variation-add-to-cart { width: 100%; }

/* Size guide / other links in the form take their own line, with a real tap target */
body.domc-sp.single-product div.product div.summary form.cart :is(a[href*="size-guide" i], a[href*="size_guide" i], a[href*="sizeguide" i], [class*="size-guide"], [class*="size_guide"], [class*="sizeguide"]) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 100%;
	min-height: 44px;
	padding: 0 12px;
	text-align: center;
	text-underline-offset: 4px;
}

/* ---------- Variations table: label on top, swatches centered ---------- */
body.domc-sp.single-product div.product div.summary :is(table.variations, table.variations tbody, table.variations tr) {
	display: block;
	width: 100%;
	margin: 0;
	border: 0;
	background: none;
}
body.domc-sp.single-product div.product div.summary table.variations tr + tr { margin-top: 14px; }
body.domc-sp.single-product div.product div.summary table.variations :is(th, td) {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	text-align: center;
	background: none;
}
body.domc-sp.single-product div.product div.summary table.variations th.label {
	padding-bottom: 10px;
	line-height: 1.3;
}
body.domc-sp.single-product div.product div.summary table.variations th.label label {
	font-size: .85rem;
	letter-spacing: .14em;
	text-transform: uppercase;
}
/* "Clear" link: a tap target, hidden while nothing is chosen (WooCommerce toggles visibility) */
body.domc-sp.single-product div.product div.summary .reset_variations {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 14px;
}
body.domc-sp.single-product div.product div.summary .reset_variations[style*="hidden"] { display: none; }

/* Variation details after choosing */
body.domc-sp.single-product div.product div.summary .single_variation_wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: clamp(12px, 1.6vw, 18px);
	width: 100%;
}
body.domc-sp.single-product div.product div.summary .woocommerce-variation {
	width: 100%;
	text-align: center;
}
body.domc-sp.single-product div.product div.summary .woocommerce-variation:empty { display: none; }
body.domc-sp.single-product div.product div.summary .woocommerce-variation > * { margin-block: 0 8px; }
body.domc-sp.single-product div.product div.summary .woocommerce-variation :is(.price, .stock) { text-align: center; }

/* ---------- Swatches ---------- */
body.domc-sp.single-product div.product div.summary table.variations td.value { position: relative; }
body.domc-sp.single-product div.product div.summary .domc-select-hidden {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	/* themes size selects (width:100%, min-width:75%); force this one to nothing so it can never widen the page */
	width: 1px !important;
	min-width: 0 !important;
	max-width: 1px !important;
	height: 1px !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
}
body.domc-sp .domc-swatches {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
}
body.domc-sp .domc-swatches .domc-swatch {
	appearance: none;
	-webkit-appearance: none;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 56px;
	min-height: 46px;
	margin: 0;
	padding: 0 16px;
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: inherit !important;
	background: transparent !important;
	border: 2px solid color-mix(in srgb, var(--dsp-accent) 50%, transparent) !important;
	border-radius: var(--dsp-r) !important;
	box-shadow: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
	transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
body.domc-sp .domc-swatches .domc-swatch:hover {
	border-color: var(--dsp-accent) !important;
	box-shadow: 0 0 12px color-mix(in srgb, var(--domc-glow-t, var(--dsp-accent)) 55%, transparent);
}
body.domc-sp .domc-swatches .domc-swatch:active { transform: scale(.96); }
body.domc-sp .domc-swatches .domc-swatch:focus-visible {
	outline: 3px solid var(--domc-link, currentColor);
	outline-offset: 3px;
}
body.domc-sp .domc-swatches .domc-swatch[aria-pressed="true"] {
	color: var(--domc-btn-text, inherit) !important;
	background: var(--domc-btn-bg, color-mix(in srgb, currentColor 20%, transparent)) !important;
	border-color: var(--dsp-accent) !important;
	box-shadow: 0 0 14px color-mix(in srgb, var(--domc-glow-t, var(--dsp-accent)) 70%, transparent);
}
body.domc-sp .domc-swatches .domc-swatch.is-unavailable {
	opacity: .4;
	text-decoration: line-through;
	cursor: not-allowed;
	box-shadow: none;
}

/* ---------- Quantity stepper ---------- */
body.domc-sp.single-product div.product div.summary .quantity.domc-qty {
	display: inline-flex;
	align-items: stretch;
	margin: 0;
	border: 2px solid color-mix(in srgb, var(--dsp-accent) 50%, transparent);
	border-radius: var(--dsp-r);
	overflow: hidden;
}
body.domc-sp.single-product div.product div.summary .quantity.domc-qty .qty {
	box-sizing: border-box;
	width: 3.6rem;
	min-height: 52px;
	margin: 0;
	padding: 0;
	font-size: 1.1rem;
	text-align: center;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	-moz-appearance: textfield;
	appearance: textfield;
}
body.domc-sp.single-product div.product div.summary .quantity.domc-qty .qty::-webkit-outer-spin-button,
body.domc-sp.single-product div.product div.summary .quantity.domc-qty .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
body.domc-sp .domc-qty .domc-qty-btn {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--dsp-touch);
	min-height: 52px;
	margin: 0;
	padding: 0;
	font: inherit;
	font-size: 1.4rem;
	line-height: 1;
	color: inherit !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	cursor: pointer;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}
body.domc-sp .domc-qty .domc-qty-btn:hover { background: color-mix(in srgb, var(--dsp-accent) 22%, transparent) !important; }
body.domc-sp .domc-qty .domc-qty-btn:active { background: color-mix(in srgb, var(--dsp-accent) 38%, transparent) !important; }
body.domc-sp .domc-qty .domc-qty-btn:focus-visible { outline: 3px solid var(--domc-link, currentColor); outline-offset: -3px; }

/* ---------- Add to cart ---------- */
body.domc-sp.single-product div.product div.summary :is(.single_add_to_cart_button, button.single_add_to_cart_button) {
	box-sizing: border-box;
	flex: 0 1 15rem;
	min-width: 12rem;
	min-height: 52px;
	margin: 0;
	padding: 0 2rem;
	font-size: 1rem;
	border-radius: var(--dsp-r);
	touch-action: manipulation;
}
body.domc-sp.single-product div.product div.summary .single_add_to_cart_button:is(.disabled, .wc-variation-selection-needed, :disabled) { opacity: .6; }

/* ---------- Express payment (Google Pay / PayPal / Stripe style buttons) ---------- */
body.domc-sp.single-product div.product div.summary :is(
	#ppc-button-ppcp-gateway, .ppc-button-wrapper, [id*="ppcp"], [class*="ppcp"], [id*="googlepay"], [class*="googlepay"],
	.wc-stripe-product-checkout-container, #wc-stripe-express-checkout-element, .wcpay-payment-request-wrapper, #wcpay-express-checkout-wrapper
) {
	box-sizing: border-box;
	max-width: min(100%, 24rem);
	margin-inline: auto;
}

/* ---------- SKU / categories: one centered line each ---------- */
body.domc-sp.single-product div.product div.summary .product_meta {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding-top: clamp(12px, 1.6vw, 18px);
	border-top: 1px solid color-mix(in srgb, var(--dsp-accent) 28%, transparent);
	font-size: clamp(.8rem, .76rem + .2vw, .9rem);
	line-height: 1.6;
	text-align: center;
}
body.domc-sp.single-product div.product div.summary .product_meta > span { display: block; }
body.domc-sp.single-product div.product div.summary .product_meta a { display: inline-block; padding: 4px 2px; }

/* ---------- Themed: the whole summary becomes a themed box ---------- */
body.domc-sp-themed.single-product div.product div.summary {
	--domc-s: 36px;
	--domc-c: var(--domc-glow-t, var(--dsp-accent));
	padding: clamp(20px, 3vw, 36px);
	color: var(--domc-text);
	border: 2px solid var(--domc-accent);
	border-radius: 14px;
	background-color: color-mix(in srgb, color-mix(in srgb, var(--domc-accent) 30%, var(--domc-surface)) var(--domc-alpha, 30%), transparent);
	box-shadow:
		0 0 calc(var(--domc-s) * .12) color-mix(in srgb, var(--domc-c) 90%, transparent),
		0 0 calc(var(--domc-s) * .35) color-mix(in srgb, var(--domc-c) 65%, transparent),
		0 0 var(--domc-s) color-mix(in srgb, var(--domc-c) 45%, transparent),
		inset 0 0 calc(var(--domc-s) * .25) color-mix(in srgb, var(--domc-c) 25%, transparent);
}
body.domc-sp-pulse.domc-sp-themed.single-product div.product div.summary { animation: domc-pulse 2.4s ease-in-out infinite; }
body.domc-sp-themed.single-product div.product div.summary :is(.product_title, .woocommerce-product-details__short-description, .product_meta, label, .stock) { color: var(--domc-text); }
body.domc-sp-themed.single-product div.product div.summary a:not(.button):not(.single_add_to_cart_button) { color: var(--domc-link); }
body.domc-sp-themed.single-product div.product div.summary :is(.single_add_to_cart_button, button.single_add_to_cart_button) {
	color: var(--domc-btn-text) !important;
	background: var(--domc-btn-bg) !important;
	border: 1px solid var(--domc-btn-border) !important;
	box-shadow: 0 0 10px color-mix(in srgb, var(--domc-glow-t) 55%, transparent), inset 0 0 6px color-mix(in srgb, var(--domc-glow-t) 20%, transparent);
}
body.domc-sp-themed.single-product div.product div.summary :is(.single_add_to_cart_button, button.single_add_to_cart_button):not(:disabled):hover {
	background: var(--domc-btn-hover) !important;
	box-shadow: 0 0 16px var(--domc-glow-t), 0 0 32px color-mix(in srgb, var(--domc-glow-t) 50%, transparent);
}
/* Light themes (Cold Boot, Silicon Storm, Fresh Build): light text, theme-colored links, readable on a dark page */
body.domc-sp-light.single-product div.product div.summary {
	--domc-text: #F4F4F4;
	--domc-link: var(--domc-accent);
}
body.domc-sp-light.single-product div.product div.summary :is(.product_title, .woocommerce-product-details__short-description, .product_meta, label, .stock) { color: #F4F4F4; }
body.domc-sp-light .domc-swatches .domc-swatch { color: #F4F4F4 !important; }
/* Quantum Array: rainbow ring + multi-color glow */
body.domc-sp-grad.single-product div.product div.summary {
	position: relative;
	border-color: transparent;
	box-shadow:
		calc(var(--domc-s) * -.2) 0 calc(var(--domc-s) * .7) #E4202C,
		calc(var(--domc-s) * .2) 0 calc(var(--domc-s) * .7) #405585,
		0 calc(var(--domc-s) * -.2) calc(var(--domc-s) * .7) #F7931E,
		0 calc(var(--domc-s) * .2) calc(var(--domc-s) * .7) #00A550;
}
body.domc-sp-pulse.domc-sp-grad.single-product div.product div.summary { animation-name: domc-pulse-grad; }
body.domc-sp-grad.single-product div.product div.summary::before {
	content: "";
	position: absolute;
	inset: -2px;
	padding: 2px;
	border-radius: inherit;
	background: var(--domc-gradient);
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
	pointer-events: none;
}

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
	body.domc-sp { --dsp-measure: 40rem; }
	body.domc-sp.single-product div.product div.summary { padding-inline: clamp(0px, 2vw, 16px); }
	body.domc-sp .domc-swatches { gap: 12px; }
	body.domc-sp .domc-swatches .domc-swatch { min-width: 60px; min-height: 52px; font-size: 1.05rem; }
	body.domc-sp .domc-qty .domc-qty-btn { width: 52px; min-height: 56px; }
	body.domc-sp.single-product div.product div.summary .quantity.domc-qty .qty { min-height: 56px; width: 4rem; font-size: 1.15rem; }
	body.domc-sp.single-product div.product div.summary :is(.single_add_to_cart_button, button.single_add_to_cart_button) { min-height: 56px; }
}

/* ---------- Mobile: full-width, big, thumb friendly ---------- */
@media (max-width: 640px) {
	body.domc-sp { --dsp-measure: 100%; --dsp-touch: 56px; }
	body.domc-sp.single-product div.product div.summary { gap: 16px; }
	body.domc-sp-themed.single-product div.product div.summary { padding: 20px 16px; }
	/* 16px+ text so phones never zoom into the page on tap */
	body.domc-sp.single-product div.product div.summary .quantity.domc-qty .qty { font-size: 1.125rem; }
	body.domc-sp .domc-swatches { gap: 10px; }
	body.domc-sp .domc-swatches .domc-swatch { flex: 1 1 54px; min-width: 54px; min-height: 56px; padding: 0 10px; font-size: 1.05rem; }
	/* Quantity on its own row, button full width underneath */
	body.domc-sp.single-product div.product div.summary form.cart:not(.variations_form),
	body.domc-sp.single-product div.product div.summary .woocommerce-variation-add-to-cart { flex-direction: column; align-items: stretch; gap: 14px; }
	body.domc-sp.single-product div.product div.summary .quantity.domc-qty { width: 100%; max-width: 100%; justify-content: space-between; }
	body.domc-sp.single-product div.product div.summary .quantity.domc-qty .qty { flex: 1 1 auto; width: auto; min-width: 0; min-height: 56px; }
	body.domc-sp .domc-qty .domc-qty-btn { width: 64px; min-height: 56px; font-size: 1.6rem; }
	body.domc-sp.single-product div.product div.summary :is(.single_add_to_cart_button, button.single_add_to_cart_button) { flex: 0 0 auto; width: 100%; min-width: 0; height: auto; min-height: 58px; font-size: 1.05rem; }
	body.domc-sp.single-product div.product div.summary :is(
		#ppc-button-ppcp-gateway, .ppc-button-wrapper, [id*="ppcp"], [class*="ppcp"], [id*="googlepay"], [class*="googlepay"],
		.wc-stripe-product-checkout-container, #wc-stripe-express-checkout-element, .wcpay-payment-request-wrapper, #wcpay-express-checkout-wrapper
	) { max-width: 100%; }
	body.domc-sp.single-product div.product div.summary .product_meta { font-size: .9rem; }
}

@media (prefers-reduced-motion: reduce) {
	body.domc-sp-themed.single-product div.product div.summary { animation: none; }
	body.domc-sp .domc-swatches .domc-swatch { transition: none; }
}
