/* My Account, order tracking and legal pages (page-account.php, page-legal.php).
   Shared parts live in base.css, order details in order.css. WooCommerce and
   Flatsome style these forms and tables too, hence the longer selectors. */

.pma-account .pma-breadcrumb,
.pma-legal .pma-breadcrumb { justify-content: center; margin-bottom: 18px; }

.pma-account-body { max-width: 1110px; margin: 0 auto; padding: 32px 34px 52px; }

/* Cards */
.pma-account-card {
	margin: 0 0 16px; padding: 24px;
	background: var(--pma-bg); border: 1px solid var(--pma-line); border-radius: var(--pma-radius);
}
.pma-ui .pma-account-card h2 { margin: 0 0 14px; font-size: 18px; line-height: 1.3; letter-spacing: -.3px; text-transform: none; color: var(--pma-ink); }
.pma-account-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pma-ui .pma-account-card-head h2 { margin: 0; }
.pma-account-card-head .pma-link { white-space: nowrap; }
.pma-ui .pma-account-muted { margin: -8px 0 18px; font-size: 13px; color: var(--pma-muted); }
.pma-ui .pma-account-muted a { color: var(--pma-purple); }
.pma-account-back { margin: 4px 0 0; }

.pma-account-empty { text-align: center; padding-top: 34px; padding-bottom: 34px; }
.pma-ui .pma-account-empty p { margin: 0 0 16px; font-size: 14px; color: var(--pma-muted); }

/* Layout: navigation + content */
.pma-account-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }

.pma-account-nav {
	position: sticky; top: 24px; padding: 8px;
	background: var(--pma-soft); border: 1px solid var(--pma-line); border-radius: var(--pma-radius);
}
.pma-account-user { display: flex; align-items: center; gap: 11px; padding: 12px 12px 16px; margin-bottom: 6px; border-bottom: 1px solid var(--pma-line); font-size: 11px; color: var(--pma-muted); min-width: 0; }
.pma-account-user > span:last-child { min-width: 0; overflow-wrap: anywhere; line-height: 1.5; }
.pma-account-user strong { display: block; font-size: 13px; font-weight: 500; color: var(--pma-ink); }
.pma-account-user .pma-avatar {
	width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	background: var(--pma-purple); color: #fff; font-size: 12px; font-weight: 700;
}
.pma-account-nav ul { margin: 0; padding: 0; list-style: none; }
.pma-account-nav li { margin: 0; }
.pma-ui .pma-account-nav a {
	display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
	font-size: 13px; color: var(--pma-ink);
}
.pma-account-nav .pma-icon { font-size: 16px; color: var(--pma-muted); }
.pma-ui .pma-account-nav a:hover { background: var(--pma-bg); color: var(--pma-purple); }
.pma-ui .pma-account-nav a[aria-current] { background: var(--pma-bg); color: var(--pma-purple); font-weight: 500; box-shadow: 0 1px 3px #28233712; }
.pma-account-nav a:is(:hover, [aria-current]) .pma-icon { color: var(--pma-purple); }
.pma-account-nav .woocommerce-MyAccount-navigation-link--customer-logout { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--pma-line); }

/* Dashboard */
.pma-shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pma-ui .pma-shortcut {
	display: flex; align-items: flex-start; gap: 12px; padding: 14px;
	border: 1px solid var(--pma-line); border-radius: 10px;
	font-size: 12px; line-height: 1.5; color: var(--pma-muted);
	transition: border-color .15s;
}
.pma-ui .pma-shortcut:hover { border-color: var(--pma-purple); }
.pma-shortcut strong { display: block; margin-bottom: 2px; font-size: 13px; font-weight: 500; color: var(--pma-ink); }

.pma-order-list { margin: 0; padding: 0; list-style: none; }
.pma-order-list li { margin: 0; border-top: 1px solid var(--pma-line); }
.pma-ui .pma-order-list a { display: flex; align-items: center; gap: 14px; padding: 12px 0; font-size: 12px; color: var(--pma-muted); }
.pma-order-list-main { flex: 1; min-width: 0; }
.pma-order-list-main strong { margin-right: 10px; font-size: 13px; font-weight: 500; color: var(--pma-ink); }
.pma-order-list-total { min-width: 70px; text-align: right; font-size: 13px; font-weight: 500; color: var(--pma-ink); }
.pma-order-list-total .amount { color: inherit; }
.pma-ui .pma-order-list a:hover strong { color: var(--pma-purple); }

