/*!
 * RoboThings Modern Customer Dashboard — front-end styles.
 * All colors/spacing/radii are driven by CSS custom properties set
 * inline by RTMD_Assets::build_css_variables() from the admin settings,
 * so this file itself never needs editing for a re-theme.
 * Scoped entirely under body.rtmd-account-page to avoid leaking
 * anywhere else on the site.
 */

body.rtmd-account-page {
	--rtmd-bg: #f6f7fb;
	--rtmd-surface: #ffffff;
	--rtmd-surface-2: #fafbfd;
	--rtmd-border: #e9ebf1;
	--rtmd-text: #16181d;
	--rtmd-text-muted: #6b7280;
	--rtmd-text-faint: #9ca3af;
	--rtmd-success: #16a34a;
	--rtmd-warning: #d97706;
	--rtmd-danger: #dc2626;
	--rtmd-info: #2563eb;
	background: var(--rtmd-bg);
	color: var(--rtmd-text);
	font-family: var(--rtmd-font-family, 'Inter', sans-serif);
	font-size: var(--rtmd-font-size, 15px);
	letter-spacing: var(--rtmd-letter-spacing, normal);
	line-height: 1.55;
}

body.rtmd-account-page.rtmd-dark {
	--rtmd-bg: #0f1115;
	--rtmd-surface: #171a21;
	--rtmd-surface-2: #1d2028;
	--rtmd-border: #2a2e38;
	--rtmd-text: #f1f2f4;
	--rtmd-text-muted: #a4a8b3;
	--rtmd-text-faint: #6c7280;
}

@media (prefers-color-scheme: dark) {
	body.rtmd-account-page.rtmd-dark-auto {
		--rtmd-bg: #0f1115;
		--rtmd-surface: #171a21;
		--rtmd-surface-2: #1d2028;
		--rtmd-border: #2a2e38;
		--rtmd-text: #f1f2f4;
		--rtmd-text-muted: #a4a8b3;
		--rtmd-text-faint: #6c7280;
	}
}

.rtmd-account-page * { box-sizing: border-box; }

/* ---------- Theme reset ----------
 * WordPress themes very commonly apply their own global styling to
 * bare button/input elements (borders, min-height, min-width,
 * background) so their site-wide buttons look consistent. Those
 * rules can beat ours on specificity or load order and leak into
 * this dashboard, producing oversized/misshapen buttons in the
 * theme's own brand color instead of ours. Rather than reset every
 * native control on the page (which would also strip styling from
 * untouched core WooCommerce form elements, like the country/state
 * selects on the native edit-address page), this resets only our
 * own interactive component classes to a neutral baseline before
 * their intended styles apply.
 */
.rtmd-btn,
.rtmd-icon-btn,
.rtmd-mobile-nav-toggle,
.rtmd-theme-toggle,
.rtmd-input,
.rtmd-avatar-edit {
	all: unset;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	font-family: inherit;
	cursor: pointer;
}
.rtmd-input { cursor: text; display: block; width: 100%; }

/* ---------- Layout ----------
 * .rtmd-dashboard-app intentionally breaks out of whatever column
 * it's rendered inside of. Some themes wrap page content in a
 * narrower fixed-width column (sized for reading text, not for a
 * wide dashboard), and that column sits *outside* our control — no
 * amount of width/max-width on our own root element can widen a
 * space its parent has already constrained. The calc(50% - 50vw)
 * negative-margin technique is the standard fix: it makes the
 * element span the actual browser viewport width regardless of any
 * ancestor's width, without requiring a CSS transform (which would
 * create a new stacking context and risk breaking fixed-position
 * children like the mobile drawer). .rtmd-dashboard-inner then
 * re-applies our real max-width and centers the actual layout within
 * that full-bleed space.
 */
.rtmd-dashboard-app {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	box-sizing: border-box;
	overflow-x: hidden;
}

.rtmd-dashboard-inner {
	max-width: var(--rtmd-container, 1280px);
	width: 100%;
	margin: 32px auto;
	padding: 0 20px;
	box-sizing: border-box;
}

.material-symbols-outlined {
	font-family: 'Material Symbols Outlined';
	font-weight: normal;
	font-style: normal;
	font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
	display: inline-block;
	vertical-align: middle;
	line-height: 1;
	-webkit-font-smoothing: antialiased;
}

/* ---------- Layout ----------
 * Flexbox, not grid, for the sidebar/content split: a fixed-width
 * sidebar (flex: 0 0 280px, never grows or shrinks) and a fluid
 * content column (flex: 1, with min-width: 0 so it can shrink below
 * its content's intrinsic size instead of forcing overflow). This is
 * a deliberately simple, well-tested pattern that avoids edge cases
 * some browser/theme combinations can hit with CSS Grid's implicit
 * track-sizing algorithm.
 */
