/*
 * TrueHugz My Account.
 *
 * Brand tokens taken from the live theme's Creative Elements globals:
 *   primary #F17100 · accent #1EB0C2 · accent-dark #058696 · tint #E9F6F8
 *   headings "Salsa" · body "Poppins"
 */

.woocommerce-account .woocommerce {
	--thma-primary: #f17100;
	--thma-accent: #1eb0c2;
	--thma-accent-dark: #058696;
	--thma-tint: #e9f6f8;
	--thma-warn: #fdf3e7;
	--thma-danger: #c0392b;
	--thma-text: #333;
	--thma-muted: #777;
	--thma-border: #e3e3e3;
	--thma-radius: 4px;

	color: var(--thma-text);
	font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

/* ---- Two-column shell ----
 *
 * Flex rather than floats with percentage widths: a percentage column is
 * whatever the theme's container happens to be, and at OceanWP's content width
 * 28% left too little room once an icon was added, so labels wrapped four lines
 * deep and were clipped. A fixed basis is predictable, and min-width:0 on the
 * content column stops long tables forcing an overflow.
 */

.woocommerce-account .woocommerce {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 0 32px;
}

/* Notices must span the row, not sit in the column gap. */
.woocommerce-account .woocommerce > .woocommerce-notices-wrapper {
	flex: 1 0 100%;
}

.woocommerce-account .woocommerce-MyAccount-navigation {
	flex: 0 0 260px;
	max-width: 100%;
	float: none;
	width: auto;
	margin: 0;
}

.woocommerce-account .woocommerce-MyAccount-content {
	flex: 1 1 0;
	min-width: 0;
	float: none;
	width: auto;
}

/* ---- Navigation ----
 *
 * OceanWP styles this list at `.woocommerce-MyAccount-navigation ul li a`
 * (0,1,3) with `padding:12px 0`, and paints its own simple-line-icon in
 * `a:before` (0,1,4) floated right. Both outrank a shorter selector, which is
 * why the text sat flush against the border and no icon appeared. Every rule
 * below is scoped through `.woocommerce-account` to outweigh them, and the
 * theme's ::before is explicitly reset rather than merely overridden.
 */

.woocommerce-account .woocommerce-MyAccount-navigation ul {
	margin: 0;
	padding: 0;
	list-style: none;
	background: #fff;
	border: 1px solid var(--thma-border);
	border-radius: var(--thma-radius);
	overflow: hidden;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li {
	margin: 0;
	padding: 0;
	list-style: none;
	border: 0;
	position: relative;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li + li {
	border-top: 1px solid var(--thma-border);
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
	display: block;
	position: relative;
	padding: 14px 16px 14px 48px;
	color: var(--thma-text);
	font-size: 16px;
	line-height: 1.35;
	text-decoration: none;
	overflow-wrap: break-word;
	transition: background-color .15s ease, color .15s ease;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover {
	background: var(--thma-tint);
	color: var(--thma-accent-dark);
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a {
	background: var(--thma-tint);
	color: var(--thma-accent-dark);
	font-weight: 600;
	box-shadow: inset 3px 0 0 var(--thma-accent);
}

/* Reset the theme's floated icon before drawing our own. */
.woocommerce-account .woocommerce-MyAccount-navigation ul li a::before {
	float: none;
	position: static;
	margin: 0;
	width: auto;
	text-align: left;
	line-height: 1;
	opacity: 1;
	color: inherit;
	content: none;
	transition: none;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li.thma-nav-item a::before {
	position: absolute;
	top: 14px;
	left: 16px;
	width: 20px;
	font-family: dashicons;
	font-size: 20px;
	text-align: center;
	speak: never;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
li.woocommerce-MyAccount-navigation-link.woocommerce-MyAccount-navigation-link--subscriptions a::before {
    position: absolute !important;
    top: 14px;
    left: 16px;
    font-weight: 600;
    line-height: 1.5 !important;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul li.thma-icon-dashboard a::before         { content: "\f226"; }
.woocommerce-account .woocommerce-MyAccount-navigation ul li.thma-icon-admin-users a::before       { content: "\f110"; }
.woocommerce-account .woocommerce-MyAccount-navigation ul li.thma-icon-location a::before          { content: "\f230"; }
.woocommerce-account .woocommerce-MyAccount-navigation ul li.thma-icon-calendar-alt a::before      { content: "\f508"; }
.woocommerce-account .woocommerce-MyAccount-navigation ul li.thma-icon-media-spreadsheet a::before { content: "\f495"; }
.woocommerce-account .woocommerce-MyAccount-navigation ul li.thma-icon-money-alt a::before         { content: "\f18e"; }
.woocommerce-account .woocommerce-MyAccount-navigation ul li.thma-icon-tag a::before               { content: "\f323"; }
.woocommerce-account .woocommerce-MyAccount-navigation ul li.thma-icon-media-text a::before        { content: "\f491"; }
.woocommerce-account .woocommerce-MyAccount-navigation ul li.thma-icon-trash a::before             { content: "\f182"; }
.woocommerce-account .woocommerce-MyAccount-navigation ul li.thma-icon-admin-comments a::before    { content: "\f101"; }
.woocommerce-account .woocommerce-MyAccount-navigation ul li.thma-icon-awards a::before            { content: "\f313"; }
.woocommerce-account .woocommerce-MyAccount-navigation ul li.thma-icon-heart a::before             { content: "\f487"; }
.woocommerce-account .woocommerce-MyAccount-navigation ul li.thma-icon-exit a::before              { content: "\f14c"; }

/* ---- Content ---- */

.woocommerce-MyAccount-content h2,
.woocommerce-MyAccount-content h3 {
	font-family: "Poppins", sans-serif;
	color: var(--thma-text);
}

.woocommerce-MyAccount-content > h2:first-child {
	margin-top: 0;
	font-size: 22px;
	font-weight: 700;
}

.thma-empty,
.thma-note {
	color: var(--thma-muted);
	font-size: 15px;
}

.thma-table {
	width: 100%;
	margin: 0 0 20px;
	border-collapse: collapse;
	font-size: 15px;
	background: #fff;
}

.thma-table th,
.thma-table td {
	padding: 12px 14px;
	text-align: left;
	border-bottom: 1px solid var(--thma-border);
}

.thma-table th {
	font-weight: 700;
	background: #fafafa;
}

.thma-table a { color: var(--thma-accent-dark); }

.thma-table code {
	padding: 2px 7px;
	background: var(--thma-tint);
	border-radius: 3px;
	font-size: 14px;
	letter-spacing: .5px;
}

.thma-card {
	margin: 0 0 20px;
	padding: 18px 20px;
	background: var(--thma-tint);
	border-radius: var(--thma-radius);
}

.thma-card--warn { background: var(--thma-warn); }

.thma-card h3 {
	margin: 0 0 10px;
	font-size: 16px;
	font-weight: 700;
}

.thma-list {
	margin: 0;
	padding-left: 20px;
	font-size: 15px;
	line-height: 1.7;
}

.thma-form { margin: 0 0 20px; }

.thma-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 15px;
	cursor: pointer;
}

.thma-checkbox input[type="checkbox"] {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	margin: 4px 0 0;
	accent-color: var(--thma-accent);
}

.woocommerce-MyAccount-content .thma-btn {
	display: inline-flex;
	align-items: center;
	padding: 11px 22px;
	background: var(--thma-accent);
	border: 2px solid var(--thma-accent);
	border-radius: var(--thma-radius);
	color: #fff;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease;
}

.woocommerce-MyAccount-content .thma-btn:hover {
	background: var(--thma-accent-dark);
	border-color: var(--thma-accent-dark);
	color: #fff;
}

.woocommerce-MyAccount-content .thma-btn--danger {
	background: var(--thma-danger);
	border-color: var(--thma-danger);
}

.woocommerce-MyAccount-content .thma-btn--danger:hover {
	background: #a5301f;
	border-color: #a5301f;
}

/* Bring WooCommerce's own account buttons into the palette. */
.woocommerce-MyAccount-content .woocommerce-Button,
.woocommerce-MyAccount-content button.button,
.woocommerce-MyAccount-content a.button {
	background: var(--thma-accent);
	border-radius: var(--thma-radius);
	color: #fff;
	font-weight: 600;
}

.woocommerce-MyAccount-content .woocommerce-Button:hover,
.woocommerce-MyAccount-content button.button:hover,
.woocommerce-MyAccount-content a.button:hover {
	background: var(--thma-accent-dark);
	color: #fff;
}

/* ---- Reviews ---- */

.thma-reviews {
	margin: 0;
	padding: 0;
	list-style: none;
}

.thma-review {
	padding: 16px 0;
	border-bottom: 1px solid var(--thma-border);
}

.thma-review h3 { margin: 0 0 4px; font-size: 16px; }
.thma-review h3 a { color: var(--thma-text); text-decoration: none; }
.thma-review h3 a:hover { color: var(--thma-primary); }

.thma-rating { margin: 0 0 4px; color: #f9b50b; font-size: 16px; letter-spacing: 2px; }
.thma-review-date { margin: 0 0 8px; color: var(--thma-muted); font-size: 13px; }
.thma-review-body { font-size: 15px; }
.thma-review-body p { margin: 0 0 8px; }

/* ---- Bare account screens ---- */

body.thma-bare .page-header,
body.thma-bare .site-breadcrumbs,
body.thma-bare #footer-bottom {
	display: none;
}

body.thma-bare #content-wrap,
body.thma-bare .content-area {
	padding-top: 40px;
	padding-bottom: 56px;
}

/* ---- Responsive ---- */

@media (max-width: 900px) {
	.woocommerce-account .woocommerce-MyAccount-navigation,
	.woocommerce-account .woocommerce-MyAccount-content {
		flex: 1 0 100%;
		max-width: 100%;
	}

	.woocommerce-account .woocommerce-MyAccount-navigation {
		margin-bottom: 28px;
	}
}

@media (max-width: 600px) {
	body.thma-bare #content-wrap,
	body.thma-bare .content-area {
		padding-top: 24px;
		padding-bottom: 32px;
	}

	.thma-table,
	.thma-table thead,
	.thma-table tbody,
	.thma-table th,
	.thma-table td,
	.thma-table tr {
		display: block;
	}

	.thma-table thead { display: none; }

	.thma-table tr {
		margin-bottom: 14px;
		border: 1px solid var(--thma-border);
		border-radius: var(--thma-radius);
	}

	.thma-table td {
		border: 0;
		border-bottom: 1px solid #f0f0f0;
		padding: 10px 14px;
	}

	.thma-table td:last-child { border-bottom: 0; }
}

/* ---- Inner screens: PrestaShop layout (the Dashboard keeps its own) ----
 *
 * The child theme centres .woocommerce-account .woocommerce, which pushed the
 * menu halfway down long screens.
 */

body.woocommerce-account:not(.thma-ep-dashboard) .woocommerce {
	align-items: flex-start;
	justify-content: flex-start;
}

body.woocommerce-account:not(.thma-ep-dashboard) .oceanwp-user-profile { display: none; }

.woocommerce-account .woocommerce > .thma-page-heading {
	flex: 1 0 100%;
	margin: 0 0 24px;
	color: var(--thma-text);
	font-family: "Poppins", sans-serif;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.3;
}

/* ---- PDPA ---- */

.thma-pdpa {
	margin: 0 0 30px;
	padding: 30px;
	background: var(--thma-tint);
}

.woocommerce-MyAccount-content .thma-pdpa h2 {
	margin: 0 0 12px;
	font-size: 22px;
	font-weight: 700;
}

.thma-pdpa p {
	margin: 0 0 16px;
	font-size: 16px;
	line-height: 1.7;
}

.thma-pdpa p:last-child { margin-bottom: 0; }
.thma-pdpa p a { color: var(--thma-primary); }

.thma-pdpa__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.woocommerce-MyAccount-content .thma-pdpa .thma-btn {
	border-radius: 10px;
	font-size: 14px;
	text-transform: uppercase;
}

/* ---- Delete account ---- */

.thma-delete-form .thma-checkbox { margin-bottom: 16px; }
.thma-delete-form .thma-checkbox a { color: var(--thma-primary); }

.woocommerce-MyAccount-content .thma-btn:disabled {
	opacity: .45;
	cursor: not-allowed;
}

@media (max-width: 600px) {
	.thma-pdpa { padding: 20px; }
	.woocommerce-account .woocommerce > .thma-page-heading { font-size: 20px; }
}

/* ---- Phones and small tablets ----
 *
 * The full menu came first and pushed every screen's content about 660px
 * down, so below 900px it folds into one "current page" button (the
 * Dashboard keeps it open, being the hub). Order and AutoDelivery tables
 * become one card per row; OceanWP drops WooCommerce's small-screen styles.
 */

.thma-nav-toggle { display: none; }

@media (max-width: 900px) {
	.woocommerce-account .woocommerce-MyAccount-navigation .thma-nav-toggle {
		display: flex;
		align-items: center;
		gap: 10px;
		width: 100%;
		padding: 14px 16px;
		background: #fff;
		border: 1px solid var(--thma-border);
		border-radius: var(--thma-radius);
		color: var(--thma-accent-dark);
		font: inherit;
		font-size: 16px;
		font-weight: 600;
		text-align: left;
		cursor: pointer;
	}

	.thma-nav-toggle::before {
		content: "\f333";
		font-family: dashicons;
		font-size: 20px;
		font-weight: 400;
	}

	.thma-nav-toggle::after {
		content: "\f347";
		margin-left: auto;
		font-family: dashicons;
		font-size: 18px;
		font-weight: 400;
		transition: transform .2s ease;
	}

	.thma-nav--collapsible.is-open .thma-nav-toggle::after { transform: rotate(180deg); }
	.thma-nav--collapsible.is-open .thma-nav-toggle { border-radius: var(--thma-radius) var(--thma-radius) 0 0; }

	.woocommerce-account .woocommerce-MyAccount-navigation.thma-nav--collapsible ul { display: none; }
	.woocommerce-account .woocommerce-MyAccount-navigation.thma-nav--collapsible.is-open ul {
		display: block;
		border-top: 0;
		border-radius: 0 0 var(--thma-radius) var(--thma-radius);
	}

	/* OceanWP wraps the menu in .woocommerce-MyAccount-tabs, which shrank to its content. */
	.woocommerce-account .woocommerce > .woocommerce-MyAccount-tabs {
		flex: 1 0 100%;
		width: 100%;
	}

	.woocommerce-account .woocommerce-MyAccount-navigation { margin-bottom: 20px; }
}

@media (max-width: 600px) {
	.woocommerce-MyAccount-content table.shop_table_responsive,
	.woocommerce-MyAccount-content table.shop_table_responsive tbody,
	.woocommerce-MyAccount-content table.shop_table_responsive tr {
		display: block;
		width: 100%;
		border: 0;
	}

	.woocommerce-MyAccount-content table.shop_table_responsive thead { display: none; }

	.woocommerce-MyAccount-content table.shop_table_responsive tbody tr {
		margin: 0 0 14px;
		background: #fff;
		border: 1px solid var(--thma-border);
		border-radius: var(--thma-radius);
	}

	/* Block with a floated label: a cell's text (e.g. "$52.12 for 1 item") stays together on the right. */
	.woocommerce-MyAccount-content table.shop_table_responsive tbody th,
	.woocommerce-MyAccount-content table.shop_table_responsive tbody td {
		display: block;
		overflow: hidden;
		padding: 10px 14px;
		border: 0;
		border-bottom: 1px solid #f0f0f0;
		text-align: right;
	}

	.woocommerce-MyAccount-content table.shop_table_responsive tbody tr > :last-child { border-bottom: 0; }

	.woocommerce-MyAccount-content table.shop_table_responsive tbody [data-title]::before {
		content: attr(data-title);
		float: left;
		margin-right: 12px;
		color: var(--thma-text);
		font-weight: 600;
		text-align: left;
	}

	.woocommerce-MyAccount-content table.shop_table_responsive .button { margin: 4px 0 0 6px; }
}
