/**
 * Smart Add-Ons storefront UI — scoped design system.
 * Intentionally self-contained so it stays stable across WooCommerce themes.
 */

.saue-addon-root {
	margin: 1rem 0 1.25rem;
	width: 100%;
	max-width: 100%;
	min-width: 0;
}

.wp-block-woocommerce-add-to-cart-with-options .saue-addon-root,
.wc-block-add-to-cart-form .saue-addon-root,
.wp-block-add-to-cart-form .saue-addon-root {
	margin: 0 0 1rem;
}

.saue-addon-wrapper,
.saue-addon-wrapper *,
.saue-addon-wrapper *::before,
.saue-addon-wrapper *::after {
	box-sizing: border-box;
}

.saue-addon-wrapper {
	display: flex;
	flex-direction: column;
	gap: var(--saue-space-panel);
	width: 100%;
	max-width: var(--saue-panel-max-width);
	min-width: 0;
	font-family: var(--saue-font-family);
	color: var(--saue-text);
	/* ── Color tokens ── */
	--saue-accent: #00a3a3;
	--saue-accent-dark: #008585;
	--saue-accent-soft: #effafb;
	/* Text-safe variant of --saue-accent for small text (e.g. option prices) —
	 * 4.57:1 on --saue-accent-soft, 4.86:1 on white. AppearanceCssGenerator
	 * overrides this per-install, deriving it from the merchant's own accent
	 * when customised; --saue-accent itself is never touched. */
	--saue-accent-text: #0a7f78;
	--saue-border: #e2e8f0;
	--saue-border-strong: #cbd5e1;
	--saue-surface: #fafbfc;
	--saue-surface-elevated: #ffffff;
	--saue-text: #0f172a;
	--saue-text-muted: #64748b;
	--saue-text-subtle: #94a3b8;
	--saue-danger: #dc2626;
	/* ── Typography tokens ── */
	--saue-font-family: inherit;
	--saue-font-size-eyebrow: 0.75rem;
	--saue-font-size-title: 1.125rem;
	--saue-font-size-heading: 0.9375rem;
	--saue-font-size-label: 0.8125rem;
	--saue-font-size-body: 0.875rem;
	--saue-font-size-caption: 0.75rem;
	--saue-font-size-price: 0.8125rem;
	--saue-font-weight-label: 600;
	--saue-font-weight-body: 400;
	--saue-line-height-tight: 1.3;
	--saue-line-height-body: 1.5;
	--saue-letter-spacing-eyebrow: 0.04em;
	/* ── Spacing & layout tokens ── */
	--saue-radius-sm: 0.5rem;
	--saue-radius-md: 0.625rem;
	--saue-space-field: 0.625rem;
	--saue-space-group: 1rem;
	--saue-space-panel: 0.875rem;
	--saue-control-height: 2.5rem;
	--saue-textarea-min-height: 5.5rem;
	--saue-panel-max-width: 100%;
}

/* ── Semantic typography utilities ── */
.saue-type-eyebrow {
	font-size: var(--saue-font-size-eyebrow);
	font-weight: 700;
	line-height: var(--saue-line-height-tight);
	letter-spacing: var(--saue-letter-spacing-eyebrow);
}

.saue-type-title {
	font-size: var(--saue-font-size-title);
	font-weight: var(--saue-font-weight-label);
	line-height: var(--saue-line-height-tight);
}

.saue-type-heading {
	font-size: var(--saue-font-size-heading);
	font-weight: var(--saue-font-weight-label);
	line-height: var(--saue-line-height-tight);
}

.saue-type-label {
	font-size: var(--saue-font-size-label);
	font-weight: var(--saue-font-weight-label);
	line-height: var(--saue-line-height-tight);
}

.saue-type-body {
	font-size: var(--saue-font-size-body);
	font-weight: var(--saue-font-weight-body);
	line-height: var(--saue-line-height-body);
}

