/* ==========================================================================
   AIC – My Account (WooCommerce)

   The theme drops WooCommerce's 'woocommerce-layout' + 'woocommerce-smallscreen'
   stylesheets (see aic_woocommerce_styles() in functions.php), so the entire
   My Account experience — nav tabs, content card, tables, forms and the
   responsive table stacking — is themed from scratch here. Only buttons, form
   fields and notices inherit from the kept 'woocommerce-general' sheet.
   ========================================================================== */

.woocommerce-account .aic-wc { padding-top: 34px; }
.woocommerce-account .woocommerce { color: var(--aic-ink); margin-top: 60px; }
.woocommerce-account .woocommerce a:not(.button) { color: var(--aic-green-d); }

/* --------------------------------------------------------------------------
   LAYOUT — sidebar tabs (left) + content card (right).
   Grid engages only when the account navigation is present (i.e. logged in);
   the logged-out login/register view keeps its own centered layout further down.
   -------------------------------------------------------------------------- */
.woocommerce-account .woocommerce:has(.woocommerce-MyAccount-navigation) {
	display: flex;
	flex-wrap: wrap;
	gap: 28px;
	align-items: flex-start;
}
/* Flex keeps source order, so the layout is deterministic even though
   WooCommerce prints an empty .woocommerce-notices-wrapper first. */
.woocommerce-account .woocommerce > .woocommerce-notices-wrapper { flex: 0 0 100%; }
.woocommerce-account .woocommerce > .woocommerce-notices-wrapper:empty { display: none; }
.woocommerce-account .woocommerce-MyAccount-navigation { flex: 0 0 250px; }
.woocommerce-account .woocommerce-MyAccount-content { flex: 1 1 0; }

/* --------------------------------------------------------------------------
   NAVIGATION (tabs)
   -------------------------------------------------------------------------- */
.woocommerce-MyAccount-navigation {
	background: #fff;
	border: 1px solid var(--aic-line);
	border-radius: var(--aic-radius);
	box-shadow: var(--aic-shadow);
	padding: 10px;
	position: sticky;
	top: 20px;
}
.woocommerce-MyAccount-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.woocommerce-MyAccount-navigation-link a {
	display: block;
	padding: 12px 16px;
	border-radius: 12px;
	color: var(--aic-ink);
	font-weight: 600;
	font-size: 14.5px;
	line-height: 1.3;
	text-decoration: none;
	transition: background .15s ease, color .15s ease;
}
.woocommerce-MyAccount-navigation-link a:hover {
	background: var(--aic-mint);
	color: var(--aic-green-d);
}
.woocommerce-MyAccount-navigation-link.is-active a {
	background: var(--aic-green);
	color: #fff;
}
.woocommerce-MyAccount-navigation-link--customer-logout a { color: var(--aic-rose-d); }
.woocommerce-MyAccount-navigation-link--customer-logout a:hover {
	background: var(--aic-pink-t);
	color: var(--aic-rose-d);
}

/* --------------------------------------------------------------------------
   CONTENT CARD
   -------------------------------------------------------------------------- */
.woocommerce-MyAccount-content {
	background: #fff;
	border: 1px solid var(--aic-line);
	border-radius: var(--aic-radius);
	box-shadow: var(--aic-shadow);
	padding: 30px 32px;
	min-width: 0; /* allow wide tables to shrink instead of overflowing the grid */
}
.woocommerce-MyAccount-content > p { color: var(--aic-muted); line-height: 1.7; }
.woocommerce-MyAccount-content h2,
.woocommerce-MyAccount-content h3 {
	margin: 0 0 18px;
	font-size: 20px;
	font-weight: 700;
	color: var(--aic-ink);
}
.woocommerce-MyAccount-content > h2:not(:first-child),
.woocommerce-MyAccount-content > h3:not(:first-child) { margin-top: 28px; }
.woocommerce-MyAccount-content mark {
	background: var(--aic-mint);
	color: var(--aic-ink);
	padding: 0 5px;
	border-radius: 4px;
}

/* --------------------------------------------------------------------------
   TABLES (orders, downloads, order details, customer details)
   -------------------------------------------------------------------------- */
