/* HUDA Premium WooCommerce Account v1.0.1 — scoped to .huda-acc-page only */

.huda-acc-page {
	--huda-primary: #4f46e5;
	--huda-ink: #0f172a;
	--huda-muted: #64748b;
	--huda-line: #e2e8f0;
	--huda-card: #ffffff;
	--huda-bg: #f8fafc;
}

/* ---------- Safety: nothing may push past the screen ---------- */
.huda-acc-page .woocommerce,
.huda-acc-page .woocommerce *,
.huda-acc-page .woocommerce *::before,
.huda-acc-page .woocommerce *::after {
	box-sizing: border-box;
}
.huda-acc-page .woocommerce {
	max-width: 100%;
	min-width: 0;
	overflow-x: clip;
	display: grid;
	grid-template-columns: 280px minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}
.huda-acc-page .woocommerce > .woocommerce-notices-wrapper,
.huda-acc-page .woocommerce > .woocommerce-message,
.huda-acc-page .woocommerce > .woocommerce-error,
.huda-acc-page .woocommerce > .woocommerce-info {
	grid-column: 1 / -1;
}
.huda-acc-page .woocommerce-MyAccount-navigation,
.huda-acc-page .woocommerce-MyAccount-content {
	float: none !important;
	width: 100% !important;
	max-width: 100%;
	min-width: 0;
	margin: 0 !important;
}
.huda-acc-page .woocommerce-MyAccount-content {
	overflow-wrap: anywhere;
	word-break: break-word;
}
.huda-acc-page .woocommerce-MyAccount-content img,
.huda-acc-page .woocommerce-MyAccount-content iframe,
.huda-acc-page .woocommerce-MyAccount-content video {
	max-width: 100%;
	height: auto;
}
.huda-acc-page .woocommerce-MyAccount-content input,
.huda-acc-page .woocommerce-MyAccount-content select,
.huda-acc-page .woocommerce-MyAccount-content textarea {
	max-width: 100%;
}

