/* Account, authentication and form primitives.

   WooCommerce's own stylesheets are dequeued (see inc/enqueue.php), so every
   rule the account, cart and checkout screens need lives here or in
   woocommerce.css. Nothing in this file introduces a radius, a shadow or a
   gradient - the flat hairline treatment is load-bearing to the design. */

/* ---------------------------------------------------------------- Title band */

.mw-page-title-band__lede {
	max-width: 56ch;
	margin-top: var(--space-4);
	font-size: 15px;
	line-height: 1.7;
	color: var(--ink-soft);
}

/* Full-bleed wrapper for the WooCommerce shortcode pages. Unlike
   .mw-page-content it imposes no max-width, because the account layout
   carries its own sidebar grid. */
.mw-woo-page {
	display: flex;
	flex-direction: column;
	flex: 1 0 auto;
}

/* ------------------------------------------------------------ Account layout */

/* Deliberately the same skeleton as the shop archive: a fixed 264px rail,
   a fluid content column, and a single hairline between them. */
.mw-account {
	display: grid;
	grid-template-columns: 264px 1fr;
	flex: 1 0 auto;
}

/* Grid items default to min-width: auto and will not shrink below their
   contents. On mobile the nav becomes a horizontally scrolling tab strip,
   and without this its full width pushed the page sideways. */
.mw-account > * {
	min-width: 0;
}

.mw-account__nav {
	border-right: 1px solid var(--line);
	padding: 36px 32px;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.mw-account__nav ul {
	min-width: 0;
}

.mw-account__nav-head {
	margin-bottom: var(--space-5);
}

.mw-account__nav-head .mw-mono {
	font-size: 12px;
	color: var(--ink);
}

.mw-account__whoami {
	border-top: 1px solid var(--line);
	padding-top: var(--space-4);
	margin-bottom: var(--space-5);
}

.mw-account__whoami .mw-mono {
	display: block;
	font-size: 10px;
	color: var(--ink-mute);
	margin-bottom: 4px;
}

.mw-account__whoami-name {
	font-family: var(--font-display);
	font-size: 20px;
	line-height: 1.2;
	color: var(--ink);
}

.mw-account__nav ul {
	border-top: 1px solid var(--line);
}

.mw-account__nav li {
	border-bottom: 1px solid var(--line);
}

.mw-account__nav li a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-3);
	min-height: 44px;
	padding: var(--space-3) 0;
	font-family: var(--font-body);
	font-weight: 500;
	font-size: 13px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ink-mute);
	transition: color var(--transition-fast);
}

.mw-account__nav li a:hover,
.mw-account__nav li a:focus-visible {
	color: var(--olive);
}

.mw-account__nav-marker {
	font-family: var(--font-mono);
	opacity: 0;
	transition: opacity var(--transition-fast);
}

.mw-account__nav li.is-active > a,
.mw-account__nav li a[aria-current='page'] {
	color: var(--ink);
}

.mw-account__nav li.is-active .mw-account__nav-marker,
.mw-account__nav li a[aria-current='page'] .mw-account__nav-marker {
	opacity: 1;
}

.mw-account__nav-foot {
	margin-top: auto;
	padding-top: var(--space-8);
}

.mw-account__nav-foot .mw-link {
	font-size: 11px;
	color: var(--ink);
}

.mw-account__nav-foot p {
	margin-top: var(--space-4);
	font-size: 10px;
	line-height: 1.6;
	letter-spacing: 0.08em;
	color: var(--ink-mute);
}

.mw-account__content {
	padding: 44px var(--gutter-desktop) var(--space-12);
	min-width: 0;
}

.mw-account__intro {
	margin-bottom: var(--space-8);
}

.mw-account__greeting {
	font-family: var(--font-display);
	font-size: 34px;
	line-height: 1.05;
	letter-spacing: -0.01em;
	color: var(--ink);
}

.mw-account__lede {
	max-width: 56ch;
	margin-top: var(--space-3);
	font-size: 15px;
	line-height: 1.7;
	color: var(--ink-soft);
}

.mw-account__stats {
	max-width: 640px;
}

