/**
 * WooCommerce account pages (order detail, address, account details, payment
 * methods) restyled into the TRI dark/gold design.
 *
 * Every rule is scoped under `.tri-sp-account--wc` — the wrapper
 * WooCommerceAccountIntegration adds — so no WooCommerce markup anywhere else
 * on the site (checkout, cart, product pages) is affected. Only presentation
 * is changed; no WooCommerce element is hidden that carries information or an
 * action, and all colours/radii/fonts come from the shared shell's existing
 * design tokens.
 */

/* --- WooCommerce's own account sub-navigation ---

   WooCommerce ships `.woocommerce-MyAccount-navigation { float:left; width:30% }`
   and `.woocommerce-MyAccount-content { float:right; width:68% }`, which inside
   the TRI shell's already-narrow main column left the nav squeezed into a
   cramped gutter beside the order table. Both floats are unwound here so the
   nav becomes a full-width pill row above full-width content. */

.tri-sp-account--wc .woocommerce-MyAccount-navigation {
	float: none;
	width: 100%;
	margin: 0 0 24px;
	padding: 0 0 20px;
	border-bottom: 1px solid var(--tri-sp-border);
}

.tri-sp-account--wc .woocommerce-MyAccount-content {
	float: none;
	width: 100%;
	margin: 0;
}

/* WooCommerce's markup has no clearing element between the two floats. */
.tri-sp-account--wc .woocommerce::after,
.tri-sp-account--wc .woocommerce-MyAccount-content::after {
	content: "";
	display: table;
	clear: both;
}

.tri-sp-account--wc .woocommerce-MyAccount-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.tri-sp-account--wc .woocommerce-MyAccount-navigation li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tri-sp-account--wc .woocommerce-MyAccount-navigation li a {
	display: inline-block;
	padding: 7px 14px;
	border: 1px solid var(--tri-sp-border);
	border-radius: 999px;
	font-size: 13px;
	color: var(--tri-sp-text-muted);
	text-decoration: none;
	transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.tri-sp-account--wc .woocommerce-MyAccount-navigation li a:hover {
	border-color: var(--tri-sp-border-hover);
	background: rgba(255, 255, 255, 0.04);
	color: var(--tri-sp-text);
	text-decoration: none;
}

.tri-sp-account--wc .woocommerce-MyAccount-navigation li.is-active a {
	background: var(--tri-sp-gold);
	border-color: var(--tri-sp-gold);
	color: #1a1206;
	font-weight: 600;
}

/* --- Headings and body copy --- */

.tri-sp-account--wc .woocommerce-MyAccount-content h2,
.tri-sp-account--wc .woocommerce-column__title,
.tri-sp-account--wc .woocommerce-order-details__title,
.tri-sp-account--wc .woocommerce-Address-title h3 {
	font-family: var(--tri-sp-font-heading);
	font-size: 20px;
	font-weight: 400;
	color: var(--tri-sp-text);
	margin: 0 0 16px;
}

.tri-sp-account--wc .woocommerce-MyAccount-content p,
.tri-sp-account--wc address {
	color: var(--tri-sp-text-muted);
	font-size: 14px;
	line-height: 1.7;
	font-style: normal;
}

.tri-sp-account--wc .woocommerce-MyAccount-content mark,
.tri-sp-account--wc .woocommerce-order-overview mark {
	background: transparent;
	color: var(--tri-sp-gold-strong);
	font-weight: 600;
}

/* --- Order/address tables --- */

.tri-sp-account--wc table {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 24px;
	font-size: 14px;
	background: transparent;
}

.tri-sp-account--wc table th,
.tri-sp-account--wc table td {
	padding: 12px 14px;
	text-align: left;
	border: none;
	border-bottom: 1px solid var(--tri-sp-border);
	background: transparent;
	color: var(--tri-sp-text);
	vertical-align: top;
}

.tri-sp-account--wc table thead th {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--tri-sp-text-muted);
	font-weight: 600;
}

.tri-sp-account--wc table tfoot th,
.tri-sp-account--wc table tfoot td {
	color: var(--tri-sp-text);
	font-weight: 600;
}

.tri-sp-account--wc table tfoot tr:last-child th,
.tri-sp-account--wc table tfoot tr:last-child td {
	color: var(--tri-sp-gold-strong);
	font-size: 16px;
	border-bottom: none;
}

