/**
 * My Account — login/register, dashboard sidebar + panels, and WC's
 * native address/account forms. Ported from the approved review mockup
 * (docs/mockups-account.html) for the markup this theme fully owns;
 * WooCommerce's own edit-address and edit-account forms are intentionally
 * NOT template-overridden (see woocommerce/myaccount/ — only
 * navigation.php, orders.php, view-order.php, and my-account.php are
 * overridden) so their real save/validation/nonce logic stays exactly
 * what WooCommerce ships — this section themes them via their own
 * stable core classes instead.
 *
 * @package B2B_Apparel
 */

/* .breadcrumbs now lives in base.css (global) — see that file's
 * comment; this was a duplicate of the same rule. */

/* ---------------- Shared field styles (also used by the Wholesale
   application form) ---------------- */
.field label,
.woocommerce-address-fields__field-wrapper label,
.woocommerce-EditAccountForm label {
	display: block;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .03em;
	font-weight: 700;
	margin-bottom: 6px;
	color: #444;
}
.field input,
.field textarea,
.woocommerce-address-fields__field-wrapper input,
.woocommerce-address-fields__field-wrapper select,
.woocommerce-address-fields__field-wrapper textarea,
.woocommerce-EditAccountForm input,
.woocommerce-EditAccountForm select,
.woocommerce-EditAccountForm textarea {
	width: 100%;
	border: 1px solid #ccc;
	padding: 10px 12px;
	font-size: 13.5px;
	font-family: inherit;
	margin-bottom: 16px;
}
/* Custom arrow for the Country/State dropdowns — no existing
   custom-select convention elsewhere in this theme to reuse (the Shop
   page's sort dropdown deliberately keeps the browser's native arrow),
   so this is a new, minimal one: flat chevron matching the site's
   monochrome line-icon style, no border-radius, consistent with every
   other input here.
   NOTE: WooCommerce automatically enhances Country/State selects with
   Select2 (wc-country-select.js, bundled with WC core) — this hides the
   real <select> entirely and replaces it with its own generated markup,
   confirmed via live DevTools inspection. The rule below is a fallback
   only (covers the brief flash before Select2's JS runs, and any select
   Select2 doesn't touch) — the actual visible styling for Country/State
   is the .select2-container block further down. */
.woocommerce-address-fields__field-wrapper select,
.woocommerce-EditAccountForm select {
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23111' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 38px;
	cursor: pointer;
}
/* Select2's own generated markup — the part actually visible for
   Country/State. Matches the same border/font/height convention as
   every other input in this form, plus the same chevron used above. */
