/* SOSMART Be3M3ana – customer / affiliate / auth spaces. Logical properties → RTL & LTR. */
:root {
	--b3m-navy: var(--sos-navy, #0B1F3A);
	--b3m-orange: var(--sos-orange, #F7941D);
	--b3m-bg: #F3F5F8;
	--b3m-card: #fff;
	--b3m-ink: #0F1B2D;
	--b3m-muted: #64748B;
	--b3m-line: #E2E8F0;
	--b3m-ok: #15803D;
	--b3m-warn: #B45309;
	--b3m-bad: #B91C1C;
	--b3m-info: #1D4ED8;
	--b3m-r: 14px;
	--b3m-sh: 0 1px 2px rgba(15, 27, 45, .06), 0 4px 16px rgba(15, 27, 45, .06);
}

.b3m-area { background: var(--b3m-bg); }
.b3m-area *, .b3m-auth-wrap * { box-sizing: border-box; }

/* Buttons */
.b3m-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 10px 18px; border: 1px solid transparent; border-radius: 10px;
	font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
	transition: background .15s, transform .1s;
}
.b3m-btn:active { transform: scale(.97); }
.b3m-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--b3m-orange) 50%, transparent); outline-offset: 2px; }
.b3m-btn--orange { background: var(--b3m-orange); color: #fff; }
.b3m-btn--orange:hover { background: color-mix(in srgb, var(--b3m-orange) 85%, #000); color: #fff; }
.b3m-btn--navy { background: var(--b3m-navy); color: #fff; }
.b3m-btn--navy:hover { background: color-mix(in srgb, var(--b3m-navy) 85%, #fff); color: #fff; }
.b3m-btn--ghost { background: #fff; color: var(--b3m-navy); border-color: var(--b3m-line); }
.b3m-btn--ghost:hover { border-color: var(--b3m-navy); }
.b3m-btn--block { width: 100%; }
.b3m-btn--wa { background: #25D366; color: #fff; }
.b3m-btn--fb { background: #1877F2; color: #fff; }
.b3m-btn--ms { background: #7B61FF; color: #fff; }

/* Layout */
.b3m-app {
	display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px;
	max-width: 1240px; margin: 0 auto; padding: 24px 16px 48px;
}
.b3m-side {
	background: var(--b3m-navy); color: #fff; border-radius: var(--b3m-r);
	padding: 16px 10px; align-self: start; position: sticky; top: 16px;
}
.b3m-side__who { display: flex; gap: 10px; align-items: center; padding: 6px 10px 16px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 8px; }
.b3m-side__who img { border-radius: 50%; }
.b3m-side__who strong { display: block; line-height: 1.3; }
.b3m-side__who small { color: #CBD5E1; }
.b3m-side nav a {
	display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
	color: #CBD5E1; text-decoration: none; font-weight: 600;
}
.b3m-side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.b3m-side nav a.is-active { background: color-mix(in srgb, var(--b3m-orange) 18%, transparent); color: var(--b3m-orange); }
.b3m-side nav hr { border: 0; border-top: 1px solid rgba(255,255,255,.12); margin: 8px 4px; }
.b3m-side .b3m-switch { color: #fff; }
.b3m-badge { margin-inline-start: auto; background: var(--b3m-orange); color: #fff; font-style: normal; font-size: 12px; border-radius: 999px; padding: 0 8px; }
.b3m-main { min-width: 0; }
.b3m-bottom { display: none; }

.b3m-page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.b3m-page-head h1 { margin: 0; font-size: 26px; color: var(--b3m-navy); }
.b3m-page-head p { margin: 4px 0 0; color: var(--b3m-muted); }
.b3m-hello { display: flex; gap: 14px; align-items: center; }
.b3m-hello img { border-radius: 50%; }

/* Cards & grids */
.b3m-card { background: var(--b3m-card); border-radius: var(--b3m-r); box-shadow: var(--b3m-sh); padding: 18px; margin-bottom: 18px; }
.b3m-card h2 { font-size: 18px; margin: 0 0 12px; color: var(--b3m-navy); }
.b3m-card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.b3m-card__head a { font-weight: 600; color: var(--b3m-orange); text-decoration: none; }
.b3m-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.b3m-grid > .b3m-card { margin-bottom: 0; }
.b3m-grid + .b3m-card, .b3m-grid + .b3m-grid { margin-top: 18px; }

.b3m-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.b3m-kpi { background: #fff; border-radius: var(--b3m-r); box-shadow: var(--b3m-sh); padding: 14px 16px; position: relative; }
.b3m-kpi small { display: block; color: var(--b3m-muted); font-size: 13px; padding-inline-end: 40px; }
.b3m-kpi strong { display: block; font-size: 21px; color: var(--b3m-navy); margin-top: 4px; font-variant-numeric: tabular-nums; }
.b3m-kpi__ic { position: absolute; inset-inline-end: 12px; top: 12px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #EEF2F7; color: var(--b3m-navy); }
.b3m-kpi--accent { background: var(--b3m-navy); }
.b3m-kpi--accent small { color: #CBD5E1; }
.b3m-kpi--accent strong { color: #fff; }
.b3m-kpi--accent .b3m-kpi__ic { background: var(--b3m-orange); color: #fff; }

/* Tables */
.b3m-table-wrap { overflow-x: auto; }
.b3m-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.b3m-table th { text-align: start; color: var(--b3m-muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--b3m-line); white-space: nowrap; }
.b3m-table td { padding: 10px 8px; border-bottom: 1px solid var(--b3m-line); vertical-align: top; }
.b3m-table a { color: var(--b3m-navy); font-weight: 700; }
.b3m-pos { color: var(--b3m-ok); }
.b3m-neg { color: var(--b3m-bad); }

.b3m-pill { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.b3m-pill--ok { background: #DCFCE7; color: var(--b3m-ok); }
.b3m-pill--warn { background: #FEF3C7; color: var(--b3m-warn); }
.b3m-pill--bad { background: #FEE2E2; color: var(--b3m-bad); }
.b3m-pill--info { background: #DBEAFE; color: var(--b3m-info); }
.b3m-pill--muted { background: #E2E8F0; color: #334155; }

.b3m-muted { color: var(--b3m-muted); }
.b3m-small { font-size: 13px; }
.b3m-accent { color: var(--b3m-orange); font-weight: 700; }
.b3m-code { font-family: ui-monospace, monospace; background: #FFF1E0; color: var(--b3m-navy); padding: 2px 8px; border-radius: 6px; letter-spacing: 1px; }

/* Empty states, notes, alerts */
.b3m-empty { text-align: center; padding: 28px 12px; color: var(--b3m-muted); }
.b3m-empty .b3m-ic { color: #94A3B8; }
.b3m-empty p { margin: 8px 0 14px; }
.b3m-notes { list-style: none; margin: 0; padding: 0; }
.b3m-notes li { padding: 10px 12px; border-radius: 10px; margin-bottom: 6px; background: #F8FAFC; }
.b3m-notes li.is-unread { background: #FFF7EC; border-inline-start: 3px solid var(--b3m-orange); }
.b3m-notes p { margin: 0; }
.b3m-notes small { color: var(--b3m-muted); }
.b3m-alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 600; }
.b3m-alert--success { background: #DCFCE7; color: #14532D; }
.b3m-alert--error { background: #FEE2E2; color: #7F1D1D; }
.b3m-alert--info { background: #FEF3C7; color: #78350F; }
.b3m-cta { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-inline-start: 4px solid var(--b3m-orange); }
.b3m-cta h2 { margin-bottom: 4px; }
.b3m-cta p { margin: 0; color: var(--b3m-muted); }
.b3m-state { text-align: center; padding: 32px 18px; }
.b3m-explain ol, .b3m-explain ul { margin: 0; padding-inline-start: 20px; }
.b3m-explain li { margin-bottom: 6px; }

/* Forms */
.b3m-form label, .b3m-form legend { display: block; font-size: 14px; font-weight: 600; color: var(--b3m-ink); margin: 12px 0 6px; }
.b3m-form input[type=text], .b3m-form input[type=email], .b3m-form input[type=tel], .b3m-form input[type=password],
.b3m-form input[type=number], .b3m-form select, .b3m-form textarea, .b3m-copy input, .b3m-search input {
	width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--b3m-line); border-radius: 10px;
	font: inherit; background: #fff; color: var(--b3m-ink);
}
.b3m-form input:focus, .b3m-form select:focus, .b3m-form textarea:focus { outline: none; border-color: var(--b3m-orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--b3m-orange) 20%, transparent); }
.b3m-form button[type=submit], .b3m-form > button { margin-top: 16px; }
.b3m-form fieldset { border: 0; padding: 0; margin: 0; }
.b3m-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.b3m-check { display: flex !important; gap: 8px; align-items: flex-start; font-weight: 500 !important; }
.b3m-check input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.b3m-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.b3m-chip { margin: 0 !important; }
.b3m-chip input { position: absolute; opacity: 0; }
.b3m-chip span { display: inline-block; padding: 8px 14px; border: 1px solid var(--b3m-line); border-radius: 999px; cursor: pointer; font-weight: 600; }
.b3m-chip input:checked + span { background: var(--b3m-navy); border-color: var(--b3m-navy); color: #fff; }
.b3m-chip input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--b3m-orange) 50%, transparent); }
.b3m-avatar-field { display: flex; align-items: center; gap: 14px; }
.b3m-avatar-field img { border-radius: 50%; }
.b3m-avatar-field label { margin: 0; }
.b3m-copy { display: flex; gap: 8px; }
.b3m-copy input { flex: 1; min-width: 0; background: #F8FAFC; }
.b3m-code-input { font-family: ui-monospace, monospace; font-weight: 700; letter-spacing: 1px; }
.b3m-share { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.b3m-share .b3m-btn { flex: 1; min-width: 110px; }
.b3m-search { display: flex; gap: 8px; }
.b3m-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; }

/* Affiliate product cards */
.b3m-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.b3m-product { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.b3m-product__img img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: #EEF2F7; }
.b3m-product h3 { margin: 0; font-size: 16px; color: var(--b3m-navy); }
.b3m-product__facts { margin: 0; display: grid; gap: 4px; font-size: 14px; }
.b3m-product__facts div { display: flex; justify-content: space-between; gap: 8px; }
.b3m-product__facts dt { color: var(--b3m-muted); }
.b3m-product__facts dd { margin: 0; text-align: end; }

/* Order detail */
.b3m-track { list-style: none; display: flex; gap: 8px; margin: 0 0 18px; padding: 0; }
.b3m-track li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--b3m-muted); position: relative; text-align: center; }
.b3m-track li span { width: 22px; height: 22px; border-radius: 50%; background: var(--b3m-line); border: 4px solid #fff; box-shadow: 0 0 0 1px var(--b3m-line); z-index: 1; }
.b3m-track li::before { content: ""; position: absolute; top: 10px; inset-inline-start: -50%; width: 100%; height: 3px; background: var(--b3m-line); }
.b3m-track li:first-child::before { display: none; }
.b3m-track li.is-done { color: var(--b3m-navy); }
.b3m-track li.is-done span { background: var(--b3m-orange); }
.b3m-track li.is-done::before { background: var(--b3m-orange); }
.b3m-track--sm { margin: 8px 0; }
.b3m-track--sm li { font-size: 11px; font-weight: 600; }
.b3m-track--sm li span { width: 16px; height: 16px; border-width: 3px; }
.b3m-track--sm li::before { top: 7px; }
.b3m-totals { margin: 12px 0 0; display: grid; gap: 6px; }
.b3m-totals div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--b3m-line); padding-bottom: 6px; }
.b3m-totals dt { color: var(--b3m-muted); }
.b3m-totals dd { margin: 0; text-align: end; font-weight: 600; }

/* Shop integration */
.b3m-pts-badge { display: inline-block; font-size: 12px; font-weight: 700; color: var(--b3m-navy); background: #EEF2F7; border-radius: 6px; padding: 1px 8px; margin: 4px 0; }
.b3m-pts-box { background: #FFF7EC; color: var(--b3m-navy); border-radius: 10px; padding: 10px 14px; font-weight: 700; margin: 12px 0; }
.b3m-aff-box { border: 2px dashed var(--b3m-orange); border-radius: 12px; padding: 14px; margin: 12px 0; display: grid; gap: 8px; }

/* Auth */
.b3m-auth-wrap { background: var(--b3m-bg); padding: 32px 16px 56px; }
.b3m-auth { max-width: 460px; margin: 0 auto; }
.b3m-auth__brand { text-align: center; margin-bottom: 16px; }
.b3m-auth__brand h1 { color: var(--b3m-navy); margin: 0 0 4px; }
.b3m-auth__brand p { color: var(--b3m-muted); margin: 0; }
.b3m-auth__links { text-align: center; margin: 14px 0 0; }
.b3m-auth__links a, .b3m-auth__switch a { color: var(--b3m-orange); font-weight: 700; }
.b3m-auth__switch { text-align: center; }
.b3m-auth .woocommerce-error, .b3m-auth .woocommerce-message, .b3m-auth .woocommerce-info { list-style: none; margin: 0 0 16px; padding: 12px 16px; border-radius: 12px; }
.b3m-auth .woocommerce-error { background: #FEE2E2; color: #7F1D1D; }

.b3m-toast { position: fixed; inset-inline-start: 16px; bottom: 84px; background: var(--b3m-ok); color: #fff; padding: 10px 16px; border-radius: 12px; box-shadow: var(--b3m-sh); z-index: 9999; font-weight: 700; }

@media (max-width: 900px) {
	.b3m-app { grid-template-columns: 1fr; padding: 16px 16px 96px; }
	.b3m-side { display: none; }
	.b3m-bottom {
		display: flex; position: fixed; inset-inline: 0; bottom: 0; z-index: 50;
		background: #fff; border-top: 1px solid var(--b3m-line);
		padding-bottom: env(safe-area-inset-bottom);
	}
	.b3m-side.is-open { display: block; position: fixed; inset-inline: 12px; bottom: 76px; top: auto; z-index: 60; max-height: calc(100vh - 120px); overflow-y: auto; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
	.b3m-more { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; font: inherit; font-size: 11px; font-weight: 600; color: var(--b3m-muted); background: none; border: 0; position: relative; cursor: pointer; }
	.b3m-more[aria-expanded="true"] { color: var(--b3m-orange); }
	.b3m-dot { position: absolute; top: 6px; inset-inline-end: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--b3m-orange); }
	.b3m-bottom a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; font-size: 11px; font-weight: 600; color: var(--b3m-muted); text-decoration: none; text-align: center; }
	.b3m-bottom a.is-active { color: var(--b3m-orange); }
	.b3m-row { grid-template-columns: 1fr; }
	.b3m-page-head h1 { font-size: 22px; }
	/* Tables become cards on phones */
	.b3m-table thead { display: none; }
	.b3m-table tr { display: block; border-bottom: 1px solid var(--b3m-line); padding: 8px 0; }
	.b3m-table td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 0; text-align: end; }
	.b3m-table td::before { content: attr(data-label); color: var(--b3m-muted); font-weight: 600; text-align: start; }
}
@media (prefers-reduced-motion: reduce) { .b3m-btn { transition: none; } }

/* v0.7 – order tracking, WhatsApp codes */
.b3m-pill--accent { background: #FFEDD5; color: #9A3412; }
.b3m-track--dated li small { font-weight: 500; color: var(--b3m-muted); font-size: 11px; }
.b3m-track li.is-current span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--b3m-orange) 35%, transparent); }
.b3m-tracking { background: #F8FAFC; border: 1px solid var(--b3m-line); border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.b3m-tracking a { color: var(--b3m-orange); font-weight: 700; }
.b3m-track-page { max-width: 720px; }
.b3m-thankyou-track { border: 2px solid var(--b3m-orange); margin: 0 0 24px; }
.b3m-thankyou-track h2 { margin: 0 0 6px; color: var(--b3m-navy); }
.b3m-thankyou-track .b3m-track { margin-top: 16px; }
.b3m-thankyou-track__actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.b3m-track-page .b3m-page-head h2 { margin: 0; color: var(--b3m-navy); }
.b3m-lines { list-style: none; margin: 12px 0; padding: 0; }
.b3m-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--b3m-line); }
.b3m-lines__total { font-size: 17px; border-bottom: 0 !important; }
.b3m-btn--wa { background: #25D366; color: #06331A; }
.b3m-btn--wa:hover { background: #1EBE5B; color: #06331A; }
.b3m-otp-input { letter-spacing: .4em; font-size: 20px !important; text-align: center; font-variant-numeric: tabular-nums; }
.b3m-otp-send { margin-top: 10px; }
.b3m-linkbtn { background: none; border: 0; color: var(--b3m-orange); font-weight: 700; cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.b3m-form label .b3m-pill { margin-inline-start: 6px; vertical-align: middle; }
@media (max-width: 600px) {
	.b3m-track--dated { overflow-x: auto; padding-bottom: 6px; }
	.b3m-track--dated li { min-width: 64px; font-size: 11px; }
}
