/**
 * My Account module v2 — cream redesign (2026-08-26)
 *
 * Design language follows the checkout thank-you page:
 * cream page background, white cards, Montserrat, black text,
 * yellow #ffeb00 accents. Scope: logged-in My Account pages only
 * (login/register page is intentionally untouched).
 *
 * @package MisterMobile
 * @subpackage Modules\MyAccount
 */

:root {
	--mm-acct-font: "Montserrat", sans-serif;
	--mm-acct-yellow: #ffeb00;
	--mm-acct-cream: #fdfbf3;
	--mm-acct-cream-deep: #f4f0e4;
	--mm-acct-text: #1a1a1a;
	--mm-acct-muted: #6b6b6b;
	--mm-acct-border: #e8e4dc;
	--mm-acct-divider: #efece4;
	--mm-acct-card: #ffffff;
	--mm-acct-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
	--mm-acct-danger: #c62828;
	--mm-acct-green: #004e32;
}

/* ————— Page scope (logged-in account pages only) ————— */

body.woocommerce-account.logged-in {
	background-color: var(--mm-acct-cream);
}

/* ————— Layout: sidebar + content grid ————— */

body.woocommerce-account.logged-in .woocommerce:has(.woocommerce-MyAccount-navigation) {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	gap: 24px;
	align-items: start;
	max-width: 1140px;
	margin: 0 auto;
	padding: 40px 20px 64px;
	font-family: var(--mm-acct-font);
	color: var(--mm-acct-text);
}

/* Notices land inside the grid wrapper — span both columns */
body.woocommerce-account.logged-in .woocommerce > .woocommerce-message,
body.woocommerce-account.logged-in .woocommerce > .woocommerce-info,
body.woocommerce-account.logged-in .woocommerce > .woocommerce-error {
	grid-column: 1 / -1;
}

/* ————— Navigation card ————— */

body.woocommerce-account.logged-in .woocommerce-MyAccount-navigation {
	float: none;
	width: auto;
	background: var(--mm-acct-card);
	border: 1px solid var(--mm-acct-border);
	border-radius: 12px;
	box-shadow: var(--mm-acct-shadow);
	padding: 12px;
	position: sticky;
	top: 24px;
}

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

body.woocommerce-account.logged-in .woocommerce-MyAccount-navigation li {
	margin: 0 0 2px;
}

body.woocommerce-account.logged-in .woocommerce-MyAccount-navigation a {
	display: block;
	padding: 11px 14px;
	border-radius: 8px;
	font-family: var(--mm-acct-font);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--mm-acct-text);
	text-decoration: none;
	transition: background 0.15s ease;
}

body.woocommerce-account.logged-in .woocommerce-MyAccount-navigation a:hover {
	background: var(--mm-acct-cream);
	color: var(--mm-acct-text);
}

body.woocommerce-account.logged-in .woocommerce-MyAccount-navigation li.is-active > a {
	background: var(--mm-acct-yellow);
	color: var(--mm-acct-text);
}

/* Log out: separated from the rest, muted until hover */
body.woocommerce-account.logged-in .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--customer-logout {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid var(--mm-acct-divider);
}

body.woocommerce-account.logged-in .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--customer-logout a {
	color: var(--mm-acct-muted);
}

body.woocommerce-account.logged-in .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--customer-logout a:hover {
	color: var(--mm-acct-danger);
	background: #fdeaea;
}

/* ————— Content card ————— */

body.woocommerce-account.logged-in .woocommerce-MyAccount-content {
	float: none;
	width: auto;
	background: var(--mm-acct-card);
	border: 1px solid var(--mm-acct-border);
	border-radius: 12px;
	box-shadow: var(--mm-acct-shadow);
	padding: 28px 32px 32px;
	font-family: var(--mm-acct-font);
	font-size: 14px;
	line-height: 1.6;
	color: var(--mm-acct-text);
	overflow-wrap: break-word;
}

body.woocommerce-account.logged-in .woocommerce-MyAccount-content h2,
body.woocommerce-account.logged-in .woocommerce-MyAccount-content h3,
body.woocommerce-account.logged-in .woocommerce-MyAccount-content legend {
	font-family: var(--mm-acct-font);
	font-weight: 700;
	color: var(--mm-acct-text);
}

