/* ====================================================
   Список заказов — /personal/orders/
   Без зависимости от Bootstrap; чистый flexbox
   ==================================================== */

.cpo {
	--cpo-accent:      #017ac3;
	--cpo-accent-bg:   rgba(1, 122, 195, 0.07);
	--cpo-border:      #dde3e8;
	--cpo-radius:      8px;
	--cpo-shadow:      0 1px 6px rgba(0,0,0,0.08);
	--cpo-text:        #222;
	--cpo-text-muted:  #777;
	--cpo-font:        "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-family: var(--cpo-font);
	padding-bottom: 2rem;
}

/* ---- Фильтры ---- */
.cpo-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 1.5rem;
}

.cpo-filter {
	display: inline-block;
	padding: 7px 18px;
	border: 1px solid var(--cpo-border);
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	color: #444 !important;
	background: #fff;
	text-decoration: none !important;
	cursor: pointer;
	transition: border-color .18s, color .18s, background .18s;
	line-height: 1.3;
}

.cpo-filter:hover {
	border-color: var(--cpo-accent);
	color: var(--cpo-accent) !important;
}

.cpo-filter--active {
	background: var(--cpo-accent-bg);
	border-color: var(--cpo-accent);
	color: var(--cpo-accent) !important;
	pointer-events: none;
}

.cpo-filter--muted {
	color: #666 !important;
	border-style: dashed;
	background: #fafafa;
}

/* ---- Заголовок статуса ---- */
.cpo-status-heading {
	font-size: 14px !important;
	font-weight: 600 !important;
	color: var(--cpo-text-muted) !important;
	margin: 0 0 10px !important;
	line-height: 1.4 !important;
}

/* ---- Пустой список ---- */
.cpo-empty {
	font-size: 15px;
	color: #555;
	margin: 0 0 1rem;
}

/* ---- Карточка заказа ---- */
.cpo-card {
	border: 1px solid var(--cpo-border);
	border-radius: var(--cpo-radius);
	box-shadow: var(--cpo-shadow);
	margin-bottom: 1.25rem;
	overflow: hidden;
}

.cpo-card__head {
	padding: 12px 18px;
	background: linear-gradient(180deg, var(--cpo-accent-bg) 0%, #f4f8fb 100%);
	border-bottom: 1px solid var(--cpo-border);
}

.cpo-card__head--history {
	background: linear-gradient(180deg, #f3f4f6 0%, #fafafa 100%);
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 6px 16px;
}

.cpo-card__title {
	font-size: 14px !important;
	font-weight: 700 !important;
	color: var(--cpo-text) !important;
	margin: 0 !important;
	line-height: 1.5 !important;
}

.cpo-card__head-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 10px;
	flex-shrink: 0;
}

.cpo-card__body {
	padding: 14px 18px 16px;
	background: #fff;
}

/* ---- Заголовок секции (Оплата / Доставка) ---- */
.cpo-section-head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 10px;
}

.cpo-section-label {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--cpo-text-muted);
	white-space: nowrap;
}

.cpo-section-line {
	flex: 1;
	height: 1px;
	background: #e5e5e5;
	display: block;
}

/* ---- Оплата ---- */
.cpo-payment {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	margin-bottom: 10px;
}

.cpo-payment__info {
	flex: 1;
	min-width: 0;
}

.cpo-payment__title {
	font-size: 13px;
	font-weight: 700;
	color: var(--cpo-text);
	margin-bottom: 4px;
	line-height: 1.5;
}

.cpo-payment__system {
	font-weight: 400;
}

.cpo-payment__sum {
	font-size: 13px;
	color: #555;
	margin-bottom: 6px;
}

.cpo-payment__checks {
	font-size: 12px;
	margin-bottom: 6px;
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.cpo-payment__action {
	flex-shrink: 0;
	padding-top: 2px;
}

.cpo-payment__cancel-tpl {
	display: none;
}

/* ---- Доставка ---- */
.cpo-shipment {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	margin-bottom: 10px;
	font-size: 13px;
}

.cpo-shipment__info {
	flex: 1;
	min-width: 0;
}

.cpo-shipment__title {
	font-weight: 700;
	margin-bottom: 4px;
}

.cpo-shipment__status {
	margin-bottom: 4px;
}

.cpo-shipment__status-badge {
	display: inline-block;
	padding: 3px 8px;
	border: 1px solid rgba(128,134,142,.2);
	border-radius: 4px;
	background: #f3f4f5;
	color: #535c69;
	font-weight: 600;
	font-size: 12px;
	vertical-align: middle;
}

.cpo-shipment__service,
.cpo-shipment__tracking {
	color: #555;
	margin-bottom: 2px;
}

.cpo-shipment__action {
	flex-shrink: 0;
}

/* ---- Разделители ---- */
.cpo-divider,
.cpo-inner-divider {
	border: none;
	height: 1px;
	background: #eee;
	margin: 10px 0;
}

.cpo-inner-divider {
	margin: 6px 0;
}

/* ---- Кнопки действий ---- */
.cpo-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 4px;
}

