/* WooCommerce "My account": login/registration cards, navigation, dashboard, addresses.
   Fields, buttons and notices: components/woocommerce-forms/woocommerce-forms.css. */

/* Login and registration: two cards side by side, stacked on narrow screens. */
.woocommerce-account #customer_login {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
	gap: 1.5rem;
	max-width: 56rem;
	margin-inline: auto;
}

.woocommerce-account #customer_login::before,
.woocommerce-account #customer_login::after {
	display: none;
}

.woocommerce-account #customer_login > div {
	float: none;
	width: auto;
	padding: 2rem;
	background: var(--leguma-surface);
	border: 1px solid var(--leguma-border);
	border-radius: var(--account-radius);
}

.woocommerce-account #customer_login h2 {
	position: relative;
	display: flex;
	gap: 0.75rem;
	align-items: center;
	margin-bottom: 1.5rem;
	font-size: 1.375rem;
}

/* Icon badge: a grey circle (::before) with the green icon masked on top (::after);
   the icon per heading is set in account.php. */
.woocommerce-account #customer_login h2::before {
	flex-shrink: 0;
	width: 2.75rem;
	height: 2.75rem;
	background: var(--leguma-surface-hover);
	border-radius: 50%;
	content: "";
}

.woocommerce-account #customer_login h2::after {
	position: absolute;
	top: 50%;
	left: 0.775rem;
	width: 1.2rem;
	height: 1.2rem;
	background: var(--leguma-secondary-dark);
	content: "";
	transform: translateY(-50%);
	-webkit-mask: var(--account-icon) center / contain no-repeat;
	mask: var(--account-icon) center / contain no-repeat;
}

.woocommerce-account #customer_login form {
	margin: 0;
	padding: 0;
	border: 0;
}

.woocommerce-account #customer_login :is(button.button, input.button) {
	width: 100%;
	margin-top: 0.5rem;
}

.woocommerce-account .woocommerce-form-login__rememberme {
	display: inline-flex !important;
	gap: 0.5rem;
	align-items: center;
	font-weight: 400 !important;
}

.woocommerce-account .woocommerce-LostPassword {
	margin: 1rem 0 0;
	font-size: 0.875rem;
	text-align: center;
}

.woocommerce-account .woocommerce-privacy-policy-text,
.woocommerce-account #customer_login .u-column2 form > p:not(.form-row) {
	color: var(--leguma-muted);
	font-size: 0.875rem;
}

/* Logged in: navigation sidebar + content. */
.logged-in.woocommerce-account .entry-content .woocommerce {
	display: grid;
	grid-template-columns: 16rem minmax(0, 1fr);
	gap: 2rem;
	align-items: start;
}

.logged-in.woocommerce-account .woocommerce::before,
.logged-in.woocommerce-account .woocommerce::after {
	display: none;
}

.logged-in.woocommerce-account .woocommerce > .woocommerce-notices-wrapper {
	grid-column: 1 / -1;
}

