/*
 * My Account: the Orders table action buttons (View, Return or exchange and any others) were full-width pills
 * stacked on top of each other. Owner request 2026-11-15: smaller, side by side. Presentation only.
 */
.woocommerce-account .woocommerce-orders-table__cell-order-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.woocommerce-account .woocommerce-orders-table__cell-order-actions .woocommerce-button,
.woocommerce-account .woocommerce-orders-table__cell-order-actions a.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: auto;
	min-height: 34px;
	margin: 0;
	padding: 0 14px;
	border-width: 1.5px;
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 1.2;
	white-space: nowrap;
}

/*
 * My Account on phones: tiles on the dashboard, a back button on every other page (owner request 2026-11-15).
 * The long menu is hidden below 768px; from 768px the side menu stays and the tiles and back button are hidden.
 * Markup: inc/account.php. Icons: assets/icons/account-*.svg as masks.
 */
.mw-acct-tiles,
.mw-acct-back {
	display: none;
}

@media (max-width: 767px) {
	.woocommerce-account .woocommerce-MyAccount-navigation {
		display: none;
	}

	.mw-acct-tiles {
		display: block;
		margin: 20px 0 8px;
	}

	.mw-acct-tiles ul {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
		margin: 0;
		padding: 0;
		list-style: none;
	}

	.mw-acct-tiles li {
		margin: 0;
	}

	.mw-acct-tile {
		display: flex;
		flex-direction: column;
		justify-content: center;
		gap: 10px;
		box-sizing: border-box;
		min-height: 104px;
		padding: 16px 14px;
		border: 1px solid var(--wp--preset--color--border);
		border-radius: 12px;
		background: var(--wp--preset--color--base);
		color: var(--wp--preset--color--contrast);
		font-size: 1rem;
		line-height: 1.25;
		text-decoration: none;
	}

	.mw-acct-tile:hover,
	.mw-acct-tile:focus-visible {
		border-color: var(--wp--preset--color--contrast);
		background: var(--wp--preset--color--surface);
	}

	.mw-acct-tile:active {
		background: var(--wp--preset--color--surface);
	}

	.mw-acct-tile__icon {
		display: block;
		width: 28px;
		height: 28px;
		background: var(--wp--preset--color--primary);
		-webkit-mask: var(--mw-acct-icon) center / contain no-repeat;
		mask: var(--mw-acct-icon) center / contain no-repeat;
	}

	.mw-acct-tile__icon--account-orders { --mw-acct-icon: url("../icons/account-orders.svg"); }
	.mw-acct-tile__icon--account-returns { --mw-acct-icon: url("../icons/account-returns.svg"); }
	.mw-acct-tile__icon--account-address { --mw-acct-icon: url("../icons/account-address.svg"); }
	.mw-acct-tile__icon--account-user { --mw-acct-icon: url("../icons/account-user.svg"); }
	.mw-acct-tile__icon--account-logout { --mw-acct-icon: url("../icons/account-logout.svg"); }
	.mw-acct-tile__icon--account-download { --mw-acct-icon: url("../icons/account-download.svg"); }
	.mw-acct-tile__icon--account-card { --mw-acct-icon: url("../icons/account-card.svg"); }
	.mw-acct-tile__icon--account-dot { --mw-acct-icon: url("../icons/account-dot.svg"); }

	.mw-acct-tile--quiet .mw-acct-tile__icon {
		background: var(--wp--preset--color--text-muted);
	}

	.mw-acct-tile--quiet {
		color: var(--wp--preset--color--text-muted);
	}

	.mw-acct-back {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		box-sizing: border-box;
		min-height: 40px;
		margin: 0 0 16px;
		padding: 0 16px 0 10px;
		border: 1.5px solid var(--wp--preset--color--contrast);
		border-radius: 999px;
		background: transparent;
		color: var(--wp--preset--color--contrast);
		font-size: 0.9375rem;
		font-weight: 500;
		line-height: 1.2;
		text-decoration: none;
	}

	.mw-acct-back:hover,
	.mw-acct-back:focus-visible {
		background: var(--wp--preset--color--surface);
	}

	.mw-acct-back__icon {
		display: block;
		width: 18px;
		height: 18px;
		background: currentColor;
		-webkit-mask: url("../icons/chevron-right.svg") center / contain no-repeat;
		mask: url("../icons/chevron-right.svg") center / contain no-repeat;
		transform: scaleX(-1);
	}
}

/*
 * My Account pages (owner request 2026-11-15, after a mockup): less space above the heading, a smaller centred heading,
 * the side menu as a card (from 768px), the two addresses as cream cards with the Edit button at the bottom, and a
 * small centred Save changes button. CSS only; WooCommerce's markup is unchanged.
 */
/* The parent theme's page template writes these two spacings as inline styles, which only !important can override
   (the parent theme must not be edited, and a new page template would change every page). Scoped to My Account. */
body.woocommerce-account .wp-site-blocks > main {
	margin-block-start: 0 !important;
}

body.woocommerce-account main > .wp-block-group.alignfull {
	padding-block-start: clamp(1rem, 2.5vw, 1.75rem) !important;
}

body.woocommerce-account main h1.wp-block-post-title {
	margin: 0 0 clamp(0.875rem, 2vw, 1.25rem);
	font-size: 1.25rem;
	font-weight: 400;
	letter-spacing: 0.02em;
	line-height: 1.25;
	text-align: center;
}

