/* WooCommerce My Account pages (login, register, dashboard, orders,
   downloads, addresses, account details). These render through WooCommerce's
   classic myaccount/*.php templates, not blocks, so — unlike Cart/Checkout —
   there's no block-based styling to lean on; this file is the only thing
   standing between this area and WooCommerce's bare default markup.
   Loaded only on the account page itself (see copper_ink_enqueue_assets()
   in inc/theme-setup.php). */

/* Cards below combine an explicit/grid-filled width with their own padding
   and border; without border-box those would add on top of the width
   instead of being included in it, overflowing their grid track (confirmed
   live: a content-box .woocommerce-Address rendered 463px wide inside a
   397px track — exactly width + 2*32px padding + 2*1px border). */
.woocommerce-account * {
	box-sizing: border-box;
}

.woocommerce-account .wp-block-post-content {
	max-width: 900px;
	margin-inline: auto;
}

/* Login / Register, and the two-address grid further down, both reuse
   WooCommerce's .col2-set class, which core CSS also gives a clearfix pair
   of generated ::before/::after (content:" "; display:table) for its default
   float-based layout. Grid/flex containers treat generated content as real
   items too, so turning .col2-set into a grid without killing these first
   silently adds two extra (empty) items into the grid — confirmed live: with
   two real columns plus these two pseudo-elements in DOM order, a 2-column
   auto-flow grid placed [::before, Login] on row 1 and [Register, ::after]
   on row 2, landing Login on the right and Register on the left instead of
   side by side. */
/* .woocommerce .col2-set::before (2 classes) otherwise beats a plain
   .col2-set::before (1 class), so this targets both real instances by id/
   class combination for the specificity to actually win. */
#customer_login.col2-set::before,
#customer_login.col2-set::after,
.u-columns.woocommerce-Addresses.col2-set::before,
.u-columns.woocommerce-Addresses.col2-set::after {
	content: none;
	display: none;
}

/* WooCommerce floats these two columns (.u-column1/.u-column2, float:left/
   right) by default. A grid container makes floats on its children compute
   to none per spec, so this replaces that layout outright rather than
   fighting it with clearfixes. */
#customer_login.col2-set {
	display: grid;
	grid-template-columns: 1fr;
	gap: 32px;
}
@media (min-width: 700px) {
	#customer_login.col2-set {
		grid-template-columns: 1fr 1fr;
	}
}
#customer_login .u-column1,
#customer_login .u-column2 {
	width: auto;
	min-width: 0;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--hairline);
	border-radius: 8px;
	padding: 40px;
}
#customer_login h2 {
	margin-top: 0;
}

/* Form fields shared across login, register, edit-account, and addresses. */
.woocommerce-form-row label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	color: var(--wp--preset--color--text-secondary);
}
.woocommerce-form-row .input-text,
.woocommerce-EditAccountForm .input-text,
.woocommerce-address-fields .input-text,
.woocommerce-address-fields select {
	width: 100%;
	border-radius: 4px;
	border-color: var(--wp--preset--color--hairline);
}
.woocommerce-form-row .input-text:focus,
.woocommerce-EditAccountForm .input-text:focus,
.woocommerce-address-fields .input-text:focus {
	border-color: var(--wp--preset--color--copper);
	outline: none;
	box-shadow: 0 0 0 1px var(--wp--preset--color--copper);
}
.woocommerce-form-login__rememberme {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
}
.woocommerce-LostPassword {
	margin-top: 16px;
	font-size: 14px;
}
.woocommerce-LostPassword a,
.woocommerce-MyAccount-content a:not(.button):not(.wp-element-button) {
	color: var(--wp--preset--color--copper);
}

/* Core CSS floats the nav as a 30%-wide left sidebar and the content as a
   68%-wide right column (.woocommerce-account .woocommerce-MyAccount-navigation
   / -content in woocommerce-layout.css) — confirmed live: it's why the pill
   nav below was squeezed to two-per-row inside that narrow 30% column while
   the dashboard text floated in its own column with a large gap before it.
   This theme wants the nav as a full-width bar above the content instead. */
.woocommerce-account nav.woocommerce-MyAccount-navigation,
.woocommerce-account div.woocommerce-MyAccount-content {
	float: none;
	width: 100%;
}

/* Account navigation: a bare <ul> by default -> a wrapping pill-tab bar.
   core's woocommerce-blocktheme.css styles this as a VERTICAL list — each
   li gets padding:1em 0 for stacked spacing, with a first-child:padding-top:0
   exception so the sidebar doesn't start with extra space. Confirmed live:
   with flex-wrap turning it horizontal, that leftover li padding pushed
   "Dashboard" (the first-child) 20px higher than every other pill, since it
   alone had no top padding. Every override below repeats the "ul li" element
   pair (instead of matching core's selector 1-for-1) specifically to win the
   specificity fight regardless of source order — core's own selectors here
   run 2-3 classes deep. */