.saue-type-caption {
	font-size: var(--saue-font-size-caption);
	font-weight: var(--saue-font-weight-body);
	line-height: var(--saue-line-height-body);
}

/* ── Panel intro ── */
.saue-addon-panel__intro {
	margin-bottom: 1rem;
}

.saue-addon-panel__eyebrow {
	margin: 0 0 0.35rem;
	text-transform: uppercase;
	color: var(--saue-accent-text);
}

.saue-addon-panel__eyebrow.saue-type-eyebrow,
.saue-addon-panel__eyebrow {
	font-size: var(--saue-font-size-eyebrow);
	font-weight: 700;
	line-height: var(--saue-line-height-tight);
	letter-spacing: var(--saue-letter-spacing-eyebrow);
}

.saue-addon-panel__title {
	margin: 0 0 0.35rem;
	color: var(--saue-text);
	font-size: var(--saue-font-size-title);
	font-weight: var(--saue-font-weight-label);
	line-height: var(--saue-line-height-tight);
}

.saue-addon-panel__desc {
	margin: 0;
	color: var(--saue-text-muted);
	font-size: var(--saue-font-size-body);
	line-height: var(--saue-line-height-body);
}

.saue-addon-group__title {
	margin: 0;
	padding-left: 0.25rem;
	color: var(--saue-text);
	font-size: var(--saue-font-size-heading);
	font-weight: var(--saue-font-weight-label);
	line-height: var(--saue-line-height-tight);
}

.saue-addon-group__description {
	margin: 0.25rem 0 0;
	padding-left: 0.25rem;
	color: var(--saue-text-muted);
	font-size: var(--saue-font-size-label);
	line-height: var(--saue-line-height-body);
}

.saue-addon-panel__groups {
	display: flex;
	flex-direction: column;
	gap: var(--saue-space-group);
}

/* ── Group card ── */
.saue-addon-group {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	overflow: hidden;
	border: 1px solid var(--saue-border);
	border-radius: var(--saue-radius-md);
	background: var(--saue-surface-elevated);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.saue-addon-group + .saue-addon-group {
	margin-top: 0;
}

.saue-addon-group__header {
	position: relative;
	padding: 0.75rem 0.875rem 0.625rem 1rem;
	border-bottom: 1px solid var(--saue-border);
	background: var(--saue-surface);
}

.saue-addon-group__header::before {
	content: '';
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 3px;
	background: var(--saue-accent);
	border-radius: var(--saue-radius-md) 0 0 0;
}

.saue-addon-group--accordion .saue-addon-group__header {
	padding: 0;
	border-bottom: none;
}

.saue-addon-group--accordion.is-open .saue-addon-group__header {
	border-bottom: 1px solid var(--saue-border);
}

.saue-addon-group__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	width: 100%;
	padding: 0.75rem 0.875rem 0.75rem 1rem;
	border: none;
	background: transparent;
	font: inherit;
	text-align: left;
	cursor: pointer;
	color: inherit;
}

.saue-addon-group__toggle:focus-visible {
	outline: 2px solid var(--saue-accent);
	outline-offset: -2px;
}

.saue-addon-group__toggle .saue-addon-group__title {
	flex: 1;
}

.saue-addon-group__chevron {
	flex-shrink: 0;
	width: 1.25rem;
	font-size: var(--saue-font-size-title);
	font-weight: var(--saue-font-weight-label);
	line-height: 1;
	color: var(--saue-text-muted);
	text-align: center;
}

.saue-addon-group__error-count {
	flex-shrink: 0;
	padding: 0.125rem 0.5rem;
	border-radius: 999px;
	background: color-mix(in srgb, var(--saue-danger) 10%, transparent);
	color: var(--saue-danger);
	font-size: var(--saue-font-size-label);
	font-weight: var(--saue-font-weight-label);
	line-height: var(--saue-line-height-tight);
	white-space: nowrap;
}