.woocommerce-account .woocommerce-MyAccount-navigation,
.woocommerce-account .woocommerce-MyAccount-content {
	float: none;
	width: auto;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul {
	margin: 0;
	padding: 0.5rem;
	list-style: none;
	background: var(--leguma-surface);
	border: 1px solid var(--leguma-border);
	border-radius: var(--account-radius);
}

.woocommerce-account .woocommerce-MyAccount-navigation a {
	display: flex;
	gap: 0.75rem;
	align-items: center;
	padding: 0.75rem 1rem;
	color: var(--leguma-text);
	border-radius: 10px;
	font-weight: 600;
	text-decoration: none;
	transition: background-color var(--leguma-transition), color var(--leguma-transition);
}

.woocommerce-account .woocommerce-MyAccount-navigation a::before {
	flex-shrink: 0;
	width: 1.125rem;
	height: 1.125rem;
	background: currentcolor;
	content: "";
	opacity: 0.75;
	-webkit-mask: var(--account-icon) center / contain no-repeat;
	mask: var(--account-icon) center / contain no-repeat;
}

.woocommerce-account .woocommerce-MyAccount-navigation a:hover {
	background: var(--leguma-surface-hover);
}

.woocommerce-account .woocommerce-MyAccount-navigation .is-active a {
	background: var(--leguma-surface-hover);
}

/* Current page: grey row with a green icon. */
.woocommerce-account .woocommerce-MyAccount-navigation .is-active a::before {
	background: var(--leguma-secondary-dark);
	opacity: 1;
}

.woocommerce-account .woocommerce-MyAccount-navigation-link--customer-logout {
	margin-top: 0.5rem;
	padding-top: 0.5rem;
	border-top: 1px solid var(--leguma-border);
}

.woocommerce-account .woocommerce-MyAccount-navigation-link--customer-logout a {
	color: var(--leguma-muted);
}

/* Content panel. */
.woocommerce-account .woocommerce-MyAccount-content {
	padding: 2rem;
	background: var(--leguma-surface);
	border: 1px solid var(--leguma-border);
	border-radius: var(--account-radius);
}

.woocommerce-account .woocommerce-MyAccount-content > p:first-child {
	font-size: 1.125rem;
}

/* Dashboard quick links. */
.account-links {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
	gap: 1rem;
	margin-top: 1.75rem;
}

.account-link {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	padding: 1.25rem;
	color: var(--leguma-text);
	border: 1px solid var(--leguma-border);
	border-radius: var(--account-radius);
	text-decoration: none;
	transition: transform var(--leguma-transition), box-shadow var(--leguma-transition), border-color var(--leguma-transition);
}

.account-link:hover {
	border-color: transparent;
	box-shadow: 0 1rem 2rem rgb(0 0 0 / 12%);
	transform: translateY(-3px);
}

.account-link__icon {
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	margin-bottom: 0.5rem;
	color: var(--leguma-secondary-dark);
	background: var(--leguma-surface-hover);
	border-radius: 50%;
}

.account-link__icon svg {
	width: 1.2rem;
	height: 1.2rem;
}

.account-link__title {
	font-weight: 700;
}

.account-link__text {
	color: var(--leguma-muted);
	font-size: 0.875rem;
	line-height: 1.45;
}

/* Orders and other tables. */
.woocommerce-account .woocommerce-MyAccount-content table.shop_table {
	overflow: hidden;
	border: 1px solid var(--leguma-border);
	border-collapse: separate;
	border-radius: var(--account-radius);
}

.woocommerce-account .woocommerce-MyAccount-content table.shop_table :is(th, td) {
	padding: 0.85rem 1rem;
	border-color: var(--leguma-border);
}

.woocommerce-account .woocommerce-MyAccount-content table.shop_table thead th {
	background: var(--leguma-surface-hover);
	font-size: 0.8125rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.woocommerce-account .woocommerce-MyAccount-content table.shop_table .button {
	min-height: 2.25rem;
	margin: 0.15rem 0.25rem 0.15rem 0;
	padding: 0.4rem 1rem;
	font-size: 0.8125rem;
}

/* Addresses. */
.woocommerce-account .woocommerce-Addresses {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
	gap: 1rem;
	margin-top: 1rem;
}

.woocommerce-account .woocommerce-Addresses::before,
.woocommerce-account .woocommerce-Addresses::after {
	display: none;
}

.woocommerce-account .woocommerce-Address {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	float: none !important;
	width: auto !important;
	padding: 1.25rem;
	border: 1px solid var(--leguma-border);
	border-radius: var(--account-radius);
}

/* Title, address, then the edit link at the bottom: the header wrapper is flattened
   so its title and link can be ordered around the address. */
.woocommerce-account .woocommerce-Address-title {
	display: contents;
}

.woocommerce-account .woocommerce-Address-title h2 {
	order: 0;
	float: none;
	margin: 0;
	font-size: 1.125rem;
}

.woocommerce-account .woocommerce-Address address {
	flex: 1;
	order: 1;
	margin: 0;
	color: var(--leguma-muted);
	font-style: normal;
	line-height: 1.7;
}

/* Edit link: outlined like the pagination buttons. */
.woocommerce-account .woocommerce-Address .edit {
	display: inline-flex;
	order: 2;
	gap: 0.5rem;
	align-items: center;
	align-self: flex-start;
	float: none;
	padding: 0.55rem 1rem;
	color: var(--leguma-text);
	border: 1px solid var(--account-field-border);
	border-radius: 10px;
	font-size: 0.875rem;
	font-weight: 700;
	text-decoration: none;
	transition: border-color var(--leguma-transition);
}

.woocommerce-account .woocommerce-Address .edit::before {
	width: 0.95rem;
	height: 0.95rem;
	background: currentcolor;
	content: "";
	-webkit-mask: var(--account-icon) center / contain no-repeat;
	mask: var(--account-icon) center / contain no-repeat;
}

.woocommerce-account .woocommerce-Address .edit:hover {
	border-color: var(--leguma-secondary);
}

/* Mobile: the theme's only breakpoint (see style.css Tokens). */
@media (max-width: 64rem) {
	.logged-in.woocommerce-account .entry-content .woocommerce {
		grid-template-columns: minmax(0, 1fr);
		gap: 1.25rem;
	}

	.woocommerce-account .woocommerce-MyAccount-content,
	.woocommerce-account #customer_login > div {
		padding: 1.25rem;
	}
}