.tri-sp-account--wc table a {
	color: var(--tri-sp-gold-strong);
	text-decoration: none;
}

.tri-sp-account--wc table a:hover {
	text-decoration: underline;
}

/* Two-column billing/shipping blocks WooCommerce renders after an order. */
.tri-sp-account--wc .woocommerce-columns,
.tri-sp-account--wc .col2-set {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 24px;
	width: 100%;
}

.tri-sp-account--wc .woocommerce-column,
.tri-sp-account--wc .col-1,
.tri-sp-account--wc .col-2 {
	width: auto;
	float: none;
	min-width: 0;
}

/* --- Forms (address editor, account details) --- */

.tri-sp-account--wc .woocommerce-input-wrapper {
	width: 100%;
}

.tri-sp-account--wc label {
	display: block;
	font-size: 12px;
	color: var(--tri-sp-text-muted);
	margin-bottom: 6px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.tri-sp-account--wc .form-row {
	margin: 0 0 16px;
	padding: 0;
}

.tri-sp-account--wc input[type="text"],
.tri-sp-account--wc input[type="email"],
.tri-sp-account--wc input[type="tel"],
.tri-sp-account--wc input[type="password"],
.tri-sp-account--wc select,
.tri-sp-account--wc textarea,
.tri-sp-account--wc .select2-container .select2-selection--single {
	width: 100%;
	background: var(--tri-sp-bg);
	border: 1px solid var(--tri-sp-border);
	border-radius: 4px;
	color: var(--tri-sp-text);
	padding: 10px 12px;
	font-family: var(--tri-sp-font-body);
	font-size: 14px;
	line-height: normal;
	height: auto;
}

/* Chunk 6.6's Elementor Global Kit collision applies here too, and the first
   attempt at fixing it was not enough. Elementor's
   `.elementor-kit-47604 input:not([type="button"]):not([type="submit"])`
   scores (0,3,1) — each :not() argument counts — so a three-class TRI selector
   ties it and loses on source order, which rendered every address field with a
   gold background (observed live; the <select> was unaffected, exactly as
   Chunk 6.6 recorded, because Elementor's selector never matches it).
   `.woocommerce-MyAccount-content` is a real class already in WooCommerce's
   own markup, taking these to (0,4,1) — a clean win, still no !important. */
.tri-sp-account--wc .tri-sp-wc .woocommerce-MyAccount-content input[type="text"],
.tri-sp-account--wc .tri-sp-wc .woocommerce-MyAccount-content input[type="email"],
.tri-sp-account--wc .tri-sp-wc .woocommerce-MyAccount-content input[type="tel"],
.tri-sp-account--wc .tri-sp-wc .woocommerce-MyAccount-content input[type="password"],
.tri-sp-account--wc .tri-sp-wc .woocommerce-MyAccount-content select,
.tri-sp-account--wc .tri-sp-wc .woocommerce-MyAccount-content textarea {
	background: var(--tri-sp-bg);
	border: 1px solid var(--tri-sp-border);
	color: var(--tri-sp-text);
	padding: 10px 12px;
	font-size: 14px;
	line-height: normal;
	height: auto;
	min-height: 0;
}

.tri-sp-account--wc input:focus,
.tri-sp-account--wc select:focus,
.tri-sp-account--wc textarea:focus {
	border-color: var(--tri-sp-gold);
	outline: none;
}

.tri-sp-account--wc .select2-container--default .select2-selection--single .select2-selection__rendered {
	color: var(--tri-sp-text);
	line-height: normal;
	padding: 0;
}

.tri-sp-account--wc .woocommerce-form__label-for-checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	text-transform: none;
	letter-spacing: 0;
	font-size: 13px;
}

.tri-sp-account--wc .woocommerce-form__label-for-checkbox input {
	width: auto;
}

.tri-sp-account--wc em,
.tri-sp-account--wc .woocommerce-Input--password + em,
.tri-sp-account--wc fieldset legend {
	color: var(--tri-sp-text-muted);
	font-size: 12px;
}

.tri-sp-account--wc fieldset {
	border: 1px solid var(--tri-sp-border);
	border-radius: var(--tri-sp-card-radius-sm);
	padding: 20px;
	margin: 24px 0;
}

/* --- Buttons --- */