.saue-addon-group--accordion .saue-addon-group__description,
.saue-addon-group--accordion .saue-addon-group__required-note {
	padding: 0 0.875rem 0.625rem 1.25rem;
}

.saue-option-price__mode--formula {
	font-weight: 500;
	color: var(--saue-text-muted);
}

.saue-addon-group__fields {
	display: flex;
	flex-direction: column;
	gap: var(--saue-space-field);
	width: 100%;
	max-width: 100%;
	min-width: 0;
	padding: 0.75rem 0.875rem 0.875rem;
}

/* WooCommerce themes (e.g. .woocommerce-page label { margin-bottom: .7em; }) */
.woocommerce-page .saue-addon-wrapper label,
.woocommerce .saue-addon-wrapper label,
.woocommerce-page .saue-addon-group__fields label,
.woocommerce .saue-addon-group__fields label {
	margin: 0 !important;
}

.woocommerce-page .saue-addon-wrapper h4,
.woocommerce .saue-addon-wrapper h4 {
	margin: 0;
}

/* ── Fields ── */
.saue-field {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin: 0;
}

.saue-field__label,
.saue-field__legend {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin: 0 0 0.375rem;
	padding: 0;
	font-size: var(--saue-font-size-label);
	font-weight: var(--saue-font-weight-label);
	line-height: var(--saue-line-height-tight);
	color: var(--saue-text);
}

.saue-field__legend {
	margin-bottom: 0.5rem;
}

.saue-field__label-text {
	display: inline;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	color: inherit;
}

.saue-field__price {
	font-size: var(--saue-font-size-price);
	font-weight: var(--saue-font-weight-label);
	color: var(--saue-accent-dark);
	white-space: nowrap;
}

.saue-field--checkbox {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
}

