/**
 * BrikPanel Returns screen (list and one return).
 *
 * Shared parts come from front-end/shared/brikpanel-ui.css (buttons, controls,
 * badges) and brikpanel-fit-table.css (tables that turn into cards when they
 * do not fit); only this screen's layout lives here.
 *
 * @package BrikPanel
 */

.bp-ret [hidden] {
	display: none;
}

.bp-ret {
	color: #303030;
}

/* ===== Header ===== */
.bp-ret-header {
	--bp-overflow-size: 2rem;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1rem;
}

.bp-ret-header-left {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.75rem;
	min-width: 0;
}

.bp-ret-header-left h1 {
	margin: 0;
	padding: 0;
	font-size: var(--brikpanel-title-size, 1.125rem);
	font-weight: var(--brikpanel-title-weight, 600);
	line-height: var(--brikpanel-title-line, 1.3);
	color: #303030;
}

.bp-ret-header-right {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}

.bp-ret-header.is-two-rows {
	flex-direction: column;
	align-items: stretch;
}

.bp-ret-header.is-two-rows .bp-ret-header-right {
	justify-content: flex-end;
}

.bp-ret-search {
	display: flex;
	flex: 1 1 16rem;
	min-width: 0;
	margin: 0;
}

.bp-ret-search .bp-ret-search-input {
	flex: 1 1 16rem;
	min-width: 0;
	width: 18rem;
}

.bp-ret-back {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	margin: 0 0 0.5rem;
	font-size: 0.8125rem;
	font-weight: 550;
	color: #616161;
	text-decoration: none;
}

.bp-ret-back:hover,
.bp-ret-back:focus {
	color: #303030;
}

/* ===== Messages after an action ===== */
.bp-ret-flash {
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	border: 1px solid #b7e1b0;
	border-radius: 0.5rem;
	background: #e4f5e1;
	color: #1a6b15;
	font-size: 0.875rem;
	line-height: 1.5;
}

.bp-ret-flash.is-error {
	border-color: #f1b0b0;
	background: #fce4e4;
	color: #a61b1b;
}

/* ===== Tabs (shared scroll strip) ===== */
.bp-ret-tabs {
	display: flex;
	margin: 0 0 1rem;
	box-shadow: inset 0 -1px 0 #e3e3e3;
}

.bp-ret-tab {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0.75rem 1rem;
	border-bottom: 2px solid transparent;
	font-size: 0.875rem;
	font-weight: 550;
	line-height: 1.4;
	color: #616161;
	text-decoration: none;
	white-space: nowrap;
}

.bp-ret-tab:hover,
.bp-ret-tab:focus {
	color: #303030;
	outline: none;
	box-shadow: none;
}

.bp-ret-tab:focus-visible {
	outline: 2px solid #303030;
	outline-offset: -2px;
}

.bp-ret-tab.is-active {
	border-bottom-color: #303030;
	color: #303030;
}

.bp-ret-tab-count {
	display: inline-flex;
	min-width: 1.25rem;
	padding: 0 0.375rem;
	border-radius: 999px;
	background: #f1f1f1;
	font-size: 0.75rem;
	line-height: 1.25rem;
	justify-content: center;
}

