/**
 * Australia Peptide Sciences Core — native WooCommerce account UI.
 *
 * Loaded only on the WooCommerce My Account page.
 */

body.woocommerce-account {
	--aps-primary: #0073aa;
	--aps-highlight: #1e73be;
	--aps-gradient: linear-gradient(135deg, #0073aa, #005177);
	--aps-background: #f2f7fb;
	--aps-surface: #ffffff;
	--aps-text: #172033;
	--aps-muted: #667085;
	--aps-border: #dfe7f0;
	--aps-radius: 16px;
	--aps-shadow: 0 12px 32px rgba(18, 46, 82, 0.09);
}

body.woocommerce-account .woocommerce,
body.woocommerce-account .woocommerce *,
body.woocommerce-account .woocommerce *::before,
body.woocommerce-account .woocommerce *::after {
	box-sizing: border-box;
}

/*
 * Account shell
 *
 * Explicit grid areas neutralize WooCommerce/theme floats. Keeping the shell
 * within its actual content parent avoids the viewport breakout that separated
 * the address content from the account navigation.
 */
body.woocommerce-account.logged-in .woocommerce {
	display: grid;
	grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
	grid-template-areas: "aps-account-nav aps-account-content";
	align-items: start;
	gap: clamp(20px, 3vw, 40px);
	clear: both;
	width: 100%;
	max-width: 1440px;
	margin: clamp(24px, 4vw, 56px) auto;
	padding: 0 clamp(16px, 2vw, 28px);
	color: var(--aps-text);
	background: transparent;
}

body.woocommerce-account:not(.logged-in) .woocommerce {
	width: min(100%, 1000px);
	margin: clamp(24px, 4vw, 56px) auto;
	padding: clamp(20px, 4vw, 44px);
	border: 1px solid var(--aps-border);
	border-radius: var(--aps-radius);
	background: var(--aps-surface);
	box-shadow: var(--aps-shadow);
}

/* Native account navigation. */
body.woocommerce-account .woocommerce-MyAccount-navigation {
	grid-area: aps-account-nav;
	position: sticky;
	top: 24px;
	float: none;
	width: 100%;
	min-width: 0;
	max-width: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
}

body.woocommerce-account .woocommerce-MyAccount-navigation ul {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	align-content: start;
	gap: 8px;
	width: 100%;
	margin: 0;
	padding: 12px;
	border: 1px solid var(--aps-border);
	border-radius: var(--aps-radius);
	background: var(--aps-surface);
	box-shadow: var(--aps-shadow);
	list-style: none;
}

body.woocommerce-account .woocommerce-MyAccount-navigation li {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	list-style: none;
}

body.woocommerce-account .woocommerce-MyAccount-navigation li::before,
body.woocommerce-account .woocommerce-MyAccount-navigation li::after {
	display: none;
	content: none;
}

body.woocommerce-account .woocommerce-MyAccount-navigation a {
	display: flex;
	width: 100%;
	min-height: 50px;
	align-items: center;
	justify-content: flex-start;
	gap: 12px;
	padding: 11px 16px;
	border: 1px solid transparent;
	border-radius: 12px;
	color: var(--aps-primary);
	background: var(--aps-background);
	font-weight: 700;
	line-height: 1.3;
	text-align: left;
	text-decoration: none;
	box-shadow: none;
	transition: color 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

body.woocommerce-account .woocommerce-MyAccount-navigation a::before {
	display: inline-flex;
	flex: 0 0 22px;
	width: 22px;
	align-items: center;
	justify-content: center;
	color: var(--aps-highlight);
	font-family: dashicons;
	font-size: 16px;
	font-style: normal;
	font-variant: normal;
	font-weight: 900;
	line-height: 1;
	text-rendering: auto;
	-webkit-font-smoothing: antialiased;
}

body.woocommerce-account .woocommerce-MyAccount-navigation-link--dashboard a::before {
	content: "\f102";
}

body.woocommerce-account .woocommerce-MyAccount-navigation-link--orders a::before {
	content: "\f174";
}

body.woocommerce-account .woocommerce-MyAccount-navigation-link--downloads a::before {
	content: "\f316";
}

body.woocommerce-account .woocommerce-MyAccount-navigation-link--edit-address a::before {
	content: "\f230";
}

body.woocommerce-account .woocommerce-MyAccount-navigation-link--edit-account a::before {
	content: "\f110";
}

body.woocommerce-account .woocommerce-MyAccount-navigation-link--points-rewards a::before {
	content: "\f524";
}

body.woocommerce-account .woocommerce-MyAccount-navigation-link--payment-methods a::before {
	content: "\f18e";
}

body.woocommerce-account .woocommerce-MyAccount-navigation-link--customer-logout a::before {
	content: "\f310";
}

body.woocommerce-account .woocommerce-MyAccount-navigation a:hover,
body.woocommerce-account .woocommerce-MyAccount-navigation a:focus-visible,
body.woocommerce-account .woocommerce-MyAccount-navigation .is-active a {
	border-color: var(--aps-primary);
	border-radius: 50px;
	color: #ffffff;
	background: var(--aps-gradient);
	box-shadow: 0 7px 18px rgba(0, 84, 166, 0.2);
	transform: translateY(-1px);
	outline: 0;
}

body.woocommerce-account .woocommerce-MyAccount-navigation a:hover::before,
body.woocommerce-account .woocommerce-MyAccount-navigation a:focus-visible::before,
body.woocommerce-account .woocommerce-MyAccount-navigation .is-active a::before {
	color: #ffffff;
}

/* Native endpoint content. */
body.woocommerce-account .woocommerce-MyAccount-content {
	grid-area: aps-account-content;
	float: none;
	clear: none;
	width: 100%;
	min-width: 0;
	max-width: none;
	min-height: 360px;
	margin: 0;
	padding: clamp(22px, 3vw, 42px);
	overflow: visible;
	border: 1px solid var(--aps-border);
	border-radius: var(--aps-radius);
	color: var(--aps-text);
	background: var(--aps-surface);
	box-shadow: var(--aps-shadow);
}

body.woocommerce-account .woocommerce-MyAccount-content > :first-child {
	margin-top: 0;
}

body.woocommerce-account .woocommerce-MyAccount-content > :last-child {
	margin-bottom: 0;
}

body.woocommerce-account .woocommerce-MyAccount-content h1,
body.woocommerce-account .woocommerce-MyAccount-content h2,
body.woocommerce-account .woocommerce-MyAccount-content h3 {
	color: black;
	line-height: 1.25;
	overflow-wrap: anywhere;
}

body.woocommerce-account .woocommerce-MyAccount-content p,
body.woocommerce-account .woocommerce-MyAccount-content address {
	color: var(--aps-muted);
	line-height: 1.7;
	overflow-wrap: anywhere;
}

body.woocommerce-account .woocommerce-MyAccount-content a:not(.button):not(.aps-admin-account-notice__button) {
	color: var(--aps-highlight);
	font-weight: 650;
}

/* Orders, downloads, and native address cards. */
body.woocommerce-account .woocommerce-orders-table,
body.woocommerce-account .woocommerce-table {
	width: 100%;
	max-width: 100%;
	margin: 22px 0;
	border: 1px solid var(--aps-border);
	border-collapse: separate;
	border-spacing: 0;
	border-radius: 12px;
	overflow: hidden;
	background: var(--aps-surface);
}

body.woocommerce-account .woocommerce-orders-table th,
body.woocommerce-account .woocommerce-table th {
	padding: 14px;
	border-color: var(--aps-border);
	color: var(--aps-primary);
	background: #eef5ff;
}

body.woocommerce-account .woocommerce-orders-table td,
body.woocommerce-account .woocommerce-table td {
	padding: 14px;
	border-color: var(--aps-border);
	color: var(--aps-text);
	background: var(--aps-surface);
}

body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Addresses {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	align-items: stretch;
	gap: 20px;
	width: 100%;
	max-width: none;
	margin: 24px 0 0;
}

body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Addresses::before,
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Addresses::after {
	display: none;
	content: none;
}

body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Addresses > .woocommerce-Address,
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Addresses > .u-column1,
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Addresses > .u-column2 {
	float: none;
	clear: none;
	width: 100%;
	min-width: 0;
	max-width: none;
	margin: 0;
	padding: 24px;
	border: 1px solid var(--aps-border);
	border-radius: 14px;
	background: var(--aps-background);
}

body.woocommerce-account .woocommerce-Address-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

body.woocommerce-account .woocommerce-Address-title h2,
body.woocommerce-account .woocommerce-Address-title h3,
body.woocommerce-account .woocommerce-Address-title a {
	float: none;
	margin: 0;
}

/* Native forms and controls. */
body.woocommerce-account .woocommerce form .form-row {
	float: none;
	min-width: 0;
}

body.woocommerce-account .woocommerce form .form-row input.input-text,
body.woocommerce-account .woocommerce form .form-row textarea,
body.woocommerce-account .woocommerce form .form-row select {
	width: 100%;
	max-width: 100%;
	min-height: 48px;
	padding: 11px 14px;
	border: 1px solid #cbd4df;
	border-radius: 8px;
	color: var(--aps-text);
	background: var(--aps-surface);
	box-shadow: none;
}

body.woocommerce-account .woocommerce form .form-row input.input-text:focus,
body.woocommerce-account .woocommerce form .form-row textarea:focus,
body.woocommerce-account .woocommerce form .form-row select:focus {
	border-color: var(--aps-highlight);
	outline: 3px solid rgba(41, 171, 226, 0.18);
	outline-offset: 1px;
}

body.woocommerce-account .woocommerce button.button,
body.woocommerce-account .woocommerce a.button,
body.woocommerce-account .woocommerce input.button {
	min-height: 44px;
	padding: 11px 20px;
	border: 1px solid var(--aps-primary);
	border-radius: 50px;
	color: #ffffff;
	background: var(--aps-gradient);
	font-weight: 700;
	text-decoration: none;
	box-shadow: none;
}

body.woocommerce-account .woocommerce button.button:hover,
body.woocommerce-account .woocommerce a.button:hover,
body.woocommerce-account .woocommerce input.button:hover,
body.woocommerce-account .woocommerce button.button:focus-visible,
body.woocommerce-account .woocommerce a.button:focus-visible,
body.woocommerce-account .woocommerce input.button:focus-visible {
	border-color: var(--aps-highlight);
	color: #ffffff;
	background: var(--aps-gradient);
	box-shadow: 0 7px 18px rgba(0, 84, 166, 0.2);
	outline: 3px solid rgba(41, 171, 226, 0.2);
	outline-offset: 2px;
}

body.woocommerce-account .woocommerce-message,
body.woocommerce-account .woocommerce-info,
body.woocommerce-account .woocommerce-error {
	width: 100%;
	margin: 0 0 22px;
	padding: 16px 22px 16px 48px;
	border: 1px solid var(--aps-primary);
	border-radius: 14px;
	color: var(--aps-text);
	background: var(--aps-surface);
}

/* Administrator-only context banner. */
.aps-admin-account-notice {
	display: flex;
	width: 100%;
	max-width: none;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	margin: 0 0 28px;
	padding: 16px 18px;
	border: 1px solid #b9d8f4;
	border-left: 5px solid var(--aps-primary);
	border-radius: 14px;
	color: #063a78;
	background: #f4f9ff;
	box-shadow: 0 6px 18px rgba(0, 84, 166, 0.08);
}

.aps-admin-account-notice__content {
	display: flex;
	min-width: 0;
	align-items: center;
	gap: 12px;
}

.aps-admin-account-notice__content p {
	margin: 0;
	color: #063a78;
	font-weight: 650;
	line-height: 1.5;
}

.aps-admin-account-notice__icon {
	display: inline-flex;
	flex: 0 0 34px;
	width: 34px;
	height: 34px;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	color: #ffffff;
	background: var(--aps-gradient);
}

.aps-admin-account-notice__button {
	display: inline-flex;
	flex: 0 0 auto;
	min-height: 40px;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 9px 15px;
	border: 1px solid var(--aps-primary);
	border-radius: 50px;
	color: #ffffff;
	background: var(--aps-gradient);
	font-weight: 700;
	text-decoration: none;
}

.aps-admin-account-notice__button:hover,
.aps-admin-account-notice__button:focus-visible {
	color: #ffffff;
	box-shadow: 0 7px 18px rgba(0, 84, 166, 0.2);
	outline: 3px solid rgba(41, 171, 226, 0.2);
	outline-offset: 2px;
}

/* Points and cashback endpoint. */
.aps-points-account {
	display: grid;
	gap: 28px;
	width: 100%;
	max-width: none;
}

.aps-points-header h2,
.aps-points-header p {
	margin-top: 0;
}

.aps-points-header p {
	margin-bottom: 0;
}

.aps-points-summary,
.aps-points-actions {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
	margin: 0;
}

.aps-points-summary > div,
.aps-points-actions > article {
	display: flex;
	min-width: 0;
	flex-direction: column;
	padding: 24px;
	border: 1px solid var(--aps-border);
	border-radius: 14px;
	background: var(--aps-background);
}

.aps-points-summary > div {
	border-top: 5px solid var(--aps-highlight);
}

.aps-points-summary span,
.aps-points-summary small {
	color: var(--aps-muted);
	font-weight: 650;
}

.aps-points-summary strong {
	margin: 6px 0;
	color: var(--aps-primary);
	font-size: clamp(2rem, 5vw, 3.25rem);
	line-height: 1;
}

.aps-points-progress {
	display: grid;
	gap: 12px;
	padding: 20px 22px;
	border: 1px solid #b9d8f4;
	border-radius: 14px;
	background: #f4f9ff;
}

.aps-points-progress__heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	color: var(--aps-text);
}

.aps-points-progress__heading strong {
	color: var(--aps-primary);
}

.aps-points-progress__heading span {
	color: var(--aps-text);
	text-align: right;
}

.aps-points-progress__track {
	width: 100%;
	height: 14px;
	overflow: hidden;
	border: 1px solid #c5d9e8;
	border-radius: 50px;
	background: #e5edf4;
}

.aps-points-progress__track > span {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--aps-gradient);
	transition: width 240ms ease;
}

