/* ===== My Account orders: action buttons alignment fix ===== */
.woocommerce-account .woocommerce-orders-table__cell-order-actions,
.woocommerce-account table.my_account_orders td.order-actions {
	white-space: nowrap;
}

.woocommerce-account .woocommerce-orders-table__cell-order-actions .button,
.woocommerce-account table.my_account_orders td.order-actions .button,
.woocommerce-account .my_account_orders .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	height: auto;
	min-height: 0;
	padding: 8px 12px;
	font-size: 13px;
	line-height: 1.2;
	margin: 0;
	vertical-align: middle;
}

.woocommerce-account .woocommerce-orders-table__cell-order-actions .button + .button,
.woocommerce-account table.my_account_orders td.order-actions .button + .button,
.woocommerce-account .my_account_orders .button + .button {
	margin-left: 8px;
}

/* Remove legacy icon pseudo element that can create odd button width/protrusion. */
.woocommerce-account .my_account_orders .button.view::after {
	content: none;
	margin: 0;
}

@media (max-width: 480px) {
	.woocommerce-account .woocommerce-orders-table__cell-order-actions,
	.woocommerce-account table.my_account_orders td.order-actions {
		white-space: normal;
	}

	.woocommerce-account .woocommerce-orders-table__cell-order-actions .button,
	.woocommerce-account table.my_account_orders td.order-actions .button,
	.woocommerce-account .my_account_orders .button {
		margin-top: 6px;
	}

	.woocommerce-account .woocommerce-orders-table__cell-order-actions .button + .button,
	.woocommerce-account table.my_account_orders td.order-actions .button + .button,
	.woocommerce-account .my_account_orders .button + .button {
		margin-left: 6px;
	}
}

/* My Account > View order: license table product column was hard-coded to 20% inline.
   Rebalance widths only in account context so product names are less cramped. */
.woocommerce-account .woocommerce-order-details .fslm-license-keys-table th:first-child,
.woocommerce-account .woocommerce-order-details .fslm-license-keys-table td:first-child {
	width: 42%;
	min-width: 42%;
}

.woocommerce-account .woocommerce-order-details .fslm-license-keys-table th:nth-child(2),
.woocommerce-account .woocommerce-order-details .fslm-license-keys-table td:nth-child(2) {
	width: 58%;
}

/* View Order: keep order-details and long purchase notes inside the viewport. */
body.woocommerce-account.woocommerce-view-order .woocommerce-order-details .woocommerce-table--order-details {
	width: 100%;
	max-width: 100%;
	table-layout: fixed;
}

body.woocommerce-account.woocommerce-view-order .woocommerce-order-details .woocommerce-table--order-details th,
body.woocommerce-account.woocommerce-view-order .woocommerce-order-details .woocommerce-table--order-details td,
body.woocommerce-account.woocommerce-view-order .woocommerce-order-details .woocommerce-table--order-details p {
	box-sizing: border-box;
	max-width: 100%;
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: break-word;
}

@media (max-width: 768px) {
	body.woocommerce-account.woocommerce-view-order table.shop_table_responsive tr td[data-title] {
		text-align: left;
		display: flex;
		flex-direction: column;
		align-items: flex-start;
	}

	body.woocommerce-account.woocommerce-view-order table.shop_table_responsive tr td[data-title]::before {
		float: none;
		display: block;
		margin: 0 0 6px;
		text-align: left;
	}

	body.woocommerce-account.woocommerce-view-order table.shop_table_responsive tr td[data-title] > .dem-view-order-cell-value {
		display: block;
		width: 100%;
		text-align: left;
	}
}

@media (max-width: 480px) {
	/* Tighten oversized account navigation rows on small screens. */
	.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
		padding-top: 14px;
		padding-bottom: 14px;
	}

	/* View Order: stack responsive table labels above values for readability. */
	.woocommerce-view-order table.shop_table_responsive tr td[data-title] {
		text-align: left;
		display: flex;
		flex-direction: column;
		align-items: flex-start;
	}

	.woocommerce-view-order table.shop_table_responsive tr td[data-title]::before {
		float: none;
		display: block;
		margin: 0 0 6px;
		text-align: left;
	}

	.woocommerce-view-order table.shop_table_responsive tr td[data-title] > .dem-view-order-cell-value {
		display: block;
		width: 100%;
		text-align: left;
	}
}

/* My Account auth mode switches: Register / Back to Login. */
body.woocommerce-account:not(.logged-in) .woocommerce .u-column1.col-1,
body.woocommerce-account:not(.logged-in) .woocommerce .u-column2.col-2 {
	float: none;
	width: 100%;
	max-width: 520px;
	margin-left: auto;
	margin-right: auto;
}

.woocommerce-account .dem-auth-switch {
	margin-left: 10px;
}

body.woocommerce-account:not(.logged-in) .woocommerce .dem-auth-actions {
	display: flex;
	align-items: stretch;
	gap: 10px;
	margin-top: 10px;
}

body.woocommerce-account:not(.logged-in) .woocommerce .dem-auth-actions .button,
body.woocommerce-account:not(.logged-in) .woocommerce .dem-auth-actions button.button {
	flex: 1 1 0;
	min-width: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 45px;
	margin: 0;
	padding: 0 14px;
	text-align: center;
	white-space: nowrap;
}

body.woocommerce-account:not(.logged-in) .woocommerce .dem-auth-actions .dem-auth-switch {
	margin-left: 0;
}

@media (max-width: 768px) {
	.woocommerce-account .dem-auth-switch {
		display: inline-flex;
		justify-content: center;
		margin-top: 10px;
		margin-left: 0;
	}

	body.woocommerce-account:not(.logged-in) .woocommerce .dem-auth-actions {
		flex-wrap: wrap;
	}

	body.woocommerce-account:not(.logged-in) .woocommerce .dem-auth-actions .button,
	body.woocommerce-account:not(.logged-in) .woocommerce .dem-auth-actions button.button {
		flex: 1 1 180px;
	}
}