.select2-container {
	display: block;
	width: 100% !important;
	margin-bottom: 16px;
}
.select2-container--default .select2-selection--single {
	border: 1px solid #ccc;
	border-radius: 0;
	height: auto;
	padding: 10px 12px;
	background: #fff;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
	line-height: normal;
	padding: 0;
	font-size: 13.5px;
	font-family: inherit;
	color: inherit;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
	height: auto;
	top: 50%;
	right: 14px;
	transform: translateY(-50%);
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
	border: 0;
	width: 12px;
	height: 8px;
	margin: 0;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23111' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
}
.select2-container--open .select2-selection--single { border-color: #111; }
.select2-dropdown { border: 1px solid #111; border-radius: 0; }
.select2-search--dropdown .select2-search__field { border: 1px solid #ccc; padding: 8px 10px; font-size: 13px; font-family: inherit; }
.select2-results__option--highlighted[aria-selected] { background: #111 !important; color: #fff !important; }
.field textarea { min-height: 90px; resize: vertical; }
.field .optional { text-transform: none; font-weight: 400; color: #999; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.btn-sm { padding: 8px 14px; font-size: 11px; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ---------------- Login / Register (WooCommerce's own default markup)
   ----------------
   WC only wraps these in <div class="u-columns col2-set"> (side-by-side
   login+register) when Settings → Accounts & Privacy → "Allow customers
   to create an account on the My Account page" is enabled — otherwise
   the login form renders bare, with no wrapper at all. Rather than
   depend on that wrapper for sizing/centering (and rather than assume
   that setting is on), the width/centering below is set directly on
   .woocommerce-form-login/.woocommerce-form-register themselves, so
   this looks correct — a narrow, centered, boxed form matching
   docs/mockups-account.html's .auth-box — either way.

   IMPORTANT: .u-columns.col2-set is NOT unique to login/register — the
   Address Book overview page (myaccount/my-address.php) reuses the
   exact same two classes on its own wrapper
   (class="u-columns woocommerce-Addresses col2-set addresses").
   A previous version of this rule targeted plain
   .woocommerce-account .u-columns.col2-set, which — confirmed live via
   DevTools — was ALSO matching (and, being 3 classes vs. the address
   book's own 2-class rule, WINNING over) the address book's container,
   injecting this rule's max-width/gap/padding into a completely
   different page and breaking its layout. Scoped to WooCommerce's real,
   distinct #customer_login ID (confirmed against WooCommerce's own
   GitHub source: <div class="u-columns col2-set" id="customer_login">,
   present only on the login/register template), with a :not() exclusion
   as a fallback in case that ID is ever absent. */
.woocommerce-account #customer_login.u-columns.col2-set,
.woocommerce-account .u-columns.col2-set:not(.woocommerce-Addresses) {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 40px;
	max-width: 780px;
	margin: 50px auto;
	padding: 0 24px;
}
.woocommerce-form-login,
.woocommerce-form-register {
	max-width: 420px;
	margin: 60px auto;
	border: 1px solid var(--ink, #111);
	padding: 36px;
}
.woocommerce-account #customer_login.u-columns.col2-set .woocommerce-form-login,
.woocommerce-account #customer_login.u-columns.col2-set .woocommerce-form-register,
.woocommerce-account .u-columns.col2-set:not(.woocommerce-Addresses) .woocommerce-form-login,
.woocommerce-account .u-columns.col2-set:not(.woocommerce-Addresses) .woocommerce-form-register {
	/* Inside the side-by-side layout, the column itself already
	   handles width/centering — don't compound it. */
	max-width: none;
	margin: 0;
}
.woocommerce-form-login h2,
.woocommerce-form-register h2 {
	font-size: 18px;
	text-transform: uppercase;
	letter-spacing: .03em;
	text-align: center;
	margin: 0 0 20px;
}
.woocommerce-form-login label,
.woocommerce-form-register label {
	display: block;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .03em;
	font-weight: 700;
	margin-bottom: 6px;
	color: #444;
}
.woocommerce-form-login input,
.woocommerce-form-register input {
	width: 100%;
	border: 1px solid #ccc;
	padding: 10px 12px;
	font-size: 13.5px;
	font-family: inherit;
}
.woocommerce-form-login .form-row,
.woocommerce-form-register .form-row { margin: 0 0 16px; }
.woocommerce-form-login__rememberme { font-size: 12.5px; display: flex; align-items: center; gap: 6px; margin-bottom: 16px; }
.woocommerce-form-login__rememberme input { width: auto; }
.woocommerce-LostPassword { text-align: right; font-size: 11.5px; margin: -10px 0 20px; }
.woocommerce-LostPassword a { text-decoration: underline; color: #666; }
.woocommerce-form-login__submit,
.woocommerce-form-register__submit,
.woocommerce-Button.button {
	display: block;
	width: 100%;
	text-align: center;
	background: #111;
	color: #fff;
	border: 1px solid #111;
	padding: 12px 20px;
	font-size: 12.5px;
	text-transform: uppercase;
	letter-spacing: .03em;
	font-weight: 700;
	cursor: pointer;
}
.woocommerce-form-login__submit:hover,
.woocommerce-form-register__submit:hover,
.woocommerce-Button.button:hover { background: #fff; color: #111; }

@media (max-width: 800px) {
	.woocommerce-account #customer_login.u-columns.col2-set,
	.woocommerce-account .u-columns.col2-set:not(.woocommerce-Addresses) {
		grid-template-columns: 1fr;
	}
}

/* ---------------- Dashboard layout ---------------- */
.dash-layout { display: grid; grid-template-columns: 220px 1fr; gap: 36px; padding: 30px 0 60px; align-items: start; }
.dash-sidebar { border: 1px solid var(--line, #ddd); }
.dash-user-box { padding: 16px; border-bottom: 2px solid #111; }
.dash-user-box .name { font-weight: 700; font-size: 13.5px; }
.dash-user-box .name .prefix { font-weight: 400; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: #888; display: block; margin-bottom: 3px; }
.dash-user-box .company { font-size: 12px; color: #888; }
.dash-nav-link {
	display: block;
	width: 100%;
	text-align: left;
	padding: 13px 16px;
	font-size: 12.5px;
	text-transform: uppercase;
	letter-spacing: .03em;
	font-weight: 600;
	border-bottom: 1px solid var(--line, #ddd);
	color: var(--ink, #111);
}
.dash-sidebar .dash-nav-link:last-child { border-bottom: 0; }
.dash-nav-link:hover { background: var(--bg-soft, #f7f7f7); }
.dash-nav-link.active { background: #111; color: #fff; }

.woocommerce-MyAccount-content h2 {
	font-size: 19px;
	text-transform: uppercase;
	border-bottom: 2px solid #111;
	padding-bottom: 12px;
	margin-bottom: 22px;
}

.verify-banner {
	border: 2px solid #111;
	background: var(--bg-soft, #f7f7f7);
	padding: 14px 18px;
	font-size: 13px;
	margin-bottom: 24px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}
.verify-banner strong { display: block; margin-bottom: 2px; }
.verify-banner button { background: none; border: 0; text-decoration: underline; font-size: 12px; font-weight: 700; white-space: nowrap; cursor: pointer; }

/* ---------------- Order History ---------------- */
.order-table { width: 100%; border-collapse: collapse; }
.order-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: #888; border-bottom: 2px solid #111; padding: 0 0 10px; }
.order-table td { border-bottom: 1px solid #eee; padding: 14px 10px 14px 0; font-size: 13px; vertical-align: middle; }
.order-table tr.clickable { cursor: pointer; }
.order-table tr.clickable:hover { background: var(--bg-soft, #f7f7f7); }
.order-number-link { font-weight: 700; text-decoration: underline; }
.view-details-link { font-size: 11.5px; text-decoration: underline; color: #666; }
.status-badge { display: inline-block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; font-weight: 700; padding: 3px 9px; border: 1px solid #111; white-space: nowrap; }
.status-badge.filled { background: #111; color: #fff; }

/* Order Tracking — order-table row link + view-order.php detail section.
 * See includes/class-order-tracking.php. */
.tracking-link { display: block; margin-top: 6px; font-size: 11px; text-decoration: underline; color: #666; }
.tracking-link:hover { color: #111; }
.tracking-section p { margin: 0 0 4px; font-size: 13px; }
.tracking-status { color: #444; }
.tracking-status .description { color: #999; font-size: 11.5px; }

/* ---------------- Pagination (shared naming with the Shop page) ---------------- */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 36px; flex-wrap: wrap; }
.pagination a, .pagination span { border: 1px solid #ddd; padding: 8px 13px; font-size: 13px; min-width: 36px; text-align: center; }
.pagination .current { background: #111; color: #fff; border-color: #111; font-weight: 700; }
.pagination .arrow { font-weight: 700; }

/* ---------------- Order Detail ---------------- */
.back-link { display: inline-block; margin-bottom: 16px; font-size: 12.5px; text-decoration: underline; color: #666; }
.order-detail-header { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
.order-detail-header h2 { border: 0; padding: 0; margin: 0; }
.order-detail-meta { font-size: 12.5px; color: #666; margin-bottom: 20px; }
.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; }
.detail-section { border: 1px solid var(--line, #ddd); padding: 18px; margin-bottom: 16px; }
.detail-section h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: #888; margin: 0 0 10px; }
.detail-line-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f2f2f2; font-size: 12.5px; }
.detail-line-item:last-child { border-bottom: 0; }
.detail-line-item .thumb { width: 44px; height: 44px; background: #f2f2f2; border: 1px solid #ddd; flex-shrink: 0; overflow: hidden; }
.detail-line-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.detail-line-item .info h5 { font-size: 12.5px; margin: 0 0 2px; }
.detail-line-item .info .meta { font-size: 11px; color: #888; }
.detail-line-item .line-price { margin-left: auto; font-weight: 700; white-space: nowrap; }
.shipping-address { font-size: 13px; line-height: 1.6; }
.detail-summary-row { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; }
.detail-summary-row.total { border-top: 2px solid #111; margin-top: 8px; padding-top: 10px; font-weight: 800; }

/* ---------------- Saved Carts ---------------- */
.saved-cart-row { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line, #ddd); padding: 16px 18px; margin-bottom: 12px; }
.saved-cart-row .name { font-weight: 700; font-size: 13.5px; margin-bottom: 3px; }
.saved-cart-row .meta { font-size: 12px; color: #888; }
.saved-cart-actions { display: flex; gap: 8px; }

/* ---------------- Wholesale Account ---------------- */
.wholesale-state-box { border: 1px solid var(--ink, #111); padding: 28px; text-align: center; }
.wholesale-state-box h3 { text-transform: uppercase; font-size: 15px; margin: 0 0 10px; }
.wholesale-state-box p { color: #666; font-size: 13.5px; max-width: 440px; margin: 0 auto 18px; }
.wholesale-perks { text-align: left; max-width: 380px; margin: 0 auto 22px; font-size: 13px; list-style: none; padding: 0; }
.wholesale-perks li { margin-bottom: 6px; padding-left: 1.4em; position: relative; }
.wholesale-perks li::before { content: "\2713"; position: absolute; left: 0; }
.wholesale-form { text-align: left; max-width: 420px; margin: 0 auto; }

/* ---------------- WooCommerce's native Company Info (billing address)
   and Account Settings forms — styled via their own core classes,
   template logic untouched. ---------------- */
.woocommerce-address-fields__field-wrapper,
.woocommerce-EditAccountForm { max-width: 640px; }
.woocommerce-address-fields__field-wrapper > .form-row,
.woocommerce-EditAccountForm > .form-row { margin-bottom: 0; }
.woocommerce-address-fields__field-wrapper .form-row-first,
.woocommerce-address-fields__field-wrapper .form-row-last,
.woocommerce-EditAccountForm .form-row-first,
.woocommerce-EditAccountForm .form-row-last {
	display: inline-block;
	width: 48%;
}
.woocommerce-address-fields__field-wrapper .form-row-last,
.woocommerce-EditAccountForm .form-row-last { float: right; }
.woocommerce-EditAccountForm fieldset { border: 1px solid var(--line, #ddd); padding: 16px; margin: 20px 0; }
.woocommerce-EditAccountForm legend { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; font-weight: 700; padding: 0 6px; }
.woocommerce-address-fields p:last-child,
.woocommerce-EditAccountForm p:last-child { margin-top: 20px; }

/* Submit buttons — targeted by [type="submit"] rather than an exact
   class name. WooCommerce's own edit-address/edit-account submit
   button class list has genuinely varied across versions (confirmed by
   checking multiple WC core source snapshots while investigating this),
   so matching on the one thing that's actually stable — it's the
   form's only submit button — is more robust than chasing an exact
   class string a second time. */
.woocommerce-address-fields button[type="submit"],
.woocommerce-EditAccountForm button[type="submit"] {
	display: inline-block;
	background: #111;
	color: #fff;
	border: 1px solid #111;
	padding: 12px 20px;
	font-size: 12.5px;
	text-transform: uppercase;
	letter-spacing: .03em;
	font-weight: 700;
	cursor: pointer;
}
.woocommerce-address-fields button[type="submit"]:hover,
.woocommerce-EditAccountForm button[type="submit"]:hover { background: #fff; color: #111; }

/* Field hint/description text (e.g. Account Settings' "This will be how
   your name will be displayed..." under Display name). NOT
   <p class="description"> as WC's general documentation/older versions
   suggest — confirmed via live DevTools inspection that this specific
   WC version (11.0.1) uses an accessibility-pattern span instead:
   <span id="account_display_name_description"><em>...</em></span>,
   linked to its input via aria-describedby. Matched on the [id$="_description"]
   suffix rather than a hardcoded field name, since any other field
   using the same WC pattern would get an ID built the same way.
   Matches .b2b-matrix-note (single-product.css) exactly, per the
   project's established tip-text convention — including overriding the
   browser's default italic <em> styling, which was fighting that. */
.woocommerce-EditAccountForm span[id$="_description"],
.woocommerce-address-fields span[id$="_description"] {
	display: block;
	font-size: 11px;
	color: #999;
	margin-top: 8px;
	margin-bottom: 16px;
	font-style: normal;
}
.woocommerce-EditAccountForm span[id$="_description"] em,
.woocommerce-address-fields span[id$="_description"] em {
	font-style: normal;
}

/* ---------------- WooCommerce's native Address Book overview
   (myaccount/my-address.php — shown after successfully saving Company
   Info, since WC redirects back to this overview rather than the edit
   form). Previously entirely unstyled, causing Billing/Shipping to
   float without any grouping or alignment. ---------------- */
.woocommerce-Addresses.col2-set {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
	margin-top: 8px;
}
.woocommerce-Address {
	border: 1px solid var(--line, #ddd);
	padding: 18px;
}
/* WooCommerce's own bundled default CSS (still loaded — never
   dequeued) sets width:48%/float:left directly on these same boxes via
   a 3-class selector (.woocommerce .col2-set .col-1, confirmed live via
   DevTools). float is a no-op on a grid item, but width isn't — so
   explicitly reset both here with higher specificity (5 classes total,
   ancestor + child) rather than leave it to chance.
   Also forcing explicit grid-column/grid-row/justify-self/order on each
   box specifically (rather than relying on default auto-placement) —
   confirmed live via DevTools that even after the float/width reset
   above took effect, the two boxes were still rendering in swapped
   left/right positions, on two different rows, and narrower than their
   grid track, despite the container correctly computing display:grid.
   Rather than keep chasing whichever WC rule indirectly causes that,
   this makes placement and sizing explicit and immune to it. */
.woocommerce-Addresses.col2-set.addresses .woocommerce-Address {
	float: none;
	width: auto;
	justify-self: stretch;
	order: 0;
}
.woocommerce-Addresses.col2-set.addresses .u-column1.woocommerce-Address {
	grid-column: 1;
	grid-row: 1;
}
.woocommerce-Addresses.col2-set.addresses .u-column2.woocommerce-Address {
	grid-column: 2;
	grid-row: 1;
}
.woocommerce-Address-title {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 10px;
	margin: 0 0 10px;
	border-bottom: 1px solid var(--line, #ddd);
	padding-bottom: 8px;
}
.woocommerce-Addresses .woocommerce-Address-title h2 {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .03em;
	color: #888;
	margin: 0;
	border: 0;
	padding: 0;
}
.woocommerce-Address-title .edit {
	font-size: 11.5px;
	text-decoration: underline;
	color: #666;
	white-space: nowrap;
}
.woocommerce-Address address {
	font-style: normal;
	font-size: 13px;
	line-height: 1.6;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
	.dash-layout { grid-template-columns: 1fr; }
	.detail-grid { grid-template-columns: 1fr; }
	.field-row { grid-template-columns: 1fr; }
	.woocommerce-Addresses.col2-set { grid-template-columns: 1fr; }
	.woocommerce-Addresses.col2-set.addresses .u-column2.woocommerce-Address { grid-column: 1; grid-row: 2; }
	.woocommerce-address-fields__field-wrapper .form-row-first,
	.woocommerce-address-fields__field-wrapper .form-row-last,
	.woocommerce-EditAccountForm .form-row-first,
	.woocommerce-EditAccountForm .form-row-last {
		width: 100%;
		float: none;
	}
}
