/**
 * DEJOIY Mobile OS — site-wide mobile/tablet chrome (max-width: 1024px).
 */

@media (max-width: 1024px) {
	/* Hide theme / Elementor / Header OS duplicates */
	body.dejoiy-mobile-os .elementor-location-header,
	body.dejoiy-mobile-os .etheme-elementor-header-sticky,
	body.dejoiy-mobile-os .elementor.elementor-10,
	body.dejoiy-mobile-os .dh-os-v4-mobile-chips,
	body.dejoiy-mobile-os #dh-os-v4-root,
	body.dejoiy-mobile-os .dejoiy-header-os-v4-overlay {
		display: none !important;
		visibility: hidden !important;
		height: 0 !important;
		overflow: hidden !important;
		pointer-events: none !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	body.dejoiy-mobile-os {
		padding-top: var(--dm-os-header-h, 12.5rem);
		padding-bottom: calc(3.85rem + env(safe-area-inset-bottom, 0));
		overflow-x: hidden;
	}

	body.dejoiy-mobile-os .page-wrapper,
	body.dejoiy-mobile-os .template-content,
	body.dejoiy-mobile-os #main-content {
		padding-top: 0 !important;
		margin-top: 0 !important;
	}

	#dejoiy-mobile-os-chrome {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		z-index: 9990;
		max-width: 100vw;
		display: flex;
		flex-direction: column;
	}

	#dejoiy-mobile-os-header {
		position: relative;
		flex: 0 0 auto;
	}

	#dejoiy-mobile-os-mkt {
		position: relative;
		flex: 0 0 auto;
	}

	.dejoiy-mobile-os-bottom {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 9991;
	}
}

@media (min-width: 1025px) {
	#dejoiy-mobile-os-chrome,
	.dejoiy-mobile-os-legal,
	.dejoiy-mobile-os-bottom {
		display: none !important;
	}
}

/* Hero header — blue block only */
.dm-hero--blue,
.dm-hero.dm-hero--blue {
	color: #fff;
	padding: 0;
	overflow: hidden;
	background: linear-gradient(165deg, #1e40af 0%, #2563eb 42%, #4f46e5 100%);
	position: relative;
}

.dm-hero__bg {
	display: none;
}

.dm-hero__inner {
	position: relative;
	padding: 0.5rem 0.75rem 0.6rem;
	max-width: 100%;
}

.dm-modes {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.4rem;
	margin-bottom: 0.5rem;
}

.dm-modes__pill {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	min-height: 44px;
	padding: 0.38rem 0.7rem;
	border-radius: 14px;
	text-decoration: none;
	color: #fff;
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.22);
}

