/**
 * FLUXX — My Account and WooCommerce forms.
 *
 * WooCommerce's own form styling was dequeued with the rest of its CSS, so
 * every input, label and button on the account, login, address and order pages
 * needs building here. Without it the login screen is raw browser defaults.
 */

/* ------------------------------------------------------------ login page */

/*
 * The columns are on `#customer_login`, not on `.woocommerce`.
 *
 * WooCommerce wraps login and register in `.u-columns.col2-set#customer_login`
 * inside `.woocommerce`, so gridding the outer element lays out a single child
 * and the two forms stay stacked in one narrow column.
 */
#customer_login,
.woocommerce-account .u-columns.col2-set {
	display: grid;
	gap: 40px;
	max-width: 940px;
	grid-template-columns: 1fr;
}

@media (min-width: 800px) {
	#customer_login,
	.woocommerce-account .u-columns.col2-set {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 56px;
	}
}

/* WooCommerce floats these; the grid places them instead. */
#customer_login > .u-column1,
#customer_login > .u-column2 {
	float: none;
	width: auto;
}

.woocommerce-account .u-column1,
.woocommerce-account .u-column2 {
	min-width: 0;
}

.woocommerce-account h2 {
	margin-bottom: 18px;
	font-size: 20px;
	font-weight: var(--fx-weight-light);
	text-transform: uppercase;
	letter-spacing: 0;
}

/* ------------------------------------------------------------ form fields */

.woocommerce form .form-row {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0 0 16px;
	padding: 0;
}

.woocommerce form .form-row label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: var(--fx-tracking-nav);
	color: var(--fx-text-muted);
}

.woocommerce form .form-row .required {
	color: var(--fx-danger);
	text-decoration: none;
	border: 0;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce .select2-container .select2-selection--single {
	width: 100%;
	height: var(--fx-control-lg);
	padding: 0 14px;
	border: 1px solid var(--fx-border-control);
	border-radius: var(--fx-radius-none);
	background: var(--fx-paper);
	font-size: 14px;
	line-height: normal;
	transition: border-color var(--fx-dur) var(--fx-ease);
}

.woocommerce form .form-row textarea {
	height: auto;
	min-height: 110px;
	padding-block: 12px;
	line-height: 1.5;
}

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

/* Two-up rows where WooCommerce asks for them. */
@media (min-width: 600px) {
	.woocommerce form .form-row-first,
	.woocommerce form .form-row-last {
		width: calc(50% - 8px);
		display: inline-flex;
		vertical-align: top;
	}

	.woocommerce form .form-row-first {
		margin-inline-end: 16px;
	}
}

/* Checkbox rows read as a line, not a stack. */
.woocommerce form .form-row.woocommerce-form__label-for-checkbox,
.woocommerce form label.woocommerce-form__label-for-checkbox {
	flex-direction: row;
	align-items: center;
	gap: 8px;
	text-transform: none;
	letter-spacing: var(--fx-tracking-body);
	font-size: 13px;
	color: var(--fx-text);
}

.woocommerce form .woocommerce-form__input-checkbox {
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--fx-ink);
}

/* ---------------------------------------------------------------- buttons */
/*
 * WooCommerce reuses `.button` across the account, cart, order and address
 * screens. Styling it once here covers all of them.
 */
.woocommerce .button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce a.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: var(--fx-control-cta);
	padding-inline: 26px;
	border: 1px solid var(--fx-ink);
	border-radius: var(--fx-radius-none);
	background: var(--fx-ink);
	color: var(--fx-text-on-dark);
	font-size: 13px;
	font-weight: var(--fx-weight-bold);
	letter-spacing: var(--fx-tracking-cta);
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color var(--fx-dur) var(--fx-ease), color var(--fx-dur) var(--fx-ease);
}

.woocommerce .button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce a.button:hover {
	background: var(--fx-ink-hover);
	color: var(--fx-text-on-dark);
}

/* The secondary action on a screen: outline rather than solid. */
.woocommerce a.button.wc-backward,
.woocommerce a.button.view,
.woocommerce .woocommerce-Address-title a.edit {
	background: transparent;
	color: var(--fx-ink);
}

.woocommerce a.button.wc-backward:hover,
.woocommerce a.button.view:hover {
	background: var(--fx-ink);
	color: var(--fx-text-on-dark);
}

.woocommerce .woocommerce-form-login__rememberme {
	margin-block: 4px 14px;
}

.woocommerce-LostPassword {
	margin-top: 12px;
	font-size: 12px;
}

.woocommerce-LostPassword a {
	text-decoration: underline;
	text-underline-offset: 0.25em;
}

.woocommerce-privacy-policy-text {
	margin-block: 14px;
	font-size: 12px;
	color: var(--fx-text-muted);
}

/* ------------------------------------------------------- account dashboard */

.woocommerce-MyAccount-content {
	min-width: 0;
}

.woocommerce-MyAccount-content > p:first-child {
	margin-top: 0;
}

.woocommerce-Address {
	margin-bottom: 24px;
}

.woocommerce-Address-title {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}

.woocommerce-Address-title h2,
.woocommerce-Address-title h3 {
	font-size: 13px;
	font-weight: var(--fx-weight-bold);
	text-transform: uppercase;
	letter-spacing: var(--fx-tracking-nav);
}

.woocommerce-Address-title .edit {
	height: auto;
	padding: 0;
	border: 0;
	background: none;
	color: var(--fx-ink);
	font-size: 11px;
	text-decoration: underline;
	text-underline-offset: 0.25em;
}

.woocommerce-Address address {
	font-style: normal;
	line-height: 1.7;
	color: var(--fx-text-muted);
}

.woocommerce-columns--addresses {
	display: grid;
	gap: 28px;
}

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

/* ------------------------------------------------------------ order pages */

.woocommerce-order-overview,
.woocommerce-order-details,
.woocommerce-customer-details {
	margin-bottom: 32px;
}

.woocommerce-order-overview {
	display: grid;
	gap: 14px;
	margin: 0 0 32px;
	padding: 18px;
	background: var(--fx-sand);
	list-style: none;
}

@media (min-width: 700px) {
	.woocommerce-order-overview {
		grid-auto-flow: column;
		grid-auto-columns: 1fr;
	}
}

.woocommerce-order-overview li {
	display: flex;
	flex-direction: column;
	gap: 3px;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: var(--fx-tracking-nav);
	color: var(--fx-text-muted);
	border: 0 !important;
}

.woocommerce-order-overview li strong {
	font-size: 14px;
	text-transform: none;
	letter-spacing: var(--fx-tracking-body);
	color: var(--fx-text);
}

.fx-order-gstin {
	margin-top: 10px;
	font-size: 13px;
}

/* -------------------------------------------------------------- messages */

.woocommerce-form-login,
.woocommerce-form-register,
.woocommerce-ResetPassword,
.woocommerce-EditAccountForm,
.woocommerce-address-fields {
	max-width: 520px;
}

.woocommerce-account .woocommerce-message,
.woocommerce-account .woocommerce-info {
	margin-bottom: 24px;
}

/* Hide the login prompt WooCommerce injects above the account form, which
   duplicates the heading immediately below it. */
.woocommerce-account:not(.logged-in) .woocommerce > .woocommerce-notices-wrapper:empty {
	display: none;
}
