/**
 * DigitalUp OrderReturns — front-end form and product picker modal.
 *
 * Deliberately neutral: colours inherit from the theme where possible so the
 * form blends into any WooCommerce storefront.
 */

.duor-wrap {
	--duor-accent: #111;
	--duor-border: #e0e0e0;
	--duor-muted: #6b6b6b;
	max-width: 640px;
}

.duor-title {
	margin: 0 0 8px;
}

.duor-intro {
	margin: 0 0 24px;
	color: var(--duor-muted);
}

.duor-field {
	margin-bottom: 16px;
}

.duor-field label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
}

.duor-field input {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--duor-border);
	border-radius: 4px;
	font: inherit;
	background: #fff;
}

.duor-field input:focus {
	outline: 2px solid var(--duor-accent);
	outline-offset: 1px;
}

.duor-button {
	display: inline-block;
	padding: 13px 26px;
	border: 1px solid var(--duor-accent);
	border-radius: 4px;
	background: transparent;
	color: var(--duor-accent);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.duor-button--primary {
	background: var(--duor-accent);
	color: #fff;
}

.duor-button[disabled] {
	opacity: 0.6;
	cursor: default;
}

.duor-message {
	margin: 0 0 16px;
	padding: 12px 14px;
	border-radius: 4px;
	font-size: 0.95em;
}

.duor-message--error {
	background: #fdecea;
	color: #932338;
}

.duor-message--success {
	background: #edf7ee;
	color: #1e6b25;
}

/* Modal ------------------------------------------------------------------ */

body.duor-modal-open {
	overflow: hidden;
}

.duor-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.duor-modal[hidden] {
	display: none;
}

.duor-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.duor-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 720px;
	max-height: 90vh;
	overflow-y: auto;
	padding: 28px;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.duor-modal__close {
	position: absolute;
	top: 10px;
	right: 14px;
	border: 0;
	background: none;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: var(--duor-muted, #6b6b6b);
}

.duor-modal__title {
	margin: 0 0 4px;
	padding-right: 30px;
}

.duor-modal__meta {
	margin: 0 0 18px;
	color: #6b6b6b;
	font-size: 0.95em;
}

.duor-modal__message {
	margin: 16px 0 0;
	padding: 12px 14px;
	border-radius: 4px;
	background: #fdecea;
	color: #932338;
	font-size: 0.95em;
}

/* Item rows -------------------------------------------------------------- */

.duor-items {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid #e0e0e0;
}

.duor-item {
	padding: 14px 0;
	border-bottom: 1px solid #e0e0e0;
}

.duor-item.is-selected {
	background: #fafafa;
}

.duor-item__select {
	display: flex;
	align-items: center;
	gap: 14px;
	cursor: pointer;
}

.duor-item__checkbox {
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
}

.duor-item__image {
	width: 64px;
	height: 64px;
	flex: 0 0 auto;
	object-fit: cover;
	border-radius: 4px;
}

.duor-item__info {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.duor-item__name {
	font-weight: 600;
}

.duor-item__sku,
.duor-item__available {
	font-size: 0.85em;
	color: #6b6b6b;
}

.duor-item__controls {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin: 12px 0 0 34px;
}

.duor-item__controls[hidden] {
	display: none;
}

.duor-item__field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 0.9em;
}

.duor-item__field--reason {
	flex: 1 1 260px;
}

.duor-item__field select {
	padding: 9px 10px;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	font: inherit;
	background: #fff;
}

.duor-comments {
	display: block;
	margin: 20px 0 0;
}

.duor-comments span {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	font-size: 0.9em;
}

.duor-comments textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	font: inherit;
	resize: vertical;
}

.duor-photo-field .duor-photo-input {
	display: block;
	width: 100%;
	font: inherit;
}

.duor-photo-hint {
	display: block;
	margin-top: 6px;
	color: #6b6b6b;
	font-size: 0.85em;
	font-weight: 400;
}

.duor-photo-error {
	display: block;
	margin-top: 6px;
	color: #932338;
	font-size: 0.85em;
}

.duor-photo-error[hidden] {
	display: none;
}

.duor-modal__body .duor-submit {
	margin-top: 20px;
	width: 100%;
}

/* Success ---------------------------------------------------------------- */

.duor-success {
	text-align: center;
	padding: 20px 0;
}

.duor-success h4 {
	margin: 0 0 12px;
	font-size: 1.3em;
}

.duor-success__ref {
	margin: 0 0 12px;
	font-size: 1.5em;
	font-weight: 700;
	letter-spacing: 0.04em;
}

.duor-success__hint {
	color: #6b6b6b;
	font-size: 0.9em;
}

@media (max-width: 600px) {
	.duor-modal {
		padding: 0;
	}

	.duor-modal__dialog {
		max-width: none;
		max-height: 100vh;
		height: 100%;
		border-radius: 0;
		padding: 24px 18px;
	}

	.duor-item__controls {
		margin-left: 0;
	}
}