/**
 * Phänomen — gift card amount picker (plugin subsidia-addon-giftcards, which
 * ships no CSS) in the product page's variation look, Figma 2166:937:
 *   BETRAG        Kicker / Accent like GRÖSSE, 12px above the options
 *   amounts       size chips: padding 12/18, 1px Text, Kicker; selected =
 *                 filled Text; hover Accent BG; focus = global outline
 *   custom amount global form field, 240px, „CHF" prefix, Body Small error
 *                 in Fehler (not designed)
 * The real radio inputs stay (transparent, over their chip): native radio
 * group semantics and arrow keys. Loaded on gift card product pages only
 * (includes/giftcard.php); tokens from variation-ui.css.
 */

/* Picker on its own line above the buy row (the form is a wrapping flex row);
   8 + the form's 12px row gap = the 20px rhythm of the info column. */
form.cart .sagc-fields {
	flex: 1 0 100%;
	display: flex;
	flex-direction: column;
	gap: 20px;
	margin: 0 0 8px;
}

.sagc-fields .sagc-amount {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.sagc-fields .sagc-amount__legend {
	display: block;
	float: none;
	width: auto;
	margin: 0 0 12px;
	padding: 0;
	color: var(--pvu-accent);
	font-size: var(--pvu-kicker-size);
	font-weight: var(--pvu-kicker-weight);
	line-height: var(--pvu-kicker-lh);
	letter-spacing: var(--pvu-kicker-ls);
	text-transform: var(--pvu-kicker-tt);
}

/* --------------------------------------------------------------------------
 * Amount chips
 * ----------------------------------------------------------------------- */

.sagc-fields .sagc-amount__options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
}

.sagc-fields .sagc-amount__option {
	position: relative;
	display: inline-flex;
	margin: 0;
	padding: 0;
	cursor: pointer;
}

.sagc-fields .sagc-amount__option input[type="radio"] {
	position: absolute;
	inset: 0;
	z-index: 1;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.sagc-fields .sagc-amount__label {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 44px;
	min-height: 44px;
	padding: 12px 18px;
	border: 1px solid var(--pvu-ink);
	background: var(--pvu-surface);
	color: var(--pvu-ink);
	font-size: var(--pvu-kicker-size);
	font-weight: var(--pvu-kicker-weight);
	line-height: var(--pvu-kicker-lh);
	letter-spacing: var(--pvu-kicker-ls);
	text-transform: var(--pvu-kicker-tt);
	white-space: nowrap;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

/* wc_price() inside the chip: no faux-bold amount. */
.sagc-fields .sagc-amount__label .woocommerce-Price-amount,
.sagc-fields .sagc-amount__label .woocommerce-Price-currencySymbol,
.sagc-fields .sagc-amount__label bdi {
	font: inherit;
	letter-spacing: inherit;
	color: inherit;
}

/* Hover: not designed — Accent BG fill (like the size chips). */
.sagc-fields .sagc-amount__option:hover input:not(:checked) + .sagc-amount__label {
	background: var(--pvu-accent-bg);
}

.sagc-fields .sagc-amount__option input:checked + .sagc-amount__label {
	border-color: var(--pvu-ink);
	background: var(--pvu-ink);
	color: var(--pvu-on-dark);
}

/* The radio has the focus, the chip shows it (global focus outline). */
.sagc-fields .sagc-amount__option input:focus-visible + .sagc-amount__label {
	outline: 3px solid var(--bde-brand-primary-color);
	outline-offset: 5px;
}

/* --------------------------------------------------------------------------
 * Custom amount — shown for „Anderer Betrag" once giftcard.js runs (without
 * the script it simply stays visible, as the plugin renders it).
 * ----------------------------------------------------------------------- */

/* `form.cart` prefix: above WooCommerce's `.woocommerce form .form-row`
   margin / padding (0,2,1). */
form.cart .sagc-fields .sagc-amount__custom {
	display: grid;
	grid-template-areas:
		"label"
		"field"
		"error";
	justify-items: start;
	row-gap: 8px;
	margin: 20px 0 0;
	padding: 0;
}

form.cart .sagc-fields .sagc-amount.pvu-gc .sagc-amount__custom {
	display: none;
}

form.cart .sagc-fields .sagc-amount.pvu-gc.is-custom .sagc-amount__custom {
	display: grid;
}

.sagc-fields .sagc-amount__custom label {
	grid-area: label;
	margin: 0;
}

.sagc-fields .sagc-amount__custom input {
	grid-area: field;
	box-sizing: border-box;
	width: 240px;
	max-width: 100%;
	margin: 0;
	padding-left: 56px;
}

/* „CHF" inside the field (decorative: the label says „in CHF"). */
.sagc-fields .sagc-amount__custom::after {
	content: "CHF";
	content: "CHF" / "";
	grid-area: field;
	align-self: center;
	justify-self: start;
	padding-left: 16px;
	color: var(--pvu-accent);
	font-size: var(--preset-id-781ac304-ba25-4354-9a36-e0647f74e153-font-size); /* Body */
	line-height: 1;
	pointer-events: none;
}

.sagc-fields .sagc-amount__custom input[aria-invalid="true"] {
	border-color: var(--pvu-error);
}

/* Inline validation (giftcard.js) — not designed: Body Small in Fehler. */
.sagc-fields .sagc-amount__error {
	grid-area: error;
	margin: 0;
	color: var(--pvu-error);
	font-size: var(--pvu-small-size);
	line-height: var(--pvu-small-lh);
}

.sagc-fields .sagc-amount__error--group {
	margin: 12px 0 0;
}

.sagc-fields .sagc-amount__error[hidden] {
	display: none;
}

/* Note under the picker — not designed: Body Small. */
.sagc-fields .sagc-fields__note {
	margin: 0;
	font-size: var(--pvu-small-size);
	line-height: var(--pvu-small-lh);
}

.sagc-fields .sagc-fields__note a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
 * Price — „ab CHF 20" / the chosen amount: the product price's own H3 look,
 * no faux-bold amount (Breakdance's Woo default is the heavy weight).
 * ----------------------------------------------------------------------- */

/* (0,5,1): above Breakdance's `.breakdance-woocommerce .product .price
   .woocommerce-Price-amount bdi` (0,4,1, heavy weight, 24px — and its sheet
   loads after this one). */
.bde-wooproductprice.breakdance-woocommerce .price .woocommerce-Price-amount,
:root .bde-wooproductprice.breakdance-woocommerce .price .woocommerce-Price-currencySymbol,
:root .bde-wooproductprice.breakdance-woocommerce .price .woocommerce-Price-amount bdi {
	font: inherit;
	letter-spacing: inherit;
	color: inherit;
}
