/*
 * Simple Return — customer screens (withdrawal form, lookup, confirmation, data request).
 * Fonts, colours and buttons come from the theme; this only adds structure, spacing and states.
 * Neutral tones derive from the text colour, so the form fits light and dark themes alike.
 */

.simple-return {
	--sr-border: color-mix(in srgb, currentColor 22%, transparent);
	--sr-muted: color-mix(in srgb, currentColor 68%, transparent);
	--sr-soft: color-mix(in srgb, currentColor 4%, transparent);
	--sr-error: #c62828;
	--sr-success: #2e7d32;
	--sr-radius: 6px;
	max-width: 48rem;
}
.simple-return *,
.simple-return *::before,
.simple-return *::after { box-sizing: border-box; }

.simple-return .sr-title { margin-bottom: .25em; }
.simple-return .sr-order-ref,
.simple-return .sr-lead { margin-top: 0; color: var(--sr-muted); }
.simple-return .sr-help { display: block; margin: .3em 0 0; font-size: .875em; color: var(--sr-muted); }
.simple-return .sr-req { color: var(--sr-error); }

/* ---- Sections ---- */
.simple-return .sr-section {
	margin: 0 0 1.5em;
	padding: 1.1em 1.25em 1.25em;
	border: 1px solid var(--sr-border);
	border-radius: var(--sr-radius);
	min-width: 0;
}
.simple-return fieldset.sr-section > legend {
	padding: 0 .4em;
	margin-left: -.4em;
	font-weight: 600;
}
.simple-return .sr-section > :first-child:not(legend) { margin-top: 0; }
.simple-return .sr-section > :last-child { margin-bottom: 0; }

/* ---- Fields: rows split the width equally and stack on narrow screens ---- */
.sr-form-row {
	display: flex;
	flex-wrap: wrap;
	gap: 1em;
	margin-bottom: 1em;
}
.sr-form-row:last-child { margin-bottom: 0; }
.sr-form-row > .sr-form-col { flex: 1 1 0; min-width: 0; }
.sr-form-col > label,
.sr-form-col legend { display: block; }
.sr-form-col fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.sr-form-col fieldset > legend { margin-bottom: .35em; padding: 0; }
.sr-form-col fieldset label { display: block; font-weight: normal; padding: .15em 0; }

.simple-return input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.simple-return textarea,
.simple-return select {
	display: block;
	width: 100%;
	margin-top: .35em;
	padding: .6em .75em;
	font: inherit;
	line-height: 1.4;
	color: inherit;
	background-color: transparent;
	border: 1px solid var(--sr-border);
	border-radius: var(--sr-radius);
}
.simple-return select { background-color: var(--sr-soft); }
/* WooCommerce block themes shrink selects on shop pages; keep them in line with the inputs. */
.simple-return form select { font-size: inherit; }
.simple-return select option { color: #1e1e1e; background: #fff; }
.simple-return textarea { min-height: 6em; resize: vertical; }
.simple-return input:focus-visible,
.simple-return textarea:focus-visible,
.simple-return select:focus-visible {
	outline: 2px solid color-mix(in srgb, currentColor 55%, transparent);
	outline-offset: 1px;
	border-color: currentColor;
}
.simple-return input[type="checkbox"],
.simple-return input[type="radio"] { width: 1.1em; height: 1.1em; margin: 0 .45em 0 0; vertical-align: -.15em; accent-color: currentColor; }

/* ---- Errors and notices ---- */
.sr-field-error input:not([type="checkbox"]):not([type="radio"]),
.sr-field-error select,
.sr-field-error textarea { border-color: var(--sr-error) !important; }
.simple-return .sr-error { display: block; margin-top: .35em; font-size: .9em; color: var(--sr-error); }
.simple-return .sr-items.sr-field-error { border-color: var(--sr-error); }
.simple-return .sr-alert {
	margin: 0 0 1.25em;
	padding: .8em 1em;
	border: 1px solid var(--sr-border);
	border-left-width: 4px;
	border-radius: var(--sr-radius);
	background: var(--sr-soft);
}
.simple-return .sr-alert--error { border-color: var(--sr-error); color: var(--sr-error); }

/* ---- Items ---- */
.sr-item-list { margin: .75em 0 0; padding: 0; list-style: none; }
.sr-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
	padding: .7em 0;
	border-top: 1px solid var(--sr-border);
}
.sr-item:first-child { border-top: 0; padding-top: .2em; }
.sr-item-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.sr-item-qty { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .5em; white-space: nowrap; }
.sr-item-of { color: var(--sr-muted); }
.simple-return .sr-item-qty input[type="number"] { width: 5em; margin-top: 0; text-align: center; }

