/* ==========================================================================
   Gift card purchase form
   ========================================================================== */

.wgc-gift-card-purchase {
	--wgc-border: rgba( 20, 30, 50, 0.16 );
	--wgc-radius: 10px;
	--wgc-hint: rgba( 20, 30, 50, 0.62 );
}

/* Class rules below would otherwise override the HTML hidden attribute
   (this is what made the custom-amount and delivery fields always show). */
.wgc-gift-card-purchase [hidden],
.wgc-gift-card-form [hidden] {
	display: none !important;
}

/* --------------------------------------------------------------------------
   Layout: two columns only when the preview could NOT be relocated into the
   theme's product-image column (JS moves it there and hides the gallery).
   -------------------------------------------------------------------------- */

.wgc-gift-card-purchase--with-preview {
	display: grid;
	grid-template-columns: minmax( 0, 1fr );
	gap: 28px;
}

@media ( min-width: 900px ) {
	.wgc-gift-card-purchase--with-preview:not( .wgc-preview-relocated ) {
		grid-template-columns: minmax( 0, 7fr ) minmax( 0, 5fr );
	}

	.wgc-gift-card-purchase--with-preview:not( .wgc-preview-relocated ) .wgc-preview {
		order: -1;
	}
}

.wgc-preview {
	width: 100%;
	position: sticky;
	top: 32px;
	align-self: start;
}