.cpo-btn {
	display: inline-block;
	padding: 7px 16px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none !important;
	cursor: pointer;
	transition: background .18s, color .18s, border-color .18s;
	border: 1px solid transparent;
	white-space: nowrap;
}

.cpo-btn--primary {
	background: var(--cpo-accent);
	color: #fff !important;
	border-color: var(--cpo-accent);
}

.cpo-btn--primary:hover {
	background: #016aaa;
	color: #fff !important;
	border-color: #016aaa;
}

.cpo-btn--disabled {
	opacity: .55;
	pointer-events: none;
}

.cpo-btn--outline {
	background: #fff;
	color: var(--cpo-accent) !important;
	border-color: var(--cpo-accent);
}

.cpo-btn--outline:hover {
	background: var(--cpo-accent);
	color: #fff !important;
}

.cpo-btn--ghost {
	background: #fff;
	color: #444 !important;
	border-color: var(--cpo-border);
}

.cpo-btn--ghost:hover {
	background: #f4f4f4;
	color: #222 !important;
}

.cpo-btn--danger-ghost {
	background: #fff;
	color: #c0392b !important;
	border-color: #e0a8a3;
}

.cpo-btn--danger-ghost:hover {
	background: #c0392b;
	color: #fff !important;
	border-color: #c0392b;
}

/* Иконка «повторить» у ссылки */
.sale-order-list-repeat-link::before {
	display: inline-block;
	width: 10px;
	height: 13px;
	background: url(images/sale-order-repeat.svg) no-repeat center;
	content: "";
	vertical-align: -2px;
	margin-right: 5px;
}

/* ---- Ссылка с пунктирным подчёркиванием ---- */
.cpo-link-dashed {
	display: inline-block;
	font-size: 13px;
	color: var(--cpo-accent) !important;
	border-bottom: 1px dashed var(--cpo-accent);
	text-decoration: none !important;
	cursor: pointer;
	margin-bottom: 6px;
}

.cpo-link-dashed:hover {
	border-bottom-style: solid;
	color: #016aaa !important;
}

/* ---- Бейджи статусов ---- */
.cpo-badge,
.sale-order-list-status-alert,
.sale-order-list-status-success,
.sale-order-list-status-restricted {
	display: inline-block;
	padding: 3px 9px 4px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 700;
	vertical-align: middle;
	white-space: nowrap;
}

.cpo-badge--alert,
.sale-order-list-status-alert {
	background: #ffe5e8;
	border: 1px solid #eab3b9;
	color: #d0021b;
}

.cpo-badge--success,
.sale-order-list-status-success {
	background: #e3f0bd;
	border: 1px solid #bed277;
	color: #597707;
}

.cpo-badge--muted,
.sale-order-list-status-restricted {
	background: #f3f4f5;
	border: 1px solid rgba(128,134,142,.2);
	color: #535c69;
}

/* ---- История: метки дат ---- */
.cpo-history-label {
	font-size: 12px;
	font-weight: 600;
	color: var(--cpo-text-muted);
}

.cpo-history-label--canceled {
	color: #c0392b;
}

.cpo-history-date {
	font-size: 12px;
	color: var(--cpo-text-muted);
}

/* ---- Сообщение об ограничении оплаты ---- */
.cpo-restricted-msg {
	margin-bottom: 6px;
}

.sale-order-list-status-restricted-message {
	font-size: 12px;
	color: #9e9fa2;
}

/* ---- Shipment ID icon ---- */
.sale-order-list-shipment-id {
	font-weight: 700;
}

.sale-order-list-shipment-id-icon {
	display: inline-block;
	width: 11px;
	height: 13px;
	background: url("images/sale-order-order-list-options-methods-shipment-list-item-id-element.svg") center no-repeat;
	cursor: pointer;
	vertical-align: -2px;
}

/* ---- Чеки ---- */
.sale-order-list-payment-check {
	font-size: 12px;
	margin-bottom: 6px;
}

/* ---- Шаблон отмены платежа (скрыт, используется JS) ---- */
.sale-order-list-inner-row-template {
	display: none;
}

/* ---- Аутентификация ---- */
.cpo-auth-error {
	max-width: 480px;
	margin: 0 auto;
}

.cpo-auth-error__msg {
	padding: 12px 16px;
	background: #ffe5e8;
	border: 1px solid #eab3b9;
	border-radius: 6px;
	color: #d0021b;
	margin-bottom: 16px;
	font-size: 14px;
}

/* ---- Пагинация ---- */
.cpo ~ nav,
.cpo .bx-pagination {
	margin-top: 1.5rem;
}

/* ---- Адаптив ---- */
@media (max-width: 600px) {
	.cpo-payment {
		flex-direction: column;
	}

	.cpo-payment__action {
		width: 100%;
	}

	.cpo-btn--primary {
		width: 100%;
		text-align: center;
	}

	.cpo-shipment {
		flex-direction: column;
	}

	.cpo-card__head--history {
		flex-direction: column;
		gap: 4px;
	}
}