.rtmd-layout {
	display: flex;
	align-items: flex-start;
	gap: 28px;
	width: 100%;
}

.rtmd-sidebar {
	flex: 0 0 var(--rtmd-sidebar-w, 280px);
	width: var(--rtmd-sidebar-w, 280px);
	max-width: var(--rtmd-sidebar-w, 280px);
}

.rtmd-content {
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
	max-width: 100%;
	display: block;
}

.woocommerce-MyAccount-content.rtmd-account-content {
	width: 100%;
	max-width: 100%;
	display: block;
}

.rtmd-mobile-nav-toggle {
	display: none;
	align-items: center !important;
	gap: 8px !important;
	background: var(--rtmd-surface) !important;
	border: 1px solid var(--rtmd-border) !important;
	border-radius: 12px !important;
	padding: 10px 14px !important;
	margin-bottom: 16px !important;
	font-weight: 600 !important;
	font-size: 14px !important;
	color: var(--rtmd-text) !important;
	cursor: pointer !important;
	box-shadow: var(--rtmd-shadow) !important;
	width: auto !important;
	height: auto !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	line-height: normal !important;
	text-transform: none !important;
	letter-spacing: normal !important;
}

/* ---------- Sidebar ---------- */

.rtmd-sidebar {
	position: sticky;
	top: 24px;
	background: var(--rtmd-surface);
	border: 1px solid var(--rtmd-border);
	border-radius: var(--rtmd-radius, 18px);
	box-shadow: var(--rtmd-shadow);
	padding: 22px;
	display: flex;
	flex-direction: column;
	gap: 20px;
	box-sizing: border-box;
	animation: rtmdFadeIn 0.4s ease;
}

body.rtmd-account-page.rtmd-sidebar-glass .rtmd-sidebar,
body.rtmd-account-page[data-rtmd-sidebar='glass'] .rtmd-sidebar {
	background: color-mix(in srgb, var(--rtmd-surface) 72%, transparent);
	backdrop-filter: blur(18px) saturate(160%);
	-webkit-backdrop-filter: blur(18px) saturate(160%);
}

.rtmd-profile-card {
	background: linear-gradient(135deg, var(--rtmd-primary), var(--rtmd-accent));
	border-radius: calc(var(--rtmd-radius, 18px) - 4px);
	padding: 24px 20px;
	color: #fff;
	text-align: center;
	position: relative;
	overflow: hidden;
}

.rtmd-profile-card::before {
	content: '';
	position: absolute;
	inset: -40% -10% auto auto;
	width: 220px;
	height: 220px;
	background: rgba(255, 255, 255, 0.12);
	border-radius: 50%;
}

.rtmd-profile-avatar-wrap {
	position: relative;
	width: 88px;
	margin: 0 auto 12px;
}

.rtmd-profile-avatar {
	border-radius: 50%;
	border: 3px solid rgba(255, 255, 255, 0.85);
	display: block;
	width: 88px;
	height: 88px;
	object-fit: cover;
}

