/* Track Order History for WooCommerce: My Account. Inherits the theme's fonts and colours. */

.wptoh-account {
	margin: 2em 0;
}

.wptoh-account--orders {
	margin-top: 0;
}

.wptoh-account h2 {
	margin-bottom: 0.6em;
}

.wptoh-filter {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6em 1.2em;
	margin-bottom: 1em;
}

.wptoh-filter__ranges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em;
}

.wptoh-account .wptoh-filter a.wptoh-filter__range {
	display: inline-block;
	padding: 0.3em 0.9em;
	border: 1px solid currentColor;
	border-radius: 2em;
	font-size: 0.9em;
	line-height: 1.5;
	text-decoration: none;
	opacity: 0.75;
}

.wptoh-account .wptoh-filter a.wptoh-filter__range:hover,
.wptoh-account .wptoh-filter a.wptoh-filter__range:focus {
	opacity: 1;
}

.wptoh-account .wptoh-filter a.wptoh-filter__range.is-current {
	opacity: 1;
	font-weight: 700;
	box-shadow: inset 0 0 0 1px currentColor;
}

.wptoh-filter__dates {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4em;
	margin: 0;
}

.wptoh-filter__dates select {
	width: auto;
}

.wptoh-filter__current {
	flex-basis: 100%;
	margin: 0;
	font-size: 0.9em;
	opacity: 0.8;
}

.wptoh-account__stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 0.8em;
	margin: 0 0 1.2em;
}

.wptoh-account__stats div {
	padding: 0.8em 1em;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 6px;
}

.wptoh-account__stats dt {
	margin: 0;
	font-size: 0.8em;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	opacity: 0.75;
}

.wptoh-account__stats dd {
	margin: 0.2em 0 0;
	font-size: 1.25em;
	font-weight: 700;
}

.wptoh-account__actions {
	white-space: nowrap;
}

/* Base look for themes that do not style WooCommerce tables (block themes). Zero specificity, so any theme rule wins. */
:where(.wptoh-account) :where(.wptoh-account__orders) {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 1em;
}

:where(.wptoh-account) :where(.wptoh-account__orders) :where(th, td) {
	padding: 0.6em 0.75em;
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
	text-align: start;
	vertical-align: top;
}

:where(.wptoh-account__actions) > :where(a, button) + :where(a, button) {
	margin-inline-start: 0.75em;
}

:where(.wptoh-filter__dates) :where(select, button) {
	font: inherit;
	font-size: 0.9em;
	padding: 0.35em 0.6em;
	min-height: 2.2em;
}

:where(.wptoh-filter__dates) :where(select) {
	padding-inline-end: 2em;
}

.wptoh-account__more {
	margin-top: 0.6em;
}

.wptoh-favourites__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 1em;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wptoh-favourites__item {
	display: flex;
	flex-direction: column;
	gap: 0.5em;
	padding: 1em;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 6px;
}

.wptoh-favourites__image img {
	display: block;
	width: 64px;
	height: auto;
}

.wptoh-favourites__info {
	display: flex;
	flex-direction: column;
	gap: 0.2em;
	flex: 1;
}

.wptoh-favourites__name {
	font-weight: 700;
}

.wptoh-favourites__qty {
	font-size: 0.85em;
	opacity: 0.75;
}

.wptoh-favourites__add {
	align-self: flex-start;
}

/* Shortcode [wptoh_orders] */
.wptoh-sc {
	display: grid;
	gap: 1em;
}

.wptoh-sc > * {
	margin-top: 0;
	margin-bottom: 0;
}

.wptoh-sc__title {
	margin: 0;
}

.wptoh-account__products {
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.92em;
}

.wptoh-account__qty {
	opacity: 0.7;
}

.wptoh-account__cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 1em;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wptoh-account__card {
	display: flex;
	flex-direction: column;
	gap: 0.6em;
	padding: 1em;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 8px;
}

.wptoh-account__card-head,
.wptoh-account__card-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5em;
}

.wptoh-account__card-number {
	font-weight: 700;
}

.wptoh-account__status {
	padding: 0.1em 0.6em;
	border-radius: 2em;
	background: rgba(0, 0, 0, 0.06);
	font-size: 0.85em;
}

.wptoh-account__card .wptoh-account__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em;
	margin-top: auto;
}

.wptoh-last-order {
	display: grid;
	gap: 0.6em;
	padding: 1.2em;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 8px;
}

.wptoh-last-order__title,
.wptoh-last-order__meta {
	margin: 0;
}

.wptoh-sc--guest {
	padding: 1em;
	border: 1px dashed rgba(0, 0, 0, 0.2);
	border-radius: 8px;
}

.wptoh-sc--guest p {
	margin: 0 0 0.6em;
}

.wptoh-sc--guest p:last-child {
	margin-bottom: 0;
}