.saue-field__option-row {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin: 0;
	padding: 0.625rem 0.75rem;
	border: 1px solid var(--saue-border);
	border-radius: var(--saue-radius-sm);
	background: var(--saue-surface-elevated);
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.saue-field__option-row:hover {
	border-color: var(--saue-border-strong);
	background: var(--saue-surface);
}

.saue-field__option-row:has(input:checked) {
	border-color: color-mix(in srgb, var(--saue-accent) 45%, transparent);
	background: var(--saue-accent-soft);
	box-shadow: 0 0 0 1px color-mix(in srgb, var(--saue-accent) 8%, transparent);
}

.saue-field--checkbox > .saue-field__description {
	padding-left: 0.125rem;
}

.saue-field__option {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.35rem 0.75rem;
	min-width: 0;
	flex: 1;
	/*
	 * The option label text is a bare <span> with no type class (see
	 * RadioField/CheckboxGroupField/CheckboxField), so without an explicit
	 * size here it inherits the host theme's body font-size instead of our
	 * own scale — on themes with a larger base font-size this rendered
	 * radio/checkbox labels noticeably oversized compared to the rest of
	 * the add-on panel. Sized to match the field label/select/input scale
	 * (--saue-font-size-label), same as the "Material" legend and the
	 * dropdown next to it — not --saue-font-size-body, which runs larger
	 * and made option text visibly bigger than every other field on the
	 * panel.
	 */
	font-size: var(--saue-font-size-label);
	line-height: var(--saue-line-height-tight);
	color: var(--saue-text);
}

.saue-field__options {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.saue-field--radio {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	margin: 0;
	padding: 0;
	border: 0;
}

/*
 * A <legend> that's the first child of a flex fieldset doesn't take part in
 * the parent's `gap` the way a normal flex item does (it's laid out via the
 * fieldset's special "rendered legend" box, not the flex algorithm) - so the
 * flex `gap` above silently doesn't apply right after it, leaving only its
 * own margin-bottom (0.375rem) for that one gap. Bump just that margin so
 * legend-to-next-sibling spacing still totals the same 0.75rem that a
 * label-then-description text/dropdown field gets from margin + gap
 * together - otherwise radio/checkbox-group/image-select fields read as
 * visibly tighter under their label than every other field type.
 */
.saue-field--radio > .saue-field__label,
.saue-field--checkbox-group > .saue-field__label,
.saue-field--image-select > .saue-field__label {
	margin-bottom: 0.75rem;
}

.saue-field__checkbox,
.saue-field__radio,
.saue-field__option-row input[type='checkbox'],
.saue-field__option-row input[type='radio'] {
	flex: 0 0 auto;
	width: 1.125rem;
	height: 1.125rem;
	margin: 0;
	border: 1.5px solid var(--saue-border-strong);
	background: var(--saue-surface-elevated);
	cursor: pointer;
	outline: none !important;
	-webkit-appearance: none;
	   -moz-appearance: none;
	        appearance: none;
	transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.saue-field__checkbox,
.saue-field__option-row input[type='checkbox'] {
	border-radius: 0.25rem;
}

.saue-field__radio,
.saue-field__option-row input[type='radio'] {
	border-radius: 50%;
}

.saue-field__checkbox:checked,
.saue-field__option-row input[type='checkbox']:checked {
	border-color: var(--saue-accent);
	background-color: var(--saue-accent);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.25 6.5 11.25 12.5 5.25' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 0.875rem 0.875rem;
}

.saue-field__radio:checked,
.saue-field__option-row input[type='radio']:checked {
	border-color: var(--saue-accent);
	background-color: var(--saue-surface-elevated);
	/* Dot via background so :focus-visible box-shadow does not erase it. */
	background-image: radial-gradient(
		circle,
		var(--saue-accent) 0 38%,
		transparent 40%
	);
	background-repeat: no-repeat;
	background-position: center;
}

.saue-field__checkbox:focus-visible,
.saue-field__radio:focus-visible,
.saue-field__option-row input[type='checkbox']:focus-visible,
.saue-field__option-row input[type='radio']:focus-visible {
	border-color: var(--saue-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--saue-accent) 18%, transparent);
}

/* Text / textarea / select controls — override theme WooCommerce form styles */
.saue-field--text,
.saue-field--textarea,
.saue-field--dropdown {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	width: 100%;
	max-width: 100%;
	min-width: 0;
}

.saue-field--textarea textarea {
	display: block;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	min-height: var(--saue-textarea-min-height) !important;
	margin: 0 !important;
	padding: 0.625rem 0.875rem !important;
	border: 1px solid var(--saue-border) !important;
	border-radius: var(--saue-radius-sm) !important;
	background: var(--saue-surface-elevated) !important;
	color: var(--saue-text) !important;
	font: inherit !important;
	font-size: var(--saue-font-size-body) !important;
	line-height: var(--saue-line-height-body) !important;
	box-shadow: none !important;
	outline: none !important;
	resize: vertical;
	transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.saue-field--textarea textarea:focus {
	border-color: var(--saue-accent) !important;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--saue-accent) 15%, transparent) !important;
}

.saue-field__label-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.saue-option-price {
	font-size: var(--saue-font-size-price);
	font-weight: var(--saue-font-weight-label);
	color: var(--saue-accent-text);
	white-space: nowrap;
}

.saue-option-price__mode {
	font-weight: 500;
	color: var(--saue-text-muted);
}

.saue-field__description--muted {
	color: var(--saue-text-subtle);
}

.saue-field--custom-price {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

.saue-field--custom-price .saue-custom-price__input-wrap {
	display: flex;
	align-items: center;
	gap: 0.375rem;
}

.saue-custom-price__currency {
	font-size: var(--saue-font-size-body);
	font-weight: var(--saue-font-weight-label);
	color: var(--saue-text);
}

.saue-field--custom-price .saue-custom-price__input {
	flex: 1 1 auto;
	min-width: 0;
}

.saue-field--custom-price .saue-field__control {
	max-width: 12rem;
}

.saue-field--checkbox-group {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	margin: 0;
	padding: 0;
	border: 0;
}

.saue-field--checkbox-group .saue-field__option-row,
.saue-field--radio .saue-field__option-row {
	align-items: center;
	padding: 0.625rem 0.75rem;
	border-radius: var(--saue-radius-sm);
	background: var(--saue-surface-elevated);
}

.saue-field__description {
	margin: 0;
	font-size: var(--saue-font-size-caption);
	line-height: var(--saue-line-height-body);
	color: var(--saue-text-muted);
}

.saue-field__required {
	color: var(--saue-danger);
	font-weight: 700;
}

.saue-addon-group__required-note {
	margin: 0.35rem 0 0;
	font-size: var(--saue-font-size-caption);
	line-height: var(--saue-line-height-body);
	color: var(--saue-text-muted);
}

.saue-field--required .saue-field__label,
.saue-field--required .saue-field__label-text {
	padding-inline-end: 0.125rem;
}

.saue-field--date {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

.saue-field--date .saue-field__control {
	display: block;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0.625rem 0.75rem !important;
	border: 1px solid var(--saue-border) !important;
	border-radius: var(--saue-radius-sm) !important;
	background: var(--saue-surface-elevated) !important;
	color: var(--saue-text) !important;
	font: inherit !important;
	font-size: var(--saue-font-size-body) !important;
	line-height: var(--saue-line-height-body) !important;
	box-shadow: none !important;
	outline: none !important;
	transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.saue-field--date .saue-field__control:focus {
	border-color: var(--saue-accent) !important;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--saue-accent) 15%, transparent) !important;
}

.saue-field__error {
	margin: 0.35rem 0 0;
	font-size: var(--saue-font-size-label);
	line-height: var(--saue-line-height-body);
	color: var(--saue-danger);
}

.saue-field--error .saue-field__control,
.saue-field--error textarea,
.saue-field--error select {
	border-color: #fca5a5 !important;
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12) !important;
}

.saue-field--error .saue-field__option-row {
	border-color: #fca5a5;
	background: #fef2f2;
}

.saue-addon-wrapper .saue-field__control {
	display: block;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	height: var(--saue-control-height) !important;
	min-height: var(--saue-control-height) !important;
	margin: 0 !important;
	padding: 0 0.75rem !important;
	border: 1px solid var(--saue-border) !important;
	border-radius: var(--saue-radius-sm) !important;
	background: var(--saue-surface-elevated) !important;
	color: var(--saue-text) !important;
	font: inherit !important;
	font-size: var(--saue-font-size-label) !important;
	line-height: var(--saue-line-height-tight) !important;
	box-shadow: none !important;
	outline: none !important;
	-webkit-appearance: none;
	   -moz-appearance: none;
	        appearance: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.saue-addon-wrapper select.saue-field__control {
	padding-right: 2.25rem !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27none%27 viewBox=%270 0 24 24%27 stroke=%27%2364748B%27 stroke-width=%272%27%3E%3Cpath stroke-linecap=%27round%27 stroke-linejoin=%27round%27 d=%27m19.5 8.25-7.5 7.5-7.5-7.5%27/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 0.75rem center !important;
	background-size: 0.875rem !important;
	cursor: pointer;
}

.saue-addon-wrapper .saue-field__control:hover {
	border-color: var(--saue-border-strong) !important;
}

.saue-addon-wrapper .saue-field__control:focus {
	border-color: var(--saue-accent) !important;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--saue-accent) 14%, transparent) !important;
}