.mw-account__section {
	margin-top: var(--space-12);
}

.mw-account__section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--space-5);
	border-bottom: 1px solid var(--line);
	padding-bottom: var(--space-4);
	margin-bottom: var(--space-6);
}

.mw-account__section-title {
	font-family: var(--font-display);
	font-size: 24px;
	line-height: 1;
	color: var(--ink);
}

.mw-account__section-head .mw-link {
	font-size: 11px;
	color: var(--ink-mute);
}

/* ------------------------------------------------------- Auth (login/register) */

/* Two editorial columns split by a hairline, mirroring the landing page's
   proposition row. Both the register and the guest variant fill the second
   column, so the layout is two-up unless a template asks for .is-single. */
.mw-auth {
	display: grid;
	grid-template-columns: 1fr 1fr;
	flex: 1 0 auto;
}

.mw-auth__col {
	padding: var(--space-12) var(--gutter-desktop);
	border-right: 1px solid var(--line);
}

.mw-auth__col:last-child {
	border-right: none;
}

.mw-auth.is-single {
	grid-template-columns: 1fr;
}

.mw-auth.is-single .mw-auth__col {
	max-width: 620px;
	border-right: none;
}

.mw-auth__eyebrow {
	display: block;
	font-size: 11px;
	letter-spacing: 0.16em;
	color: var(--olive);
	margin-bottom: var(--space-4);
}

.mw-auth__title {
	font-family: var(--font-display);
	font-size: 34px;
	line-height: 1.05;
	letter-spacing: -0.01em;
	color: var(--ink);
}

.mw-auth__lede {
	max-width: 44ch;
	margin-top: var(--space-3);
	margin-bottom: var(--space-8);
	font-size: 15px;
	line-height: 1.7;
	color: var(--ink-soft);
}

.mw-auth__note {
	font-size: 14px;
	line-height: 1.6;
	color: var(--ink-mute);
	margin-bottom: var(--space-5);
}

.mw-auth__lost {
	margin-top: var(--space-5);
}

.mw-auth__lost .mw-link {
	font-size: 13px;
	color: var(--ink-mute);
}

/* ------------------------------------------------------------------- Forms */

.mw-form {
	max-width: 520px;
}

.mw-form--address,
.mw-form.woocommerce-EditAccountForm {
	max-width: 720px;
}

/* Two-up where the field asks for it (first/last name, city/pin), single
   column otherwise. Woo's own form-row-first/last classes map onto this so
   fields rendered by woocommerce_form_field() land in the right cells. */
.mw-form__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--space-5) var(--space-5);
}

.mw-field,
.mw-form__grid .form-row {
	display: flex;
	flex-direction: column;
	margin: 0;
	min-width: 0;
}

.mw-form__grid .form-row-wide,
.mw-form__grid .mw-field.is-wide,
.mw-form > .mw-field {
	grid-column: 1 / -1;
}

.mw-form > .mw-field + .mw-field {
	margin-top: var(--space-5);
}

.mw-field label,
.mw-form__grid .form-row label,
.mw-fieldset label {
	font-family: var(--font-mono);
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ink-mute);
	margin-bottom: var(--space-2);
}

.mw-field__req,
.mw-form .required {
	color: var(--olive);
	margin-left: 4px;
	text-decoration: none;
	border: none;
}

.mw-field__hint {
	margin-top: 6px;
	font-family: var(--font-body);
	font-size: 12px;
	line-height: 1.5;
	color: var(--ink-mute);
	text-transform: none;
	letter-spacing: 0;
}

/* One input treatment for every text-ish control the store renders, whether
   it comes from our templates or from woocommerce_form_field(). */
.mw-input,
.mw-form input[type='text'],
.mw-form input[type='email'],
.mw-form input[type='tel'],
.mw-form input[type='password'],
.mw-form input[type='number'],
.mw-form input[type='search'],
.mw-form textarea,
.mw-form select,
.mw-form .input-text {
	width: 100%;
	background: transparent;
	border: 1px solid var(--line-strong);
	padding: 0 var(--space-4);
	height: 52px;
	font-family: var(--font-body);
	font-size: 15px;
	color: var(--ink);
	transition: border-color var(--transition-fast);
	-webkit-appearance: none;
	appearance: none;
}