body.woocommerce-account.logged-in .woocommerce-MyAccount-content h2 {
	font-size: 20px;
	margin: 0 0 16px;
}

/* ————— Dashboard: re-typeset the default text ————— */

body.woocommerce-account.logged-in .woocommerce-MyAccount-content > p {
	margin: 0 0 14px;
	font-size: 14px;
	color: var(--mm-acct-text);
}

body.woocommerce-account.logged-in .woocommerce-MyAccount-content > p:first-of-type {
	font-size: 17px;
	line-height: 1.5;
	padding-bottom: 16px;
	margin-bottom: 18px;
	border-bottom: 1px solid var(--mm-acct-divider);
}

body.woocommerce-account.logged-in .woocommerce-MyAccount-content > p a {
	color: var(--mm-acct-text);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-color: var(--mm-acct-yellow);
	text-decoration-thickness: 3px;
	text-underline-offset: 3px;
}

body.woocommerce-account.logged-in .woocommerce-MyAccount-content > p a:hover {
	background: var(--mm-acct-yellow);
	text-decoration-color: var(--mm-acct-yellow);
}

/* ————— Tables (orders, downloads, ...) ————— */

body.woocommerce-account.logged-in .woocommerce-MyAccount-content table.shop_table {
	width: 100%;
	border-collapse: collapse;
	border: none;
	margin: 0 0 16px;
	font-size: 14px;
}

body.woocommerce-account.logged-in .woocommerce-MyAccount-content table.shop_table th,
body.woocommerce-account.logged-in .woocommerce-MyAccount-content table.shop_table td {
	border: none;
	border-bottom: 1px solid var(--mm-acct-divider);
	padding: 14px 12px;
	text-align: left;
	vertical-align: middle;
	background: transparent;
}

body.woocommerce-account.logged-in .woocommerce-MyAccount-content table.shop_table thead th {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--mm-acct-muted);
	border-bottom: 2px solid var(--mm-acct-border);
}

body.woocommerce-account.logged-in .woocommerce-MyAccount-content table.shop_table tbody tr:hover td {
	background: var(--mm-acct-cream);
}

body.woocommerce-account.logged-in .woocommerce-orders-table__cell-order-number a {
	font-weight: 700;
	color: var(--mm-acct-text);
	text-decoration: none;
}

body.woocommerce-account.logged-in .woocommerce-orders-table__cell-order-number a:hover {
	text-decoration: underline;
	text-decoration-color: var(--mm-acct-yellow);
	text-decoration-thickness: 3px;
}

body.woocommerce-account.logged-in .woocommerce-orders-table__cell-order-total {
	white-space: nowrap;
}

/* ————— Order status badges (rendered by My_Account_Navigation) ————— */

.mm-acct-status {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 999px;
	font-family: var(--mm-acct-font);
	font-size: 12px;
	font-weight: 700;
	line-height: 1.4;
	white-space: nowrap;
	background: var(--mm-acct-cream-deep);
	color: var(--mm-acct-muted);
}

.mm-acct-status--processing {
	background: var(--mm-acct-yellow);
	color: var(--mm-acct-text);
}

.mm-acct-status--completed {
	background: #e3efe8;
	color: var(--mm-acct-green);
}

.mm-acct-status--on-hold,
.mm-acct-status--pending {
	background: #fff3d6;
	color: #7a4d00;
}

.mm-acct-status--cancelled,
.mm-acct-status--refunded,
.mm-acct-status--failed {
	background: #fdeaea;
	color: var(--mm-acct-danger);
}

/* ————— Buttons ————— */

body.woocommerce-account.logged-in .woocommerce-MyAccount-content .button,
body.woocommerce-account.logged-in .woocommerce-MyAccount-content button[type="submit"] {
	display: inline-block;
	padding: 12px 24px;
	border: 2px solid var(--mm-acct-text);
	border-radius: 6px;
	background: var(--mm-acct-text);
	color: #fff;
	font-family: var(--mm-acct-font);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

body.woocommerce-account.logged-in .woocommerce-MyAccount-content .button:hover,
body.woocommerce-account.logged-in .woocommerce-MyAccount-content button[type="submit"]:hover {
	background: var(--mm-acct-yellow);
	border-color: var(--mm-acct-text);
	color: var(--mm-acct-text);
}

/* Table row actions (View, Pay, Cancel): compact outline variant */
body.woocommerce-account.logged-in .woocommerce-MyAccount-content table.shop_table .button {
	padding: 7px 16px;
	background: transparent;
	color: var(--mm-acct-text);
	margin: 0 4px 4px 0;
}

body.woocommerce-account.logged-in .woocommerce-MyAccount-content table.shop_table .button:hover {
	background: var(--mm-acct-text);
	color: #fff;
}

/* ————— Forms (account details, edit address) ————— */

body.woocommerce-account.logged-in .woocommerce-MyAccount-content .form-row label {
	display: block;
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--mm-acct-text);
}