.aps-points-toast-region {
	position: fixed;
	z-index: 99999;
	top: 24px;
	right: 24px;
	width: min(390px, calc(100vw - 32px));
	pointer-events: none;
}

.aps-points-toast {
	padding: 16px 18px;
	border: 1px solid #9ad7c1;
	border-left: 5px solid #067647;
	border-radius: 12px;
	color: #172033;
	background: #ffffff;
	box-shadow: 0 18px 45px rgba(18, 46, 82, 0.2);
	animation: aps-points-toast-in 220ms ease-out both;
	pointer-events: auto;
}

.aps-points-toast--error {
	border-color: #f2b8b5;
	border-left-color: #b42318;
}

.aps-points-toast.is-leaving {
	animation: aps-points-toast-out 220ms ease-in both;
}

@keyframes aps-points-toast-in {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes aps-points-toast-out {
	from {
		opacity: 1;
		transform: translateY(0);
	}
	to {
		opacity: 0;
		transform: translateY(-8px);
	}
}

.aps-points-actions h3 {
	margin-top: 0;
}

.aps-points-actions form {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: end;
	gap: 10px;
	margin-top: auto;
}

.aps-points-actions form label {
	grid-column: 1 / -1;
	color: var(--aps-primary);
	font-weight: 700;
}

.aps-points-actions input[type="number"] {
	width: 100%;
	min-height: 46px;
	padding: 10px 14px;
	border: 1px solid #cbd4df;
	border-radius: 8px;
	color: var(--aps-text);
	background: var(--aps-surface);
}

.aps-points-actions input[type="number"]:focus {
	border-color: var(--aps-highlight);
	outline: 3px solid rgba(41, 171, 226, 0.18);
	outline-offset: 1px;
}

.aps-points-actions .aps-points-clear {
	display: block;
	margin-top: 12px;
}

.aps-points-actions .aps-points-clear[hidden] {
	display: none;
}

.aps-points-ledger-wrap {
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

body.woocommerce-account .aps-points-ledger .is-credit {
	color: #067647;
	font-weight: 800;
}

body.woocommerce-account .aps-points-ledger .is-debit {
	color: #b42318;
	font-weight: 800;
}

.aps-points-pagination ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0;
	border: 0;
	list-style: none;
}

.aps-points-pagination li {
	border: 0;
}

.aps-points-pagination a,
.aps-points-pagination span {
	display: inline-flex;
	min-width: 40px;
	min-height: 40px;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--aps-primary);
	border-radius: 50px;
	text-decoration: none;
}

