/**
 * WC UA Delivery — My Account customer UI.
 */

/* -------------------------------------------------------------------------- */
/* Order detail cards                                                         */
/* -------------------------------------------------------------------------- */

.wcuad-account-cards {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
	margin: 0 0 24px;
}

.wcuad-account-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 16px 18px;
	margin: 0;
}

.wcuad-account-card__title {
	margin: 0 0 14px;
	font-size: 1.05rem;
	line-height: 1.3;
}

.wcuad-account-grid {
	display: grid;
	gap: 10px;
}

.wcuad-account-row {
	display: grid;
	grid-template-columns: minmax(120px, 38%) 1fr;
	gap: 10px 16px;
	align-items: start;
}

.wcuad-account-row--badge {
	align-items: center;
}

.wcuad-account-label {
	color: #6b7280;
	font-size: 0.92rem;
}

.wcuad-account-value {
	color: #111827;
	font-size: 0.95rem;
	word-break: break-word;
}

.wcuad-account-card__actions {
	margin: 14px 0 0;
}

.wcuad-account-btn {
	display: inline-block;
}

/* -------------------------------------------------------------------------- */
/* Badges                                                                     */
/* -------------------------------------------------------------------------- */

.wcuad-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 4px 11px;
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 600;
	line-height: 1.35;
	white-space: nowrap;
	border: 1px solid transparent;
}

.wcuad-badge--paid {
	background: #ecfdf5;
	color: #047857;
	border-color: #a7f3d0;
}

.wcuad-badge--waiting {
	background: #fff7ed;
	color: #c2410c;
	border-color: #fed7aa;
}

.wcuad-badge--bank {
	background: #eff6ff;
	color: #1d4ed8;
	border-color: #bfdbfe;
}

.wcuad-badge--cod {
	background: #f5f3ff;
	color: #6d28d9;
	border-color: #ddd6fe;
}

.wcuad-badge--failed {
	background: #fef2f2;
	color: #b91c1c;
	border-color: #fecaca;
}

.wcuad-badge--unpaid {
	background: #f3f4f6;
	color: #4b5563;
	border-color: #e5e7eb;
}

.wcuad-badge--delivery-transit {
	background: #eff6ff;
	color: #1d4ed8;
	border-color: #bfdbfe;
}

.wcuad-badge--delivery-office {
	background: #fef9c3;
	color: #a16207;
	border-color: #fde68a;
}

.wcuad-badge--delivery-done {
	background: #ecfdf5;
	color: #047857;
	border-color: #a7f3d0;
}

.wcuad-badge--delivery-return {
	background: #fef2f2;
	color: #b91c1c;
	border-color: #fecaca;
}

.wcuad-badge--delivery-empty {
	background: #f3f4f6;
	color: #4b5563;
	border-color: #e5e7eb;
}

.wcuad-badge--order {
	background: #f3f4f6;
	color: #374151;
	border-color: #e5e7eb;
}

.wcuad-badge--order-pending {
	background: #fff7ed;
	color: #c2410c;
	border-color: #fed7aa;
}

.wcuad-badge--order-processing {
	background: #eff6ff;
	color: #1d4ed8;
	border-color: #bfdbfe;
}

.wcuad-badge--order-on-hold {
	background: #fef9c3;
	color: #a16207;
	border-color: #fde68a;
}

.wcuad-badge--order-completed {
	background: #ecfdf5;
	color: #047857;
	border-color: #a7f3d0;
}

.wcuad-badge--order-cancelled {
	background: #f3f4f6;
	color: #6b7280;
	border-color: #e5e7eb;
}

.wcuad-badge--order-failed {
	background: #fef2f2;
	color: #b91c1c;
	border-color: #fecaca;
}

.wcuad-badge--order-refunded {
	background: #f5f3ff;
	color: #6d28d9;
	border-color: #ddd6fe;
}

/* -------------------------------------------------------------------------- */
/* Orders list — shared                                                       */
/* -------------------------------------------------------------------------- */

.wcuad-orders-list {
	margin-top: 4px;
}

.wcuad-order-meta {
	display: grid;
	gap: 4px;
}

