/* ======================================================
   Blommac PWA / mobile-app shell styles
   ====================================================== */

:root {
	--app-bottom-nav-h: 60px;
}

/* ---------- Bottom navigation (mobile only) ---------- */
.app-bottom-nav {
	display: none;
}

@media (max-width: 991px) {
	.app-bottom-nav {
		display: flex;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 1040;
		background: #ffffff;
		border-top: 1px solid #eef1f5;
		box-shadow: 0 -2px 14px rgba(17, 24, 39, 0.08);
		padding-bottom: env(safe-area-inset-bottom, 0px);
	}
	.app-bottom-nav .app-nav-item {
		position: relative;
		flex: 1 1 0;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 3px;
		height: var(--app-bottom-nav-h);
		text-decoration: none;
		color: #7a8699;
		font-size: 11px;
		font-weight: 500;
		line-height: 1;
		transition: color 0.15s ease;
	}
	.app-bottom-nav .app-nav-item i {
		font-size: 21px;
	}
	.app-bottom-nav .app-nav-item.active,
	.app-bottom-nav .app-nav-item:active {
		color: var(--theme-color, #34619e);
	}
	.app-bottom-nav .app-nav-badge {
		position: absolute;
		top: 4px;
		right: 50%;
		transform: translateX(22px);
		min-width: 17px;
		height: 17px;
		padding: 0 4px;
		border-radius: 999px;
		background: #e7515a;
		color: #fff;
		font-size: 10px;
		font-weight: 700;
		line-height: 17px;
		text-align: center;
	}

	/* Keep page content clear of the fixed bar + the scroll-to-top button */
	body {
		padding-bottom: calc(var(--app-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
	}
	.scroll-to-top {
		bottom: calc(var(--app-bottom-nav-h) + 16px) !important;
	}
}

/* ---------- Install banner ---------- */
.pwa-install-banner {
	display: none;
	position: fixed;
	left: 12px;
	right: 12px;
	bottom: calc(var(--app-bottom-nav-h) + 12px + env(safe-area-inset-bottom, 0px));
	z-index: 1060;
	align-items: center;
	gap: 12px;
	background: #ffffff;
	border: 1px solid #eef1f5;
	border-radius: 14px;
	box-shadow: 0 8px 30px rgba(17, 24, 39, 0.18);
	padding: 10px 12px;
}
.pwa-install-banner.show {
	display: flex;
}
.pwa-install-banner img {
	width: 42px;
	height: 42px;
	border-radius: 10px;
	flex: 0 0 auto;
}
.pwa-install-banner .pwa-install-text {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
}
.pwa-install-banner .pwa-install-text strong {
	font-size: 14px;
	color: #1f2937;
}
.pwa-install-banner .pwa-install-text span {
	font-size: 12px;
	color: #7a8699;
}
.pwa-install-banner .btn {
	background: var(--theme-color, #34619e);
	color: #fff;
	border-radius: 999px;
	padding: 8px 18px;
	font-size: 13px;
	font-weight: 600;
	flex: 0 0 auto;
}
.pwa-install-banner .pwa-install-close {
	background: transparent;
	border: 0;
	font-size: 22px;
	line-height: 1;
	color: #9aa4b2;
	padding: 0 4px;
	cursor: pointer;
}

@media (min-width: 992px) {
	/* On desktop show the banner bottom-right, no bottom-nav offset */
	.pwa-install-banner {
		left: auto;
		right: 20px;
		bottom: 20px;
		max-width: 360px;
	}
}

/* ---------- Always-visible "Download App" button (mobile only) ---------- */
.pwa-download-btn {
	display: none;                       /* shown via .show + only on mobile */
	position: fixed;
	right: 14px;
	bottom: calc(var(--app-bottom-nav-h) + 14px + env(safe-area-inset-bottom, 0px));
	z-index: 1055;
	align-items: center;
	gap: 7px;
	background: var(--theme-color, #34619e);
	color: #fff;
	border: 0;
	border-radius: 999px;
	padding: 11px 18px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	box-shadow: 0 8px 22px rgba(17, 24, 39, 0.28);
	cursor: pointer;
}
.pwa-download-btn i {
	font-size: 16px;
}
@media (max-width: 991px) {
	.pwa-download-btn.show {
		display: inline-flex;            /* always visible on mobile until installed */
	}
}
/* Never show in installed (standalone) app mode */
.pwa-standalone .pwa-download-btn {
	display: none !important;
}

/* ---------- App-style mobile header ---------- */
@media (max-width: 991px) {
	/* Sticky, clean header with a soft shadow */
	.header-mobile {
		position: sticky;
		top: 0;
		z-index: 1035;
		background: #fff;
		box-shadow: 0 2px 10px rgba(17, 24, 39, 0.06);
		padding: 8px 0 !important;
		padding-top: calc(8px + env(safe-area-inset-top, 0px)) !important;
	}
	/* Compact, tidy top strip */
	.top-header {
		font-size: 12px;
		padding: 4px 0;
	}
	.top-header .top-list {
		justify-content: flex-end;
	}
	/* Center the logo nicely, give the side actions equal room */
	.header-mobile-card .bars-search-card,
	.header-mobile-card .head-round-card {
		width: 96px;
		display: flex;
		align-items: center;
	}
	.header-mobile-card .head-round-card {
		justify-content: flex-end;
	}
	.header-mobile-card .logo-card {
		width: calc(100% - 192px);
	}
	.header-mobile-card .logo-card .logo img {
		max-height: 40px;
		width: auto;
		object-fit: contain;
	}
	/* Bigger, rounder, tappable icon buttons */
	.header .header-mobile-card ul.head-round-icon {
		margin-top: 0 !important;
		align-items: center;
	}
	.header .header-mobile-card ul.head-round-icon li a i {
		width: 40px;
		height: 40px;
		line-height: 40px;
		font-size: 18px;
		border-radius: 50%;
		background: #f2f5fa;
		color: #1f2937;
		text-align: center;
		transition: background 0.15s ease, color 0.15s ease;
	}
	.header .header-mobile-card ul.head-round-icon li a:active i {
		background: var(--theme-color, #34619e);
		color: #fff;
	}
	/* Badge placement on the rounder icons */
	.header .header-mobile-card ul.head-round-icon li a .cart_count {
		left: auto;
		right: -4px;
		top: -4px;
	}
}

/* ---------- Home: mobile product / category / tab layout ---------- */
@media (max-width: 991px) {
	/* Compact section headings */
	.section-heading { margin-bottom: 20px; }
	.section-heading h2 { font-size: 24px; margin-bottom: 8px; }
	.section-heading h5 { font-size: 13px; margin-bottom: 6px; }

	/* Tabs -> horizontally scrollable app-style pills */
	ul.nav-pills.tp-tabs {
		display: flex;
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		gap: 8px;
		margin: 0 -12px 16px;
		padding: 2px 12px 6px;
	}
	ul.nav-pills.tp-tabs::-webkit-scrollbar { display: none; }
	ul.nav-pills.tp-tabs li {
		float: none;
		margin: 0;
		flex: 0 0 auto;
	}
	ul.nav-pills.tp-tabs li .nav-link {
		padding: 8px 16px;
		font-size: 13px;
		white-space: nowrap;
	}

	/* Tab product grid -> two columns per row */
	#pills-tabContent > .tab-pane > .row {
		margin-left: -6px;
		margin-right: -6px;
	}
	#pills-tabContent > .tab-pane > .row > [class*="col-"] {
		flex: 0 0 50%;
		max-width: 50%;
		padding-left: 6px;
		padding-right: 6px;
	}

	/* owl handles its own gaps now -> drop the extra card margins on mobile */
	.owl-carousel .item-card,
	.owl-carousel .featured-card { margin-right: 0; }

	/* Product card polish for the narrow 2-up width */
	.item-card { padding: 8px; }
	.item-card .item-title a { font-size: 13px; line-height: 1.3; }
	.item-card .item-sold { font-size: 11px; }
	.item-card .item-pric-card .new-price { font-size: 15px; }
	.item-card .item-pric-card .old-price { font-size: 12px; }
	.item-card .item-card-bottom a.add-to-cart {
		float: none;
		display: block;
		text-align: center;
		padding: 8px 10px;
		font-size: 12px;
		margin-bottom: 8px;
	}
	.item-card .item-card-bottom ul.item-cart-list {
		float: none;
		display: flex;
		justify-content: center;
		gap: 10px;
	}
	.item-card .item-card-bottom ul.item-cart-list li { float: none; }

	/* Featured categories -> compact horizontal slider cards */
	.featured-card .featured-image { padding: 12px; }
	.featured-card .featured-image img { width: 80px; height: 80px; }
	.featured-card .featured-title { padding: 12px 6px; }
	.featured-card .featured-title a { font-size: 12px; }
}
@media (max-width: 575px) {
	.section-heading h2 { font-size: 21px; }
	.featured-card .featured-image img { width: 68px; height: 68px; }
	.item-card .item-card-bottom a.add-to-cart { font-size: 11px; padding: 7px 8px; }
}

/* ---------- Mobile: hide desktop-only chrome ---------- */
@media (max-width: 991px) {
	.top-header { display: none !important; }           /* Order Tracking / Admin strip */
	.scroll-to-top { display: none !important; }         /* scroll-to-top arrow */
	[class^="whatsapp-"] { display: none !important; }   /* floating WhatsApp button */
	.cookie_consent_card { display: none !important; }   /* cookie consent message */
}

/* ---------- Offline "Connection failed" screen ----------
   Hidden by default (also inline style="display:none" in markup).
   Shown ONLY by JS (element.style.display='flex') when offline + mobile,
   so it can never leak into normal page flow if this stylesheet is stale. */
.app-offline-screen {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2000;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 24px;
	padding-top: calc(24px + env(safe-area-inset-top, 0px));
	background: #f6f8fb;
}
body.is-offline { overflow: hidden; }
.app-offline-screen .app-offline-icon {
	width: 92px;
	height: 92px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 8px 30px rgba(17, 24, 39, 0.12);
	margin-bottom: 22px;
}
.app-offline-screen .app-offline-icon i {
	font-size: 42px;
	color: var(--theme-color, #34619e);
}
.app-offline-screen h3 {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 8px;
	color: #1f2937;
}
.app-offline-screen p {
	font-size: 14px;
	color: #6b7280;
	max-width: 300px;
	margin: 0 0 22px;
	line-height: 1.5;
}
.app-offline-screen button {
	background: var(--theme-color, #34619e);
	color: #fff;
	border: 0;
	border-radius: 999px;
	padding: 12px 30px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}

/* ---------- Standalone (installed) app polish ---------- */
.pwa-standalone .top-header {
	display: none;            /* hide the address/phone strip in app mode */
}
.pwa-standalone body {
	-webkit-tap-highlight-color: transparent;
}
/* Respect the notch / status bar area at the top in app mode */
.pwa-standalone .header-mobile,
.pwa-standalone .header-desktop {
	padding-top: env(safe-area-inset-top, 0px);
}