.tri-sp-account--wc .button,
.tri-sp-account--wc button[type="submit"],
.tri-sp-account--wc input[type="submit"],
.tri-sp-account--wc .woocommerce-Button {
	display: inline-block;
	background: var(--tri-sp-gold);
	border: 1px solid var(--tri-sp-gold);
	color: #1a1206;
	font-family: var(--tri-sp-font-body);
	font-weight: 600;
	font-size: 14px;
	padding: 12px 22px;
	border-radius: var(--tri-sp-button-radius);
	cursor: pointer;
	text-decoration: none;
	line-height: normal;
	width: auto;
}

.tri-sp-account--wc .button:hover,
.tri-sp-account--wc button[type="submit"]:hover,
.tri-sp-account--wc input[type="submit"]:hover,
.tri-sp-account--wc .woocommerce-Button:hover {
	background: var(--tri-sp-gold-strong);
	border-color: var(--tri-sp-gold-strong);
	color: #1a1206;
}

/* --- WooCommerce notices --- */

.tri-sp-account--wc .woocommerce-message,
.tri-sp-account--wc .woocommerce-info,
.tri-sp-account--wc .woocommerce-error {
	list-style: none;
	background: rgba(202, 150, 79, 0.12);
	border: 1px solid var(--tri-sp-border);
	border-left: 3px solid var(--tri-sp-gold);
	border-radius: var(--tri-sp-card-radius-sm);
	color: var(--tri-sp-text);
	padding: 14px 16px;
	margin: 0 0 20px;
	font-size: 14px;
}

.tri-sp-account--wc .woocommerce-error {
	background: rgba(190, 70, 60, 0.14);
	border-color: rgba(190, 70, 60, 0.5);
	border-left-color: rgba(190, 70, 60, 0.9);
	color: #f2d9d5;
}

.tri-sp-account--wc .woocommerce-message::before,
.tri-sp-account--wc .woocommerce-info::before,
.tri-sp-account--wc .woocommerce-error::before {
	display: none;
}

/* --- Order-again / downloads / pagination bits --- */

.tri-sp-account--wc .woocommerce-pagination ul {
	list-style: none;
	display: flex;
	gap: 6px;
	padding: 0;
	margin: 16px 0 0;
}

.tri-sp-account--wc .woocommerce-pagination a,
.tri-sp-account--wc .woocommerce-pagination span {
	display: inline-block;
	padding: 6px 12px;
	border: 1px solid var(--tri-sp-border);
	border-radius: 4px;
	color: var(--tri-sp-text-muted);
	text-decoration: none;
	font-size: 13px;
}

.tri-sp-account--wc .woocommerce-pagination .current {
	background: var(--tri-sp-gold);
	border-color: var(--tri-sp-gold);
	color: #1a1206;
}

/* --- Responsive --- */

@media (max-width: 768px) {
	.tri-sp-account--wc .woocommerce-MyAccount-navigation ul {
		gap: 6px;
	}

	.tri-sp-account--wc .woocommerce-MyAccount-navigation li a {
		padding: 6px 12px;
		font-size: 12px;
	}

	/* Order tables restack rather than scrolling sideways. */
	.tri-sp-account--wc .woocommerce-table--order-details,
	.tri-sp-account--wc .woocommerce-table--order-details tbody,
	.tri-sp-account--wc .woocommerce-table--order-details tfoot,
	.tri-sp-account--wc .woocommerce-table--order-details tr,
	.tri-sp-account--wc .woocommerce-table--order-details th,
	.tri-sp-account--wc .woocommerce-table--order-details td {
		display: block;
		width: 100%;
	}

	.tri-sp-account--wc .woocommerce-table--order-details thead {
		display: none;
	}

	.tri-sp-account--wc .woocommerce-table--order-details tbody tr {
		border: 1px solid var(--tri-sp-border);
		border-radius: var(--tri-sp-card-radius-sm);
		padding: 8px 12px;
		margin-bottom: 12px;
	}

	.tri-sp-account--wc .woocommerce-table--order-details th,
	.tri-sp-account--wc .woocommerce-table--order-details td {
		border-bottom: none;
		padding: 6px 0;
	}

	.tri-sp-account--wc .woocommerce-table--order-details tfoot tr {
		display: flex;
		justify-content: space-between;
		gap: 12px;
		border-bottom: 1px solid var(--tri-sp-border);
	}

	.tri-sp-account--wc .woocommerce-table--order-details tfoot th,
	.tri-sp-account--wc .woocommerce-table--order-details tfoot td {
		width: auto;
	}
}