.rtmd-avatar-edit {
	position: absolute;
	bottom: -2px;
	right: -2px;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: #fff;
	color: var(--rtmd-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	text-decoration: none;
	cursor: pointer;
}
.rtmd-avatar-edit .material-symbols-outlined { font-size: 16px; }
.rtmd-avatar-edit-spinner { animation: rtmdSpin 0.8s linear infinite; }
.rtmd-is-hidden { display: none !important; }
@keyframes rtmdSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Safety net: the native [hidden] attribute can lose to any author
 * rule that sets `display` on the same element at equal specificity
 * (e.g. .material-symbols-outlined{display:inline-block}), since
 * author-origin CSS beats the browser's own UA stylesheet default
 * for [hidden] when specificity ties. Elements toggled via the
 * `hidden` attribute anywhere in this plugin should always actually
 * hide, so this is scoped broadly rather than patched per element.
 */
.rtmd-account-page [hidden] { display: none !important; }

.rtmd-profile-name {
	font-size: 18px;
	font-weight: var(--rtmd-heading-weight, 700);
	margin: 0 0 2px;
	position: relative;
}
.rtmd-profile-role {
	margin: 0 0 16px;
	font-size: 13px;
	opacity: 0.9;
	position: relative;
}

.rtmd-profile-meta {
	background: rgba(255, 255, 255, 0.14);
	border-radius: 12px;
	padding: 10px 12px;
	margin-bottom: 14px;
	position: relative;
}
.rtmd-profile-meta-item {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	padding: 3px 0;
}
.rtmd-profile-meta-label { opacity: 0.8; }
.rtmd-profile-meta-value { font-weight: 600; }

.rtmd-profile-stats {
	display: flex;
	justify-content: space-around;
	margin-bottom: 16px;
	position: relative;
}
.rtmd-profile-stat { display: flex; flex-direction: column; }
.rtmd-profile-stat strong { font-size: 16px; font-weight: 800; }
.rtmd-profile-stat span { font-size: 11px; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- Buttons ---------- */

.rtmd-btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 6px !important;
	padding: 10px 18px !important;
	border-radius: var(--rtmd-radius-btn, 12px) !important;
	font-weight: 600 !important;
	font-size: 14px !important;
	border: 1px solid transparent !important;
	cursor: pointer !important;
	text-decoration: none !important;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
	position: relative;
	overflow: hidden;
	width: auto !important;
	height: auto !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	line-height: normal !important;
	text-transform: none !important;
	letter-spacing: normal !important;
}
.rtmd-btn:hover { transform: translateY(-1px); }
.rtmd-btn-block { width: 100% !important; }
.rtmd-btn-sm { padding: 7px 14px !important; font-size: 13px !important; }

.rtmd-btn-primary {
	background: var(--rtmd-primary);
	color: #fff;
	box-shadow: 0 4px 14px color-mix(in srgb, var(--rtmd-primary) 45%, transparent);
}
.rtmd-btn-primary:hover { box-shadow: 0 6px 20px color-mix(in srgb, var(--rtmd-primary) 55%, transparent); color: #fff; }

.rtmd-btn-outline {
	background: transparent;
	color: var(--rtmd-text);
	border-color: var(--rtmd-border);
}
.rtmd-btn-outline:hover { border-color: var(--rtmd-primary); color: var(--rtmd-primary); }

.rtmd-profile-card .rtmd-btn-outline {
	border-color: rgba(255, 255, 255, 0.6);
	color: #fff;
	position: relative;
}
.rtmd-profile-card .rtmd-btn-outline:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }

.rtmd-btn.rtmd-ripple::after {
	content: '';
	position: absolute;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.6);
	transform: scale(0);
	opacity: 0;
	top: var(--rtmd-ripple-y, 50%);
	left: var(--rtmd-ripple-x, 50%);
	pointer-events: none;
}
.rtmd-btn.rtmd-ripple-active::after {
	animation: rtmdRipple 0.5s ease-out;
}

/* ---------- Sidebar nav ---------- */

.rtmd-nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }

.rtmd-nav-link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 10px;
	color: var(--rtmd-text-muted);
	text-decoration: none;
	font-weight: 500;
	font-size: 14px;
	transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
	position: relative;
}
.rtmd-nav-link:hover {
	background: var(--rtmd-surface-2);
	color: var(--rtmd-text);
	padding-left: 16px;
}

.rtmd-nav-icon { font-size: 20px; }
.rtmd-nav-label { flex: 1; }

.rtmd-nav-badge {
	background: var(--rtmd-warning);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	border-radius: 999px;
	min-width: 18px;
	height: 18px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 5px;
}

.rtmd-nav-item.is-active .rtmd-nav-link {
	background: color-mix(in srgb, var(--rtmd-primary) 12%, transparent);
	color: var(--rtmd-primary);
	font-weight: 700;
}
.rtmd-nav-item.is-active .rtmd-nav-link::before {
	content: '';
	position: absolute;
	left: -22px;
	top: 8px;
	bottom: 8px;
	width: 3px;
	border-radius: 3px;
	background: var(--rtmd-primary);
}

.rtmd-nav-item-logout { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--rtmd-border); }

.rtmd-theme-toggle {
	display: flex !important;
	align-items: center !important;
	gap: 10px !important;
	background: var(--rtmd-surface-2) !important;
	border: 1px solid var(--rtmd-border) !important;
	border-radius: 10px !important;
	padding: 10px 12px !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	color: var(--rtmd-text-muted) !important;
	cursor: pointer !important;
	width: auto !important;
	height: auto !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	line-height: normal !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	box-shadow: none !important;
}
.rtmd-theme-toggle:hover { color: var(--rtmd-text); }

/* ---------- Cards, generic ---------- */

.rtmd-card {
	width: 100%;
	box-sizing: border-box;
	background: var(--rtmd-surface);
	border: 1px solid var(--rtmd-border);
	border-radius: var(--rtmd-radius, 18px);
	box-shadow: var(--rtmd-shadow);
	padding: 22px;
	animation: rtmdFadeIn 0.4s ease;
}