/* Status badge */
.pma-status {
	display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px;
	font-size: 11px; font-weight: 500; line-height: 1.6; white-space: nowrap;
}
.pma-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pma-status.is-done    { background: #e8f7ee; color: #1d8a4c; }
.pma-status.is-active  { background: #efe9fb; color: var(--pma-purple); }
.pma-status.is-waiting { background: #fff4e0; color: #b26b00; }
.pma-status.is-failed  { background: #f3f1f5; color: #7a7285; }

/* Orders table */
.pma-orders-card { padding: 8px 24px 16px; }
.pma-ui table.pma-orders-table { width: 100%; margin: 0; border: 0; border-collapse: collapse; }
.pma-ui .pma-orders-table :is(th, td) {
	padding: 14px 10px; border: 0; border-bottom: 1px solid var(--pma-line); background: none;
	font-size: 13px; line-height: 1.4; text-align: left; text-transform: none; letter-spacing: 0; vertical-align: middle; color: var(--pma-ink);
}
.pma-ui .pma-orders-table th { font-size: 11px; font-weight: 400; color: var(--pma-muted); }
.pma-ui .pma-orders-table :is(th, td):first-child { padding-left: 0; }
.pma-ui .pma-orders-table :is(th, td):last-child { padding-right: 0; text-align: right; }
.pma-ui .pma-orders-table tbody tr:last-child td { border-bottom: 0; }
.pma-ui .pma-orders-table .woocommerce-orders-table__cell-order-number a { color: var(--pma-purple); font-weight: 500; }
.pma-ui .pma-orders-table .woocommerce-orders-table__cell-order-date { color: var(--pma-muted); }
.pma-ui .pma-orders-table .woocommerce-orders-table__cell-order-total { color: var(--pma-muted); }
.pma-ui .pma-orders-table .amount { color: var(--pma-ink); font-weight: 500; }
.pma-ui .pma-orders-table .woocommerce-orders-table__cell-order-actions a { min-height: 34px; margin: 0 0 0 6px; padding: 7px 14px; font-size: 12px; }

.pma-pagination { display: flex; align-items: center; gap: 12px; padding-top: 16px; border-top: 1px solid var(--pma-line); }
.pma-pagination-info { flex: 1; text-align: center; font-size: 12px; color: var(--pma-muted); }
.pma-pagination .pma-secondary:first-child:last-child { margin-left: auto; }

/* One order: head, updates */
.pma-order-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.pma-ui .pma-order-head h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.5px; }
.pma-ui .pma-order-head .pma-account-muted { margin: 0; }
.pma-order-notes { margin: 0; padding: 0; list-style: none; }
.pma-order-notes li { position: relative; margin: 0; padding: 0 0 16px 22px; border-left: 2px solid var(--pma-line); margin-left: 5px; }
.pma-order-notes li:last-child { padding-bottom: 0; border-left-color: transparent; }
.pma-order-notes li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--pma-purple); box-shadow: 0 0 0 3px #efe9fb; }
.pma-order-notes time { display: block; margin-bottom: 4px; font-size: 11px; color: var(--pma-muted); }
.pma-order-notes .description p { margin: 0 0 6px; font-size: 13px; line-height: 1.6; color: var(--pma-ink); }

/* Forms: login, lost password, account details, addresses, tracking */
.pma-account .form-row { margin: 0 0 16px; padding: 0; float: none; width: auto; }
.pma-ui.pma-account .form-row label:not(.checkbox),
.pma-ui.pma-account fieldset legend {
	display: block; margin: 0 0 7px; padding: 0;
	font-size: 12px; font-weight: 500; line-height: 1.4; color: var(--pma-ink); text-transform: none; letter-spacing: 0;
}
.pma-ui.pma-account .required { color: var(--pma-purple); text-decoration: none; border: 0; }
.pma-ui.pma-account :is(input.input-text, input[type=email], input[type=password], input[type=text], textarea, select) {
	width: 100%; height: auto; min-height: 46px; margin: 0; padding: 11px 12px;
	background: #fff; border: 1px solid #d8d0e3; border-radius: 7px; box-shadow: none;
	color: var(--pma-ink); font-size: 14px; line-height: 1.4;
	transition: border-color .15s, box-shadow .15s;
}
.pma-ui.pma-account :is(input.input-text, input[type=email], input[type=password], input[type=text], textarea, select):focus {
	border-color: var(--pma-purple); box-shadow: 0 0 0 3px #7141cc26; outline: 0;
}
.pma-ui.pma-account input::placeholder { color: #a79fb3; }
.pma-ui.pma-account :is(.description, em) { display: block; margin-top: 6px; font-size: 11px; font-style: normal; color: var(--pma-muted); }
.pma-ui.pma-account fieldset { margin: 8px 0 18px; padding: 18px 0 0; border: 0; border-top: 1px solid var(--pma-line); }
.pma-ui.pma-account input[type=checkbox] { accent-color: var(--pma-purple); width: 16px; height: 16px; margin: 0 6px 0 0; vertical-align: -3px; }
/* WooCommerce's own buttons on the account forms ("Save changes", "Reset password"…) */
.pma-ui.pma-account .woocommerce-MyAccount-content .button,
.pma-ui.pma-account .woocommerce-ResetPassword .button {
	display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin: 0; padding: 12px 22px;
	background-color: var(--pma-purple) !important; color: #fff; border: 0; border-radius: 7px; box-shadow: none;
	font-size: 13px; font-weight: 700; line-height: 1.2; text-transform: none; letter-spacing: 0;
}
.pma-ui.pma-account .woocommerce-MyAccount-content .button:hover { filter: brightness(.93); }
.pma-account-content > form,
.pma-account-content > .woocommerce-Addresses,
.pma-account-content > p:first-child + .woocommerce-Addresses { margin: 0; padding: 24px; background: var(--pma-bg); border: 1px solid var(--pma-line); border-radius: var(--pma-radius); }
.pma-ui.pma-account .woocommerce-Address-title h3 { font-size: 16px; text-transform: none; }
.pma-ui.pma-account .woocommerce-Address address { font-style: normal; font-size: 13px; line-height: 1.7; }

/* Login */
.pma-login { max-width: 440px; margin: 0 auto; }
.pma-login.has-register { max-width: 900px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.pma-login-card { padding: 28px; }
.pma-login-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 18px; font-size: 12px; }
.pma-ui .pma-login-row label { margin: 0; font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--pma-ink); }
.pma-login-card .pma-primary { width: 100%; min-height: 48px; font-size: 14px; }
.pma-login-note { grid-column: 1 / -1; margin: 6px 0 0; font-size: 12px; line-height: 1.7; color: var(--pma-muted); text-align: center; }
.pma-login-note .pma-icon { margin-right: 6px; vertical-align: -2px; color: var(--pma-purple); }
.pma-ui.pma-account .woocommerce-ResetPassword { max-width: 440px; margin: 0 auto; padding: 28px; background: var(--pma-bg); border: 1px solid var(--pma-line); border-radius: var(--pma-radius); }
.pma-ui.pma-account .woocommerce-ResetPassword > p:first-child { font-size: 13px; line-height: 1.6; color: var(--pma-muted); }

/* Tracking */
.pma-tracking .pma-account-body { max-width: 820px; }
.pma-track-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.pma-track-submit { margin: 0; }
.pma-track-submit .pma-primary { min-width: 180px; }
.pma-track-submit .pma-icon { font-size: 16px; }

/* Notices (wrong password, order not found…) */
.pma-ui.pma-account :is(.woocommerce-error, .woocommerce-message, .woocommerce-info) {
	margin: 0 0 16px; padding: 12px 16px; list-style: none;
	border: 1px solid var(--pma-line); border-radius: 9px; background: var(--pma-soft);
	font-size: 13px; line-height: 1.6; color: var(--pma-ink);
}
.pma-ui.pma-account .woocommerce-error { border-color: #efb3be; background: #fdf1f3; }
.pma-ui.pma-account :is(.woocommerce-error, .woocommerce-message, .woocommerce-info)::before { display: none; }
.pma-ui.pma-account :is(.woocommerce-error, .woocommerce-message, .woocommerce-info) li { margin: 0; }

/* Legal pages */
.pma-legal-layout {
	max-width: 1110px; margin: 0 auto; padding: 36px 34px 52px;
	display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; align-items: start;
}
.pma-legal-toc {
	position: sticky; top: 24px; padding: 16px 18px;
	background: var(--pma-soft); border: 1px solid var(--pma-line); border-radius: var(--pma-radius);
	font-size: 12px;
}
.pma-legal-toc summary { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--pma-ink); list-style: none; cursor: pointer; }
.pma-legal-toc summary::-webkit-details-marker { display: none; }
.pma-legal-toc summary .pma-icon { color: var(--pma-purple); font-size: 16px; }
.pma-legal-toc ol { margin: 12px 0 0; padding: 0 0 0 20px; }
.pma-legal-toc li { margin: 0 0 6px; color: var(--pma-muted); line-height: 1.4; }
.pma-ui .pma-legal-toc a { color: var(--pma-muted); }
.pma-ui .pma-legal-toc a:hover { color: var(--pma-purple); }
.pma-legal .pma-article { max-width: 760px; margin: 0; padding: 0; border: 0; }
.pma-ui.pma-legal .pma-article h2 { scroll-margin-top: 20px; margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--pma-line); font-size: 21px; }
.pma-ui.pma-legal .pma-article h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.pma-ui.pma-legal .pma-article :is(p, li) { font-size: 15px; }
.pma-legal-contact { margin-top: 32px !important; padding: 14px 16px; background: var(--pma-soft); border-radius: 9px; }

@media (max-width: 860px) {
	.pma-account-layout { grid-template-columns: minmax(0, 1fr); }
	.pma-account-nav { position: static; }
	.pma-account-nav ul { display: flex; flex-wrap: wrap; gap: 4px; }
	.pma-ui .pma-account-nav a { padding: 8px 10px; }
	.pma-account-nav .woocommerce-MyAccount-navigation-link--customer-logout { margin: 0; padding: 0; border: 0; }
	.pma-legal-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 26px 22px 40px; }
	.pma-legal-toc { position: static; }
}