/* ---------- Navigation with 3D icons ---------- */
.huda-acc-page .woocommerce-MyAccount-navigation {
	background: var(--huda-card);
	border: 1px solid var(--huda-line);
	border-radius: 20px;
	padding: 12px;
	box-shadow: 0 10px 30px -12px rgba(15, 23, 42, .15);
}
.huda-acc-page .woocommerce-MyAccount-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.huda-acc-page .woocommerce-MyAccount-navigation li {
	margin: 0;
	padding: 0;
	list-style: none;
	min-width: 0;
}
.huda-acc-page .woocommerce-MyAccount-navigation li a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 14px;
	color: var(--huda-ink);
	font-weight: 600;
	font-size: 15px;
	line-height: 1.25;
	text-decoration: none;
	border: 1px solid transparent;
	transition: background .2s, transform .2s, box-shadow .2s;
}
.huda-acc-page .woocommerce-MyAccount-navigation li a::before {
	content: "";
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	filter: drop-shadow(0 6px 6px rgba(15, 23, 42, .18));
	transition: transform .25s;
}
.huda-acc-page .woocommerce-MyAccount-navigation li a:hover {
	background: var(--huda-bg);
	transform: translateX(2px);
}
.huda-acc-page .woocommerce-MyAccount-navigation li a:hover::before {
	transform: translateY(-2px) scale(1.06);
}
.huda-acc-page .woocommerce-MyAccount-navigation li.is-active a {
	background: linear-gradient(135deg, #eef2ff, #e0e7ff);
	border-color: #c7d2fe;
	box-shadow: 0 6px 16px -8px rgba(79, 70, 229, .5);
}

/* ---------- Dashboard ---------- */
.huda-dash { display: grid; gap: 18px; min-width: 0; }

.huda-welcome {
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 24px;
	border-radius: 22px;
	color: #fff;
	background: radial-gradient(120% 140% at 0% 0%, var(--hc1, #6366f1) 0%, var(--hc2, #4338ca) 60%, #0f172a 150%);
	box-shadow: 0 18px 36px -16px rgba(67, 56, 202, .65), inset 0 1px 0 rgba(255, 255, 255, .25);
	min-width: 0;
}
.huda-welcome__avatar img {
	display: block;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	border: 3px solid rgba(255, 255, 255, .55);
	box-shadow: 0 8px 18px rgba(0, 0, 0, .3);
}
.huda-welcome__text { min-width: 0; }
.huda-welcome__hi { font-size: 13px; opacity: .85; letter-spacing: .04em; }
.huda-welcome__name { margin: 2px 0 4px; color: #fff; font-size: 24px; line-height: 1.2; }
.huda-welcome__sub { margin: 0; font-size: 14px; opacity: .88; }

.huda-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.huda-stat {
	background: var(--huda-card);
	border: 1px solid var(--huda-line);
	border-radius: 18px;
	padding: 16px 18px;
	box-shadow: 0 10px 24px -14px rgba(15, 23, 42, .2);
	min-width: 0;
}
.huda-stat__label { display: block; font-size: 13px; color: var(--huda-muted); }
.huda-stat__value { display: block; margin-top: 4px; font-size: 22px; color: var(--huda-ink); }

.huda-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.huda-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 18px 12px;
	background: var(--huda-card);
	border: 1px solid var(--huda-line);
	border-radius: 20px;
	text-align: center;
	text-decoration: none;
	color: var(--huda-ink);
	font-weight: 600;
	box-shadow: 0 10px 24px -14px rgba(15, 23, 42, .2);
	transition: transform .25s, box-shadow .25s;
	min-width: 0;
}
.huda-tile:hover { transform: translateY(-4px); box-shadow: 0 18px 30px -14px rgba(79, 70, 229, .35); }
.huda-ico {
	display: block;
	width: 64px;
	height: 64px;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	filter: drop-shadow(0 10px 10px rgba(15, 23, 42, .22));
}
.huda-tile__label { font-size: 14px; line-height: 1.3; }

/* ---------- Tables: scroll inside their own box ---------- */
.huda-acc-page .huda-table-scroll {
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--huda-line);
	border-radius: 16px;
	background: var(--huda-card);
}
.huda-acc-page .huda-table-scroll table {
	width: 100%;
	min-width: 620px;
	margin: 0 !important;
	border: 0 !important;
	border-collapse: collapse;
}
.huda-acc-page .huda-table-scroll table th,
.huda-acc-page .huda-table-scroll table td {
	padding: 12px 14px;
	white-space: nowrap;
	text-align: left;
}
.huda-acc-page .huda-table-scroll table thead th {
	background: var(--huda-bg);
	font-size: 13px;
	color: var(--huda-muted);
}
/* Cancel WooCommerce's stacked mobile table so it scrolls instead */
.huda-acc-page .huda-table-scroll table.shop_table_responsive thead { display: table-header-group !important; }
.huda-acc-page .huda-table-scroll table.shop_table_responsive tbody tr { display: table-row !important; }
.huda-acc-page .huda-table-scroll table.shop_table_responsive tr td,
.huda-acc-page .huda-table-scroll table.shop_table_responsive tr th { display: table-cell !important; text-align: left !important; }
.huda-acc-page .huda-table-scroll table.shop_table_responsive tr td::before { display: none !important; content: none !important; }

/* ---------- Hide any old dashboard block inside the content area ---------- */
.huda-acc-page .woocommerce-MyAccount-content:has(> .huda-dash) > *:not(.huda-dash):not(.woocommerce-notices-wrapper):not(.woocommerce-message):not(.woocommerce-error):not(.woocommerce-info) {
	display: none !important;
}

/* ---------- Extra dashboard sections ---------- */
.huda-h { margin: 6px 0 -4px; font-size: 16px; color: var(--huda-ink); }
.huda-stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.huda-stat--wallet { background: linear-gradient(135deg, #ecfeff, #ccfbf1); border-color: #99f6e4; }

.huda-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.huda-card {
	background: var(--huda-card);
	border: 1px solid var(--huda-line);
	border-radius: 20px;
	padding: 18px;
	box-shadow: 0 10px 24px -14px rgba(15, 23, 42, .2);
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.huda-card .huda-h { margin: 0; }

.huda-orders { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.huda-orders li { margin: 0; padding: 0; }
.huda-order {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 14px;
	background: var(--huda-bg);
	text-decoration: none;
	color: var(--huda-ink);
	min-width: 0;
}
.huda-order__main, .huda-order__side { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.huda-order__side { align-items: flex-end; }
.huda-order small { color: var(--huda-muted); font-size: 12px; }

.huda-st {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	background: #e2e8f0;
	color: #334155;
}
.huda-st--completed { background: #dcfce7; color: #166534; }
.huda-st--processing { background: #dbeafe; color: #1e40af; }
.huda-st--on-hold, .huda-st--pending { background: #fef3c7; color: #92400e; }
.huda-st--cancelled, .huda-st--failed, .huda-st--refunded { background: #fee2e2; color: #991b1b; }

.huda-info { margin: 0; display: grid; gap: 10px; }
.huda-info > div { display: flex; justify-content: space-between; gap: 12px; min-width: 0; }
.huda-info dt { color: var(--huda-muted); font-size: 13px; }
.huda-info dd { margin: 0; font-weight: 600; font-size: 14px; text-align: right; min-width: 0; overflow-wrap: anywhere; }

.huda-link { margin-top: auto; font-weight: 700; font-size: 14px; color: var(--huda-primary); text-decoration: none; }
.huda-empty { margin: 0; color: var(--huda-muted); }

.huda-support {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px 18px;
	border-radius: 20px;
	text-decoration: none;
	color: #fff;
	background: linear-gradient(135deg, #22c55e, #15803d);
	box-shadow: 0 16px 30px -16px rgba(21, 128, 61, .7), inset 0 1px 0 rgba(255, 255, 255, .3);
	min-width: 0;
}
.huda-support .huda-ico { width: 48px; height: 48px; flex: 0 0 48px; }
.huda-support__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.huda-support__text strong { color: #fff; font-size: 16px; }
.huda-support__text small { opacity: .9; font-size: 13px; }
.huda-support__go { font-size: 22px; font-weight: 700; }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
	.huda-acc-page .woocommerce { grid-template-columns: minmax(0, 1fr); gap: 16px; }

	.huda-acc-page .woocommerce-MyAccount-navigation ul {
		display: grid;
		grid-template-columns: repeat(var(--huda-cols, 2), minmax(0, 1fr));
		gap: 8px;
	}
	.huda-acc-page .woocommerce-MyAccount-navigation li a {
		padding: 9px 10px;
		font-size: 14px;
		gap: 9px;
	}
	.huda-acc-page .woocommerce-MyAccount-navigation li a::before {
		flex-basis: 34px;
		width: 34px;
		height: 34px;
	}
	.huda-welcome { padding: 18px; gap: 14px; }
	.huda-welcome__avatar img { width: 56px; height: 56px; }
	.huda-welcome__name { font-size: 20px; }
	.huda-welcome__sub { font-size: 13px; }
	.huda-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.huda-cols { grid-template-columns: minmax(0, 1fr); }
	.huda-stats--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.huda-stats--3 .huda-stat--wallet { grid-column: 1 / -1; }
}

@media (max-width: 380px) {
	.huda-stats { grid-template-columns: minmax(0, 1fr); }
	.huda-acc-page .woocommerce-MyAccount-navigation li a { font-size: 13px; }
}

/* ---------- Section toggles & voice button (all scoped inside the dashboard) ---------- */
.huda--no-stats .huda-stats,
.huda--no-recent .huda-sec-recent,
.huda--no-info .huda-sec-info { display: none; }
.huda--no-tiles > .huda-h, .huda--no-tiles > .huda-tiles { display: none; }
.huda--no-recent.huda--no-info .huda-cols { display: none; }
.huda--no-recent .huda-cols, .huda--no-info .huda-cols { grid-template-columns: minmax(0, 1fr); }
.huda-voice {
	margin-top: 10px; border: 0; cursor: pointer; padding: 8px 16px; border-radius: 999px;
	font-weight: 700; font-size: 13px; color: #fff; background: rgba(255, 255, 255, .2);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 14px -8px rgba(0, 0, 0, .5);
}
.huda-voice:hover { background: rgba(255, 255, 255, .3); }