.woocommerce-account .woocommerce-MyAccount-navigation ul,
.woocommerce-account .woocommerce-MyAccount-navigation ul li,
.woocommerce-account .woocommerce-MyAccount-navigation ul li:first-child {
	padding: 0;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0 0 40px;
	padding-bottom: 24px;
	border-bottom: 1px solid var(--wp--preset--color--hairline);
}
.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
	display: inline-block;
	padding: 8px 16px;
	border: 1px solid var(--wp--preset--color--hairline);
	border-radius: 999px;
	font-size: 14px;
	text-decoration: none;
	color: var(--wp--preset--color--text-secondary);
}
.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover {
	border-color: var(--wp--preset--color--copper);
	color: var(--wp--preset--color--copper);
}
/* core also underlines .is-active a — same specificity fight. */
.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a {
	background: var(--wp--preset--color--ink);
	border-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--porcelain);
	text-decoration: none;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a:hover {
	color: var(--wp--preset--color--porcelain);
}

.woocommerce-MyAccount-content > p {
	color: var(--wp--preset--color--text-secondary);
	line-height: 1.7;
}

/* Orders + downloads tables share WooCommerce's .shop_table base class. */
.shop_table {
	width: 100%;
	border-collapse: collapse;
}
.shop_table th {
	text-align: left;
	padding: 12px 16px;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--wp--preset--color--stone);
	border-bottom: 1px solid var(--wp--preset--color--hairline);
}
.shop_table td {
	padding: 16px;
	border-bottom: 1px solid var(--wp--preset--color--hairline);
	font-size: 14px;
}
.woocommerce-orders-table__cell-order-actions .button {
	margin: 2px 4px 2px 0;
}
.woocommerce-orders-table__row--status-completed .woocommerce-orders-table__cell-order-status {
	color: var(--wp--preset--color--success);
}
.woocommerce-orders-table__row--status-cancelled .woocommerce-orders-table__cell-order-status,
.woocommerce-orders-table__row--status-failed .woocommerce-orders-table__cell-order-status {
	color: var(--wp--preset--color--error);
}

/* A generic fallback for any WooCommerce button that doesn't already carry
   wp-element-button (which already gets the theme's terracotta button style
   from theme.json automatically). */
.woocommerce-button:not(.wp-element-button) {
	display: inline-block;
	padding: 8px 16px;
	border: 1px solid var(--wp--preset--color--hairline);
	border-radius: 4px;
	color: var(--wp--preset--color--text-secondary);
	text-decoration: none;
}
.woocommerce-button:not(.wp-element-button):hover {
	border-color: var(--wp--preset--color--copper);
	color: var(--wp--preset--color--copper);
}

/* Addresses */
.woocommerce-Addresses {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
}
@media (min-width: 700px) {
	.woocommerce-Addresses {
		grid-template-columns: 1fr 1fr;
	}
}
/* .woocommerce .col2-set .col-1/.col-2 (3 classes) sets width:48% on these
   same elements — .woocommerce-Address alone (1 class) loses that fight, so
   this matches on 4 classes to reliably win regardless of source order. */
.u-columns.woocommerce-Addresses .u-column1.woocommerce-Address,
.u-columns.woocommerce-Addresses .u-column2.woocommerce-Address {
	width: auto;
	min-width: 0;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--hairline);
	border-radius: 8px;
	padding: 32px;
	container-type: inline-size;
}
/* Title + "Add/Edit ... address" link: side by side needs about 300px of the
   card's own CONTENT-box width (the un-set "Add Billing address" label is the
   longest case at ~290px combined) -- a container query keys off the card's
   own width rather than the viewport, since this card can be narrow either on
   a phone or in the 2-up desktop grid. Query thresholds compare against the
   container's content box, i.e. inside its 32px padding + 1px border, not the
   border-box width you'd read from getBoundingClientRect -- confirmed live
   that a 438px (border-box) card only has ~372px of content-box width, so a
   380px threshold here never matched even on cards with plenty of room.
   Below the threshold it stacks instead of both halves wrapping their own
   text into cramped columns. */
.woocommerce-Address-title {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	margin-bottom: 12px;
}
@container (min-width: 300px) {
	.woocommerce-Address-title {
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}
}
.woocommerce-Address-title h2 {
	font-size: 20px;
	margin: 0;
}
.woocommerce-Address address {
	font-style: normal;
	color: var(--wp--preset--color--text-secondary);
	line-height: 1.7;
}
