/**
 * Pixelated Orange - Gift Cards
 * Front-end styling: single product page amount picker + recipient
 * fields, and the balance-check shortcode.
 */

.po-gc-fields {
	margin: 1.5em 0;
}

.po-gc-field-label {
	display: block;
	font-weight: var(--po-gc-field-label-weight, 600);
	color: var(--po-gc-field-label-colour, #000000);
	text-transform: var(--po-gc-field-label-transform, none);
	margin-bottom: 0.4em;
}

.po-gc-field {
	margin: 0 0 1em;
}

.po-gc-field input[type="text"],
.po-gc-field input[type="email"],
.po-gc-field input[type="number"],
.po-gc-field input[type="date"],
.po-gc-field select,
.po-gc-field textarea {
	width: 100%;
	max-width: 360px;
	box-sizing: border-box;
	padding: var(--po-gc-field-padding-v, 10px) var(--po-gc-field-padding-h, 12px);
	font-size: var(--po-gc-field-font-size, 15px);
	font-family: inherit;
	border-style: solid;
	border-width: var(--po-gc-field-border-width, 1px);
	border-color: var(--po-gc-field-border-colour, #cccccc);
	border-radius: var(--po-gc-field-border-radius, 4px);
	background: var(--po-gc-field-bg, #ffffff);
	color: var(--po-gc-field-text, #000000);
}

.po-gc-field textarea {
	max-width: 480px;
	resize: vertical;
}

.po-gc-expiry-note {
	font-size: 0.9em;
	color: #666;
}

.po-gc-preview-btn {
	background: none;
	border: 1px solid var(--po-gc-field-border-colour, #cccccc);
	border-radius: var(--po-gc-field-border-radius, 4px);
	padding: 0.4em 0.9em;
	font-size: 0.9em;
	cursor: pointer;
}

.po-gc-amounts {
	margin: 0 0 1em;
}

.po-gc-amounts__options {
	display: flex;
	flex-wrap: wrap;
	gap: var(--po-gc-amount-gap, 10px);
}

.po-gc-amount-option {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: var(--po-gc-amount-padding-v, 12px) var(--po-gc-amount-padding-h, 22px);
	font-size: var(--po-gc-amount-font-size, 15px);
	border-style: solid;
	border-width: var(--po-gc-amount-border-width, 1px);
	border-color: var(--po-gc-amount-border-colour, #cccccc);
	border-radius: var(--po-gc-amount-border-radius, 6px);
	background: var(--po-gc-amount-bg, #ffffff);
	color: var(--po-gc-amount-text, #000000);
	cursor: pointer;
}

.po-gc-amount-option:has(input:checked) {
	border-color: var(--po-gc-amount-border-selected, #e67e22);
	background: var(--po-gc-amount-bg-selected, #fdf1e6);
	color: var(--po-gc-amount-text-selected, #000000);
}

/* The label itself is the clickable "button" - the native radio dot adds
   nothing but visual clutter on top of that, so it's stripped out entirely
   rather than just re-skinned. -webkit-appearance is required alongside
   the unprefixed property since Safari/iOS ignores plain `appearance` on
   radio/checkbox inputs without it. */
.po-gc-amount-option input {
	-webkit-appearance: none;
	appearance: none;
	position: absolute;
	width: 0;
	height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	opacity: 0;
}

.po-gc-custom-amount-field input:disabled {
	background: #f4f4f4;
	color: #999;
}

/* ---- Balance check shortcode ---- */

/* Stacked, not side-by-side - both the email field and the submit button
   below it are meant to be full width, matching the code field above them,
   rather than splitting one row's width between them. */
.po-gc-balance-check__row {
	display: flex;
	flex-direction: column;
	width: 100%;
}

/* Overrides .po-gc-field's own max-width:360px cap (meant for a field
   sitting on its own) so the email input goes fully edge-to-edge, matching
   the code field above it. */
.po-gc-balance-check__row input {
	width: 100%;
	max-width: none;
	margin: 0;
}

/* The submit button picks up the same look as the amount-option buttons
   (single product page's amount picker - see .po-gc-amount-option above)
   rather than the browser's/theme's default .button styling, so the two
   front-end forms this plugin renders read as one consistent style. Spacing
   above it reuses the same --po-gc-amount-gap setting that spaces the
   amount options apart, rather than a separate hard-coded value, so the two
   forms' vertical rhythm stays in sync if that setting ever changes. */
.po-gc-balance-check__row button {
	width: 100%;
	margin: 0;
	margin-top: var(--po-gc-amount-gap, 10px);
	padding: var(--po-gc-amount-padding-v, 12px) var(--po-gc-amount-padding-h, 22px);
	font-size: var(--po-gc-amount-font-size, 15px);
	border-style: solid;
	border-width: var(--po-gc-amount-border-width, 1px);
	border-color: var(--po-gc-amount-border-colour, #cccccc);
	border-radius: var(--po-gc-amount-border-radius, 6px);
	background: var(--po-gc-amount-bg, #ffffff);
	color: var(--po-gc-amount-text, #000000);
	cursor: pointer;
}

.po-gc-balance-check__result {
	margin-top: 1em;
	padding: 0.8em 1em;
	border-radius: 6px;
	background: #f4f4f4;
}

.po-gc-balance-check__result--active {
	background: #eaf7ec;
}

.po-gc-balance-check__result--expired,
.po-gc-balance-check__result--depleted,
.po-gc-balance-check__result--cancelled,
.po-gc-balance-check__result--error {
	background: #fbeaea;
}

/* ---- Gift card template preview modal ----
   Bespoke to this plugin (not Core's shared popup - that component only
   renders plain title/message text, not an arbitrarily-styled card), but
   echoes the same visual language: dimmed centred backdrop, rounded panel,
   top-right close button. */

.po-gc-preview-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.6);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100000;
	padding: 20px;
	box-sizing: border-box;
}

.po-gc-preview-modal {
	position: relative;
	width: 100%;
	max-width: 420px;
	border-radius: 10px;
	padding: 32px 20px 20px;
	box-sizing: border-box;
}

.po-gc-preview-close {
	position: absolute;
	top: 8px;
	right: 12px;
	background: none;
	border: none;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: inherit;
}

.po-gc-preview-card {
	padding: 8px 8px 4px;
	text-align: center;
}

.po-gc-preview-card__image {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 0 auto 1.6em;
}

.po-gc-preview-card__heading {
	font-weight: 700;
	font-size: 1.15em;
	margin: 0 0 1.6em;
	line-height: 1.5;
}

.po-gc-preview-card__box {
	display: block;
	border: 2px solid #000000;
	border-radius: 22px;
	padding: 32px 20px;
	margin: 0 0 1.6em;
}

.po-gc-preview-card__amount {
	display: block;
	font-weight: 800;
	font-size: 1.9em;
	margin: 0 0 1em;
}

.po-gc-preview-card__code {
	display: block;
	font-weight: 700;
	font-size: 1.15em;
	letter-spacing: 1px;
}

.po-gc-preview-card__message {
	font-weight: 600;
	margin: 0 0 1.6em;
	line-height: 1.4;
}

.po-gc-preview-card__button {
	display: inline-block;
	background: #000000;
	color: #ffffff;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border-radius: 30px;
	padding: 0.8em 2em;
	margin: 0 0 0.5em;
}
