/* NCG PWA — mobile polish. Additive and scoped to NCG classes to avoid
   fighting the existing template styles. */

/* Never let the page scroll sideways on a phone. */
@media (max-width: 768px) {
	html, body { overflow-x: hidden; }
	img, video { max-width: 100%; height: auto; }
	/* NCG tables scroll inside their own container rather than blowing out the page. */
	.ncg-order-table, .cart-table, .specs-table, .wp-list-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Comfortable touch targets for NCG controls on touch devices. */
@media (hover: none) and (pointer: coarse) {
	.ncg-btn, .ncg-add-cart-btn, .ncg-submit-btn, .pay-btn, .btn-block,
	.ncg-engage-btn, .ncg-social-follow .ncg-follow-icon, .tab-btn, .nav-btn {
		min-height: 44px;
	}
}

/* Respect notches / home indicators for fixed elements. */
.ncg-ticker.pos-bottom { padding-bottom: env(safe-area-inset-bottom); }

/* Sticky "listen" player on insight articles: as you scroll the article, the
   audio player pins to the bottom of the viewport on phones so listening
   continues while you read. */
@media (max-width: 768px) {
	.ncg-auto-player {
		position: sticky;
		bottom: 0;
		z-index: 60;
		margin: 20px -30px 0;
		padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
		background: var(--ncg-color-bg-surface, #fff);
		box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.12);
	}
	.ncg-auto-player audio { width: 100%; display: block; }
}

/* Install prompt button. */
.ncg-pwa-install {
	position: fixed;
	left: 50%;
	transform: translateX(-50%);
	bottom: calc(16px + env(safe-area-inset-bottom));
	z-index: 99998;
	background: #23312C;
	color: #fff;
	border: none;
	border-radius: 30px;
	padding: 12px 22px;
	font-size: 14px;
	font-weight: 700;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
	cursor: pointer;
}
.ncg-pwa-install span { color: #C89B7B; margin-right: 4px; }
.ncg-pwa-install-x {
	position: fixed;
	left: calc(50% + 92px);
	bottom: calc(20px + env(safe-area-inset-bottom));
	z-index: 99999;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	border: none;
	background: #C89B7B;
	color: #23312C;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}

/* In standalone (installed) mode, hide the install prompt entirely. */
@media (display-mode: standalone) {
	.ncg-pwa-install, .ncg-pwa-install-x { display: none !important; }
}