.wcuad-order-meta__number {
	font-size: 1rem;
	font-weight: 700;
	color: #111827;
	text-decoration: none;
	line-height: 1.25;
}

.wcuad-order-meta__number:hover {
	color: #047857;
}

.wcuad-order-meta__date {
	font-size: 0.82rem;
	color: #6b7280;
	line-height: 1.3;
}

.wcuad-order-total {
	display: grid;
	gap: 3px;
}

.wcuad-order-total__amount {
	font-size: 1rem;
	font-weight: 700;
	color: #111827;
	line-height: 1.25;
}

.wcuad-order-total__items {
	font-size: 0.8rem;
	color: #9ca3af;
	line-height: 1.3;
}

.wcuad-account-cell--payment {
	display: flex;
	align-items: flex-start;
}

.wcuad-delivery-stack {
	display: grid;
	gap: 7px;
	align-content: start;
}

.wcuad-delivery-stack__carrier {
	font-size: 0.9rem;
	font-weight: 600;
	color: #111827;
	line-height: 1.3;
}

.wcuad-delivery-stack__status {
	display: flex;
}

.wcuad-delivery-stack__ttn {
	font-size: 0.82rem;
	color: #4b5563;
	line-height: 1.35;
	word-break: break-all;
}

.wcuad-delivery-stack__ttn-label {
	color: #6b7280;
	font-weight: 600;
}

.wcuad-delivery-stack__ttn-value {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.8rem;
	color: #111827;
}