/* ---- Address: street, then postcode + city side by side, then country ---- */
.sr-address > legend { font-weight: 600; }
.sr-address .sr-sublabel { font-size: .9em; color: var(--sr-muted); }
.sr-address > label,
.sr-address-town { margin-bottom: .6em; }
.sr-address-town { display: flex; gap: .75em; }
.sr-address-town .sr-address-postcode { flex: 0 0 9em; }
.sr-address-town .sr-address-city { flex: 1 1 0; min-width: 0; }

/* ---- Actions ---- */
.simple-return .sr-actions { display: flex; flex-wrap: wrap; gap: .75em; align-items: center; margin: 1.5em 0 0; }
.simple-return .sr-button { cursor: pointer; }

/* ---- Confirmation ---- */
.sr-success { display: flex; align-items: center; gap: .75em; margin-bottom: 1em; }
.sr-success .sr-title { margin: 0; }
.sr-success-icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2em;
	height: 2em;
	border-radius: 50%;
	background: var(--sr-success);
	color: #fff;
	font-weight: 700;
}
.sr-summary {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(11em, 1fr));
	gap: .75em 1.5em;
	margin: 0 0 1.5em;
	padding: 1em 1.25em;
	border: 1px solid var(--sr-border);
	border-radius: var(--sr-radius);
}
.sr-summary dt { font-size: .8em; text-transform: uppercase; letter-spacing: .04em; color: var(--sr-muted); }
.sr-summary dd { margin: .15em 0 0; font-weight: 600; }
.simple-return .sr-statement {
	margin: 0 0 1.5em;
	padding: .9em 1.1em;
	border-left: 4px solid currentColor;
	background: var(--sr-soft);
	border-radius: 0 var(--sr-radius) var(--sr-radius) 0;
	font-style: normal;
}
.simple-return .sr-address-block { margin: 0 0 .5em; }

/* ---- Account list ---- */
.simple-return .sr-subtitle { margin-top: 2em; }
.simple-return .sr-label-link { display: inline-block; white-space: nowrap; }
.simple-return .simple-return-returns td:first-child { white-space: nowrap; }
.simple-return .sr-status { display: inline-block; padding: .1em .6em; border-radius: 999px; font-size: .85em; background: var(--sr-soft); border: 1px solid var(--sr-border); white-space: nowrap; }
.simple-return .sr-status--refunded { border-color: var(--sr-success); color: var(--sr-success); }
.simple-return .sr-status--rejected,
.simple-return .sr-status--cancelled { color: var(--sr-muted); }
.simple-return .simple-return-orders .sr-cell-action { text-align: right; }

@media (max-width: 600px) {
	.sr-form-row > .sr-form-col { flex-basis: 100%; }
	.simple-return .sr-section { padding: .9em 1em 1em; }
	.sr-address-town { flex-wrap: wrap; }
	.sr-address-town .sr-address-postcode,
	.sr-address-town .sr-address-city { flex-basis: 100%; }
	.simple-return .sr-actions .sr-button { width: 100%; }
	.simple-return .simple-return-orders .sr-cell-action { text-align: left; }
	/* WooCommerce's responsive tables print "<title>:" before every cell; the action cell has none. */
	.simple-return .shop_table_responsive td.sr-cell-action::before { display: none; }
	.simple-return .shop_table_responsive td.sr-cell-action:not(:has(a)) { display: none; }
}
