/*
 * My Account (classic shortcode, Blocksy markup). Presentation only:
 * menu items, endpoints and forms stay WooCommerce's.
 */

body.woocommerce-account {
	background: var(--yozita-color-background);
}
body.woocommerce-account .hero-section .page-title {
	font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
	font-weight: 700;
	letter-spacing: -0.02em;
}

/* Logged in: navigation card + content column. */
.woocommerce.ct-woo-account {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: var(--yozita-space-5);
	margin-bottom: var(--yozita-space-6);
}
.ct-woo-account .ct-acount-nav {
	flex: 1 1 240px;
	max-width: 260px;
	min-width: 0;
	padding: 8px;
	border: 0;
	border-radius: var(--yozita-radius);
	background: var(--yozita-color-surface);
	box-sizing: border-box;
}
.ct-woo-account .woocommerce-MyAccount-content {
	flex: 999 1 560px;
	min-width: 0;
	width: auto;
	display: flex;
	flex-direction: column;
	gap: 20px;
}
.ct-woo-account .woocommerce-MyAccount-content > :where(p, .woocommerce-notices-wrapper:not(:empty), form, table, .woocommerce-Addresses, .woocommerce-order-details, .woocommerce-customer-details, .woocommerce-message, .woocommerce-info) {
	margin: 0;
}

/* Navigation ------------------------------------------------------------ */
.ct-woo-account .woocommerce-MyAccount-navigation ul {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
	border: 0;
}
.ct-woo-account .woocommerce-MyAccount-navigation li {
	margin: 0;
	border: 0;
}
.ct-woo-account .woocommerce-MyAccount-navigation li a {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	padding: 0 14px;
	border-radius: 6px;
	color: var(--yozita-color-text);
	font-size: 0.875rem;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
}
.ct-woo-account .woocommerce-MyAccount-navigation li a::before {
	content: "";
	flex: none;
	width: 18px;
	height: 18px;
	background: currentColor;
	-webkit-mask: var(--yozita-account-icon) center / contain no-repeat;
	mask: var(--yozita-account-icon) center / contain no-repeat;
}
/* Hover: red text and icon (the icon follows currentColor). The darker red
   keeps 4.5:1 contrast on the grey hover background. */
.ct-woo-account .woocommerce-MyAccount-navigation ul li:not(.is-active):hover a,
.ct-woo-account .woocommerce-MyAccount-navigation ul li:not(.is-active) a:focus-visible {
	background: var(--yozita-color-background);
	color: var(--yozita-color-brand-hover);
}
.ct-woo-account .woocommerce-MyAccount-navigation li.is-active a,
.ct-woo-account .woocommerce-MyAccount-navigation li a[aria-current="page"] {
	background: var(--yozita-color-text);
	color: var(--yozita-color-surface);
	font-weight: 600;
}

/* Content cards ---------------------------------------------------------- */
.ct-woo-account .woocommerce-MyAccount-content {
	font-size: 0.9375rem;
	color: var(--yozita-color-text);
}
.ct-woo-account .woocommerce-MyAccount-content > p:first-of-type,
.ct-woo-account .woocommerce-MyAccount-content > form,
.ct-woo-account .woocommerce-orders-table,
.ct-woo-account .woocommerce-Addresses .woocommerce-Address,
.ct-woo-account .woocommerce-order-details,
.ct-woo-account .woocommerce-customer-details {
	padding: 28px;
	border-radius: var(--yozita-radius);
	background: var(--yozita-color-surface);
	box-sizing: border-box;
}
/* Dashboard greeting and its follow-up paragraph read as one card. */
.ct-woo-account .woocommerce-MyAccount-content > p:first-of-type {
	font-size: 1.25rem;
	font-weight: 600;
	padding-bottom: 0;
	border-radius: var(--yozita-radius) var(--yozita-radius) 0 0;
}
.ct-woo-account .woocommerce-MyAccount-content > p:first-of-type + p {
	margin-top: -20px;
	padding: 8px 28px 28px;
	border-radius: 0 0 var(--yozita-radius) var(--yozita-radius);
	background: var(--yozita-color-surface);
	color: var(--yozita-color-muted);
}
.ct-woo-account .woocommerce-MyAccount-content > p:first-of-type a {
	font-size: 0.875rem;
	font-weight: 400;
	color: var(--yozita-color-text);
}

/* Dashboard shortcuts (inc/commerce-pages.php). */
.yozita-account-shortcuts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.yozita-account-shortcuts li {
	margin: 0;
}
.yozita-account-shortcuts a {
	display: flex;
	flex-direction: column;
	gap: 8px;
	height: 100%;
	padding: 20px;
	border-radius: var(--yozita-radius);
	background: var(--yozita-color-surface);
	color: var(--yozita-color-text);
	text-decoration: none;
	box-sizing: border-box;
}
.yozita-account-shortcuts a:hover strong {
	color: var(--yozita-color-brand-hover);
}
.yozita-account-shortcuts strong {
	font-size: 0.9375rem;
	font-weight: 600;
}
.yozita-account-shortcuts a > span:last-child {
	font-size: 0.8125rem;
	color: var(--yozita-color-muted);
}
.yozita-account-shortcut-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--yozita-color-background);
	color: var(--yozita-color-brand);
}
.yozita-account-shortcut-icon svg {
	width: 20px;
	height: 20px;
}