.aps-points-pagination .current {
	color: #ffffff;
	background: var(--aps-gradient);
}

/*
 * Storefront gate: the logged-out My Account page is the members-only login.
 * Scoped to the body class the gate adds, so nothing changes while it is off.
 */
body.aps-storefront-gate.woocommerce-account:not(.logged-in) .aps-gate-intro {
	margin: 0 0 28px;
	padding: clamp(20px, 3vw, 32px);
	border: 1px solid var(--aps-border);
	border-radius: var(--aps-radius);
	color: var(--aps-text);
	background: var(--aps-background);
	text-align: center;
}

body.aps-storefront-gate.woocommerce-account:not(.logged-in) .aps-gate-intro__title {
	margin: 0 0 10px;
	color: var(--aps-text);
	font-size: clamp(24px, 3vw, 32px);
	line-height: 1.2;
}

body.aps-storefront-gate.woocommerce-account:not(.logged-in) .aps-gate-intro__message {
	max-width: 620px;
	margin: 0 auto 16px;
	color: var(--aps-text);
	font-size: 17px;
	line-height: 1.55;
}

body.aps-storefront-gate.woocommerce-account:not(.logged-in) .aps-gate-intro__points {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 0 0 16px;
	padding: 0;
	list-style: none;
}

body.aps-storefront-gate.woocommerce-account:not(.logged-in) .aps-gate-intro__points li {
	margin: 0;
	padding: 6px 14px;
	border: 1px solid var(--aps-border);
	border-radius: 50px;
	color: var(--aps-primary);
	background: var(--aps-surface);
	font-size: 14px;
	font-weight: 700;
	list-style: none;
}