body.woocommerce-account.logged-in .woocommerce-MyAccount-content .form-row .required {
	color: var(--mm-acct-danger);
	text-decoration: none;
}

body.woocommerce-account.logged-in .woocommerce-MyAccount-content .input-text,
body.woocommerce-account.logged-in .woocommerce-MyAccount-content select,
body.woocommerce-account.logged-in .woocommerce-MyAccount-content textarea {
	width: 100%;
	padding: 11px 14px;
	border: 1.5px solid var(--mm-acct-border);
	border-radius: 8px;
	background: #fff;
	font-family: var(--mm-acct-font);
	font-size: 14px;
	color: var(--mm-acct-text);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.woocommerce-account.logged-in .woocommerce-MyAccount-content .input-text:focus,
body.woocommerce-account.logged-in .woocommerce-MyAccount-content select:focus,
body.woocommerce-account.logged-in .woocommerce-MyAccount-content textarea:focus {
	outline: none;
	border-color: var(--mm-acct-text);
	box-shadow: 0 0 0 3px rgba(255, 235, 0, 0.4);
}

body.woocommerce-account.logged-in .woocommerce-MyAccount-content fieldset {
	margin: 24px 0 16px;
	padding: 20px;
	border: 1px solid var(--mm-acct-border);
	border-radius: 10px;
	background: var(--mm-acct-cream);
}

body.woocommerce-account.logged-in .woocommerce-MyAccount-content fieldset legend {
	padding: 0 8px;
	font-size: 15px;
}

/* ————— Addresses ————— */

body.woocommerce-account.logged-in .woocommerce-MyAccount-content .woocommerce-Addresses {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	width: 100%;
}

body.woocommerce-account.logged-in .woocommerce-MyAccount-content .woocommerce-Address {
	float: none;
	width: auto;
	max-width: none;
	padding: 20px;
	border: 1px solid var(--mm-acct-border);
	border-radius: 10px;
	background: var(--mm-acct-cream);
}

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

body.woocommerce-account.logged-in .woocommerce-MyAccount-content .woocommerce-Address-title h3 {
	font-size: 15px;
	margin: 0;
}

body.woocommerce-account.logged-in .woocommerce-MyAccount-content .woocommerce-Address-title .edit {
	font-size: 13px;
	font-weight: 600;
	color: var(--mm-acct-text);
	text-decoration: underline;
	text-decoration-color: var(--mm-acct-yellow);
	text-decoration-thickness: 3px;
	text-underline-offset: 3px;
}

body.woocommerce-account.logged-in .woocommerce-MyAccount-content .woocommerce-Address address {
	font-style: normal;
	line-height: 1.7;
	color: var(--mm-acct-muted);
	border: none;
	padding: 0;
}

/* ————— Notices inside the account area ————— */

body.woocommerce-account.logged-in .woocommerce-message,
body.woocommerce-account.logged-in .woocommerce-info,
body.woocommerce-account.logged-in .woocommerce-error {
	border-radius: 10px;
	border: 1px solid var(--mm-acct-border);
	background: var(--mm-acct-card);
	color: var(--mm-acct-text);
	font-family: var(--mm-acct-font);
	font-size: 14px;
	box-shadow: var(--mm-acct-shadow);
}

/* ————— Responsive ————— */

@media screen and (max-width: 900px) {
	body.woocommerce-account.logged-in .woocommerce:has(.woocommerce-MyAccount-navigation) {
		grid-template-columns: 1fr;
		padding: 24px 16px 48px;
	}

	body.woocommerce-account.logged-in .woocommerce-MyAccount-navigation {
		position: static;
		padding: 10px;
	}

	/* Nav becomes a wrapped pill row */
	body.woocommerce-account.logged-in .woocommerce-MyAccount-navigation ul {
		display: flex;
		flex-wrap: wrap;
		gap: 6px;
	}

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

	body.woocommerce-account.logged-in .woocommerce-MyAccount-navigation a {
		padding: 8px 14px;
		border: 1px solid var(--mm-acct-border);
		border-radius: 999px;
		font-size: 13px;
	}

	body.woocommerce-account.logged-in .woocommerce-MyAccount-navigation li.is-active > a {
		border-color: var(--mm-acct-yellow);
	}

	body.woocommerce-account.logged-in .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--customer-logout {
		margin: 0;
		padding: 0;
		border: none;
	}

	body.woocommerce-account.logged-in .woocommerce-MyAccount-content {
		padding: 20px;
	}

	body.woocommerce-account.logged-in .woocommerce-MyAccount-content .woocommerce-Addresses {
		grid-template-columns: 1fr;
	}
}

/* Stacked order rows on small screens (pairs with WC smallscreen CSS) */
@media screen and (max-width: 768px) {
	body.woocommerce-account.logged-in .woocommerce-MyAccount-content table.shop_table.woocommerce-orders-table thead {
		display: none;
	}

	body.woocommerce-account.logged-in .woocommerce-MyAccount-content table.shop_table.woocommerce-orders-table tr {
		display: block;
		margin-bottom: 12px;
		border: 1px solid var(--mm-acct-border);
		border-radius: 10px;
		padding: 8px 12px;
		background: #fff;
	}

	body.woocommerce-account.logged-in .woocommerce-MyAccount-content table.shop_table.woocommerce-orders-table td {
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 12px;
		padding: 8px 0;
		border-bottom: 1px solid var(--mm-acct-divider);
		text-align: right;
	}

	body.woocommerce-account.logged-in .woocommerce-MyAccount-content table.shop_table.woocommerce-orders-table td:last-child {
		border-bottom: none;
	}

	body.woocommerce-account.logged-in .woocommerce-MyAccount-content table.shop_table.woocommerce-orders-table td::before {
		content: attr(data-title);
		font-weight: 700;
		font-size: 12px;
		text-transform: uppercase;
		letter-spacing: 0.04em;
		color: var(--mm-acct-muted);
		text-align: left;
	}
}

/* ═════ Trade-in orders tab (ported from v1, retinted to cream tokens) ═════ */

.mm-trade-in-orders-list {
	margin-top: 0;
}

.mm-trade-in-orders-cards {
	margin-bottom: 2em;
}

.mm-orders-status-filter {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5em 1em;
	padding: 0.75em 1em;
	background: var(--mm-acct-cream-deep);
	border-radius: 8px;
	margin-bottom: 1.5em;
}

.mm-orders-status-label {
	font-weight: 600;
	margin-right: 0.25em;
}

.mm-status-btn {
	padding: 0.4em 1em;
	border: none;
	border-radius: 999px;
	background: transparent;
	color: var(--mm-acct-text);
	font-size: 0.95em;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
}

.mm-status-btn:hover {
	background: rgba(0, 0, 0, 0.06);
}

.mm-status-btn.is-active {
	background: var(--mm-acct-yellow);
	color: var(--mm-acct-text);
	font-weight: 600;
}

.mm-order-card {
	background: #fff;
	border-radius: 12px;
	margin-bottom: 1.25em;
	overflow: hidden;
	border: 1px solid var(--mm-acct-border);
}

.mm-order-card__header {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5em 1em;
	padding: 1em 1.25em;
	border-bottom: 1px solid var(--mm-acct-divider);
}

.mm-order-card__type-pill {
	display: inline-block;
	padding: 0.35em 0.85em;
	border-radius: 999px;
	background: var(--mm-acct-text);
	color: #fff;
	font-size: 0.85em;
	font-weight: 500;
}

.mm-order-card__title {
	flex: 1;
	min-width: 0;
	font-weight: 600;
	font-size: 1em;
}

.mm-order-card__status-pill {
	display: inline-block;
	padding: 0.35em 0.85em;
	border-radius: 999px;
	font-size: 0.85em;
	font-weight: 600;
}

.mm-order-card__status-pill--completed {
	background: var(--mm-acct-yellow);
	color: var(--mm-acct-text);
}

.mm-order-card__status-pill--pending {
	background: var(--mm-acct-yellow);
	color: var(--mm-acct-text);
}

.mm-order-card__toggle {
	width: 36px;
	min-width: 36px;
	height: 36px;
	min-height: 36px;
	padding: 0;
	cursor: pointer;
	position: relative;
	border-radius: 6px;
	flex-shrink: 0;
	z-index: 1;
	background: none !important;
	color: var(--mm-acct-text) !important;
	border: none !important;
}

.mm-order-card__toggle:hover {
	background: none !important;
}

.mm-order-card__toggle:focus {
	outline: none !important;
}

.mm-order-card__toggle .mm-order-card__chevron {
	display: block;
	transition: transform 0.2s ease;
}

/* Expanded: chevron points up (default polyline is down, so rotate 180deg = up) */
.mm-order-card:not(.is-collapsed) .mm-order-card__chevron {
	transform: rotate(180deg);
}

.mm-order-card.is-collapsed .mm-order-card__chevron {
	transform: rotate(0deg);
}

.mm-order-card__body {
	display: grid;
	grid-template-rows: 1fr;
	transition: grid-template-rows 0.35s ease-out;
	overflow: hidden;
}

.mm-order-card.is-collapsed .mm-order-card__body {
	grid-template-rows: 0fr;
}

.mm-order-card__body-inner {
	min-height: 0;
	overflow: hidden;
	display: grid;
	grid-template-columns: 1fr 1.5fr;
	gap: 0;
}

.mm-order-card__col {
	padding: 1.25em;
}

.mm-order-card__col--info {
	background: var(--mm-acct-cream);
	border-right: 1px solid var(--mm-acct-divider);
}

.mm-order-card__col--details {
	background: #fff;
}

.mm-order-card__info-block {
	font-size: 0.95em;
	line-height: 1.5;
}

.mm-order-card__info-name {
	font-weight: 600;
	margin-bottom: 0.35em;
}

.mm-order-card__info-address {
	color: var(--mm-acct-muted);
}

.mm-order-card__details-label {
	font-weight: 600;
	margin-bottom: 0.5em;
	font-size: 0.95em;
}

.mm-order-card__items {
	list-style: none;
	margin: 0 0 0.75em 0;
	padding: 0;
}

.mm-order-card__item {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 1em;
	padding: 0.35em 0;
	border-bottom: 1px solid var(--mm-acct-divider);
	font-size: 0.95em;
}

.mm-order-card__item:last-child {
	border-bottom: none;
}

.mm-order-card__item-label {
	flex: 1;
	min-width: 0;
}

.mm-order-card__item-price {
	white-space: nowrap;
	font-weight: 500;
}

.mm-order-card__total {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-top: 0.75em;
	border-top: 1px solid var(--mm-acct-border);
	margin-top: 0.25em;
}

.mm-order-card.is-hidden-by-filter {
	display: none;
}

@media screen and (max-width: 768px) {
	.mm-order-card__body-inner {
		grid-template-columns: 1fr;
	}

	.mm-order-card__col--info {
		border-right: none;
		border-bottom: 1px solid var(--mm-acct-divider);
	}

	.mm-order-card__header {
		flex-direction: column;
		align-items: flex-start;
	}
}

.mm-trade-in-orders-list .woocommerce-orders-table {
	width: 100%;
}

.mm-trade-in-orders-list .woocommerce-orders-table__cell-order-total {
	white-space: nowrap;
}

@media screen and (max-width: 768px) {
	.mm-trade-in-orders-list .woocommerce-orders-table thead {
		display: none;
	}

	.mm-trade-in-orders-list .woocommerce-orders-table__row {
		display: block;
		margin-bottom: 1em;
		border: 1px solid var(--mm-acct-border);
		border-radius: 4px;
		padding: 0.75em;
	}

	.mm-trade-in-orders-list .woocommerce-orders-table__cell {
		display: flex;
		justify-content: space-between;
		padding: 0.35em 0;
		border: none;
	}

	.mm-trade-in-orders-list .woocommerce-orders-table__cell::before {
		content: attr(data-title);
		font-weight: 600;
		margin-right: 0.5em;
	}
}