@media (max-width: 600px) {
	.pma-account-body { padding: 24px 16px 40px; }
	.pma-account-card, .pma-login-card { padding: 18px 16px; }
	.pma-shortcuts, .pma-track-fields, .pma-login.has-register { grid-template-columns: minmax(0, 1fr); }
	.pma-order-list-main strong { display: block; margin: 0; }
	.pma-ui.pma-account :is(input.input-text, input[type=email], input[type=password], input[type=text], textarea, select) { font-size: 16px; } /* no iOS zoom */
	.pma-track-submit .pma-primary { width: 100%; }

	/* Orders table → one card per order */
	.pma-orders-card { padding: 4px 16px 12px; }
	.pma-ui .pma-orders-table thead { display: none; }
	.pma-ui .pma-orders-table, .pma-ui .pma-orders-table tbody, .pma-ui .pma-orders-table tr { display: block; }
	.pma-ui .pma-orders-table tr { padding: 12px 0; border-bottom: 1px solid var(--pma-line); }
	.pma-ui .pma-orders-table tbody tr:last-child { border-bottom: 0; }
	.pma-ui .pma-orders-table td { display: block; padding: 5px 0 !important; border: 0; text-align: right; }
	.pma-ui .pma-orders-table td::before { content: attr(data-title); float: left; font-size: 11px; line-height: 1.9; color: var(--pma-muted); }
	.pma-ui .pma-orders-table .woocommerce-orders-table__cell-order-actions::before { content: none; }
	.pma-ui .pma-orders-table .woocommerce-orders-table__cell-order-actions { justify-content: flex-end; padding-top: 8px !important; }
}