.woocommerce-account table.shop_table {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid var(--aic-line);
	border-radius: 14px;
	overflow: hidden;
	margin: 0 0 24px;
	font-size: 14px;
}
.woocommerce-account table.shop_table thead th {
	background: var(--aic-mint);
	color: var(--aic-green-d);
	text-align: left;
	font-weight: 700;
	padding: 14px 16px;
	white-space: nowrap;
}
.woocommerce-account table.shop_table tbody td,
.woocommerce-account table.shop_table tbody th,
.woocommerce-account table.shop_table tfoot td,
.woocommerce-account table.shop_table tfoot th {
	padding: 14px 16px;
	border-top: 1px solid var(--aic-line);
	vertical-align: middle;
	color: var(--aic-ink);
	text-align: left;
}
.woocommerce-account table.shop_table tbody tr:hover td { background: #fafbfa; }
.woocommerce-account table.shop_table tfoot th { font-weight: 700; }
.woocommerce-account table.shop_table td.woocommerce-orders-table__cell-order-actions { text-align: right; }
.woocommerce-account table.shop_table .button { margin: 0 0 0 6px; }

/* --------------------------------------------------------------------------
   ADDRESSES
   -------------------------------------------------------------------------- */
.woocommerce-account .woocommerce-Addresses.u-columns {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
	margin: 0;
}
.woocommerce-account .woocommerce-Address {
	border: 1px solid var(--aic-line);
	border-radius: 14px;
	padding: 22px 24px;
	background: #fff;
}
.woocommerce-account .woocommerce-Address-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}
.woocommerce-account .woocommerce-Address-title h3 { margin: 0; }
.woocommerce-account .woocommerce-Address-title .edit {
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
}
.woocommerce-account address {
	font-style: normal;
	color: var(--aic-muted);
	line-height: 1.8;
	margin: 0;
}

/* --------------------------------------------------------------------------
   FORMS (edit account, addresses, login, register, lost password)
   -------------------------------------------------------------------------- */
.woocommerce-account form .form-row,
.woocommerce-account form .woocommerce-form-row { margin: 0 0 18px; }

.woocommerce-account form label,
.woocommerce-account .woocommerce-form-row label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	font-size: 13.5px;
	color: var(--aic-ink);
}
.woocommerce-account form .required {
	color: var(--aic-rose-d);
	border: 0;
	text-decoration: none;
}
.woocommerce-account form .woocommerce-form-login__rememberme,
.woocommerce-account form label.checkbox {
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 8px;
}
.woocommerce-account form .woocommerce-form-login__rememberme input,
.woocommerce-account form label.checkbox input { width: auto; margin: 0; }

.woocommerce-account input.input-text,
.woocommerce-account input[type="text"],
.woocommerce-account input[type="email"],
.woocommerce-account input[type="tel"],
.woocommerce-account input[type="password"],
.woocommerce-account textarea,
.woocommerce-account select,
.woocommerce-account .select2-container .select2-selection--single {
	width: 100%;
	border: 1px solid #dcdfdc;
	border-radius: 10px;
	padding: 12px 14px;
	font: inherit;
	background: #fff;
	color: var(--aic-ink);
	box-sizing: border-box;
}
.woocommerce-account .select2-container .select2-selection--single {
	height: auto;
	display: flex;
	align-items: center;
}
.woocommerce-account input.input-text:focus,
.woocommerce-account textarea:focus,
.woocommerce-account select:focus {
	outline: none;
	border-color: var(--aic-green);
	box-shadow: 0 0 0 3px rgba(111, 174, 111, .18);
}
.woocommerce-account form .description,
.woocommerce-account form small { color: var(--aic-muted); font-size: 12.5px; }

.woocommerce-account fieldset {
	border: 1px solid var(--aic-line);
	border-radius: 14px;
	padding: 20px 22px;
	margin: 22px 0;
}
.woocommerce-account fieldset legend {
	font-weight: 700;
	padding: 0 8px;
	color: var(--aic-ink);
}

/* Two-column field rows on wider screens (first/last name, etc.).
   Grid the field container so first/last land side-by-side and *_wide rows,
   fieldsets and the submit row span the full width — no floats to clear. */
@media (min-width: 600px) {
	.woocommerce-account .woocommerce-address-fields__field-wrapper,
	.woocommerce-account form.woocommerce-EditAccountForm {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 0 18px;
		align-items: start;
	}
	.woocommerce-account .woocommerce-address-fields__field-wrapper .form-row-wide,
	.woocommerce-account form.woocommerce-EditAccountForm > .form-row-wide,
	.woocommerce-account form.woocommerce-EditAccountForm > fieldset,
	.woocommerce-account form.woocommerce-EditAccountForm > p:last-child {
		grid-column: 1 / -1;
	}
}

/* --------------------------------------------------------------------------
   BUTTONS
   -------------------------------------------------------------------------- */
