/* ONETV Mobile UI */
:root {
	--otm-bg: #0f0f12;
	--otm-line: rgba(255, 255, 255, .07);
	--otm-text: #e9e7f2;
	--otm-dim: #a7a3b8;
	--otm-accent: #8b6dff;
	--otm-accent-bg: rgba(109, 78, 236, .22);
	--otm-h: 64px;
}

/* ---------- Out of stock: dark card + «نفدت الكمية» ---------- */
.product-grid-item.outofstock .out-of-stock.product-label { display: none !important; }
.product-grid-item.outofstock .product-image-link { position: relative; display: block; overflow: hidden; border-radius: inherit; }
.product-grid-item.outofstock .product-image-link img { filter: saturate(.6) !important; }
.product-grid-item.outofstock .product-image-link::after {
	content: 'نفدت الكمية';
	position: absolute; inset: 0; z-index: 3; border-radius: inherit;
	background: radial-gradient(120% 90% at 50% 50%, rgba(0,0,0,.55), rgba(0,0,0,.72));
	display: flex; align-items: center; justify-content: center;
	padding: 8px; text-align: center; pointer-events: none;
	font-family: inherit; font-weight: 900; line-height: 1.1;
	font-size: clamp(22px, 7.5vw, 40px);
	color: #ff2424;
	-webkit-text-stroke: 1px rgba(0, 0, 0, .55);
	text-shadow: 0 0 2px #000, 0 2px 0 #4a0000, 0 0 18px rgba(255, 30, 30, .55), 0 0 32px rgba(0, 0, 0, .9);
}
@media (min-width: 1025px) {
	.product-grid-item.outofstock .product-image-link::after { font-size: clamp(22px, 2.4vw, 38px); }
}
.product-grid-item.outofstock .wd-product-title,
.product-grid-item.outofstock .wd-entities-title,
.product-grid-item.outofstock .price { opacity: .55; }

/* ---------- Bottom navigation (phone / tablet) ---------- */
.otm-nav { display: none; }
template#otm-acc-tpl { display: none; }
.otm-acc { display: none; }

@media (max-width: 1024px) {
	/* old Woodmart bottom toolbar (المتجر / قائمة الرغبات / سلة التسوق) */
	.wd-toolbar { display: none !important; }
	/* header: no ☰ menu and no cart; account icon instead */
	.whb-header .wd-header-mobile-nav,
	.whb-header .wd-header-cart { display: none !important; }

	.otm-acc {
		display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
		width: 42px; height: 42px; border-radius: 50%;
		color: var(--otm-text) !important; background: rgba(255, 255, 255, .06);
		border: 1px solid var(--otm-line); text-decoration: none !important;
		transition: background .2s ease, color .2s ease;
	}
	.otm-acc.is-in { color: #fff !important; background: var(--otm-accent-bg); border-color: rgba(139, 109, 255, .45); }
	.otm-acc:active { transform: scale(.94); }

	.otm-nav {
		position: fixed; z-index: 9990; left: 0; right: 0; bottom: 0;
		display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
		height: calc(var(--otm-h) + env(safe-area-inset-bottom, 0px));
		padding: 6px 8px env(safe-area-inset-bottom, 0px);
		background: var(--otm-bg); border-top: 1px solid var(--otm-line);
		box-shadow: 0 -10px 28px -14px rgba(0, 0, 0, .9);
		font-family: inherit;
	}
	.otm-nav__i {
		display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
		min-width: 0; height: 100%; color: var(--otm-dim) !important; text-decoration: none !important;
		-webkit-tap-highlight-color: transparent;
	}
	.otm-nav__ico {
		position: relative; display: flex; align-items: center; justify-content: center;
		width: 58px; height: 30px; border-radius: 999px; transition: background .2s ease, color .2s ease;
	}
	.otm-nav__ico svg { width: 23px; height: 23px; }
	.otm-nav__t { font-size: 11.5px; font-weight: 600; line-height: 1.1; white-space: nowrap; }
	.otm-nav__i.is-on { color: var(--otm-accent) !important; }
	.otm-nav__i.is-on .otm-nav__ico { background: var(--otm-accent-bg); }
	.otm-nav__i.is-on .otm-nav__t { font-weight: 800; }
	.otm-nav__i:active .otm-nav__ico { transform: scale(.92); }

	.otm-badge {
		position: absolute; top: -3px; right: 10px;
		min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
		background: var(--otm-accent); color: #fff; font-size: 10.5px; font-weight: 800; line-height: 17px; text-align: center;
		box-shadow: 0 0 0 2px var(--otm-bg);
	}
	.otm-badge.is-empty { display: none; }

	/* room for the bar */
	body { padding-bottom: calc(var(--otm-h) + env(safe-area-inset-bottom, 0px)) !important; }
	.scrollToTop, .wd-scroll-top { bottom: calc(var(--otm-h) + 14px) !important; }
}
