/*
 * My Account: order view, account menu and orders list (UX batch OV, 2026-10-29).
 * Loaded on account pages only (functions.php). Markup in
 * woocommerce/myaccount/view-order.php and orders.php, the menu button from
 * functions.php. Review page: workspace _local/ux-order-view-review/.
 */

/* ---------- order header (OV2, OV7) ---------- */
body.woocommerce-account .ksec-ov-head,
body.woocommerce-account .ksec-ov-card,
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details {
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 10px;
	padding: 24px 32px;
	margin: 0 0 24px;
}
body.woocommerce-account .ksec-ov-head {
	display: flex;
	flex-wrap: wrap;
	gap: 16px 24px;
	align-items: center;
	justify-content: space-between;
}
body.woocommerce-account .ksec-ov-head__title {
	display: block;
	margin: 0 0 8px;
	font-size: 26px;
	font-weight: 500;
	line-height: 1.2;
	color: #0f1419;
}
body.woocommerce-account .ksec-ov-head__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	align-items: center;
	color: #444;
	font-size: 15px;
}
body.woocommerce-account .ksec-ov-head__meta .ksec-acc-order__status {
	margin: 0;
	font-size: 12px;
}
body.woocommerce-account .ksec-ov-head__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}
body.woocommerce-account .ksec-ov-head__actions a.ksec-ov-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: 44px;
	margin: 0;
	padding: 0 18px;
	border: 1px solid #0f1419;
	border-radius: 4px;
	background: #fff;
	color: #0f1419;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
}
body.woocommerce-account .ksec-ov-head__actions a.ksec-ov-btn:hover,
body.woocommerce-account .ksec-ov-head__actions a.ksec-ov-btn:focus-visible {
	background: #f3f4f4;
	color: #0f1419;
}
body.woocommerce-account .ksec-ov-head__actions a.ksec-ov-btn--primary {
	background: #0f1419;
	color: #fff;
}
body.woocommerce-account .ksec-ov-head__actions a.ksec-ov-btn--primary:hover,
body.woocommerce-account .ksec-ov-head__actions a.ksec-ov-btn--primary:focus-visible {
	background: #000;
	color: #fff;
}