@media (min-width: 768px) {
	body.woocommerce-account main h1.wp-block-post-title {
		font-size: 1.375rem;
	}

	/* Menu card on the left, content on the right. Flex with explicit order, so any other element WooCommerce or a
	   plugin prints inside the wrapper (notices and so on) takes a full row of its own above them. */
	body.woocommerce-account .woocommerce:has(> .woocommerce-MyAccount-navigation) {
		display: flex;
		flex-wrap: wrap;
		gap: 0 30px;
		align-items: flex-start;
	}

	/* WooCommerce's clearfix pseudo-elements would become empty flex items and push the menu and the content. */
	body.woocommerce-account .woocommerce:has(> .woocommerce-MyAccount-navigation)::before,
	body.woocommerce-account .woocommerce:has(> .woocommerce-MyAccount-navigation)::after {
		display: none;
	}

	body.woocommerce-account .woocommerce:has(> .woocommerce-MyAccount-navigation) > * {
		flex: 0 0 100%;
		order: 0;
		min-width: 0;
		margin-block: 0;
	}

	body.woocommerce-account .woocommerce:has(> .woocommerce-MyAccount-navigation) > .woocommerce-MyAccount-navigation {
		flex: 0 0 220px;
		order: 1;
	}

	body.woocommerce-account .woocommerce:has(> .woocommerce-MyAccount-navigation) > .woocommerce-MyAccount-content {
		flex: 1 1 0;
		order: 2;
	}

	body.woocommerce-account .woocommerce-notices-wrapper:has(*) {
		margin-bottom: 16px;
	}

	body.woocommerce-account .woocommerce-MyAccount-navigation {
		float: none;
		box-sizing: border-box;
		width: auto;
		padding: 10px;
		border: 1px solid var(--wp--preset--color--border);
		border-radius: 12px;
		background: var(--wp--preset--color--base);
	}

	body.woocommerce-account .woocommerce-MyAccount-navigation ul {
		margin: 0;
		padding: 0;
		list-style: none;
	}

	body.woocommerce-account .woocommerce-MyAccount-navigation li {
		margin: 0;
		padding: 0;
	}

	body.woocommerce-account .woocommerce-MyAccount-navigation li a {
		display: block;
		padding: 10px 14px;
		border-radius: 8px;
		font-size: 0.9375rem;
		line-height: 1.3;
		text-decoration: none;
	}

	body.woocommerce-account .woocommerce-MyAccount-navigation li a:hover,
	body.woocommerce-account .woocommerce-MyAccount-navigation li a:focus-visible {
		background: var(--wp--preset--color--surface);
	}

	body.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a {
		background: var(--wp--preset--color--surface);
		box-shadow: inset 3px 0 0 var(--wp--preset--color--primary);
		font-weight: 500;
	}

	body.woocommerce-account .woocommerce-MyAccount-content {
		float: none;
		width: auto;
		min-width: 0;
	}
}

/* Addresses: two cream cards, Edit button at the bottom. */
body.woocommerce-account .woocommerce-MyAccount-content > p:has(+ .woocommerce-Addresses) {
	margin: 0 0 14px;
	color: var(--wp--preset--color--text-muted);
	font-size: 0.875rem;
	text-align: center;
}

body.woocommerce-account .woocommerce-Addresses {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 16px;
	margin: 0;
}

@media (min-width: 768px) {
	body.woocommerce-account .woocommerce-Addresses {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* WooCommerce's clearfix pseudo-elements would take the first grid cell. */
body.woocommerce-account .woocommerce-Addresses::before,
body.woocommerce-account .woocommerce-Addresses::after {
	display: none;
}

body.woocommerce-account .woocommerce-Addresses .woocommerce-Address,
body.woocommerce-account .woocommerce-Addresses .col-1,
body.woocommerce-account .woocommerce-Addresses .col-2 {
	float: none;
	width: auto;
	margin: 0;
}

body.woocommerce-account .woocommerce-Addresses .woocommerce-Address {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	box-sizing: border-box;
	padding: 18px 20px;
	border-radius: 12px;
	background: var(--wp--preset--color--surface);
}

body.woocommerce-account .woocommerce-Address header.woocommerce-Address-title {
	display: contents;
}

body.woocommerce-account .woocommerce-Address .woocommerce-Address-title :is(h2, h3) {
	order: 1;
	margin: 0 0 10px;
	font-size: 1.125rem;
	font-weight: 500;
	line-height: 1.3;
}

body.woocommerce-account .woocommerce-Address address {
	order: 2;
	margin: 0 0 14px;
	font-size: 0.9375rem;
	font-style: normal;
	line-height: 1.65;
}

body.woocommerce-account .woocommerce-Address .woocommerce-Address-title a.edit {
	order: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	float: none;
	min-height: 36px;
	padding: 0 18px;
	border: 1.5px solid var(--wp--preset--color--contrast);
	border-radius: 999px;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
}

body.woocommerce-account .woocommerce-Address .woocommerce-Address-title a.edit:hover,
body.woocommerce-account .woocommerce-Address .woocommerce-Address-title a.edit:focus-visible {
	background: var(--wp--preset--color--surface);
}

/* Account details and address forms: a small centred Save button. */
body.woocommerce-account .woocommerce-EditAccountForm fieldset legend {
	font-size: 1.0625rem;
	font-weight: 400;
}

body.woocommerce-account :is(.woocommerce-EditAccountForm, .woocommerce-address-fields) p:has(> button[name="save_account_details"], > button[name="save_address"]) {
	text-align: center;
}

body.woocommerce-account button[name="save_account_details"],
body.woocommerce-account button[name="save_address"] {
	width: auto;
	min-height: 44px;
	padding: 0 30px;
	font-size: 0.9375rem;
	font-weight: 500;
}
