/**
 * MARO Refunds — Frontend CSS
 *
 * Design tokens follow Blocksy CSS variable convention.
 * All transitions/animations respect prefers-reduced-motion.
 *
 * @version 1.7.1
 */

/* ============================================================
   Screen reader only (WCAG)
   ============================================================ */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	white-space: nowrap;
	border: 0;
}

/* ============================================================
   Container
   ============================================================ */
.maro-refund-form {
	max-width: 700px;
	margin: 0 auto;
	font-size: 1rem;
	color: var( --theme-text-color, #1a1a1a );
}

/* ============================================================
   Steps
   ============================================================ */
.mrf-step-title {
	font-size: 1.5rem;
	font-weight: 700;
	margin-bottom: .5rem;
	line-height: 1.3;
}

.mrf-step-desc {
	color: var( --theme-text-color-light, #666 );
	margin-bottom: 1.5rem;
	line-height: 1.7;
}

.mrf-back {
	background: none;
	border: none;
	cursor: pointer;
	color: var( --theme-link-initial-color, #0073aa );
	font-size: .9rem;
	padding: 0;
	margin-bottom: 1rem;
	display: inline-block;
}

.mrf-back:hover {
	text-decoration: underline;
}

/* ============================================================
   Form elements
   ============================================================ */
.mrf-form {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.mrf-field {
	display: flex;
	flex-direction: column;
	gap: .375rem;
}

.mrf-label {
	font-weight: 600;
	font-size: .875rem;
	color: var( --theme-text-color, #1a1a1a );
}

.mrf-input,
.mrf-select,
.mrf-textarea {
	width: 100%;
	padding: .625rem .875rem;
	border: 1.5px solid var( --theme-border-color, #ddd );
	border-radius: 6px;
	font-size: 1rem;
	background: #fff;
	color: var( --theme-text-color, #1a1a1a );
	transition: border-color .15s ease;
	box-sizing: border-box;
}

.mrf-input:focus,
.mrf-select:focus,
.mrf-textarea:focus {
	outline: 3px solid var( --theme-palette-color-1, #1a1a1a );
	outline-offset: 2px;
	border-color: var( --theme-palette-color-1, #1a1a1a );
}

.mrf-textarea {
	resize: vertical;
	min-height: 80px;
}

.mrf-textarea--sm {
	min-height: 60px;
	font-size: .875rem;
}

/* ============================================================
   Buttons
   ============================================================ */
.mrf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	padding: .75rem 1.75rem;
	border: none;
	border-radius: 6px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: background-color .15s ease, transform .1s ease;
	line-height: 1;
}

.mrf-btn--primary {
	background: var( --theme-palette-color-1, #1a1a1a );
	color: #fff;
}

.mrf-btn--primary:hover:not( :disabled ) {
	background: var( --theme-palette-color-2, #333 );
}

.mrf-btn:focus-visible {
	outline: 3px solid var( --theme-palette-color-1, #1a1a1a );
	outline-offset: 3px;
}

.mrf-btn:disabled {
	opacity: .5;
	cursor: not-allowed;
}

.mrf-btn--submit,
.mrf-btn--next {
	width: 100%;
	margin-top: 1.5rem;
	padding: 1rem;
	font-size: 1.05rem;
}

.mrf-btn--print {
	font-size: 1.05rem;
	padding: 1rem 2rem;
}

/* ============================================================
   Product cards (Step 2)
   ============================================================ */
.mrf-product-card {
	border: 1.5px solid var( --theme-border-color, #e5e5e5 );
	border-radius: 8px;
	overflow: hidden;
	margin-bottom: 1rem;
	transition: border-color .15s ease;
}

.mrf-product-card:focus-within {
	border-color: var( --theme-palette-color-1, #1a1a1a );
}

.mrf-product-check-row {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1rem;
	cursor: pointer;
}

.mrf-product-checkbox {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	cursor: pointer;
	accent-color: var( --theme-palette-color-1, #1a1a1a );
}

.mrf-product-thumb {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border-radius: 4px;
	flex-shrink: 0;
}

.mrf-product-info {
	flex: 1;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	gap: .25rem;
}

.mrf-product-name {
	font-weight: 600;
	font-size: .95rem;
	line-height: 1.3;
}

.mrf-product-meta {
	font-size: .8rem;
	color: var( --theme-text-color-light, #888 );
}

/* ============================================================
   Reasons survey
   ============================================================ */
.mrf-survey {
	padding: 1rem 1rem 1rem 1rem;
	border-top: 1px solid var( --theme-border-color, #e5e5e5 );
	background: var( --theme-form-background, #fafafa );
	opacity: 0;
	transform: translateY( -4px );
	transition: opacity .2s ease, transform .2s ease;
}

.mrf-survey--visible {
	opacity: 1;
	transform: translateY( 0 );
}

@media ( prefers-reduced-motion: reduce ) {
	.mrf-survey {
		transition: none;
	}
}

.mrf-survey-label {
	font-size: .8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var( --theme-text-color-light, #888 );
	margin-bottom: .625rem;
}

/* Pills */
.mrf-pills {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
}

.mrf-pill-input:checked + .mrf-pill {
	background: var( --theme-palette-color-1, #1a1a1a );
	color: #fff;
	border-color: var( --theme-palette-color-1, #1a1a1a );
}

.mrf-pill {
	display: inline-block;
	margin: 0 0 .5em 0;
	padding: .375rem .875rem;
	border: 1.5px solid var( --theme-border-color, #ddd );
	border-radius: 20px;
	font-size: .875rem;
	font-weight: 500;
	cursor: pointer;
	background: #fff;
	color: var( --theme-text-color, #1a1a1a );
	transition: background .15s ease, color .15s ease, border-color .15s ease;
	user-select: none;
}

.mrf-pill:hover {
	border-color: var( --theme-palette-color-1, #1a1a1a );
}

/* Comment wrap */
.mrf-comment-wrap {
	margin-top: .75rem;
}

.mrf-hidden {
	display: none !important;
}

/* ============================================================
   Customer note
   ============================================================ */
.mrf-note-wrap {
	margin-top: 1.5rem;
	display: flex;
	flex-direction: column;
	gap: .375rem;
}

/* ============================================================
   Loader
   ============================================================ */
.mrf-loader {
	display: flex;
	justify-content: center;
	padding: 3rem 0;
}

.mrf-spinner {
	display: inline-block;
	width: 36px;
	height: 36px;
	border: 3px solid var( --theme-border-color, #e5e5e5 );
	border-top-color: var( --theme-palette-color-1, #1a1a1a );
	border-radius: 50%;
	animation: mrfSpin .7s linear infinite;
}

@keyframes mrfSpin {
	to { transform: rotate( 360deg ); }
}

@media ( prefers-reduced-motion: reduce ) {
	.mrf-spinner { animation: none; opacity: .5; }
}

/* ============================================================
   Error
   ============================================================ */
.mrf-error {
	padding: .875rem 1rem;
	background: #fef3f3;
	border: 1.5px solid #d63638;
	border-radius: 6px;
	color: #9e0001;
	font-size: .9rem;
	line-height: 1.5;
}

/* ============================================================
   Step 3 — Success
   ============================================================ */
.mrf-step--3 {
	text-align: center;
	padding: 2rem 1rem;
}

.mrf-success-icon {
	width: 72px;
	height: 72px;
	background: #edfaed;
	border: 2px solid #00a32a;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 2rem;
	color: #00a32a;
	margin-bottom: 1.25rem;
}

.mrf-success-rma {
	font-size: 1.1rem;
	margin-bottom: 1rem;
}

.mrf-hint {
	margin-top: 1.25rem;
	font-size: .875rem;
	color: var( --theme-text-color-light, #888 );
	line-height: 1.6;
}

/* ============================================================
   Responsive
   ============================================================ */
@media ( max-width: 480px ) {
	.mrf-product-thumb { width: 48px; height: 48px; }
	.mrf-btn--primary  { font-size: .95rem; }
	.mrf-pills         { gap: .375rem; }
	.mrf-pill          { font-size: .8rem; padding: .3rem .7rem; }
}

/* ============================================================
   Qty selector (Step 2)
   ============================================================ */
.mrf-qty-wrap {
	display: flex;
	align-items: center;
	gap: .5rem;
	padding: .5rem 1rem;
	background: var( --theme-form-background, #f5f5f5 );
	border-top: 1px solid var( --theme-border-color, #e5e5e5 );
}

.mrf-qty-label {
	font-size: .8rem;
	color: var( --theme-text-color-light, #666 );
	white-space: nowrap;
}

.mrf-qty-input {
	width: 70px;
	padding: .3rem .5rem;
	border: 1.5px solid var( --theme-border-color, #ddd );
	border-radius: 4px;
	font-size: .9rem;
	text-align: center;
}

.mrf-qty-input:focus {
	outline: 3px solid var( --theme-palette-color-1, #1a1a1a );
	outline-offset: 2px;
	border-color: var( --theme-palette-color-1, #1a1a1a );
}

/* ============================================================
   Excluded product cards (Step 2)
   ============================================================ */
.mrf-product-card--excluded {
	opacity: .6;
	background: #fafafa;
}

.mrf-product-card--excluded .mrf-product-name {
	text-decoration: line-through;
	color: var( --theme-text-color-light, #888 );
}

.mrf-excluded-badge {
	display: inline-block;
	margin-left: auto;
	padding: .25rem .75rem;
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
	border-radius: 20px;
	font-size: .75rem;
	font-weight: 600;
	white-space: nowrap;
	flex-shrink: 0;
}

/* ============================================================
   Action panel — Wymiana / Zwrot toggle (Step 2)
   ============================================================ */
.mrf-action-panel {
	padding: 1rem;
	border-top: 1px solid var( --theme-border-color, #e5e5e5 );
	background: var( --theme-form-background, #fafafa );
	overflow: hidden;
}

/* Toggle buttons */
.mrf-action-toggle {
	display: flex;
	gap: .5rem;
	margin-bottom: 1rem;
}

.mrf-action-btn {
	display: inline-flex;
	align-items: center;
	gap: .375rem;
	padding: .5rem 1.25rem;
	border: 2px solid var( --theme-border-color, #ddd );
	border-radius: 24px;
	background: #fff;
	font-size: .9rem;
	font-weight: 600;
	cursor: pointer;
	color: var( --theme-text-color-light, #666 );
	transition: all .15s ease;
}

.mrf-action-btn:hover {
	border-color: var( --theme-palette-color-1, #1a1a1a );
	color: var( --theme-palette-color-1, #1a1a1a );
}

.mrf-action-btn--active {
	background: var( --theme-palette-color-1, #1a1a1a );
	border-color: var( --theme-palette-color-1, #1a1a1a );
	color: #fff;
}

.mrf-action-btn--active:hover {
	color: #fff;
}

.mrf-action-btn:focus-visible {
	outline: 3px solid var( --theme-palette-color-1, #1a1a1a );
	outline-offset: 3px;
}

/* Exchange panel */
.mrf-exchange-panel {
	display: flex;
	flex-direction: column;
	gap: .5rem;
}

.mrf-exchange-panel .mrf-survey-label {
	margin-bottom: 0;
}

/* Return panel */
.mrf-return-panel {
	display: flex;
	flex-direction: column;
	gap: .75rem;
}

@media ( prefers-reduced-motion: reduce ) {
	.mrf-action-btn { transition: none; }
}

/* ============================================================
   Bank account field (COD returns)
   ============================================================ */
.mrf-bank-wrap {
	margin-top: 1.25rem;
	padding: 1.25rem;
	background: #fffbeb;
	border: 1.5px solid #fcd34d;
	border-radius: 8px;
}

.mrf-input--bank {
	font-family: monospace;
	letter-spacing: .05em;
	font-size: .95rem;
}

.mrf-bank-desc {
	margin-top: .5rem;
	font-size: .8rem;
	color: #92400e;
	line-height: 1.6;
}

.mrf-required {
	color: #ef4444;
	margin-left: 2px;
}

/* ============================================================
   Discount notice (Step 2) — subtle 12px info box
   ============================================================ */
.mrf-discount-notice {
	display: flex;
	align-items: flex-start;
	gap: .5rem;
	margin-bottom: 1.25rem;
	padding: .75rem 1rem;
	border: 1px solid var( --theme-border-color, #e5e5e5 );
	border-left: 2px solid var( --theme-palette-color-1, #b0a090 );
	border-radius: 4px;
	background: transparent;
}

.mrf-discount-notice__icon {
	flex-shrink: 0;
	font-size: 11px;
	color: var( --theme-text-color-light, #aaa );
	line-height: 1.6;
	font-style: normal;
}

.mrf-discount-notice__text {
	margin: 0;
	font-size: 12px;
	line-height: 1.65;
	color: var( --theme-text-color-light, #888 );
	font-weight: 400;
}

/* ============================================================
   Input error state (IBAN validation)
   ============================================================ */
.mrf-input--error,
.mrf-input--error:focus {
	border-color: #d63638;
	outline-color: #d63638;
}

/* =========================================================================
 * Step "summary" — read-only recap + legal confirmation (v1.5.7)
 * ========================================================================= */
.mrf-step--summary .mrf-step-title:focus { outline: none; }

.mrf-summary-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 20px;
	margin: 4px 0 18px;
	padding: 12px 14px;
	background: var( --theme-form-background, #fafafa );
	border: 1px solid #e5e5e5;
	border-radius: 6px;
	font-size: .9rem;
	color: #444;
}
.mrf-summary-meta__row { white-space: nowrap; }

.mrf-summary-list {
	list-style: none;
	margin: 0 0 18px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.mrf-summary-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	background: #fff;
}

.mrf-summary-thumb {
	flex: 0 0 auto;
	width: 52px;
	height: 52px;
	object-fit: cover;
	border-radius: 6px;
}

.mrf-summary-item__body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.mrf-summary-item__name { font-weight: 600; color: #1a1a1a; }

.mrf-summary-badge {
	align-self: flex-start;
	display: inline-block;
	padding: 2px 10px;
	border-radius: 20px;
	font-size: .78rem;
	font-weight: 600;
	line-height: 1.6;
}
.mrf-summary-badge--return   { background: #eef1ff; color: #2b3a8c; }
.mrf-summary-badge--exchange { background: #fff3e0; color: #8a4b00; }

.mrf-summary-item__qty,
.mrf-summary-item__detail { font-size: .88rem; color: #444; }
.mrf-summary-item__detail--muted { color: #777; font-style: italic; }

.mrf-summary-note {
	margin: 0 0 16px;
	padding: 12px 14px;
	background: var( --theme-form-background, #fafafa );
	border: 1px solid #e5e5e5;
	border-radius: 6px;
}
.mrf-summary-note__label {
	display: block;
	font-weight: 600;
	font-size: .85rem;
	margin-bottom: 4px;
	color: #1a1a1a;
}
.mrf-summary-note__text { margin: 0; font-size: .92rem; color: #333; }
.mrf-summary-note__text--mono {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	letter-spacing: .5px;
}

.mrf-summary-legal {
	margin: 0 0 18px;
	padding: 12px 14px;
	border-left: 3px solid var( --theme-palette-color-1, #1a1a1a );
	background: #f7f7f7;
	font-size: .85rem;
	line-height: 1.5;
	color: #444;
}

@media ( max-width: 480px ) {
	.mrf-summary-meta__row { white-space: normal; }
}