.dm-modes__pill.is-active {
	background: linear-gradient(145deg, #fef9c3, #fde68a);
	color: #1e3a8a;
	border-color: #facc15;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
}

.dm-modes__brand {
	font-size: 0.92rem;
	font-weight: 800;
	line-height: 1.1;
}

.dm-modes__sub {
	font-size: 0.66rem;
	font-weight: 600;
	margin-top: 0.08rem;
	opacity: 0.85;
}

.dm-loc {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	margin-bottom: 0.5rem;
	padding: 0.3rem 0.1rem;
	text-decoration: none;
	color: #fff;
	min-height: 40px;
}

.dm-loc__text {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.2rem;
	align-items: baseline;
}

.dm-loc__label {
	font-size: 0.7rem;
	opacity: 0.9;
}

.dm-loc__value {
	font-size: 0.8rem;
	font-weight: 800;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 72vw;
}

.dm-loc__chev {
	font-size: 1.2rem;
	opacity: 0.85;
}

.dm-search-row {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	margin-bottom: 0.5rem;
}

.dm-search {
	flex: 1;
	min-width: 0;
}

.dm-search__field--premium {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	min-height: 48px;
	padding: 0 1rem 0 0.85rem;
	border-radius: 999px;
	background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
	border: 1px solid rgba(255, 255, 255, 0.9);
	box-shadow:
		0 6px 20px rgba(15, 23, 42, 0.14),
		inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.dm-search__ico {
	display: flex;
	color: #6366f1;
	flex: 0 0 auto;
}

.dm-search__input {
	flex: 1;
	min-width: 0;
	border: none;
	background: transparent;
	font-size: 0.88rem;
	color: #0f172a;
	padding: 0.65rem 0;
}

.dm-search__input:focus {
	outline: none;
}

.dm-search__input::placeholder {
	color: #94a3b8;
	transition: opacity 0.35s ease;
}

.dm-search-row__action {
	position: relative;
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.18);
	border: 1px solid rgba(255, 255, 255, 0.35);
	text-decoration: none;
}

.dm-search-row__badge {
	position: absolute;
	top: 2px;
	right: 2px;
	min-width: 1.1rem;
	height: 1.1rem;
	padding: 0 0.2rem;
	border-radius: 999px;
	background: #facc15;
	color: #1e3a8a;
	font-size: 0.62rem;
	font-weight: 800;
	display: flex;
	align-items: center;
	justify-content: center;
}

.dm-catnav {
	display: flex;
	gap: 0.1rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding-bottom: 0.2rem;
}

.dm-catnav::-webkit-scrollbar {
	display: none;
}

.dm-catnav__item {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.18rem;
	min-width: 4.1rem;
	padding: 0.3rem 0.35rem 0.45rem;
	text-decoration: none;
	color: rgba(255, 255, 255, 0.9);
}

.dm-catnav__ico {
	width: 2.4rem;
	height: 2.4rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	font-size: 1.1rem;
}

.dm-catnav__label {
	font-size: 0.6rem;
	font-weight: 600;
	text-align: center;
	line-height: 1.15;
}

.dm-catnav__item.is-active .dm-catnav__ico {
	background: #fff;
	color: var(--dm-accent, #2563eb);
}

.dm-catnav__item.is-active .dm-catnav__label {
	font-weight: 800;
	border-bottom: 2px solid #fde047;
}

/* Bottom nav */
.dm-bottom {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	background: rgba(255, 255, 255, 0.98);
	border-top: 1px solid rgba(15, 23, 42, 0.08);
	padding: 0.35rem 0 calc(0.35rem + env(safe-area-inset-bottom, 0));
	box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
}

.dm-bottom__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.08rem;
	text-decoration: none;
	color: #64748b;
	font-size: 0.6rem;
	min-height: 48px;
	padding: 0.12rem;
}

.dm-bottom__item span:first-child {
	font-size: 1.05rem;
}

.dm-bottom__item.is-active {
	color: #2563eb;
	font-weight: 700;
}

@media (max-width: 390px) {
	.dm-search__input {
		font-size: 0.82rem;
	}
	.dm-modes__brand {
		font-size: 0.86rem;
	}
	.dm-catnav__item {
		min-width: 3.75rem;
	}
}

@media (max-width: 360px) {
	.dm-bottom__item small {
		font-size: 0.52rem;
	}
}

/* Dedicated pages — restore native layout (no Mobile OS chrome) */
@media (max-width: 1024px) {
	body.dejoiy-mobile-os-off {
		padding-top: 0 !important;
		padding-bottom: 0 !important;
	}

	body.dejoiy-mobile-os-off #dejoiy-mobile-os-chrome,
	body.dejoiy-mobile-os-off #dejoiy-mobile-os-header,
	body.dejoiy-mobile-os-off #dejoiy-mobile-os-bottom,
	body.dejoiy-mobile-os-off #dm-joi-search-sheet {
		display: none !important;
	}
}

/* White strip — separate from blue header */
.dm-mkt-strip--white,
#dejoiy-mobile-os-mkt {
	background: #ffffff !important;
	padding: 0.6rem 0.65rem 0.7rem;
	margin: 0;
	border-top: 4px solid #ffffff;
	box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
	border-radius: 0 0 16px 16px;
}

.dejoiy-mobile-os-chrome {
	background: transparent;
}

.dm-mkt-cats {
	display: flex;
	gap: 0.4rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding: 0;
	margin: 0;
}

.dm-mkt-cats::-webkit-scrollbar {
	display: none;
}

.dm-mkt-cats__item {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.28rem;
	width: 4.35rem;
	text-decoration: none;
	color: #0f172a;
}