.woocommerce-account .woocommerce .button,
.woocommerce-account .woocommerce button[type="submit"],
.woocommerce-account .woocommerce input[type="submit"] {
	background: var(--aic-green);
	color: #fff;
	border: 0;
	border-radius: 999px;
	padding: 12px 26px;
	font-weight: 600;
	font-size: 14px;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	display: inline-block;
	transition: background .15s ease, transform .15s ease;
}
.woocommerce-account .woocommerce .button:hover,
.woocommerce-account .woocommerce button[type="submit"]:hover,
.woocommerce-account .woocommerce input[type="submit"]:hover {
	background: var(--aic-green-d);
	transform: translateY(-1px);
}
/* Lighter secondary buttons inside tables (View / Pay / Cancel etc.) */
.woocommerce-account table.shop_table .button {
	background: var(--aic-mint);
	color: var(--aic-green-d);
	padding: 8px 16px;
	font-size: 13px;
}
.woocommerce-account table.shop_table .button:hover {
	background: var(--aic-green);
	color: #fff;
}
.woocommerce-account .woocommerce-LostPassword { margin-top: 10px; font-size: 13.5px; }

/* --------------------------------------------------------------------------
   LOGGED-OUT: login + register
   -------------------------------------------------------------------------- */
.woocommerce-account #customer_login.u-columns {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 28px;
	max-width: 900px;
	margin: 0 auto;
}
.woocommerce-account #customer_login .u-column1,
.woocommerce-account #customer_login .u-column2 {
	float: none;
	width: auto;
	background: #fff;
	border: 1px solid var(--aic-line);
	border-radius: var(--aic-radius);
	box-shadow: var(--aic-shadow);
	padding: 30px 32px;
}
.woocommerce-account #customer_login h2 { margin: 0 0 20px; font-size: 22px; }
/* Standalone login form (registration disabled → no col2-set wrapper) */
.woocommerce-account .woocommerce > form.woocommerce-form-login {
	max-width: 460px;
	margin: 0 auto;
	background: #fff;
	border: 1px solid var(--aic-line);
	border-radius: var(--aic-radius);
	box-shadow: var(--aic-shadow);
	padding: 30px 32px;
}

/* --------------------------------------------------------------------------
   NOTICES
   -------------------------------------------------------------------------- */
.woocommerce-account .woocommerce-message,
.woocommerce-account .woocommerce-error,
.woocommerce-account .woocommerce-info {
	border-radius: 10px;
	margin-bottom: 22px;
}

/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
	.woocommerce-account .woocommerce:has(.woocommerce-MyAccount-navigation) { gap: 20px; }
	.woocommerce-account .woocommerce-MyAccount-navigation,
	.woocommerce-account .woocommerce-MyAccount-content { flex: 0 0 100%; }
	.woocommerce-MyAccount-navigation { position: static; top: auto; }
	.woocommerce-MyAccount-navigation ul { flex-direction: row; flex-wrap: wrap; gap: 6px; }
	.woocommerce-MyAccount-navigation-link a { padding: 9px 15px; font-size: 14px; }
	.woocommerce-MyAccount-content { padding: 24px 20px; }
	.woocommerce-account .woocommerce-Addresses.u-columns,
	.woocommerce-account #customer_login.u-columns { grid-template-columns: 1fr; }
}

/* Stack tables into label/value rows on small screens (replaces the removed
   'woocommerce-smallscreen' responsive behaviour; relies on WooCommerce's
   data-title attributes that shop_table_responsive already outputs). */
@media (max-width: 640px) {
	.woocommerce-account table.shop_table_responsive thead { display: none; }
	.woocommerce-account table.shop_table_responsive,
	.woocommerce-account table.shop_table_responsive tbody { display: block; }
	.woocommerce-account table.shop_table_responsive tbody tr {
		display: block;
		margin-bottom: 16px;
		border: 1px solid var(--aic-line);
		border-radius: 12px;
		overflow: hidden;
	}
	.woocommerce-account table.shop_table_responsive tbody td {
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 16px;
		text-align: right;
		border: 0;
		border-bottom: 1px solid var(--aic-line);
		padding: 12px 14px;
	}
	.woocommerce-account table.shop_table_responsive tbody tr td:last-child { border-bottom: 0; }
	.woocommerce-account table.shop_table_responsive tbody td::before {
		content: attr(data-title);
		font-weight: 700;
		color: var(--aic-muted);
		text-align: left;
	}
	.woocommerce-account table.shop_table_responsive td.woocommerce-orders-table__cell-order-actions { justify-content: flex-end; }
	.woocommerce-account table.shop_table_responsive td.woocommerce-orders-table__cell-order-actions::before { content: ""; }
}