.rtmd-page-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 22px;
	flex-wrap: wrap;
}
.rtmd-page-title {
	font-size: 26px;
	font-weight: var(--rtmd-heading-weight, 800);
	margin: 0 0 4px;
	letter-spacing: var(--rtmd-letter-spacing, normal);
}
.rtmd-page-subtitle { margin: 0; color: var(--rtmd-text-muted); font-size: 14px; }

/* ---------- Account completion ---------- */

.rtmd-completion-card {
	display: flex;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
	margin-bottom: 22px;
}
.rtmd-completion-info { display: flex; gap: 12px; align-items: flex-start; flex: 1 1 260px; }
.rtmd-completion-info .material-symbols-outlined { color: var(--rtmd-primary); font-size: 26px; }
.rtmd-completion-info p { margin: 2px 0 0; color: var(--rtmd-text-muted); font-size: 13px; }
.rtmd-completion-bar-wrap { display: flex; align-items: center; gap: 10px; flex: 1 1 200px; }
.rtmd-completion-bar { flex: 1; height: 8px; border-radius: 99px; background: var(--rtmd-surface-2); overflow: hidden; }
.rtmd-completion-bar-fill { height: 100%; background: linear-gradient(90deg, var(--rtmd-primary), var(--rtmd-accent)); border-radius: 99px; transition: width 0.5s ease; }
.rtmd-completion-pct { font-weight: 700; font-size: 13px; }

/* ---------- Stat cards ---------- */

.rtmd-stat-grid {
	width: 100%;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 16px;
	margin-bottom: 26px;
}

.rtmd-stat-card {
	border-radius: var(--rtmd-radius, 18px);
	padding: 20px;
	color: #fff;
	position: relative;
	overflow: hidden;
	box-shadow: var(--rtmd-shadow);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	cursor: default;
}
.rtmd-stat-card:hover { transform: translateY(-4px); }

