/* SolomaxHub app (11.6.0-solomax.55): install banner, install steps sheet, menu items and app-mode spacing.
 * Loaded on the storefront (wp_enqueue_scripts) and in the customer portal (acp_panel_head).
 * Dark mode: html[data-sx-theme="dark"] on the storefront, body[data-ux-theme="dark"] in the portal. */

.sx-pwa-banner,
.sx-pwa-sheet {
	--sxp-card: #FFFFFF;
	--sxp-line: #F3E2D2;
	--sxp-ink: #1C1410;
	--sxp-muted: #6B5E55;
	--sxp-soft: #FFF1E6;
	--sxp-brand: #FD7702;
	--sxp-brand-hover: #E86A00;
	--sxp-on-brand: #1C1410; /* brand ink on orange: 6.7:1 (the portal's primary buttons use the same) */
}

html[data-sx-theme="dark"] .sx-pwa-banner,
html[data-sx-theme="dark"] .sx-pwa-sheet,
body[data-ux-theme="dark"] .sx-pwa-banner,
body[data-ux-theme="dark"] .sx-pwa-sheet {
	--sxp-rim: rgba(255, 236, 220, 0.18);
	--sxp-card: #1F1916;
	--sxp-line: rgba(255, 236, 220, 0.12);
	--sxp-ink: #F3EDE6;
	--sxp-muted: #B8AA9C;
	--sxp-soft: #342216;
}

/* The portal and the storefront style their menu links with display:flex !important; keep [hidden] working. */
html body .sx-drawer__nav a[data-sx-install][hidden],
html body.acp-ux .ux-side > a[data-sx-install][hidden],
[data-sx-install][hidden] {
	display: none !important;
}

/* ------------------------------------------------------------ Buttons */
.sx-pwa-banner .sx-pwa-btn,
.sx-pwa-sheet .sx-pwa-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 18px;
	border: 0;
	border-radius: 12px;
	background: var(--sxp-brand);
	color: var(--sxp-on-brand);
	font: inherit;
	font-size: 0.95rem;
	font-weight: 800;
	line-height: 1.2;
	cursor: pointer;
	white-space: nowrap;
}

.sx-pwa-banner .sx-pwa-btn:hover,
.sx-pwa-sheet .sx-pwa-btn:hover { background: var(--sxp-brand-hover); color: var(--sxp-on-brand); }

.sx-pwa-banner .sx-pwa-btn:focus-visible,
.sx-pwa-sheet .sx-pwa-btn:focus-visible,
.sx-pwa-banner .sx-pwa-banner__later:focus-visible,
.sx-pwa-sheet .sx-pwa-sheet__x:focus-visible {
	outline: 3px solid #C2410C; /* the portal's own solid focus ring */
	outline-offset: 2px;
}

html[data-sx-theme="dark"] .sx-pwa-banner .sx-pwa-btn:focus-visible,
html[data-sx-theme="dark"] .sx-pwa-sheet .sx-pwa-btn:focus-visible,
html[data-sx-theme="dark"] .sx-pwa-banner .sx-pwa-banner__later:focus-visible,
html[data-sx-theme="dark"] .sx-pwa-sheet .sx-pwa-sheet__x:focus-visible,
body[data-ux-theme="dark"] .sx-pwa-banner .sx-pwa-btn:focus-visible,
body[data-ux-theme="dark"] .sx-pwa-sheet .sx-pwa-btn:focus-visible,
body[data-ux-theme="dark"] .sx-pwa-banner .sx-pwa-banner__later:focus-visible,
body[data-ux-theme="dark"] .sx-pwa-sheet .sx-pwa-sheet__x:focus-visible {
	outline-color: #FF9A4D;
}

.sx-pwa-sheet .sx-pwa-btn--block { display: flex; width: 100%; min-height: 52px; }

/* ------------------------------------------------------------ Portal banner */
.sx-pwa-banner {
	display: grid;
	grid-template-columns: 44px minmax(0, 1fr);
	align-items: center;
	gap: 12px 14px;
	margin: 0; /* the portal's content grid already spaces its rows */
	padding: 14px 16px;
	border: 1px solid var(--sxp-line);
	border-radius: 18px;
	background: var(--sxp-card);
	color: var(--sxp-ink);
	box-shadow: 0 10px 28px rgba(28, 20, 16, 0.08);
}

.sx-pwa-banner__icon {
	display: block;
	width: 44px;
	height: 44px;
	border-radius: 12px;
}

.sx-pwa-banner__text { min-width: 0; }

.sx-pwa-banner .sx-pwa-banner__text strong {
	display: block;
	color: var(--sxp-ink);
	font-size: 1rem;
	font-weight: 800;
	line-height: 1.3;
}

.sx-pwa-banner .sx-pwa-banner__text span {
	display: block;
	margin-top: 2px;
	color: var(--sxp-muted);
	font-size: 0.9rem;
	line-height: 1.4;
	text-wrap: pretty;
}