.saue-addon-wrapper textarea.saue-field__control,
.saue-field--textarea .saue-field__control {
	display: block;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	height: auto !important;
	min-height: var(--saue-textarea-min-height) !important;
	margin: 0 !important;
	padding: 0.625rem 0.875rem !important;
	border: 1px solid var(--saue-border) !important;
	border-radius: var(--saue-radius-sm) !important;
	background: var(--saue-surface-elevated) !important;
	color: var(--saue-text) !important;
	font: inherit !important;
	font-size: var(--saue-font-size-body) !important;
	line-height: var(--saue-line-height-body) !important;
	box-shadow: none !important;
	outline: none !important;
	resize: vertical;
	transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.saue-addon-wrapper textarea.saue-field__control:focus,
.saue-field--textarea .saue-field__control:focus {
	border-color: var(--saue-accent) !important;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--saue-accent) 15%, transparent) !important;
}

/* ── File upload ── */
.saue-field--file {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

.saue-file-upload__dropzone {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.25rem;
	min-height: 6.5rem;
	padding: 1rem;
	border: 1.5px dashed var(--saue-border-strong);
	border-radius: var(--saue-radius-sm);
	background: var(--saue-surface);
	text-align: center;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.saue-file-upload__dropzone:hover,
.saue-file-upload__dropzone:focus-within {
	border-color: var(--saue-accent);
	background: var(--saue-accent-soft);
}

.saue-file-upload__dropzone.is-uploading {
	opacity: 0.7;
	pointer-events: none;
}

.saue-file-upload__input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.saue-file-upload__label {
	font-size: var(--saue-font-size-label);
	font-weight: var(--saue-font-weight-label);
	color: var(--saue-text);
	pointer-events: none;
}

.saue-file-upload__hint {
	margin: 0;
	font-size: var(--saue-font-size-caption);
	color: var(--saue-text-muted);
	pointer-events: none;
}

.saue-file-upload__preview {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.625rem 0.75rem;
	border: 1px solid var(--saue-border);
	border-radius: var(--saue-radius-sm);
	background: var(--saue-surface-elevated);
}

.saue-file-upload__thumb {
	flex-shrink: 0;
	width: 2.5rem;
	height: 2.5rem;
	border: 1px solid var(--saue-border);
	border-radius: 0.375rem;
	object-fit: cover;
}

.saue-file-upload__icon {
	position: relative;
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 0.375rem;
	background: color-mix(in srgb, var(--saue-file-icon-color, #64748b) 12%, transparent);
	color: var(--saue-file-icon-color, #64748b);
}

.saue-file-upload__icon svg {
	width: 1.25rem;
	height: 1.25rem;
}

.saue-file-upload__icon-label {
	position: absolute;
	bottom: -0.25rem;
	left: 50%;
	transform: translateX(-50%);
	padding: 0 0.25rem;
	border-radius: 0.1875rem;
	background: var(--saue-file-icon-color, #64748b);
	font-size: 0.5625rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.02em;
	color: #fff;
	white-space: nowrap;
}

.saue-file-upload__filename {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: var(--saue-font-size-label);
	color: var(--saue-text);
}

.saue-file-upload__remove {
	flex-shrink: 0;
	padding: 0.25rem 0.625rem;
	border: 1px solid var(--saue-border);
	border-radius: 0.375rem;
	background: var(--saue-surface-elevated);
	font-size: var(--saue-font-size-caption);
	font-weight: var(--saue-font-weight-label);
	color: var(--saue-text-muted);
	cursor: pointer;
}

.saue-file-upload__remove:hover {
	border-color: #fca5a5;
	color: var(--saue-danger);
}

.saue-field--error .saue-file-upload__dropzone,
.saue-field--error .saue-file-upload__preview {
	border-color: #fca5a5 !important;
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12) !important;
}

/* ── Price summary ── */
.saue-price-summary {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin-top: 0.125rem;
	padding: 0.75rem 0.875rem;
	border: 1px solid var(--saue-border);
	border-radius: var(--saue-radius-md);
	background: var(--saue-surface);
	box-shadow: none;

	/* PriceSummary.jsx renders __addons/__total as sibling <span>s with no
	 * separator — without this, they default to inline and run together
	 * as "Add-ons: $XTotal: $Y" above the mobile breakpoint below. */
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.25rem 1rem;
}

.saue-price-summary__addons {
	font-size: var(--saue-font-size-body);
	color: var(--saue-text-muted);
}

.saue-price-summary__total {
	font-size: var(--saue-font-size-title);
	font-weight: 700;
	color: var(--saue-text);
}

.saue-price-summary__title {
	margin: 0 0 0.75rem;
	font-size: var(--saue-font-size-eyebrow);
	font-weight: 700;
	letter-spacing: var(--saue-letter-spacing-eyebrow);
	text-transform: uppercase;
	color: var(--saue-text-muted);
}

.saue-price-summary__loading {
	font-size: var(--saue-font-size-body);
	color: var(--saue-text-muted);
}

.saue-price-summary__breakdown {
	margin: 0 0 0.75rem;
	padding: 0;
	list-style: none;
	border-bottom: 1px solid var(--saue-border);
}

.saue-price-summary__breakdown li {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 1rem;
	padding: 0.375rem 0;
	font-size: var(--saue-font-size-body);
	color: var(--saue-text-muted);
}

.saue-price-summary__amount {
	font-weight: var(--saue-font-weight-label);
	color: var(--saue-text);
	white-space: nowrap;
}

.saue-price-summary__totals {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

.saue-price-summary__row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	font-size: var(--saue-font-size-body);
	color: var(--saue-text-muted);
}

.saue-price-summary__row--total {
	padding-top: 0.375rem;
	border-top: 1px solid var(--saue-border);
	font-size: var(--saue-font-size-title);
	font-weight: 700;
	color: var(--saue-text);
}

/*
 * Mobile: pin the live total to the viewport bottom while the add-on
 * list is taller than the screen. Sticky (not fixed) keeps it in flow —
 * short forms never jump, and it releases into place above Add to Cart.
 * Themes with a bottom banner can raise it via --saue-sticky-offset-bottom
 * (unset = 0). 767px matches the plugin admin tablet split (min-width: 768px).
 */
@media (max-width: 767px) {
	.saue-price-summary {
		position: sticky;
		bottom: var(--saue-sticky-offset-bottom, 0px);
		z-index: 20;
		flex-shrink: 0;
		padding: 0.625rem 0.875rem;
		box-shadow: 0 -8px 20px -12px rgba(15, 23, 42, 0.18);
	}
}

/* Cart, checkout, and order summaries — per-field add-on rows. */
.woocommerce-cart-form dl.variation,
.woocommerce-checkout-review-order-table dl.variation,
.woocommerce-table--order-details dl.variation {
	margin: 0.375rem 0 0;
	font-size: 0.8125rem;
	line-height: 1.45;
	color: #475569;
}

.woocommerce-cart-form dl.variation dt,
.woocommerce-checkout-review-order-table dl.variation dt,
.woocommerce-table--order-details dl.variation dt {
	font-weight: 600;
	color: #334155;
}

.woocommerce-cart-form dl.variation dd,
.woocommerce-checkout-review-order-table dl.variation dd,
.woocommerce-table--order-details dl.variation dd {
	margin: 0 0 0.25rem;
}

.wc-block-cart .wc-block-components-product-details,
.wc-block-checkout .wc-block-components-product-details,
.wc-block-components-order-summary-item .wc-block-components-product-details {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	margin-top: 0.375rem;
	font-size: 0.8125rem;
	line-height: 1.45;
	color: #475569;
}

.wc-block-cart .wc-block-components-product-details > span,
.wc-block-checkout .wc-block-components-product-details > span,
.wc-block-components-order-summary-item .wc-block-components-product-details > span {
	display: block;
}

.wc-block-cart .wc-block-components-product-details span[aria-hidden='true'],
.wc-block-checkout .wc-block-components-product-details span[aria-hidden='true'],
.wc-block-components-order-summary-item .wc-block-components-product-details span[aria-hidden='true'] {
	display: none !important;
}

.wc-block-components-product-details__name {
	font-weight: 600;
	color: #334155;
}

.wc-block-components-product-details__add-ons-subtotal .wc-block-components-product-details__name,
.wc-block-components-product-details__add-ons-subtotal .wc-block-components-product-details__value {
	font-weight: 700;
	color: #0f172a;
}

/* Mini-cart drawer — compact stacked add-on rows (WC truncates long single values). */
.wc-block-mini-cart .wc-block-components-product-details {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	margin-top: 0.375rem;
	padding-top: 0.375rem;
	border-top: 1px solid #e2e8f0;
	font-size: 0.75rem;
	line-height: 1.4;
	color: #64748b;
}

.wc-block-mini-cart .wc-block-components-product-details > span {
	display: block;
}

.wc-block-mini-cart .wc-block-components-product-details span[aria-hidden='true'] {
	display: none !important;
}

.wc-block-mini-cart .wc-block-components-product-details__name {
	font-weight: 600;
	color: #475569;
}

.wc-block-mini-cart .wc-block-components-product-details__add-ons-subtotal {
	margin-top: 0.125rem;
	padding-top: 0.25rem;
	border-top: 1px dashed #e2e8f0;
}

.wc-block-mini-cart .wc-block-components-product-details__add-ons-subtotal .wc-block-components-product-details__name,
.wc-block-mini-cart .wc-block-components-product-details__add-ons-subtotal .wc-block-components-product-details__value {
	font-weight: 700;
	color: #0f172a;
}

/*
 * Keep the add-on UI on its own full-width row, above the theme's
 * quantity/add-to-cart controls, when a theme lays out `form.cart` as flex.
 * Spacing below the add-on block is owned entirely by `.saue-addon-root`'s
 * bottom margin — we never add margins to the theme's quantity box or button,
 * so they always stay vertically aligned with each other on the same row.
 */
.woocommerce div.product form.cart .saue-addon-root {
	order: -1;
	flex: 0 0 100%;
	width: 100%;
}

.wp-block-woocommerce-add-to-cart-with-options form.cart,
.wc-block-add-to-cart-form form.cart {
	display: flex;
	flex-direction: column;
}

.wp-block-woocommerce-add-to-cart-with-options form.cart .saue-addon-root,
.wc-block-add-to-cart-form form.cart .saue-addon-root {
	order: -1;
	width: 100%;
}

/* Image selection swatches */
.saue-field--image-select {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	margin: 0;
	padding: 0;
	border: 0;
}

.saue-image-select__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
	gap: 0.75rem;
	margin-top: 0.5rem;
}

.saue-image-select__option {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	margin: 0;
	cursor: pointer;
}

.saue-image-select__input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	pointer-events: none;
}

.saue-image-select__visual {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	border: 2px solid var(--saue-border);
	border-radius: var(--saue-radius-md);
	background: var(--saue-surface-elevated);
	overflow: hidden;
	position: relative;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.saue-image-select__visual img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.saue-image-select__color {
	display: block;
	position: absolute;
	inset: 0;
}

.saue-image-select__placeholder {
	padding: 0.5rem;
	font-size: var(--saue-font-size-caption);
	font-weight: var(--saue-font-weight-label);
	text-align: center;
	color: var(--saue-text-muted);
}

.saue-image-select__option.is-selected .saue-image-select__visual,
.saue-image-select__option:focus-within .saue-image-select__visual {
	border-color: var(--saue-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--saue-accent) 15%, transparent);
}

.saue-image-select__meta {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.125rem;
	text-align: center;
}

.saue-image-select__label {
	font-size: var(--saue-font-size-label);
	font-weight: 500;
	color: var(--saue-text);
	line-height: var(--saue-line-height-tight);
}

.saue-image-select__meta .saue-option-price {
	font-size: var(--saue-font-size-caption);
}