/* Orders table: scrolls inside its card on narrow screens. */
.ct-woo-account .woocommerce-orders-table {
	display: block;
	overflow-x: auto;
	border: 0;
	font-variant-numeric: tabular-nums;
}
.ct-woo-account .woocommerce-orders-table th {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--yozita-color-muted);
}
.ct-woo-account .woocommerce-orders-table :is(th, td) {
	border: 0;
	border-bottom: 1px solid #e5e7eb;
	padding: 14px 12px;
}
.ct-woo-account .woocommerce-orders-table mark {
	background: none;
	color: inherit;
	font-weight: 600;
}

/* Logged out: sign in and register side by side. ------------------------- */
.ct-woo-unauthorized #customer_login {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
	gap: var(--yozita-space-4);
	margin-bottom: var(--yozita-space-6);
}
.ct-woo-unauthorized #customer_login::before,
.ct-woo-unauthorized #customer_login::after {
	display: none;
}
.ct-woo-unauthorized #customer_login > [class*="u-column"] {
	float: none;
	width: auto;
	max-width: none;
	margin: 0;
	padding: 36px;
	border-radius: var(--yozita-radius);
	background: var(--yozita-color-surface);
	box-sizing: border-box;
}
.ct-woo-unauthorized :is(.woocommerce-form-login, .woocommerce-form-register, .woocommerce-ResetPassword) {
	margin: 0;
	padding: 0;
	border: 0;
}
.ct-woo-unauthorized #customer_login h2 {
	font-size: 1.375rem;
	font-weight: 600;
}

/* Fields and buttons on every account screen. */
:is(.ct-woo-account, .ct-woo-unauthorized) :is(input.input-text, select, textarea) {
	min-height: 48px;
	border: 1px solid var(--yozita-color-border);
	border-radius: var(--yozita-radius);
	background: var(--yozita-color-surface);
	color: var(--yozita-color-text);
	font-family: inherit;
}
:is(.ct-woo-account, .ct-woo-unauthorized) :is(input.input-text, select, textarea):focus {
	border-color: var(--yozita-color-text);
	box-shadow: 0 0 0 1px var(--yozita-color-text);
}
:is(.ct-woo-account, .ct-woo-unauthorized) .required {
	color: var(--yozita-color-brand-hover);
}
:is(.ct-woo-account, .ct-woo-unauthorized) :is(button.button, .woocommerce-button.button, a.button) {
	min-height: 48px;
	padding: 0 24px;
	border-radius: var(--yozita-radius);
	background: var(--yozita-color-brand);
	color: var(--yozita-color-surface);
	font-weight: 600;
}
:is(.ct-woo-account, .ct-woo-unauthorized) :is(button.button, .woocommerce-button.button, a.button):is(:hover, :focus-visible) {
	background: var(--yozita-color-brand-hover);
	color: var(--yozita-color-surface);
}
/* Register is the secondary action beside Sign in. */
.ct-woo-unauthorized .woocommerce-form-register button.button {
	border: 1.5px solid var(--yozita-color-text);
	background: var(--yozita-color-surface);
	color: var(--yozita-color-text);
}
.ct-woo-unauthorized .woocommerce-form-register button.button:is(:hover, :focus-visible) {
	background: var(--yozita-color-text);
	color: var(--yozita-color-surface);
}
.ct-woo-account .woocommerce-orders-table .button {
	min-height: 36px;
	padding: 0 14px;
	border: 1.5px solid var(--yozita-color-text);
	background: var(--yozita-color-surface);
	color: var(--yozita-color-text);
	font-size: 0.8125rem;
}

@media (max-width: 767px) {
	.ct-woo-account .ct-acount-nav {
		flex-basis: 100%;
		max-width: none;
		overflow-x: auto;
	}
	.ct-woo-account .woocommerce-MyAccount-navigation ul {
		flex-direction: row;
	}
	.ct-woo-account .woocommerce-MyAccount-content > p:first-of-type,
	.ct-woo-account .woocommerce-MyAccount-content > form,
	.ct-woo-account .woocommerce-orders-table,
	.ct-woo-account .woocommerce-Addresses .woocommerce-Address {
		padding: 20px 16px;
	}
	.ct-woo-account .woocommerce-MyAccount-content > p:first-of-type + p {
		padding: 8px 16px 20px;
	}
	.ct-woo-unauthorized #customer_login > [class*="u-column"] {
		padding: 24px 16px;
	}
}
