.mobile-bottom-nav {
	display: none;
}

@media (max-width: 991.98px) {
	/* Some Bootstrap navbar-expand rules force the panel visible above 768px;
	 * keep the mobile menu governed by its collapse state at every tablet size. */
	.header-wrapper .header-mobile > .menu-wrapper #navbar-menu-mobile.collapse:not(.show) {
		display: none !important;
	}

	.header-wrapper .header-mobile > .menu-wrapper #navbar-menu-mobile.collapse.show {
		display: block !important;
	}

	/* Keep the tablet category panel governed by the toggler's collapse state. */
	#menu #navbar-menu.collapse:not(.show) {
		display: none !important;
	}

	#menu #navbar-menu.collapse.show {
		display: block !important;
	}

	body {
		padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
	}

	/* Keep the existing search component available on phones without
	 * duplicating its form or changing its submit endpoint. */
	.header-container {
		padding-right: 10px;
		padding-left: 10px;
	}

	.header-container #logo {
		margin: 10px 0 8px;
	}

	.header-container #logo img {
		max-height: 52px;
		width: auto;
		margin: 0 auto;
	}

	.header-container .header-search {
		width: 100%;
		padding-right: 5px;
		padding-left: 5px;
	}

	.header-container .header-search form {
		margin-bottom: 10px;
	}

	.header-container .header-search input {
		min-height: 44px;
		font-size: 16px;
	}

	.header-container .header-search button {
		min-width: 48px;
		min-height: 44px;
	}

	/* The category menu remains the same component, but its mobile panel is
	 * constrained to the viewport so long catalog trees stay usable. */
	.menu-wrapper {
		position: relative;
		z-index: 1025;
	}

	.menu-wrapper > .container {
		padding-right: 0;
		padding-left: 0;
	}

	#menu {
		margin-bottom: 10px;
		border-radius: 0;
		padding-right: 10px;
		padding-left: 10px;
	}

	#menu .navbar-toggler {
		min-width: 44px;
		min-height: 44px;
		padding: 8px 10px;
	}

	#menu #navbar-menu {
		max-height: calc(100vh - 210px);
		overflow-y: auto;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
	}

	#menu .navbar-nav {
		margin-right: -10px;
		margin-left: -10px;
	}

	#menu .navbar-nav > .nav-item > a {
		display: flex;
		align-items: center;
		min-height: 44px;
		padding: 10px 14px;
	}

	#menu .dropdown-menu {
		position: static;
		width: 100%;
		margin: 0;
		border: 0;
		border-radius: 0;
		box-shadow: none;
	}

	/* The compact header duplicates the shared menu markup, but Bootstrap's
	 * dropdown click handler is not reliable inside that collapsed mobile copy.
	 * Keep the full category tree visible whenever the mobile navigation opens. */
	.header-wrapper .header-mobile > .menu-wrapper #navbar-menu-mobile.show .nav-item.dropdown > .dropdown-menu {
		display: block;
		float: none;
	}

	#menu .dropdown-inner {
		flex-direction: column;
	}

	#menu .dropdown-inner ul {
		min-width: 0;
		margin-bottom: 0;
	}

	#menu .dropdown-menu .dropdown-item {
		min-height: 42px;
		padding: 10px 22px;
		white-space: normal;
	}

	#menu .dropdown-menu .dropdown-divider {
		margin: 6px 14px;
	}

	.mobile-bottom-nav {
		box-sizing: border-box;
		position: fixed;
		z-index: 1030;
		right: 0;
		bottom: 0;
		left: 0;
		display: flex;
		align-items: stretch;
		padding: 6px 6px env(safe-area-inset-bottom, 0px);
		border-top: 1px solid #e5e7eb;
		background: rgba(255, 255, 255, .97);
		box-shadow: 0 -4px 16px rgba(20, 30, 50, .08);
		backdrop-filter: blur(8px);
	}

	.mobile-bottom-nav-item {
		display: flex;
		min-width: 0;
		flex: 1;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 3px;
		min-height: 48px;
		padding: 3px 2px;
		overflow: hidden;
		color: #6b7280;
		font-size: 11px;
		line-height: 1.2;
		text-decoration: none;
	}

	.mobile-bottom-nav-item span {
		display: block;
		max-width: 100%;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.mobile-bottom-nav-item .fa {
		font-size: 19px;
	}

	.mobile-bottom-nav-icon {
		position: relative;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-height: 22px;
	}

	.mobile-bottom-nav-badge {
		position: absolute;
		top: -7px;
		right: -17px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 16px;
		height: 16px;
		padding: 0 4px;
		border: 2px solid #fff;
		border-radius: 999px;
		background: #dc2626;
		color: #fff;
		font-size: 10px;
		font-weight: 700;
		line-height: 12px;
		pointer-events: none;
	}

	.mobile-bottom-nav-item.active {
		color: var(--main-color, #fdad00);
		font-weight: 600;
	}

	.mobile-bottom-nav-item:focus-visible {
		outline: 2px solid var(--main-color, #fdad00);
		outline-offset: -2px;
		border-radius: 6px;
	}
}

@media (min-width: 768px) and (max-width: 991.98px) {
	/* Bootstrap 5 no longer provides the legacy hidden-sm/hidden-xs
	 * utilities used by the migrated header. Keep the cart/account block out
	 * of the mobile and tablet header, as it was in the v38 mobile theme. */
	.header-container > .row > .col-lg-4.col-md-5.hidden-sm.hidden-xs {
		display: none;
	}

	/* Preserve the original tablet composition: the menu remains the primary
	 * navigation at this breakpoint. */
	.header-container .header-search {
		display: none;
	}
}

@media (max-width: 767px) {
	/* Bootstrap 5 no longer provides the legacy hidden-sm/hidden-xs
	 * utilities used by the migrated header. Keep the cart/account block out
	 * of the mobile header, as it was in the v38 mobile theme. */
	.header-container > .row > .col-lg-4.col-md-5.hidden-sm.hidden-xs {
		display: none;
	}
}