.wcuad-delivery-stack__track {
	display: inline-flex;
	align-items: center;
	width: fit-content;
	font-size: 0.82rem;
	font-weight: 600;
	color: #047857;
	text-decoration: none;
	padding: 2px 0;
	border-bottom: 1px solid transparent;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.wcuad-delivery-stack__track:hover {
	color: #065f46;
	border-bottom-color: #86efac;
}

.wcuad-order-actions {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 8px;
}

.wcuad-order-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	padding: 7px 14px !important;
	font-size: 0.82rem !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	border-radius: 8px !important;
	text-decoration: none !important;
	white-space: nowrap;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.wcuad-order-action--primary {
	box-shadow: 0 1px 2px rgba(4, 120, 87, 0.12);
}

.wcuad-order-action--secondary {
	background: #fff !important;
	color: #047857 !important;
	border: 1px solid #86efac !important;
}

.wcuad-order-action--secondary:hover {
	background: #ecfdf5 !important;
	border-color: #4ade80 !important;
	color: #065f46 !important;
}

.wcuad-order-action--tertiary {
	background: transparent !important;
	color: #047857 !important;
	border: 1px solid #d1d5db !important;
	min-height: 32px;
	padding: 5px 12px !important;
}

.wcuad-order-action--tertiary:hover {
	background: #f9fafb !important;
	border-color: #9ca3af !important;
	color: #065f46 !important;
}

.wcuad-order-action--cancel {
	background: #fff !important;
	color: #6b7280 !important;
	border: 1px solid #e5e7eb !important;
	min-height: 32px;
	padding: 5px 12px !important;
}

.wcuad-order-action--cancel:hover {
	background: #f9fafb !important;
	color: #374151 !important;
	border-color: #d1d5db !important;
}

.wcuad-account-card .wcuad-bank-requisites {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid #e5e7eb;
}

.wcuad-account-card .wcuad-bank-requisites h3 {
	margin: 0 0 10px;
	font-size: 0.95rem;
}

.wcuad-account-card .wcuad-bank-requisites__table th,
.wcuad-account-card .wcuad-bank-requisites__table td {
	font-size: 0.9rem;
	padding: 6px 8px 6px 0;
	vertical-align: top;
}

/* -------------------------------------------------------------------------- */
/* Desktop orders list — card rows                                            */
/* -------------------------------------------------------------------------- */

@media (min-width: 992px) {
	.wcuad-orders-list .woocommerce-orders-table.account-orders-table {
		width: 100%;
		border: 0;
		border-collapse: separate;
		border-spacing: 0 14px;
		table-layout: fixed;
		background: transparent;
	}

	.wcuad-orders-list .woocommerce-orders-table thead th {
		padding: 0 14px 8px;
		border: 0;
		background: transparent;
		font-size: 0.72rem;
		font-weight: 700;
		letter-spacing: 0.04em;
		text-transform: uppercase;
		color: #9ca3af;
		vertical-align: bottom;
	}

	.wcuad-orders-list .woocommerce-orders-table tbody tr {
		background: #fff;
		box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
		transition: box-shadow 0.18s ease, transform 0.18s ease;
	}

	.wcuad-orders-list .woocommerce-orders-table tbody tr:hover {
		box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
		transform: translateY(-1px);
	}

	.wcuad-orders-list .woocommerce-orders-table tbody th,
	.wcuad-orders-list .woocommerce-orders-table tbody td {
		padding: 18px 14px;
		border-top: 1px solid #e5e7eb;
		border-bottom: 1px solid #e5e7eb;
		border-left: 0;
		border-right: 0;
		background: #fff;
		vertical-align: middle;
	}

	.wcuad-orders-list .woocommerce-orders-table tbody th {
		border-left: 1px solid #e5e7eb;
		border-radius: 14px 0 0 14px;
	}

	.wcuad-orders-list .woocommerce-orders-table tbody td:last-child {
		border-right: 1px solid #e5e7eb;
		border-radius: 0 14px 14px 0;
	}

	.wcuad-orders-list .woocommerce-orders-table__header-order-number,
	.wcuad-orders-list .woocommerce-orders-table__cell-order-number {
		width: 16%;
	}

	.wcuad-orders-list .woocommerce-orders-table__header-order-status,
	.wcuad-orders-list .woocommerce-orders-table__cell-order-status {
		width: 12%;
	}

	.wcuad-orders-list .woocommerce-orders-table__header-wcuad-payment,
	.wcuad-orders-list .woocommerce-orders-table__cell-wcuad-payment {
		width: 18%;
	}

	.wcuad-orders-list .woocommerce-orders-table__header-wcuad-delivery,
	.wcuad-orders-list .woocommerce-orders-table__cell-wcuad-delivery {
		width: 28%;
	}

	.wcuad-orders-list .woocommerce-orders-table__header-order-total,
	.wcuad-orders-list .woocommerce-orders-table__cell-order-total {
		width: 12%;
	}

	.wcuad-orders-list .woocommerce-orders-table__header-order-actions,
	.wcuad-orders-list .woocommerce-orders-table__cell-order-actions {
		width: 14%;
	}

	.wcuad-orders-list .woocommerce-orders-table .wcuad-badge {
		white-space: normal;
		text-align: center;
	}

	.wcuad-orders-list .wcuad-order-total__amount {
		font-size: 1.05rem;
	}

	.wcuad-orders-list .wcuad-order-actions {
		min-width: 118px;
	}

	/* Tracking link already shown in delivery column on desktop. */
	.wcuad-orders-list .woocommerce-orders-table__cell-order-actions .wcuad-order-action.track {
		display: none;
	}
}

/* -------------------------------------------------------------------------- */
/* Detail page cards                                                          */
/* -------------------------------------------------------------------------- */

@media (min-width: 900px) {
	.wcuad-account-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		align-items: start;
	}
}

/* -------------------------------------------------------------------------- */
/* Mobile — keep WooCommerce responsive table                                 */
/* -------------------------------------------------------------------------- */

@media (max-width: 991px) {
	.wcuad-account-row {
		grid-template-columns: 1fr;
		gap: 4px;
	}

	.wcuad-account-label {
		font-weight: 600;
		color: #374151;
	}

	.wcuad-orders-list .woocommerce-orders-table .wcuad-order-actions {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 8px;
	}

	.wcuad-orders-list .woocommerce-orders-table .wcuad-order-action {
		flex: 1 1 auto;
		min-width: 120px;
	}

	.wcuad-orders-list .woocommerce-orders-table .wcuad-order-action--tertiary,
	.wcuad-orders-list .woocommerce-orders-table .wcuad-order-action--cancel {
		flex: 1 1 100%;
	}
}

@media (max-width: 768px) {
	.wcuad-orders-list .woocommerce-orders-table tr td::before,
	.wcuad-orders-list .woocommerce-orders-table tr th::before {
		font-weight: 600;
		color: #6b7280;
	}
}