.wgc-preview__stage {
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 12px 32px rgba( 10, 20, 40, 0.22 );
	margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Notices
   -------------------------------------------------------------------------- */

.wgc-gift-card-purchase .wgc-usage-notice {
	padding: 12px 16px;
	border-radius: var( --wgc-radius );
	background: rgba( 20, 30, 50, 0.05 );
	border: 1px solid var( --wgc-border );
	font-size: 0.9em;
	line-height: 1.5;
	margin: 0 0 22px;
}

.wgc-gift-card-purchase .wgc-usage-notice p {
	margin: 0;
}

.wgc-gift-card-purchase .wgc-usage-notice a {
	color: inherit;
}

/* --------------------------------------------------------------------------
   Fields
   -------------------------------------------------------------------------- */

.wgc-gift-card-form .wgc-field {
	margin: 0 0 20px;
	display: block;
}

.wgc-gift-card-form .wgc-field > label,
.wgc-gift-card-form legend {
	display: block;
	font-weight: 600;
	font-size: 0.85em;
	letter-spacing: 0.02em;
	margin-bottom: 8px;
}

.wgc-gift-card-form .wgc-field input[type="text"],
.wgc-gift-card-form .wgc-field input[type="email"],
.wgc-gift-card-form .wgc-field input[type="date"],
.wgc-gift-card-form .wgc-field input[type="time"],
.wgc-gift-card-form .wgc-field input[type="number"],
.wgc-gift-card-form .wgc-field textarea {
	width: 100%;
	max-width: 30rem;
	padding: 11px 14px;
	border: 1px solid var( --wgc-border );
	border-radius: var( --wgc-radius );
	background: #ffffff;
	color: inherit;
	font: inherit;
	line-height: 1.4;
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wgc-gift-card-form .wgc-field input:focus,
.wgc-gift-card-form .wgc-field textarea:focus {
	outline: none;
	border-color: currentColor;
	box-shadow: 0 0 0 3px rgba( 20, 30, 50, 0.1 );
}

.wgc-gift-card-form .wgc-field-hint {
	display: block;
	font-size: 0.8em;
	color: var( --wgc-hint );
	margin-top: 6px;
}

/* --------------------------------------------------------------------------
   Amount pills — compact, inline
   -------------------------------------------------------------------------- */

.wgc-gift-card-form .wgc-amounts {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	border: 0;
	padding: 0;
	margin: 0 0 18px;
}

.wgc-gift-card-form .wgc-amounts legend {
	width: 100%;
	margin-bottom: 4px;
	float: left;
}

.wgc-gift-card-form .wgc-amount-option {
	margin: 0;
	cursor: pointer;
}

.wgc-gift-card-form .wgc-amount-option input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

/* Direct child only — a bare `span` selector would also style WooCommerce's
   nested price markup, giving the number and the currency symbol their own
   pills inside the pill. */
.wgc-gift-card-form .wgc-amount-option > span {
	display: inline-block;
	padding: 8px 16px;
	border: 1.5px solid var( --wgc-border );
	border-radius: 999px;
	line-height: 1.2;
	font-size: 0.95em;
	background: #ffffff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

/* Belt and braces: neutralise any theme chrome on price markup we render. */
.wgc-gift-card-form .wgc-amount-option > span * {
	border: 0;
	background: none;
	padding: 0;
	margin: 0;
	border-radius: 0;
	box-shadow: none;
	font-size: inherit;
	color: inherit;
}

.wgc-gift-card-form .wgc-amount-option input:checked + span {
	border-color: currentColor;
	box-shadow: inset 0 0 0 1.5px currentColor;
	font-weight: 700;
}

.wgc-gift-card-form .wgc-amount-option input:focus-visible + span {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.wgc-gift-card-form .wgc-custom-amount {
	margin-top: -6px;
}

.wgc-gift-card-form .wgc-custom-amount input {
	max-width: 13rem;
}

/* --------------------------------------------------------------------------
   Design picker — compact row of thumbnails
   -------------------------------------------------------------------------- */

.wgc-gift-card-form .wgc-designs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	border: 0;
	padding: 0;
	margin: 0 0 20px;
}

.wgc-gift-card-form .wgc-designs legend {
	width: 100%;
	margin-bottom: 4px;
	float: left;
}

.wgc-design-option {
	margin: 0;
	cursor: pointer;
	text-align: center;
}

.wgc-design-option input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.wgc-design-option .wgc-card-thumb {
	border: 2px solid transparent;
	border-radius: 10px;
	transition: border-color 0.15s ease, transform 0.15s ease;
}

.wgc-design-option:hover .wgc-card-thumb {
	transform: translateY( -1px );
}

.wgc-design-option input:checked ~ .wgc-card-thumb,
.wgc-design-option input:checked + .wgc-card-thumb {
	border-color: currentColor;
}

.wgc-design-option input:focus-visible ~ .wgc-card-thumb {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.wgc-design-option__title {
	display: block;
	font-size: 0.72em;
	margin-top: 5px;
	max-width: 110px;
	color: var( --wgc-hint );
}

/* --------------------------------------------------------------------------
   Delivery
   -------------------------------------------------------------------------- */

.wgc-gift-card-form .wgc-delivery {
	border: 0;
	padding: 0;
	margin: 0 0 20px;
}

.wgc-gift-card-form .wgc-delivery__option {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 400;
	font-size: 0.95em;
	margin-bottom: 6px;
	cursor: pointer;
}

.wgc-gift-card-form .wgc-delivery-datetime {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
	margin: 8px 0 0 26px;
}

.wgc-gift-card-form .wgc-delivery-datetime input {
	width: auto;
	max-width: none;
	padding: 9px 12px;
}

.wgc-gift-card-form .wgc-delivery-datetime .wgc-field-hint {
	width: 100%;
	margin-top: 2px;
}

/* --------------------------------------------------------------------------
   Message counter + purchase row
   -------------------------------------------------------------------------- */

.wgc-gift-card-form .wgc-message-counter {
	text-align: right;
	max-width: 30rem;
}

.wgc-gift-card-form .wgc-purchase-row {
	display: flex;
	align-items: stretch;
	gap: 10px;
	margin-top: 6px;
}

.wgc-gift-card-form .wgc-purchase-row .quantity input {
	padding: 10px;
	border: 1px solid var( --wgc-border );
	border-radius: var( --wgc-radius );
	width: 74px;
	text-align: center;
	font: inherit;
}

.wgc-gift-card-form .wgc-purchase-row .single_add_to_cart_button {
	border-radius: var( --wgc-radius );
	padding-left: 28px;
	padding-right: 28px;
}

/* --------------------------------------------------------------------------
   Order confirmation panel
   -------------------------------------------------------------------------- */

.wgc-order-cards {
	margin: 2em 0;
}

.wgc-order-cards code {
	font-size: 1.05em;
	letter-spacing: 0.04em;
}