.sx-pwa-banner__actions {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	gap: 8px;
}

.sx-pwa-banner__actions .sx-pwa-btn { flex: 1 1 auto; }

.sx-pwa-banner .sx-pwa-banner__later {
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid var(--sxp-line);
	border-radius: 12px;
	background: transparent;
	color: var(--sxp-ink);
	font: inherit;
	font-size: 0.92rem;
	font-weight: 700;
	cursor: pointer;
}

@media (min-width: 640px) {
	.sx-pwa-banner { grid-template-columns: 44px minmax(0, 1fr) auto; }
	.sx-pwa-banner__actions { grid-column: auto; }
	.sx-pwa-banner__actions .sx-pwa-btn { flex: 0 0 auto; }
}

/* ------------------------------------------------------------ Steps sheet */
html.sx-pwa-lock,
html.sx-pwa-lock body { overflow: hidden !important; }

.sx-pwa-sheet {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	overscroll-behavior: contain;
}

.sx-pwa-sheet[hidden] { display: none !important; }

.sx-pwa-sheet__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(22, 18, 15, 0.55);
}

.sx-pwa-sheet__card {
	position: relative;
	width: 100%;
	max-height: calc(100vh - 24px);
	max-height: calc(100dvh - 24px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 22px max(20px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
	border: 1px solid var(--sxp-rim, transparent);
	border-bottom: 0;
	border-radius: 22px 22px 0 0;
	background: var(--sxp-card);
	color: var(--sxp-ink);
	box-shadow: 0 -12px 40px rgba(28, 20, 16, 0.22);
	font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	text-align: left;
}

.sx-pwa-sheet__card:focus { outline: none; }

.sx-pwa-sheet .sx-pwa-nowrap { white-space: nowrap; }

.sx-pwa-sheet .sx-pwa-sheet__x {
	position: absolute;
	top: 12px;
	right: 12px;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--sxp-soft);
	color: var(--sxp-ink);
	cursor: pointer;
}

.sx-pwa-sheet__icon {
	display: block;
	width: 56px;
	height: 56px;
	margin: 0 0 12px;
	border-radius: 14px;
}

.sx-pwa-sheet .sx-pwa-sheet__card h2 {
	margin: 0 44px 4px 0;
	color: var(--sxp-ink);
	font-size: 1.25rem;
	font-weight: 800;
	line-height: 1.3;
	letter-spacing: -0.01em;
}

.sx-pwa-sheet .sx-pwa-sheet__card .sx-pwa-sheet__lead {
	margin: 0 0 14px;
	color: var(--sxp-muted);
	font-size: 0.95rem;
	line-height: 1.45;
}

.sx-pwa-steps {
	margin: 0 0 18px;
	padding: 0;
	list-style: none;
	counter-reset: sxstep;
}

.sx-pwa-steps li {
	display: grid;
	grid-template-columns: 26px 36px minmax(0, 1fr);
	align-items: center;
	gap: 10px;
	padding: 10px 0;
	border-top: 1px solid var(--sxp-line);
	color: var(--sxp-ink);
	font-size: 0.95rem;
	line-height: 1.4;
	counter-increment: sxstep;
}

.sx-pwa-steps li::before {
	content: counter(sxstep);
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--sxp-brand);
	color: var(--sxp-on-brand);
	font-size: 0.85rem;
	font-weight: 800;
}

.sx-pwa-steps li > svg {
	box-sizing: content-box;
	width: 20px;
	height: 20px;
	padding: 8px;
	border-radius: 10px;
	background: var(--sxp-soft);
	color: var(--sxp-brand);
}

.sx-pwa-steps b { font-weight: 800; }

@media (min-width: 600px) {
	.sx-pwa-sheet { align-items: center; padding: 16px; }
	.sx-pwa-sheet__card {
		border-bottom: 1px solid var(--sxp-rim, transparent);
		max-width: 420px;
		padding: 24px;
		border-radius: 22px;
		box-shadow: 0 24px 60px rgba(28, 20, 16, 0.28);
	}
}

/* ------------------------------------------------------------ Pull-to-refresh-safe menus */
#mobileMenuDrawer,
#mobileMenuDrawer .sx-drawer__body,
body.acp-ux .ux-side {
	overscroll-behavior: contain;
}

/* ------------------------------------------------------------ Installed app (standalone) */
/* Phone held sideways: keep the tab bar clear of the notch and rounded corners. */
body.acp-ux .sx-tabbar {
	left: calc(10px + env(safe-area-inset-left, 0px));
	right: calc(10px + env(safe-area-inset-right, 0px));
}

@media (max-width: 899.98px) {
	html.sx-standalone body.acp-ux .ux-main,
	html.sx-standalone body.acp-ux main#uxMain {
		padding-left: max(14px, env(safe-area-inset-left, 0px)) !important;
		padding-right: max(14px, env(safe-area-inset-right, 0px)) !important;
	}
}

html.sx-standalone { -webkit-tap-highlight-color: transparent; }
