/**
 * The voucher's form on its product page.
 *
 * Neutral on purpose: colours, fonts and radii come from the page around it
 * (currentColor, inherit), and the custom properties below are the seam a
 * theme sets to make it its own.
 */

.dcw-gc-form {
	--dcw-gc-line: rgba( 0, 0, 0, 0.18 );
	--dcw-gc-line-strong: rgba( 0, 0, 0, 0.45 );
	--dcw-gc-soft: rgba( 0, 0, 0, 0.6 );
	--dcw-gc-surface: transparent;
	--dcw-gc-accent: currentColor;
	--dcw-gc-radius: 6px;
	--dcw-gc-gap: 16px;

	display: grid;
	gap: var( --dcw-gc-gap );
	margin-block: 0 var( --dcw-gc-gap );
}

.dcw-gc-field {
	display: grid;
	gap: 6px;
	min-inline-size: 0;
	position: relative;
}

.dcw-gc-field[hidden] {
	display: none;
}

.dcw-gc-label {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
}

.dcw-gc-optional {
	color: var( --dcw-gc-soft );
	font-weight: 400;
}

.dcw-gc-optional[hidden] {
	display: none;
}

.dcw-gc-select,
.dcw-gc-input {
	box-sizing: border-box;
	inline-size: 100%;
	min-block-size: 44px;
	padding: 10px 12px;
	border: 1px solid var( --dcw-gc-line-strong );
	border-radius: var( --dcw-gc-radius );
	background-color: var( --dcw-gc-surface );
	color: inherit;
	font: inherit;
	font-size: 16px;
	line-height: 1.35;
}

.dcw-gc-textarea {
	min-block-size: 84px;
	resize: vertical;
}

.dcw-gc-select:focus-visible,
.dcw-gc-input:focus-visible {
	outline: 2px solid var( --dcw-gc-accent );
	outline-offset: 1px;
}

.dcw-gc-count {
	justify-self: end;
	color: var( --dcw-gc-soft );
	font-size: 12px;
}

.dcw-gc-to {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	border: 0;
	min-inline-size: 0;
}

.dcw-gc-to legend {
	margin-block-end: 6px;
	padding: 0;
}

.dcw-gc-choice {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding: 12px 14px;
	border: 1px solid var( --dcw-gc-line );
	border-radius: var( --dcw-gc-radius );
	cursor: pointer;
}

.dcw-gc-choice:has( input:checked ) {
	border-color: var( --dcw-gc-line-strong );
	box-shadow: inset 0 0 0 1px var( --dcw-gc-line-strong );
}

.dcw-gc-choice input {
	flex: 0 0 auto;
	margin: 3px 0 0;
}

.dcw-gc-choice__text {
	display: grid;
	gap: 2px;
}

.dcw-gc-choice__title {
	font-weight: 600;
}

.dcw-gc-choice__hint {
	color: var( --dcw-gc-soft );
	font-size: 13px;
	line-height: 1.4;
}

/* The looks: one dot per colour, the chosen one ringed; its name is in the
   legend, so the labels are for screen readers only. */
.dcw-gc-designs {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	border: 0;
	min-inline-size: 0;
}

.dcw-gc-designs legend {
	margin-block-end: 6px;
	padding: 0;
}

.dcw-gc-design-name {
	font-weight: 400;
}

.dcw-gc-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	padding: 4px;
}

.dcw-gc-swatch {
	position: relative;
	display: inline-flex;
	border-radius: 50%;
	cursor: pointer;
}

.dcw-gc-swatch input {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.dcw-gc-swatch__dot {
	inline-size: 30px;
	block-size: 30px;
	border-radius: 50%;
	background: var( --dcw-gc-swatch );
}

.dcw-gc-swatch__label {
	position: absolute;
	inline-size: 1px;
	block-size: 1px;
	overflow: hidden;
	clip-path: inset( 50% );
	white-space: nowrap;
}

.dcw-gc-swatch:has( input:checked ) .dcw-gc-swatch__dot {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px var( --dcw-gc-accent );
}

.dcw-gc-swatch:has( input:focus-visible ) .dcw-gc-swatch__dot {
	outline: 2px solid var( --dcw-gc-accent );
	outline-offset: 5px;
}

.dcw-gc-grid {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 200px, 1fr ) );
	gap: var( --dcw-gc-gap );
}

.dcw-gc-note {
	margin: 0;
	color: var( --dcw-gc-soft );
	font-size: 13px;
	line-height: 1.45;
}

.dcw-gc-closed {
	font-weight: 600;
}

.dcw-giftcard-icon {
	display: inline-block;
	vertical-align: -2px;
	margin-inline-end: 5px;
}
