/**
 * Customer account pages.
 *
 * WooCommerce's account templates render correctly but arrive with default
 * styling, so orders, addresses and rewards looked like stock WooCommerce
 * rather than Zoi. Everything here is layout and brand tokens only — no
 * WooCommerce markup or behaviour is overridden, so account templates stay
 * upgrade-safe.
 *
 * All colour and type comes from the tokens in zoi-tokens.css. No hex value is
 * introduced here (ZF-02-R006).
 */

.woocommerce-account .woocommerce {
	display: grid;
	grid-template-columns: minmax(200px, 240px) 1fr;
	gap: clamp(1.5rem, 4vw, 3rem);
	align-items: start;
}

/*
 * A grid item's default `min-width: auto` refuses to shrink below its content,
 * so a wide table pushed the whole column past the viewport — the rewards
 * activity table overflowed at 390px while the narrower orders table did not.
 * `min-width: 0` lets the column shrink so the table's own scroller can take
 * over.
 */
.woocommerce-account .woocommerce-MyAccount-content {
	min-width: 0;
}

/* ------------------------------------------------------------------ *
 * Navigation
 * ------------------------------------------------------------------ */

.woocommerce-MyAccount-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	border: 1px solid var(--zoi-rule, rgba(43, 32, 24, 0.12));
	border-radius: 2px;
	overflow: hidden;
}

.woocommerce-MyAccount-navigation li {
	margin: 0;
	border-bottom: 1px solid var(--zoi-rule, rgba(43, 32, 24, 0.08));
}

.woocommerce-MyAccount-navigation li:last-child {
	border-bottom: 0;
}

.woocommerce-MyAccount-navigation li a {
	display: block;
	padding: 0.85rem 1.1rem;
	font-family: var(--wp--preset--font-family--body, inherit);
	font-size: 0.9rem;
	letter-spacing: 0.01em;
	text-decoration: none;
	color: var(--zoi-ink, #2b2018);
	transition: background-color 120ms ease, color 120ms ease;
}

.woocommerce-MyAccount-navigation li a:hover,
.woocommerce-MyAccount-navigation li a:focus-visible {
	background: var(--zoi-cream, #f4eee3);
}

.woocommerce-MyAccount-navigation li.is-active a {
	background: var(--zoi-cream, #f4eee3);
	font-weight: 600;
}

/* The active item needs more than weight and tint to be distinguishable
   (ZF-34-R003: never rely on colour alone). */
.woocommerce-MyAccount-navigation li.is-active a::before {
	content: "";
	display: inline-block;
	width: 3px;
	height: 0.9em;
	margin-right: 0.6rem;
	vertical-align: -0.05em;
	background: var(--zoi-camel-accessible, #6f4c2b);
}

/* ------------------------------------------------------------------ *
 * Content
 * ------------------------------------------------------------------ */

.woocommerce-MyAccount-content > h2,
.woocommerce-MyAccount-content > h3 {
	font-family: var(--wp--preset--font-family--display, inherit);
	font-weight: 500;
	margin-top: 0;
}

.woocommerce-MyAccount-content p {
	color: var(--zoi-ink, #2b2018);
}

/* ------------------------------------------------------------------ *
 * Tables — orders, downloads, rewards activity
 * ------------------------------------------------------------------ */

.woocommerce-account table.woocommerce-orders-table,
.woocommerce-account table.shop_table {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid var(--zoi-rule, rgba(43, 32, 24, 0.12));
}

.woocommerce-account table.woocommerce-orders-table th,
.woocommerce-account table.shop_table th {
	text-align: left;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 0.75rem 0.9rem;
	background: var(--zoi-cream, #f4eee3);
	border-bottom: 1px solid var(--zoi-rule, rgba(43, 32, 24, 0.12));
}

.woocommerce-account table.woocommerce-orders-table td,
.woocommerce-account table.shop_table td {
	padding: 0.85rem 0.9rem;
	border-bottom: 1px solid var(--zoi-rule, rgba(43, 32, 24, 0.08));
	font-size: 0.9rem;
	vertical-align: middle;
}

/* ------------------------------------------------------------------ *
 * Rewards panel
 * ------------------------------------------------------------------ */

.zoi-rewards__balance {
	font-family: var(--wp--preset--font-family--display, inherit);
	font-size: clamp(1.4rem, 3vw, 1.9rem);
	margin: 0 0 0.35rem;
}

.zoi-rewards__pending,
.zoi-rewards__rule {
	font-size: 0.88rem;
	color: var(--zoi-camel-accessible, #6f4c2b);
	margin: 0 0 0.5rem;
}

.zoi-rewards__table {
	margin-top: 1.5rem;
}

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

.woocommerce-account .woocommerce-form input[type="text"],
.woocommerce-account .woocommerce-form input[type="email"],
.woocommerce-account .woocommerce-form input[type="password"],
.woocommerce-account .woocommerce-Address input,
.woocommerce-account .woocommerce-EditAccountForm input {
	width: 100%;
	padding: 0.7rem 0.8rem;
	border: 1px solid var(--zoi-rule, rgba(43, 32, 24, 0.25));
	border-radius: 2px;
	font-size: 0.95rem;
	background: #fff;
	color: var(--zoi-ink, #2b2018);
}

.woocommerce-account .woocommerce-form input:focus-visible,
.woocommerce-account .woocommerce-EditAccountForm input:focus-visible {
	outline: 2px solid var(--zoi-camel-accessible, #6f4c2b);
	outline-offset: 1px;
}

/* Touch targets stay comfortable (ZF-34-R003). */
.woocommerce-account .button,
.woocommerce-account button[type="submit"] {
	min-height: 44px;
	padding: 0.7rem 1.4rem;
	border-radius: 2px;
	font-size: 0.85rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	cursor: pointer;
}

/* ------------------------------------------------------------------ *
 * Mobile
 * ------------------------------------------------------------------ */

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

	/* Order tables are the usual source of horizontal overflow on phones. */
	.woocommerce-account table.woocommerce-orders-table,
	.woocommerce-account table.shop_table {
		display: block;
		overflow-x: auto;
		white-space: nowrap;
	}
}