/* ===== List ===== */
.bp-ret-card {
	overflow: hidden;
	background: #fff;
	border: 1px solid #e3e3e3;
	border-radius: 0.75rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.bp-ret-table {
	width: 100%;
	border-collapse: collapse;
}

.bp-ret-table th,
.bp-ret-lines th {
	padding: 0.75rem 1rem;
	border-bottom: 1px solid #e3e3e3;
	background: #f7f7f7;
	font-size: var(--brikpanel-th-size, 0.75rem);
	font-weight: 550;
	color: #616161;
	text-align: start;
	white-space: nowrap;
}

.bp-ret-table td,
.bp-ret-lines td {
	padding: 0.75rem 1rem;
	border-bottom: 1px solid #f1f1f1;
	font-size: 0.8125rem;
	vertical-align: middle;
}

.bp-ret-table tr:last-child td,
.bp-ret-lines tr:last-child td {
	border-bottom: 0;
}

.bp-ret-link {
	font-weight: 600;
	color: #303030;
	text-decoration: none;
}

.bp-ret-link:hover,
.bp-ret-link:focus {
	text-decoration: underline;
}

.bp-ret-cell-main {
	display: block;
}

.bp-ret-cell-sub {
	display: block;
	color: #616161;
	font-size: 0.75rem;
	overflow-wrap: anywhere;
}

.bp-ret-muted {
	color: #616161;
}

.bp-ret-eu {
	margin-inline-start: 0.375rem;
}

.bp-ret-status {
	display: inline-flex;
	align-items: center;
	padding: 0 0.5rem;
	border-radius: 999px;
	background: #f1f1f1;
	color: #303030;
	font-size: 0.75rem;
	font-weight: 550;
	line-height: 1.5rem;
	white-space: nowrap;
}

.bp-ret-status.is-requested {
	background: #fff1d6;
	color: #7a5000;
}

.bp-ret-status.is-approved,
.bp-ret-status.is-received,
.bp-ret-status.is-resolving {
	background: #e3edff;
	color: #1d4ba0;
}

.bp-ret-status.is-refunded {
	background: #e4f5e1;
	color: #1a6b15;
}

.bp-ret-status.is-rejected {
	background: #fce4e4;
	color: #a61b1b;
}

.bp-ret-empty {
	padding: 2.5rem 1.5rem;
	text-align: center;
	color: #616161;
	font-size: 0.875rem;
}

.bp-ret-empty-title {
	margin: 0 0 0.5rem;
	color: #303030;
	font-size: 0.9375rem;
	font-weight: 600;
}

.bp-ret-pages {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 0.5rem;
	margin: 1rem 0 0;
}

.bp-ret-pages-info {
	margin-inline-end: auto;
	color: #616161;
	font-size: 0.8125rem;
}

/* ===== One return ===== */
.bp-ret-cols {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
	gap: 1rem;
	align-items: start;
}

.bp-ret-main,
.bp-ret-side {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	min-width: 0;
}

@media (max-width: 1100px) {
	.bp-ret-cols {
		grid-template-columns: minmax(0, 1fr);
	}
}

.bp-ret-section {
	min-width: 0;
	padding: 1.25rem 1.5rem;
	background: #fff;
	border: 1px solid #e3e3e3;
	border-radius: 0.75rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.bp-ret-section-title {
	margin: 0 0 1rem;
	padding: 0;
	font-size: var(--brikpanel-card-title-size, 0.9375rem);
	font-weight: var(--brikpanel-card-title-weight, 600);
	color: #303030;
}

.bp-ret-section p {
	margin: 0 0 0.5rem;
	font-size: 0.8125rem;
}

.bp-ret-lines {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid #e3e3e3;
	border-radius: 0.5rem;
}

.bp-ret-product {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-width: 0;
}

.bp-ret-thumb img {
	display: block;
	width: 40px;
	height: 40px;
	object-fit: cover;
	border-radius: 0.375rem;
	border: 1px solid #e3e3e3;
}

.bp-ret-product-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.bp-ret-product-text a {
	color: #303030;
	font-weight: 550;
	text-decoration: none;
}

.bp-ret-product-text a:hover,
.bp-ret-product-text a:focus {
	text-decoration: underline;
}

.bp-ret-note {
	margin: 0.75rem 0 0;
	color: #616161;
	font-size: 0.8125rem;
	line-height: 1.5;
}

.bp-ret-label {
	margin: 0.75rem 0 0.25rem;
	color: #616161;
	font-size: var(--brikpanel-label-size, 0.8125rem);
	font-weight: var(--brikpanel-label-weight, 550);
}

.bp-ret-reason,
.bp-ret-strong {
	font-weight: 600;
}

.bp-ret-quote {
	margin: 0.5rem 0 0;
	padding: 0.5rem 0.875rem;
	border-inline-start: 3px solid #e3e3e3;
	color: #303030;
	font-size: 0.8125rem;
}

.bp-ret-quote p {
	margin: 0 0 0.375rem;
}

.bp-ret-dl {
	display: grid;
	grid-template-columns: minmax(0, auto) minmax(0, 1fr);
	gap: 0.5rem 1rem;
	margin: 0.5rem 0 0;
	font-size: 0.8125rem;
}

.bp-ret-dl dt {
	color: #616161;
}

.bp-ret-dl dd {
	margin: 0;
	text-align: end;
	overflow-wrap: anywhere;
}

.bp-ret-photos {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
	gap: 0.5rem;
}

.bp-ret-photo {
	display: block;
	padding: 0;
	overflow: hidden;
	aspect-ratio: 1;
	max-width: 100%;
	border: 1px solid #e3e3e3;
	border-radius: 0.5rem;
	background: #f7f7f7;
	cursor: zoom-in;
}

.bp-ret-photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bp-ret-photo:focus-visible {
	outline: 2px solid #303030;
	outline-offset: 2px;
}

.bp-ret-history {
	margin: 0;
	padding: 0;
	list-style: none;
}

.bp-ret-history li {
	position: relative;
	margin: 0 0 0.875rem;
	padding-inline-start: 1rem;
	border-inline-start: 2px solid #e3e3e3;
	font-size: 0.8125rem;
}

.bp-ret-history-status {
	display: block;
	font-weight: 600;
}

.bp-ret-history-note {
	display: block;
	margin-top: 0.25rem;
	color: #303030;
	overflow-wrap: anywhere;
}

/* ===== Dialogs ===== */
.bp-ret-dialog {
	box-sizing: border-box;
	width: min(32rem, calc(100vw - 2rem));
	max-height: calc(100vh - 2rem);
	padding: 1.5rem;
	border: 1px solid #e3e3e3;
	border-radius: 0.75rem;
	background: #fff;
	color: #303030;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.bp-ret-dialog::backdrop {
	background: rgba(0, 0, 0, 0.35);
}

.bp-ret-dialog form {
	margin: 0;
}

.bp-ret-dialog-title {
	margin: 0 0 1rem;
	font-size: 1rem;
	font-weight: 600;
}

.bp-ret-field-label {
	display: block;
	margin: 0 0 0.375rem;
	font-size: var(--brikpanel-label-size, 0.8125rem);
	font-weight: var(--brikpanel-label-weight, 550);
}

.bp-ret-dialog .bp-ret-textarea {
	box-sizing: border-box;
	width: 100%;
	height: auto;
	min-height: 7rem;
	padding: 0.5rem 0.75rem;
	line-height: 1.5;
	resize: vertical;
}

.bp-ret-dialog-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 0.5rem;
	margin: 1.25rem 0 0;
}

.bp-ret-check {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0.75rem 0 0;
	font-size: 0.8125rem;
	cursor: pointer;
}

.bp-ret-sum dt {
	align-self: center;
}

.bp-ret-sum .bp-ret-check {
	margin: 0;
}

.bp-ret-dialog .bp-ret-money {
	width: 8rem;
	text-align: end;
}

.bp-ret-total-label,
.bp-ret-total {
	padding-top: 0.5rem;
	border-top: 1px solid #e3e3e3;
	font-weight: 600;
	color: #303030;
}

/* The label reaches over the column gap, so the line above the total is one line. */
.bp-ret-sum .bp-ret-total-label {
	margin-inline-end: -1rem;
	padding-inline-end: 1rem;
}

.bp-ret-viewer {
	width: min(56rem, calc(100vw - 2rem));
}

.bp-ret-viewer img {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 10rem);
	margin: 0 auto;
	border-radius: 0.5rem;
}

@media (max-width: 782px) {
	.bp-ret-section {
		padding: 1rem;
	}

	.bp-ret-dl {
		grid-template-columns: minmax(0, 1fr);
		gap: 0.125rem;
	}

	.bp-ret-dl dd {
		margin-bottom: 0.5rem;
		text-align: start;
	}

	/* The refund sum stays two columns: its labels and amounts are short. */
	.bp-ret-dl.bp-ret-sum {
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 0.5rem 1rem;
	}

	.bp-ret-sum dd {
		margin-bottom: 0;
		text-align: end;
	}
}