/* ---------- Progress card (OV3, OV4) ---------- */
body.woocommerce-account .ksec-ov-card__title,
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details h2 {
	margin: 0 0 18px;
	font-size: 20px;
	font-weight: 500;
}
body.woocommerce-account ol.ksec-ov-steps {
	display: flex;
	margin: 0 0 18px;
	padding: 0;
	list-style: none;
}
body.woocommerce-account .ksec-ov-step {
	position: relative;
	flex: 1;
	margin: 0;
	padding-top: 34px;
	list-style: none;
	text-align: center;
	font-size: 14px;
	font-weight: 600;
	color: #0f1419;
}
/* the marker: green tick when done, teal ring when current, grey ring to come */
body.woocommerce-account .ksec-ov-step::before {
	content: "";
	position: absolute;
	top: 0;
	left: 50%;
	z-index: 1;
	box-sizing: border-box;
	width: 24px;
	height: 24px;
	transform: translateX(-50%);
	border: 2px solid #c8cccf;
	border-radius: 50%;
	background: #fff;
	color: #fff;
	font-size: 13px;
	line-height: 20px;
	text-align: center;
}
body.woocommerce-account .ksec-ov-step--done::before {
	content: "\2713";
	border-color: #018f4a;
	background: #018f4a;
}
body.woocommerce-account .ksec-ov-step--current::before {
	border: 6px solid #02738a;
}
body.woocommerce-account .ksec-ov-step--todo {
	color: #5b6373;
	font-weight: 500;
}
/* the line into each step, green once that step is done */
body.woocommerce-account .ksec-ov-step::after {
	content: "";
	position: absolute;
	top: 11px;
	left: -50%;
	width: 100%;
	height: 2px;
	background: #c8cccf;
}
body.woocommerce-account .ksec-ov-step--done::after { background: #018f4a; }
body.woocommerce-account .ksec-ov-step:first-child::after { display: none; }
body.woocommerce-account .ksec-ov-step__label,
body.woocommerce-account .ksec-ov-step__date { display: block; }
body.woocommerce-account .ksec-ov-step__date {
	margin-top: 2px;
	color: #444;
	font-size: 13px;
	font-weight: 400;
}
body.woocommerce-account .ksec-ov-track {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	align-items: baseline;
	margin: 0;
	padding-top: 14px;
	border-top: 1px solid #e2e2e2;
	color: #444;
	font-size: 15px;
}
/* one rule above the first line only; none when there are no steps above it */
body.woocommerce-account .ksec-ov-track + .ksec-ov-track { border-top: 0; padding-top: 8px; }
body.woocommerce-account .ksec-ov-card__title + .ksec-ov-track { border-top: 0; padding-top: 0; }
body.woocommerce-account .ksec-ov-track strong { color: #0f1419; }
body.woocommerce-account .ksec-ov-track a { font-weight: 600; }

/* ---------- order details: thumbnails, totals, help (OV5, OV6, OV8, OV12) ---------- */
body.woocommerce-account .woocommerce-table--order-details img.ksec-ov-thumb {
	float: left;
	width: 56px;
	height: 56px;
	margin: 0 14px 6px 0;
	object-fit: contain;
	border: 1px solid #e2e2e2;
	border-radius: 4px;
	background: #fff;
}
body.woocommerce-account .woocommerce-table--order-details td.product-name { overflow: hidden; }
body.woocommerce-account .woocommerce-table--order-details small,
body.woocommerce-account .woocommerce-table--order-details .shipped_via,
body.woocommerce-account .woocommerce-table--order-details .includes_tax {
	font-size: 13px;
}
body.woocommerce-account .woocommerce-table--order-details .amount { font-variant-numeric: tabular-nums; }
body.woocommerce-account .ksec-ov-help {
	margin: 18px 0 0;
	color: #444;
	font-size: 15px;
}

/* ---------- addresses in one card (OV11) ---------- */
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details { display: flow-root; }

/* ---------- orders list (OV15) ---------- */
.ksec-acc-order__thumbs {
	display: flex;
	gap: 6px;
	margin: 4px 0 6px;
}
.ksec-acc-order__thumbs img.ksec-acc-order__thumb {
	width: 40px;
	height: 40px;
	object-fit: contain;
	border: 1px solid #e2e2e2;
	border-radius: 4px;
	background: #fff;
}
.ksec-acc-order__items-list {
	display: flex;
	gap: 4px;
	min-width: 0;
	max-width: 100%;
}
.ksec-acc-order__items-first {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.ksec-acc-order__items-more {
	flex: 0 0 auto;
	white-space: nowrap;
}
.ksec-acc-order__body { min-width: 0; }

/* ---------- account menu button (OV1); desktop keeps the sidebar ---------- */
.ksec-acc-nav__toggle { display: none; }

@media (max-width: 767px) {
	body.woocommerce-account .woocommerce-MyAccount-navigation.ksec-acc-nav--dd {
		padding: 0;
		margin-bottom: 16px;
		overflow: hidden;
	}
	body.woocommerce-account .ksec-acc-nav__toggle:not([hidden]) {
		display: flex;
		align-items: center;
		gap: 10px;
		width: 100%;
		min-height: 52px;
		margin: 0;
		padding: 0 16px;
		border: 0;
		border-radius: inherit;
		background: #fff;
		color: #0f1419;
		font: inherit;
		font-size: 16px;
		font-weight: 600;
		line-height: 1.2;
		text-align: left;
		cursor: pointer;
	}
	body.woocommerce-account .ksec-acc-nav__toggle:focus-visible {
		outline: 2px solid #02738a;
		outline-offset: -2px;
	}
	.ksec-acc-nav__hint {
		margin-left: auto;
		color: #444;
		font-size: 13px;
		font-weight: 400;
	}
	.ksec-acc-nav__toggle svg { flex: 0 0 auto; transition: transform .2s; }
	.ksec-acc-nav--dd.is-open .ksec-acc-nav__toggle svg { transform: rotate(180deg); }
	body.woocommerce-account .woocommerce-MyAccount-navigation.ksec-acc-nav--dd:not(.is-open) ul { display: none; }
	body.woocommerce-account .woocommerce-MyAccount-navigation.ksec-acc-nav--dd.is-open ul {
		padding: 4px 8px 8px;
		border-top: 1px solid #e2e2e2;
	}

	/* breadcrumb links: 44px tall tap area (15px before) */
	body.woocommerce-account .woocommerce-breadcrumb a {
		display: inline-flex;
		align-items: center;
		min-height: 44px;
	}

	/* order view */
	body.woocommerce-account .ksec-ov-head,
	body.woocommerce-account .ksec-ov-card,
	body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details { padding: 18px 16px; }
	/* column-reverse: the primary (Pay, Order again) on top, Cancel furthest from it */
	body.woocommerce-account .ksec-ov-head__actions { flex-direction: column-reverse; width: 100%; }
	body.woocommerce-account .ksec-ov-head__actions a.ksec-ov-btn { width: 100%; }
	body.woocommerce-account ol.ksec-ov-steps { flex-direction: column; gap: 16px; }
	body.woocommerce-account .ksec-ov-step { padding: 2px 0 0 36px; text-align: left; }
	body.woocommerce-account .ksec-ov-step::before { left: 0; transform: none; }
	body.woocommerce-account .ksec-ov-step::after { top: -16px; left: 11px; width: 2px; height: 16px; }

	/* each total on one row, label left and amount right (OV9). !important
	   because the parent theme's small-screen table rules stack these cells
	   with their own !important. */
	body.woocommerce-account .woocommerce-table--order-details tbody tr,
	body.woocommerce-account .woocommerce-table--order-details tfoot tr {
		display: flex !important;
		align-items: baseline;
		justify-content: space-between;
		gap: 12px;
	}
	body.woocommerce-account .woocommerce-table--order-details tbody td,
	body.woocommerce-account .woocommerce-table--order-details tfoot th,
	body.woocommerce-account .woocommerce-table--order-details tfoot td {
		display: block !important;
		width: auto !important;
		padding: 6px 0 !important;
		border: 0 !important;
	}
	body.woocommerce-account .woocommerce-table--order-details tbody td.product-total,
	body.woocommerce-account .woocommerce-table--order-details tfoot td {
		text-align: right !important;
	}
	body.woocommerce-account .woocommerce-table--order-details tbody td.product-total { white-space: nowrap; }
}