body.aps-storefront-gate.woocommerce-account:not(.logged-in) .aps-gate-intro__statement {
	max-width: 620px;
	margin: 0 auto;
	color: var(--aps-muted);
	font-size: 13px;
	line-height: 1.5;
}

/* Create account first: most visitors at the gate are new. */
body.aps-storefront-gate.woocommerce-account:not(.logged-in) .u-columns.col2-set {
	display: flex;
	flex-wrap: wrap;
	gap: clamp(20px, 3vw, 40px);
	width: 100%;
}

body.aps-storefront-gate.woocommerce-account:not(.logged-in) .u-columns.col2-set::before,
body.aps-storefront-gate.woocommerce-account:not(.logged-in) .u-columns.col2-set::after {
	display: none;
	content: none;
}

body.aps-storefront-gate.woocommerce-account:not(.logged-in) .u-columns.col2-set > .u-column1,
body.aps-storefront-gate.woocommerce-account:not(.logged-in) .u-columns.col2-set > .u-column2 {
	flex: 1 1 300px;
	float: none;
	width: auto;
	max-width: 100%;
	margin: 0;
}

body.aps-storefront-gate.woocommerce-account:not(.logged-in) .u-columns.col2-set > .u-column2 {
	order: -1;
}

/* The gate always keeps returning buyers signed in, so the checkbox is not needed. */
body.aps-storefront-gate.woocommerce-account:not(.logged-in) .woocommerce-form-login__rememberme {
	display: none !important;
}