.mw-form textarea {
	height: auto;
	min-height: 120px;
	padding: var(--space-4);
	line-height: 1.6;
	resize: vertical;
}

.mw-form select {
	/* A hairline chevron drawn in CSS - the design uses no icon family. */
	background-image:
		linear-gradient(45deg, transparent 50%, var(--ink) 50%),
		linear-gradient(135deg, var(--ink) 50%, transparent 50%);
	background-position:
		calc(100% - 20px) calc(50% + 1px),
		calc(100% - 14px) calc(50% + 1px);
	background-size: 6px 6px, 6px 6px;
	background-repeat: no-repeat;
	padding-right: var(--space-9);
}

.mw-input:focus,
.mw-form input:focus,
.mw-form textarea:focus,
.mw-form select:focus {
	outline: none;
	border-color: var(--ink);
}

.mw-input::placeholder,
.mw-form input::placeholder,
.mw-form textarea::placeholder {
	color: var(--ink-dim);
}

/* WooCommerce's JS wraps every password field in .password-input and appends
   an empty .show-password-input button. With Woo's stylesheet dequeued that
   button rendered as a stray 8px sliver under the field. The design uses no
   icon family, so it becomes a mono text toggle instead. */
.password-input {
	position: relative;
	display: block;
}

.show-password-input {
	position: absolute;
	right: 0;
	top: 0;
	height: 52px;
	padding: 0 var(--space-4);
	background: none;
	border: none;
	font-family: var(--font-mono);
	font-size: 10px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ink-mute);
	transition: color var(--transition-fast);
}

.show-password-input::after {
	content: 'Show';
}

.show-password-input.display-password::after {
	content: 'Hide';
}

.show-password-input:hover,
.show-password-input:focus-visible {
	color: var(--ink);
}

/* Keep typed characters clear of the toggle. */
.password-input .mw-input,
.password-input .input-text {
	padding-right: 72px;
}

.mw-check,
.mw-form .woocommerce-form__label-for-checkbox {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	font-family: var(--font-body);
	font-size: 13px;
	letter-spacing: 0;
	text-transform: none;
	color: var(--ink-soft);
	margin: 0;
	cursor: pointer;
}

.mw-check input[type='checkbox'],
.mw-form input[type='checkbox'] {
	width: 16px;
	height: 16px;
	margin: 0;
	border: 1px solid var(--line-strong);
	background: transparent;
	-webkit-appearance: none;
	appearance: none;
	display: grid;
	place-content: center;
	flex-shrink: 0;
}

.mw-check input[type='checkbox']::after,
.mw-form input[type='checkbox']::after {
	content: '';
	width: 8px;
	height: 8px;
	background: var(--ink);
	transform: scale(0);
	transition: transform var(--transition-fast);
}

.mw-check input[type='checkbox']:checked::after,
.mw-form input[type='checkbox']:checked::after {
	transform: scale(1);
}

.mw-form__actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--space-5);
	margin-top: var(--space-8);
}

.mw-form__actions .mw-link {
	font-size: 12px;
	color: var(--ink-mute);
}

.mw-fieldset {
	border: none;
	border-top: 1px solid var(--line);
	padding: var(--space-8) 0 0;
	margin: var(--space-8) 0 0;
}

.mw-fieldset:first-of-type {
	border-top: none;
	padding-top: 0;
	margin-top: 0;
}

.mw-fieldset__legend {
	font-size: 11px;
	color: var(--ink);
	padding: 0;
	margin-bottom: var(--space-5);
}

.mw-fieldset__note {
	font-size: 13px;
	color: var(--ink-mute);
	margin-top: calc(var(--space-5) * -1 + var(--space-2));
	margin-bottom: var(--space-5);
}

/* WordPress renders the review form with a cols="45" textarea and no CSS
   of its own. Left alone it is wider than a phone. */
.comment-respond,
.comment-form {
	max-width: 100%;
	min-width: 0;
}

