/**
 * BrikPanel Customers: one customer's page (views/profile.php).
 *
 * Two columns from 1100px of card width, one below. Cards, tiles and type
 * follow the BrikPanel design system; buttons and badges are the shared
 * brikpanel-btn / brikpanel-badge parts (front-end/shared/brikpanel-ui.css).
 *
 * @package BrikPanel
 */

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

.bp-cpr {
	color: #303030;
}

.bp-cpr-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-cpr-back:hover,
.bp-cpr-back:focus {
	color: #303030;
}

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

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

.bp-cpr-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;
	overflow-wrap: anywhere;
}

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

/* Levels set by brikpanel-fit-row.js: `is-fold` folds Email, WhatsApp and the
   WordPress profile into "More actions", `is-two-rows` puts the buttons on
   their own row under the name. */
.bp-cpr-header.is-two-rows {
	flex-direction: column;
	align-items: stretch;
}

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

/* Badges sit on the grey page, so they get the card's white and a hairline. */
.bp-cpr-badge {
	background: #fff;
	box-shadow: inset 0 0 0 1px #e3e3e3;
	border-radius: 999px;
	line-height: 1.375rem;
	color: #303030;
}

.bp-cpr-card .bp-cpr-badge {
	background: #f1f1f1;
	box-shadow: none;
}

.bp-cpr-card .bp-cpr-badge.is-good {
	background: #e4f5e1;
	color: #1a6b15;
}

/* ===== Tiles ===== */
.bp-cpr-stats {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1rem;
	margin-bottom: 1rem;
}

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

.bp-cpr-stat-label {
	margin-bottom: 0.5rem;
	font-size: var(--brikpanel-label-size, 0.8125rem);
	font-weight: var(--brikpanel-label-weight, 550);
	color: #616161;
}

.bp-cpr-stat-value {
	font-size: 1.375rem;
	font-weight: 600;
	line-height: 1.2;
	color: #303030;
	font-variant-numeric: tabular-nums;
	overflow-wrap: anywhere;
}

.bp-cpr-stat-sub {
	margin-top: 0.5rem;
	font-size: 0.75rem;
	color: #616161;
}

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

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

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

/* ===== Cards ===== */
.bp-cpr-card {
	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-cpr-card-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-cpr-note {
	margin: 0.5rem 0 0;
	font-size: 0.8125rem;
	color: #616161;
}

.bp-cpr-card-title + .bp-cpr-note {
	margin-top: 0;
}

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

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

.bp-cpr-more {
	display: inline-flex;
	gap: 0.375rem;
	margin-top: 0.75rem;
	font-size: 0.8125rem;
	font-weight: 550;
	color: #303030;
	text-decoration: none;
}

.bp-cpr-more:hover,
.bp-cpr-more:focus {
	text-decoration: underline;
}

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

/* ===== Orders table ===== */
.bp-cpr-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.875rem;
}

.bp-cpr-table th {
	padding: 0.5rem;
	border-bottom: 1px solid #e3e3e3;
	font-size: var(--brikpanel-th-size, 0.75rem);
	font-weight: var(--brikpanel-th-weight, 600);
	text-align: start;
	color: #616161;
}

.bp-cpr-table td {
	padding: 0.625rem 0.5rem;
	border-bottom: 1px solid #f1f1f1;
	color: #303030;
}

.bp-cpr-table tbody tr:last-child td {
	border-bottom: 0;
}

.bp-cpr-table .bp-cpr-num {
	text-align: end;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

/* Order and cart status pills: grey, green for money coming in, amber for
   waiting, red for failed or cancelled. */
.bp-cpr-status {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0 0.5rem;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 550;
	line-height: 1.375rem;
	white-space: nowrap;
	background: #f1f1f1;
	color: #303030;
}

.bp-cpr-status::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
}

.bp-cpr-status.is-processing,
.bp-cpr-status.is-cart-recovered,
.bp-cpr-status.is-cart-converted {
	background: #e4f5e1;
	color: #1a6b15;
}

.bp-cpr-status.is-on-hold,
.bp-cpr-status.is-pending,
.bp-cpr-status.is-cart-abandoned {
	background: #fff1d6;
	color: #7a5000;
}

.bp-cpr-status.is-failed,
.bp-cpr-status.is-cancelled {
	background: #fce4e4;
	color: #a61b1b;
}

/* ===== Lists (products, carts, coupons) ===== */
.bp-cpr-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.bp-cpr-list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.5rem 0;
	border-bottom: 1px solid #f1f1f1;
	font-size: 0.875rem;
}

.bp-cpr-list li:last-child {
	border-bottom: 0;
}

.bp-cpr-list li > :first-child {
	min-width: 0;
	overflow-wrap: anywhere;
}

.bp-cpr-list-value {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	flex: 0 0 auto;
	color: #616161;
	font-variant-numeric: tabular-nums;
}

.bp-cpr-code {
	padding: 0.125rem 0.375rem;
	border-radius: 0.25rem;
	background: #f1f1f1;
	font-size: 0.8125rem;
}

/* ===== Contact and addresses ===== */
.bp-cpr-dl {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 0.5rem 1rem;
	margin: 0;
	font-size: 0.875rem;
}

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

.bp-cpr-dl dd {
	margin: 0;
	min-width: 0;
	color: #303030;
	overflow-wrap: anywhere;
}

.bp-cpr-address {
	margin: 0 0 0.75rem;
	font-size: 0.875rem;
	line-height: 1.5;
	color: #303030;
}

.bp-cpr-address:last-child {
	margin-bottom: 0;
}

.bp-cpr-address strong {
	display: block;
	margin-bottom: 0.125rem;
	font-size: 0.8125rem;
	font-weight: 550;
	color: #616161;
}

/* Phones: one column of cards, tiles two by two (data-bp-tiles measures). */
@media (max-width: 782px) {
	.bp-cpr-card {
		padding: 1rem 1.125rem;
	}
}