/* Tablet: retain a compact two-column account shell. */
@media (max-width: 1024px) {
	body.woocommerce-account.logged-in .woocommerce {
		grid-template-columns: minmax(190px, 220px) minmax(0, 1fr);
		gap: 20px;
		padding: 0 16px;
	}

	body.woocommerce-account .woocommerce-MyAccount-navigation a {
		padding: 10px 12px;
		font-size: 14px;
	}

	body.woocommerce-account .woocommerce-MyAccount-content {
		padding: 24px;
	}

	body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Addresses,
	.aps-points-summary,
	.aps-points-actions {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Mobile: navigation becomes a compact grid above the content. */
@media (max-width: 767px) {
	body.woocommerce-account.logged-in .woocommerce {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"aps-account-nav"
			"aps-account-content";
		gap: 18px;
		margin: 24px auto;
		padding: 0 14px;
	}

	body.woocommerce-account .woocommerce-MyAccount-navigation {
		position: static;
	}

	body.woocommerce-account .woocommerce-MyAccount-navigation ul {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
		padding: 10px;
	}

	body.woocommerce-account .woocommerce-MyAccount-navigation a {
		min-height: 46px;
		justify-content: flex-start;
		padding: 9px 11px;
	}

	body.woocommerce-account .woocommerce-MyAccount-content {
		min-height: 0;
		padding: 20px 16px;
	}

	.aps-admin-account-notice {
		align-items: stretch;
		flex-direction: column;
	}

	.aps-admin-account-notice__button {
		width: 100%;
	}

	.aps-points-actions form {
		grid-template-columns: minmax(0, 1fr);
	}

	.aps-points-progress__heading {
		align-items: flex-start;
		flex-direction: column;
	}

	.aps-points-progress__heading span {
		text-align: left;
	}

	.aps-points-toast-region {
		top: 16px;
		right: 16px;
	}

	body.woocommerce-account .woocommerce-orders-table thead {
		display: none;
	}

	body.woocommerce-account .woocommerce-orders-table tr,
	body.woocommerce-account .woocommerce-orders-table td {
		display: block;
		width: 100%;
	}
}

@media (max-width: 480px) {
	body.woocommerce-account .woocommerce-MyAccount-navigation ul {
		grid-template-columns: minmax(0, 1fr);
	}

	body.woocommerce-account .woocommerce-Address-title {
		align-items: flex-start;
		flex-direction: column;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.woocommerce-account .woocommerce *,
	body.woocommerce-account .woocommerce *::before,
	body.woocommerce-account .woocommerce *::after {
		scroll-behavior: auto;
		transition: none;
	}

	.aps-points-toast,
	.aps-points-toast.is-leaving {
		animation: none;
	}
}