.comment-form textarea,
.comment-form input[type='text'],
.comment-form input[type='email'],
.comment-form input[type='url'] {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	background: transparent;
	border: 1px solid var(--line-strong);
	padding: var(--space-3) var(--space-4);
	font-family: var(--font-body);
	font-size: 15px;
	color: var(--ink);
}

.comment-form textarea {
	min-height: 120px;
	line-height: 1.6;
	resize: vertical;
}

.comment-form label {
	display: block;
	font-family: var(--font-mono);
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ink-mute);
	margin-bottom: var(--space-2);
}

.comment-form p {
	margin-bottom: var(--space-4);
}

.comment-reply-title {
	font-family: var(--font-display);
	font-size: 24px;
	line-height: 1;
	color: var(--ink);
	margin-bottom: var(--space-5);
}

/* Compact variant used in dense contexts (order rows, empty states). */
.mw-btn-outline.is-small,
.mw-btn.is-small {
	padding: 12px 20px;
	font-size: 11px;
}

/* -------------------------------------------------------------- Order lists */

.mw-order-list {
	border-top: 1px solid var(--line);
}

.mw-order-list__row {
	display: grid;
	grid-template-columns: 1fr 1.2fr 1fr 1fr auto;
	align-items: center;
	gap: var(--space-4);
	border-bottom: 1px solid var(--line);
	padding: var(--space-4) 0;
	font-size: 12px;
}

.mw-order-list__no {
	color: var(--ink);
	font-size: 12px;
}

.mw-order-list__date,
.mw-order-list__status {
	font-size: 11px;
	color: var(--ink-mute);
}

.mw-order-list__total {
	font-family: var(--font-mono);
	font-size: 13px;
	color: var(--ink);
}

.mw-order-list__row .mw-link {
	font-size: 11px;
}

/* Order cards on the orders endpoint */
.mw-orders {
	border-top: 1px solid var(--line);
}

.mw-order {
	border-bottom: 1px solid var(--line);
	padding: var(--space-6) 0;
}

.mw-order__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--space-5);
	margin-bottom: var(--space-5);
}

.mw-order__ident {
	display: flex;
	align-items: baseline;
	gap: var(--space-4);
}

.mw-order__no {
	font-size: 14px;
	color: var(--ink);
	border-bottom: 1px solid currentColor;
	padding-bottom: 1px;
}

.mw-order__date {
	font-size: 11px;
	color: var(--ink-mute);
}

/* Status reads as a mono tag. Completed is the only olive one; anything
   needing the customer's attention takes the alert colour. */
.mw-order__status,
.mw-order-list__status {
	font-size: 10px;
	letter-spacing: 0.12em;
}

.mw-order__status {
	border: 1px solid var(--line-strong);
	padding: 5px 10px;
	color: var(--ink-mute);
	white-space: nowrap;
}

.mw-order__status.is-completed {
	border-color: var(--olive);
	color: var(--olive);
}

.mw-order__status.is-processing,
.mw-order__status.is-on-hold {
	border-color: var(--ink);
	color: var(--ink);
}

.mw-order__status.is-cancelled,
.mw-order__status.is-failed,
.mw-order__status.is-refunded {
	border-color: var(--alert);
	color: var(--alert);
}

.mw-order__body {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: var(--space-6);
}

.mw-order__thumbs {
	display: flex;
	gap: var(--space-2);
}

.mw-order__thumb {
	width: 56px;
	flex-shrink: 0;
}

.mw-order__items {
	font-size: 11px;
	color: var(--ink-mute);
	margin-bottom: 4px;
}

.mw-order__total {
	font-family: var(--font-mono);
	font-size: 16px;
	color: var(--ink);
}

.mw-order__actions {
	display: flex;
	align-items: center;
	gap: var(--space-5);
}

.mw-order__actions .mw-link {
	font-size: 11px;
	color: var(--ink-mute);
}

.mw-order-notes {
	border-top: 1px solid var(--line);
}

.mw-order-notes__item {
	border-bottom: 1px solid var(--line);
	padding: var(--space-5) 0;
}