.rtmd-stat-icon { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.rtmd-stat-value { font-size: 26px; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.rtmd-stat-label { font-size: 12.5px; opacity: 0.92; }

.rtmd-stat-card.grad-1 { background: linear-gradient(135deg,#6366f1,#818cf8); }
.rtmd-stat-card.grad-2 { background: linear-gradient(135deg,#f59e0b,#fbbf24); }
.rtmd-stat-card.grad-3 { background: linear-gradient(135deg,#10b981,#34d399); }
.rtmd-stat-card.grad-4 { background: linear-gradient(135deg,#ec4899,#f472b6); }
.rtmd-stat-card.grad-5 { background: linear-gradient(135deg,#0ea5e9,#38bdf8); }
.rtmd-stat-card.grad-6 { background: linear-gradient(135deg,#d4af37,#f2d472); }
.rtmd-stat-card.grad-7 { background: linear-gradient(135deg,#8b5cf6,#a78bfa); }
.rtmd-stat-card.grad-8 { background: linear-gradient(135deg,#ef4444,#f87171); }

/* ---------- Widgets ---------- */

.rtmd-widget-grid {
	width: 100%;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	align-items: start;
	gap: 18px;
}
.rtmd-widget {
	padding: 18px;
}
.rtmd-widget-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 10px; }
.rtmd-widget-head h2 { font-size: 15px; margin: 0; font-weight: var(--rtmd-heading-weight, 700); }
.rtmd-link { color: var(--rtmd-primary); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; flex-shrink: 0; }
.rtmd-link:hover { text-decoration: underline; }

.rtmd-mini-order-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rtmd-mini-order-list li + li { border-top: 1px solid var(--rtmd-border); }
.rtmd-mini-order {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-areas:
		"id badge"
		"date total";
	align-items: center;
	gap: 2px 12px;
	padding: 9px 4px;
	border-radius: 8px;
	text-decoration: none;
	color: var(--rtmd-text);
	font-size: 12.5px;
}
.rtmd-mini-order:hover { background: var(--rtmd-surface-2); }
.rtmd-mini-order-id { grid-area: id; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rtmd-mini-order-date { grid-area: date; color: var(--rtmd-text-muted); font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rtmd-mini-order .rtmd-badge { grid-area: badge; justify-self: end; }
.rtmd-mini-order-total { grid-area: total; justify-self: end; font-weight: 700; white-space: nowrap; }

.rtmd-product-strip {
	display: flex;
	gap: 14px;
	overflow-x: auto;
	overflow-y: hidden;
	padding-bottom: 10px;
	max-width: 100%;
	scrollbar-width: thin;
	scrollbar-color: var(--rtmd-border) transparent;
	scroll-behavior: smooth;
}
.rtmd-product-strip::-webkit-scrollbar { height: 4px; }
.rtmd-product-strip::-webkit-scrollbar-track { background: transparent; }
.rtmd-product-strip::-webkit-scrollbar-thumb { background: var(--rtmd-border); border-radius: 99px; }
.rtmd-product-strip::-webkit-scrollbar-thumb:hover { background: var(--rtmd-text-faint); }

.rtmd-scroll-track { position: relative; }
.rtmd-scroll-arrow {
	position: absolute !important;
	top: 22px;
	width: 30px !important;
	height: 30px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	border-radius: 50% !important;
	background: var(--rtmd-surface) !important;
	border: 1px solid var(--rtmd-border) !important;
	color: var(--rtmd-text) !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	cursor: pointer !important;
	box-shadow: var(--rtmd-shadow) !important;
	z-index: 2;
	padding: 0 !important;
}
.rtmd-scroll-arrow[hidden] { display: none !important; }
.rtmd-scroll-arrow-prev { left: -6px; }
.rtmd-scroll-arrow-next { right: -6px; }
.rtmd-scroll-arrow .material-symbols-outlined { font-size: 18px; }
.rtmd-product-chip { flex: 0 0 76px; text-align: center; text-decoration: none; color: var(--rtmd-text); font-size: 11.5px; }
.rtmd-product-chip img { width: 60px; height: 60px; object-fit: cover; border-radius: 10px; margin-bottom: 5px; border: 1px solid var(--rtmd-border); background: var(--rtmd-surface-2); display: block; }
.rtmd-product-chip span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rtmd-coupon-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.rtmd-coupon-chip {
	display: flex;
	align-items: center;
	gap: 6px;
	background: var(--rtmd-surface-2);
	border: 1px dashed var(--rtmd-primary);
	border-radius: 10px;
	padding: 8px 12px;
	font-size: 13px;
}
.rtmd-coupon-chip .material-symbols-outlined { color: var(--rtmd-primary); font-size: 18px; }
.rtmd-coupon-chip code { font-weight: 700; }

/* ---------- Badges ---------- */

.rtmd-badge {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 11.5px;
	font-weight: 700;
	text-transform: capitalize;
	white-space: nowrap;
}
.rtmd-badge-green  { background: #dcfce7; color: #15803d; }
.rtmd-badge-orange { background: #ffedd5; color: #c2410c; }
.rtmd-badge-red    { background: #fee2e2; color: #b91c1c; }
.rtmd-badge-blue   { background: #dbeafe; color: #1d4ed8; }
.rtmd-badge-gray   { background: #f1f2f4; color: #4b5563; }

body.rtmd-dark .rtmd-badge-green  { background: #14532d55; color: #4ade80; }
body.rtmd-dark .rtmd-badge-orange { background: #7c2d1255; color: #fb923c; }
body.rtmd-dark .rtmd-badge-red    { background: #7f1d1d55; color: #f87171; }
body.rtmd-dark .rtmd-badge-blue   { background: #1e3a8a55; color: #60a5fa; }
body.rtmd-dark .rtmd-badge-gray   { background: #37415155; color: #cbd5e1; }

/* ---------- Orders table ---------- */

.rtmd-orders-table-wrap, .rtmd-downloads-wrap { width: 100%; overflow-x: auto; padding: 8px; box-sizing: border-box; }
.rtmd-orders-table, .rtmd-order-items-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.rtmd-orders-table th, .rtmd-order-items-table th {
	text-align: left;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--rtmd-text-faint);
	padding: 12px 14px;
	border-bottom: 1px solid var(--rtmd-border);
}
.rtmd-orders-table td, .rtmd-order-items-table td {
	padding: 14px;
	border-bottom: 1px solid var(--rtmd-border);
	font-size: 14px;
	vertical-align: middle;
}
.rtmd-order-row:hover { background: var(--rtmd-surface-2); }
.rtmd-order-number { font-weight: 700; color: var(--rtmd-primary); text-decoration: none; }

.rtmd-product-cell { display: flex; align-items: center; gap: 10px; }
.rtmd-product-cell img { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; border: 1px solid var(--rtmd-border); }

.rtmd-order-items-table .rtmd-col-qty,
.rtmd-order-items-table .rtmd-col-total {
	text-align: right;
	white-space: nowrap;
	vertical-align: top;
}
.rtmd-order-items-table th.rtmd-col-qty,
.rtmd-order-items-table th.rtmd-col-total {
	text-align: right;
}
.rtmd-order-item-product { display: flex; gap: 12px; align-items: flex-start; }
.rtmd-order-item-thumb img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; border: 1px solid var(--rtmd-border); display: block; }
.rtmd-order-item-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rtmd-order-item-name { font-weight: 600; }
.rtmd-order-item-name a { color: inherit; text-decoration: none; }
.rtmd-order-item-name a:hover { color: var(--rtmd-primary); }
.rtmd-order-item-meta { font-size: 12.5px; color: var(--rtmd-text-muted); }
.rtmd-order-item-meta ul, .rtmd-order-item-meta table { margin: 2px 0 0; }
.rtmd-order-item-meta ul { list-style: none; padding: 0; }
.rtmd-order-item-meta li, .rtmd-order-item-meta tr { padding: 1px 0; }
.rtmd-order-item-note { font-size: 12px; color: var(--rtmd-text-faint); font-style: italic; }

.rtmd-row-actions { display: flex; gap: 6px; }
.rtmd-icon-btn {
	width: 34px !important;
	height: 34px !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	border-radius: 9px !important;
	background: var(--rtmd-surface-2) !important;
	color: var(--rtmd-text-muted) !important;
	border: 1px solid var(--rtmd-border) !important;
	cursor: pointer !important;
	text-decoration: none !important;
	padding: 0 !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	line-height: normal !important;
}
.rtmd-icon-btn:hover { color: var(--rtmd-primary); border-color: var(--rtmd-primary); }
.rtmd-icon-btn-primary { background: var(--rtmd-primary) !important; color: #fff !important; border-color: var(--rtmd-primary) !important; }
.rtmd-icon-btn-primary:hover { opacity: 0.9; color: #fff; }
.rtmd-icon-btn .material-symbols-outlined { font-size: 18px; }

.rtmd-pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 18px; }
.rtmd-pagination-status { font-size: 13px; color: var(--rtmd-text-muted); }

.rtmd-empty-state { text-align: center; padding: 48px 24px; color: var(--rtmd-text-muted); }
.rtmd-empty-state .material-symbols-outlined { font-size: 40px; color: var(--rtmd-text-faint); margin-bottom: 10px; }
.rtmd-extension-note { font-size: 12.5px; margin-top: 6px; }
.rtmd-extension-dev-note { font-size: 11.5px; margin-top: 12px; color: var(--rtmd-text-faint); }
.rtmd-extension-dev-note code { background: var(--rtmd-surface-2); padding: 2px 6px; border-radius: 4px; }

/* ---------- Order details ---------- */

.rtmd-timeline-card { margin-bottom: 22px; }
.rtmd-timeline-card h2 { margin: 0 0 20px; font-size: 16px; }
.rtmd-timeline { list-style: none; display: flex; margin: 0; padding: 0; }
.rtmd-timeline-step {
	flex: 1;
	text-align: center;
	position: relative;
	font-size: 11.5px;
	color: var(--rtmd-text-faint);
}
.rtmd-timeline-step::before {
	content: '';
	position: absolute;
	top: 7px;
	left: -50%;
	width: 100%;
	height: 3px;
	background: var(--rtmd-border);
	z-index: 0;
}
.rtmd-timeline-step:first-child::before { display: none; }
.rtmd-timeline-dot {
	display: block;
	width: 16px; height: 16px;
	border-radius: 50%;
	background: var(--rtmd-border);
	margin: 0 auto 8px;
	position: relative;
	z-index: 1;
	border: 3px solid var(--rtmd-surface);
}
.rtmd-timeline-step-done .rtmd-timeline-dot { background: var(--rtmd-primary); }
.rtmd-timeline-step-done::before { background: var(--rtmd-primary); }
.rtmd-timeline-step-done { color: var(--rtmd-text); }
.rtmd-timeline-step-current .rtmd-timeline-dot { box-shadow: 0 0 0 4px color-mix(in srgb, var(--rtmd-primary) 25%, transparent); }
.rtmd-timeline-step-current { color: var(--rtmd-primary); font-weight: 700; }

.rtmd-status-banner {
	display: flex; align-items: center; gap: 10px;
	margin-bottom: 22px;
	font-weight: 600;
}

.rtmd-order-grid { width: 100%; display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; margin-bottom: 20px; box-sizing: border-box; }
.rtmd-order-side { display: flex; flex-direction: column; gap: 20px; }
.rtmd-order-items-card h2, .rtmd-order-summary-card h2, .rtmd-address-card h2, .rtmd-order-notes-card h2 { font-size: 16px; margin: 0 0 14px; }
.rtmd-order-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.rtmd-kv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rtmd-kv-list li {
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: 10px 0;
	border-bottom: 1px solid var(--rtmd-border);
	font-size: 13.5px;
}
.rtmd-kv-list li:last-child { border-bottom: none; padding-bottom: 0; }
.rtmd-kv-list li:first-child { padding-top: 0; }
.rtmd-kv-list li span:first-child {
	color: var(--rtmd-text-muted);
	font-size: 11.5px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	font-weight: 600;
}
.rtmd-kv-list li span:last-child {
	font-weight: 600;
	word-break: break-word;
}

.rtmd-address-card address { font-style: normal; font-size: 13.5px; line-height: 1.7; color: var(--rtmd-text-muted); }
.rtmd-address-phone { margin: 6px 0 0; font-size: 13px; }

.rtmd-address-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.rtmd-address-card-head h2 { margin: 0; flex: 1; }
.rtmd-address-card-head .material-symbols-outlined:first-child { color: var(--rtmd-primary); }

.rtmd-address-grid { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; box-sizing: border-box; }
.rtmd-address-intro { margin-bottom: 18px; }

.rtmd-order-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.rtmd-order-note-date { margin: 0 0 4px; font-size: 12px; color: var(--rtmd-text-faint); }
.rtmd-order-note-content { font-size: 13.5px; }

/* ---------- Downloads ---------- */
.rtmd-downloads-table .rtmd-col-actions { text-align: right; }

/* ---------- Account form ---------- */
.rtmd-account-form-card { max-width: 760px; }

.rtmd-form-section-title {
	font-size: 16px;
	font-weight: var(--rtmd-heading-weight, 700);
	margin: 0 0 16px;
}
.rtmd-form-section-title-spaced { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--rtmd-border); }

.rtmd-checkbox-label { display: flex !important; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.rtmd-checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--rtmd-primary); cursor: pointer; }

/* WooCommerce's woocommerce_form_field() output — used for the
 * billing/shipping sections so the store's actual configured address
 * fields (and country/state dropdowns) render correctly — comes with
 * its own .form-row wrapper classes. Styled here to match the rest
 * of the form rather than overridden/replaced. */
.rtmd-address-fields-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4px 16px;
}
.rtmd-address-fields-grid .form-row {
	margin: 0 0 16px !important;
	padding: 0 !important;
	float: none !important;
	width: auto !important;
}
.rtmd-address-fields-grid .form-row-wide { grid-column: 1 / -1; }
.rtmd-address-fields-grid .form-row label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 6px;
	color: var(--rtmd-text);
}
.rtmd-address-fields-grid .form-row .required { color: var(--rtmd-danger); text-decoration: none; border: 0; }
.rtmd-address-fields-grid .form-row .woocommerce-input-wrapper { display: block; width: 100%; }
.rtmd-address-fields-grid .input-text,
.rtmd-address-fields-grid select,
.rtmd-address-fields-grid textarea {
	width: 100% !important;
	padding: 11px 14px !important;
	border-radius: 10px !important;
	border: 1px solid var(--rtmd-border) !important;
	background: var(--rtmd-surface-2) !important;
	color: var(--rtmd-text) !important;
	font-size: 14px !important;
	font-family: inherit !important;
	box-sizing: border-box !important;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.rtmd-address-fields-grid .input-text:focus,
.rtmd-address-fields-grid select:focus,
.rtmd-address-fields-grid textarea:focus {
	outline: none;
	border-color: var(--rtmd-primary) !important;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--rtmd-primary) 18%, transparent);
}
.rtmd-address-fields-grid .select2-container .select2-selection--single {
	height: 44px !important;
	display: flex !important;
	align-items: center !important;
	border-radius: 10px !important;
	border: 1px solid var(--rtmd-border) !important;
	background: var(--rtmd-surface-2) !important;
}
.rtmd-form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rtmd-form-field { margin: 0 0 16px; }
.rtmd-form-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.rtmd-input, .rtmd-account-form select, .rtmd-account-form textarea {
	width: 100%;
	padding: 11px 14px;
	border-radius: 10px;
	border: 1px solid var(--rtmd-border);
	background: var(--rtmd-surface-2);
	color: var(--rtmd-text);
	font-size: 14px;
	font-family: inherit;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.rtmd-input:focus {
	outline: none;
	border-color: var(--rtmd-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--rtmd-primary) 18%, transparent);
}
.rtmd-field-hint { display: block; font-size: 11.5px; color: var(--rtmd-text-faint); margin-top: 4px; }
.rtmd-password-fieldset { border: none; padding: 0; margin: 8px 0 18px; }
.rtmd-password-fieldset legend { font-size: 14px; font-weight: 700; margin-bottom: 12px; padding: 0; }

/* ---------- Loading skeletons ---------- */
.rtmd-skeleton {
	background: linear-gradient(90deg, var(--rtmd-surface-2) 25%, var(--rtmd-border) 37%, var(--rtmd-surface-2) 63%);
	background-size: 400% 100%;
	animation: rtmdSkeleton 1.4s ease infinite;
	border-radius: 8px;
}

/* ---------- Animations ---------- */
@keyframes rtmdFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rtmdSkeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@keyframes rtmdRipple { from { transform: scale(0); opacity: 0.5; } to { transform: scale(18); opacity: 0; } }

body.rtmd-account-page.rtmd-no-animations *,
body.rtmd-account-page.rtmd-no-animations *::before,
body.rtmd-account-page.rtmd-no-animations *::after {
	animation: none !important;
	transition: none !important;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
	.rtmd-order-grid { grid-template-columns: 1fr; }
}

@media (max-width: 880px) {
	.rtmd-layout { flex-direction: column; }

	.rtmd-mobile-nav-toggle {
		display: flex;
	}

	.rtmd-sidebar {
		flex-basis: auto;
		width: min(320px, 86vw);
		max-width: 86vw;
		position: fixed !important;
		top: 0 !important;
		left: 0 !important;
		bottom: 0 !important;
		z-index: 2147483647 !important;
		border-radius: 0;
		transform: translateX(-105%);
		transition: transform 0.3s ease;
		overflow-y: auto;
	}
	.rtmd-sidebar.rtmd-sidebar-open { transform: translateX(0); }

	.rtmd-sidebar-overlay {
		position: fixed !important;
		inset: 0 !important;
		background: rgba(15, 17, 21, 0.5);
		z-index: 2147483646 !important;
	}
	.rtmd-sidebar-overlay[hidden] { display: none; }

	.rtmd-form-row-2 { grid-template-columns: 1fr; }
	.rtmd-address-fields-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
	.rtmd-dashboard-inner { margin: 16px auto; padding: 0 14px; }
	.rtmd-page-title { font-size: 21px; }
	.rtmd-stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
	.rtmd-stat-card { padding: 14px; }
	.rtmd-stat-value { font-size: 20px; }

	.rtmd-widget-grid { grid-template-columns: 1fr; gap: 14px; }
	.rtmd-card { padding: 16px; }
	.rtmd-widget-head h2 { font-size: 15px; }

	.rtmd-mini-order { font-size: 12px; padding: 8px 4px; gap: 2px 10px; }
	.rtmd-mini-order .rtmd-badge { font-size: 10.5px; padding: 3px 8px; }

	.rtmd-orders-table thead { display: none; }
	.rtmd-orders-table, .rtmd-orders-table tbody, .rtmd-orders-table tr, .rtmd-orders-table td { display: block; width: 100%; }
	.rtmd-orders-table tr { border: 1px solid var(--rtmd-border); border-radius: 12px; margin-bottom: 12px; padding: 6px; }
	.rtmd-orders-table td {
		display: flex;
		justify-content: space-between;
		align-items: center;
		border-bottom: none;
		padding: 8px 10px;
	}
	.rtmd-orders-table td::before {
		content: attr(data-label);
		font-size: 11px;
		text-transform: uppercase;
		color: var(--rtmd-text-faint);
		font-weight: 700;
		margin-right: 10px;
	}
}

/* ---------- Accessibility ---------- */
.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.rtmd-account-page a:focus-visible,
.rtmd-account-page button:focus-visible,
.rtmd-account-page input:focus-visible {
	outline: 2px solid var(--rtmd-primary);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.rtmd-account-page *, .rtmd-account-page *::before, .rtmd-account-page *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

@media (prefers-contrast: more) {
	.rtmd-account-page { --rtmd-border: #7a7a7a; --rtmd-text-muted: #333; }
}

/* ---------- Print (invoice) ----------
 * Powers the "Print / Download Invoice" button — the browser's own
 * print dialog offers "Save as PDF" on every modern OS, so this
 * needs no invoice-generating plugin to give a genuinely working
 * download. Hides everything except the order items and summary.
 */
@media print {
	.rtmd-sidebar,
	.rtmd-sidebar-overlay,
	.rtmd-mobile-nav-toggle,
	.rtmd-order-actions,
	.rtmd-page-head a,
	.rtmd-timeline-card,
	.rtmd-order-notes-card,
	.rtmd-scroll-arrow {
		display: none !important;
	}
	.rtmd-layout { display: block !important; }
	.rtmd-content { width: 100% !important; }
	.rtmd-order-grid { display: block !important; }
	.rtmd-order-side { margin-top: 20px; }
	.rtmd-card {
		box-shadow: none !important;
		border: 1px solid #ddd !important;
		break-inside: avoid;
	}
	body.rtmd-account-page { background: #fff !important; }
}