.dm-mkt-cats__circle {
	width: 3.15rem;
	height: 3.15rem;
	border-radius: 50%;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
	border: 2px solid rgba(255, 255, 255, 0.65);
}

.dm-mkt-cats__circle img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.dm-mkt-cats__emoji {
	font-size: 1.35rem;
	line-height: 1;
}

.dm-mkt-cats__label {
	font-size: 0.6rem;
	font-weight: 600;
	text-align: center;
	line-height: 1.15;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: #334155;
}

/* Full-screen JOI search */
.dm-joi-sheet {
	position: fixed;
	inset: 0;
	z-index: 10050;
	background: rgba(15, 23, 42, 0.35);
}

.dm-joi-sheet[hidden] {
	display: none !important;
}

body.dm-joi-sheet-open {
	overflow: hidden;
}

.dm-joi-sheet__panel {
	position: absolute;
	inset: 0;
	background: #fff;
	display: flex;
	flex-direction: column;
	animation: dm-sheet-in 0.22s ease;
}

@keyframes dm-sheet-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.dm-joi-sheet__head {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.65rem 0.75rem;
	border-bottom: 1px solid #e2e8f0;
	background: #fff;
}

.dm-joi-sheet__back {
	width: 44px;
	height: 44px;
	border: none;
	background: #f1f5f9;
	border-radius: 12px;
	font-size: 1.2rem;
	cursor: pointer;
	flex: 0 0 auto;
}

.dm-joi-sheet__input-wrap {
	flex: 1;
	min-width: 0;
}

.dm-joi-sheet__input {
	width: 100%;
	border: none;
	background: #f8fafc;
	border-radius: 999px;
	min-height: 48px;
	padding: 0 1rem;
	font-size: 1rem;
	color: #0f172a;
}

.dm-joi-sheet__input:focus {
	outline: 2px solid #6366f1;
	outline-offset: 1px;
}

.dm-joi-sheet__body {
	flex: 1;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 0.5rem 0.75rem 1.5rem;
}

.dm-joi-sheet__hint {
	margin: 0 0 0.65rem;
	font-size: 0.78rem;
	color: #64748b;
}

.dm-joi-sheet__results {
	list-style: none;
	margin: 0;
	padding: 0;
}

.dm-joi-sheet__result {
	margin-bottom: 0.35rem;
}

.dm-joi-sheet__link {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.55rem 0.45rem;
	border-radius: 12px;
	text-decoration: none;
	color: inherit;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
}

.dm-joi-sheet__thumb {
	width: 52px;
	height: 52px;
	border-radius: 10px;
	object-fit: cover;
	flex: 0 0 auto;
	background: #e2e8f0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.2rem;
}

.dm-joi-sheet__thumb--ph {
	background: #eef2ff;
}

.dm-joi-sheet__meta {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.12rem;
}

.dm-joi-sheet__badge {
	font-size: 0.62rem;
	font-weight: 700;
	color: #6366f1;
	text-transform: uppercase;
}

.dm-joi-sheet__title {
	font-size: 0.88rem;
	font-weight: 700;
	color: #0f172a;
	line-height: 1.25;
}

.dm-joi-sheet__price {
	font-size: 0.78rem;
	font-weight: 800;
	color: #0f172a;
}

.dm-joi-sheet__empty {
	padding: 1rem 0.5rem;
	color: #64748b;
	font-size: 0.85rem;
	list-style: none;
}

/* Tablet auto-adjust (768px – 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
	.dm-hero__inner {
		max-width: min(100%, 920px);
		margin: 0 auto;
		padding-left: 1rem;
		padding-right: 1rem;
	}

	.dm-modes {
		max-width: 520px;
		margin-left: auto;
		margin-right: auto;
	}

	.dm-search-row {
		max-width: 720px;
		margin-left: auto;
		margin-right: auto;
	}

	.dm-mkt-cats__item {
		width: 4.75rem;
	}

	.dm-mkt-cats__circle {
		width: 3.5rem;
		height: 3.5rem;
	}

	.dm-mkt-cats__label {
		font-size: 0.62rem;
	}

	.dm-catnav__item {
		min-width: 4.5rem;
	}

	body.dejoiy-mobile-os {
		padding-top: var(--dm-os-header-h, 14rem);
	}
}