.mw-order-notes__date {
	font-size: 10px;
	color: var(--ink-mute);
	margin-bottom: var(--space-2);
}

.mw-order-notes__body p {
	font-size: 14px;
	line-height: 1.7;
	color: var(--ink-soft);
}

/* --------------------------------------------------------------- Addresses */

.mw-address-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--space-6);
	max-width: 720px;
}

.mw-address-card {
	border: 1px solid var(--line);
	padding: var(--space-6);
	min-width: 0;
}

.mw-address-card__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--space-4);
	border-bottom: 1px solid var(--line);
	padding-bottom: var(--space-3);
	margin-bottom: var(--space-4);
}

.mw-address-card__head .mw-mono {
	font-size: 11px;
	color: var(--ink);
}

.mw-address-card__head .mw-link {
	font-size: 10px;
	color: var(--ink-mute);
}

.mw-address-card__body {
	font-style: normal;
	font-size: 14px;
	line-height: 1.8;
	color: var(--ink-soft);
}

.mw-address-card__empty {
	font-family: var(--font-mono);
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ink-dim);
}

/* ------------------------------------------------------------ Empty states */

/* Used wherever a screen has nothing to show. Never a bare sentence: an
   empty state gets a headline, an explanation and a way out. */
.mw-empty {
	border: 1px solid var(--line);
	padding: var(--space-12) var(--space-8);
	text-align: center;
	max-width: 620px;
}

.mw-empty__title {
	font-family: var(--font-display);
	font-size: 28px;
	line-height: 1.15;
	color: var(--ink);
	margin-bottom: var(--space-3);
}

.mw-empty__body {
	max-width: 46ch;
	margin: 0 auto var(--space-8);
	font-size: 15px;
	line-height: 1.7;
	color: var(--ink-soft);
}

/* --------------------------------------------------------------- Responsive */

@media (max-width: 900px) {
	.mw-account {
		grid-template-columns: 1fr;
	}

	/* The rail becomes a horizontally scrolling tab strip so no endpoint is
	   ever more than one tap away. */
	.mw-account__nav {
		border-right: none;
		border-bottom: 1px solid var(--line);
		padding: var(--space-5) var(--gutter-mobile);
	}

	.mw-account__nav-head,
	.mw-account__whoami,
	.mw-account__nav-foot {
		display: none;
	}

	.mw-account__nav ul {
		display: flex;
		gap: var(--space-6);
		overflow-x: auto;
		border-top: none;
		scrollbar-width: none;
	}

	.mw-account__nav ul::-webkit-scrollbar {
		display: none;
	}

	.mw-account__nav li {
		border-bottom: none;
		flex-shrink: 0;
	}

	.mw-account__nav li a {
		padding: var(--space-2) 0;
		border-bottom: 1px solid transparent;
	}

	.mw-account__nav li.is-active > a {
		border-bottom-color: var(--ink);
	}

	.mw-account__nav-marker {
		display: none;
	}

	.mw-account__content {
		padding: var(--space-8) var(--gutter-mobile) var(--space-12);
	}

	.mw-auth.has-register {
		grid-template-columns: 1fr;
	}

	.mw-auth__col {
		border-right: none;
		border-bottom: 1px solid var(--line);
		padding: var(--space-8) var(--gutter-mobile);
	}

	.mw-address-grid {
		grid-template-columns: 1fr;
	}

	.mw-order__body {
		grid-template-columns: 1fr;
		gap: var(--space-4);
	}

	.mw-order__actions {
		justify-content: flex-start;
	}

	.mw-order-list__row {
		grid-template-columns: 1fr auto;
		row-gap: var(--space-2);
	}

	.mw-order-list__date,
	.mw-order-list__status {
		grid-column: 1;
	}

	.mw-form__grid {
		grid-template-columns: 1fr;
	}

	.mw-form__grid .form-row-first,
	.mw-form__grid .form-row-last,
	.mw-field {
		grid-column: 1 / -1;
	}

	.mw-empty {
		padding: var(--space-8) var(--space-5);
	}

	.mw-page-title-band {
		padding: var(--space-7) var(--gutter-mobile);
	}
}
