/* Mobile layout pass (QA track B) from the ByteKeel main theme custom.css, scoped to .bkx by
 * scratchpad/qa-tracks/gen-demo-mobile.cjs. Redundant once tools/scope-main-css.cjs is re-run
 * (bk-main.css then carries the same rules). */
/* -------------------------------------------------------------------------
 * Mobile layout pass (QA track B, 2026-11-04).
 * ---------------------------------------------------------------------- */

/* Side-sliding reveals start 32px off their column. On phones that pushed the
 * element past the 16px gutter (latent page width 406 at 390), which only the
 * html/body overflow clip hid. Below md they rise like every other reveal. */
@media (max-width: 767.98px) {
	.bkx .reveal.reveal-left:not(.is-visible), .bkx .reveal.reveal-right:not(.is-visible) { translate: 0 28px; }
}

/* Floating chat button: clear the bottom nav and the home indicator. */
.bkx button[aria-label^="Open live chat"] {
	bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
	right: calc(1rem + env(safe-area-inset-right, 0px));
	transition-property: opacity, transform, translate, scale, background-color;
	transition-duration: .2s;
}
@media (min-width: 768px) {
	.bkx button[aria-label^="Open live chat"] { bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px)); right: calc(1.5rem + env(safe-area-inset-right, 0px)); }
}
/* assets/js/components/chat-dock.js adds this while a button sits under it. */
.bkx button[aria-label^="Open live chat"].bk-chat-tucked { opacity: 0; translate: 0 12px; scale: .9; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
	.bkx button[aria-label^="Open live chat"].bk-chat-tucked { translate: none; scale: none; }
}

/* Bottom nav: icons sit on one line whatever the label length, two-line
 * labels ("Divi Smart Popup") wrap centred, and the bar clears the side
 * insets in landscape. */
.bkx nav[aria-label="Quick actions"] { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
.bkx nav[aria-label="Quick actions"] a { justify-content: flex-start; padding: 8px 2px 6px; text-align: center; line-height: 1.15; }
.bkx nav[aria-label="Quick actions"] a > svg { flex: none; margin-bottom: 2px; }
/* The footer's own pb-24 keeps content above the bar; add the inset. */
@media (max-width: 767.98px) {
	.bkx footer.pb-24 { padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px)); }
}

/* Campaign bar on phones: the message gets its own line, the countdown and
 * the pricing link share the second one. Nothing runs under the close button. */
@media (max-width: 767.98px) {
	.bkx [data-bk-promo] > .container { flex-wrap: wrap; row-gap: .375rem; column-gap: .5rem; padding-left: .75rem; padding-right: 2.75rem; }
	.bkx [data-bk-promo] > .container > p.text-center { flex: 1 1 100%; order: -1; line-height: 1.35; text-wrap: balance; }
	.bkx [data-bk-promo] > .container > p[aria-hidden] { display: flex; }
	.bkx [data-bk-promo] > .container > a { min-height: 28px; display: inline-flex; align-items: center; }
	.bkx [data-bk-promo] > button { width: 44px; height: 44px; right: 0; }
}

/* Touch screens: footer links get a 44px target. */
@media (pointer: coarse) {
	.bkx footer a.min-h-\[34px\] { min-height: 44px; }
}

/* Offer cards at 320: the price row ($29 / $14.50 / first year) could not
 * wrap, so the grid column grew to its min-content and the card ran 23px past
 * the gutter. Let the row wrap and the card shrink with its column. */
.bkx .grid > article.rounded-card { min-width: 0; }
/* Same root cause in the home hero: the product card's long names made the
 * single mobile grid column 442px wide at 320, clipped by the section. Grid
 * items of page containers and reveal blocks shrink with their column. */
.bkx .container.grid > *, .bkx .grid > .reveal { min-width: 0; }
.bkx .rounded-card p.flex.items-end.gap-2 { flex-wrap: wrap; row-gap: 0; }
/* Free-claim card on the free product landings: the nowrap submit label
 * ("Get Order Profit Calculator for WooCommerce free") set the grid column to
 * 486px at 390 and the card clipped its own copy. */
.bkx .bk-fc > * { min-width: 0; }
.bkx .bk-fc .bkc-free button.btn-primary { white-space: normal; text-wrap: balance; padding-block: .75rem; }
/* Button labels that wrap at 320 stay centred. */
.bkx .btn-primary, .bkx .btn-secondary, .bkx .btn-ghost-dark { text-align: center; }

/* Touch screens: 44px targets where the layout allows it. */
@media (pointer: coarse) {
	.bkx .chip { min-height: 44px; }
	/* Plugins / premium type tabs (All, Free, Premium). */
	.bkx button.min-h-\[40px\][aria-pressed] { min-height: 44px; }
	/* Stand-alone text links ("Explore demo", "Read the policy"): a taller hit
	 * area that does not move the layout. */
	.bkx a.text-sm.font-semibold.text-primary:not([class*="btn"]):not(.chip):not(.absolute):not(.fixed) { position: relative; }
	.bkx a.text-sm.font-semibold.text-primary:not([class*="btn"]):not(.chip):not(.absolute):not(.fixed)::after { content: ""; position: absolute; inset: -12px 0; }
	/* Campaign bar link: 44px hit area around the small pill. */
	.bkx [data-bk-promo] .container > a { position: relative; }
	.bkx [data-bk-promo] .container > a::after { content: ""; position: absolute; inset: -10px -6px; }
}

