/*
 * Markefon mobile header UX - Phase 2.0
 * Scope: mobile Wolmart/Elementor header only. No DOM or checkout changes.
 */

@media (max-width: 767px) {
	body:not(.woocommerce-checkout) #header.header-3029 {
		--mkf-header-x: 16px;
		--mkf-header-icon-size: 38px;
		background: #fff;
		box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
	}

	body:not(.woocommerce-checkout) #header.header-3029 .elementor-section {
		margin: 0 !important;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .elementor-container {
		min-height: 0 !important;
		padding-right: var(--mkf-header-x) !important;
		padding-left: var(--mkf-header-x) !important;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .elementor-widget-wrap {
		align-items: center;
		gap: 8px;
		padding: 0 !important;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .welcome-msg {
		max-height: 24px;
		overflow: hidden;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .welcome-msg .elementor-heading-title {
		margin: 0;
		font-size: 11px !important;
		line-height: 24px !important;
		white-space: nowrap;
		text-overflow: ellipsis;
		overflow: hidden;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .sticky-content {
		padding: 10px 0 8px !important;
		background: #fff;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .sticky-content .elementor-container {
		display: flex;
		align-items: center;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .elementor-widget-wolmart_header_site_logo {
		flex: 1 1 auto;
		min-width: 0;
		margin: 0 auto 0 0 !important;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .logo {
		display: inline-flex;
		align-items: center;
		min-height: var(--mkf-header-icon-size);
	}

	body:not(.woocommerce-checkout) #header.header-3029 .site-logo {
		display: block;
		width: auto !important;
		max-width: 132px !important;
		max-height: 36px !important;
		object-fit: contain;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .elementor-widget-wolmart_header_account,
	body:not(.woocommerce-checkout) #header.header-3029 .elementor-widget-wolmart_header_cart,
	body:not(.woocommerce-checkout) #header.header-3029 .elementor-widget-wolmart_header_mmenu_toggle {
		flex: 0 0 var(--mkf-header-icon-size);
		width: var(--mkf-header-icon-size) !important;
		height: var(--mkf-header-icon-size);
		margin: 0 !important;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .account,
	body:not(.woocommerce-checkout) #header.header-3029 .mini-basket-dropdown,
	body:not(.woocommerce-checkout) #header.header-3029 .elementor-widget-wolmart_header_mmenu_toggle .elementor-widget-container {
		width: 100%;
		height: 100%;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .account .login,
	body:not(.woocommerce-checkout) #header.header-3029 .cart-toggle,
	body:not(.woocommerce-checkout) #header.header-3029 .mobile-menu-toggle {
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		width: var(--mkf-header-icon-size);
		height: var(--mkf-header-icon-size);
		margin: 0 !important;
		padding: 0 !important;
		border-radius: 12px;
		color: #111827;
		line-height: 1;
		text-decoration: none;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .w-icon-account,
	body:not(.woocommerce-checkout) #header.header-3029 .w-icon-cart,
	body:not(.woocommerce-checkout) #header.header-3029 .w-icon-hamburger {
		position: relative;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 24px;
		height: 24px;
		font-size: 24px;
		line-height: 1;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .cart-label,
	body:not(.woocommerce-checkout) #header.header-3029 .cart-name,
	body:not(.woocommerce-checkout) #header.header-3029 .account span,
	body:not(.woocommerce-checkout) #header.header-3029 .delimiter {
		display: none !important;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .cart-count {
		position: absolute;
		top: -7px;
		right: -9px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 17px;
		height: 17px;
		padding: 0 4px;
		border: 2px solid #fff;
		border-radius: 999px;
		background: #ef0040;
		color: #fff;
		font-size: 10px;
		font-weight: 800;
		line-height: 1;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .custom-search-box {
		position: relative;
		z-index: 30;
		margin: 0 !important;
		padding: 0 0 8px !important;
		overflow: visible !important;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .custom-search-box .elementor-widget-container,
	body:not(.woocommerce-checkout) #header.header-3029 .custom-search-box .search-wrapper {
		position: relative;
		z-index: 30;
		width: 100%;
		overflow: visible !important;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .custom-search-box form.input-wrapper {
		position: relative;
		z-index: 31;
		display: flex;
		align-items: center;
		min-height: 40px;
		border: 1px solid #e5e7eb;
		border-radius: 12px;
		background: #f8fafc;
		box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
		overflow: visible !important;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .custom-search-box input[name="s"] {
		height: 40px !important;
		min-height: 40px !important;
		padding: 0 8px 0 14px !important;
		border: 0 !important;
		background: transparent !important;
		color: #111827;
		font-size: 13px !important;
		font-weight: 500;
		line-height: 40px !important;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .custom-search-box input[name="s"]::placeholder {
		color: #9ca3af;
		opacity: 1;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .custom-search-box .btn-search {
		flex: 0 0 40px;
		width: 40px !important;
		height: 40px !important;
		min-width: 40px !important;
		margin: 0 !important;
		border: 0 !important;
		background: transparent !important;
		color: #111827 !important;
		font-size: 18px !important;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .custom-category-section {
		padding: 0 0 8px !important;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .custom-category-section .elementor-container {
		padding-right: 10px !important;
		padding-left: 10px !important;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .mkf-mini-banner-row {
		gap: 6px !important;
		padding: 0 !important;
		overflow-x: auto;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .mkf-mini-banner-row::-webkit-scrollbar {
		display: none;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .mkf-mini-banner {
		flex: 0 0 88px !important;
		min-width: 88px !important;
		max-width: 88px !important;
		min-height: 74px !important;
		padding: 9px 8px !important;
		border-radius: 13px !important;
		box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08) !important;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .mkf-mini-banner--small {
		flex-basis: 64px !important;
		min-width: 64px !important;
		max-width: 64px !important;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .mkf-mini-banner-tag {
		margin-bottom: 5px !important;
		padding: 3px 6px !important;
		font-size: 8px !important;
		line-height: 1 !important;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .mkf-mini-banner-title {
		margin: 0 !important;
		font-size: 11px !important;
		line-height: 1.05 !important;
		letter-spacing: 0 !important;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .mkf-mini-banner-desc {
		display: none !important;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .mkf-mini-banner-small-icon {
		margin-bottom: 3px !important;
		font-size: 15px !important;
	}

	body:not(.woocommerce-checkout) #header.header-3029 .mkf-mini-banner-small-title {
		font-size: 8.5px !important;
		line-height: 1.1 !important;
	}

	body.single-product:not(.woocommerce-checkout) #header.header-3029 {
		margin-bottom: 0 !important;
	}

	body.single-product:not(.woocommerce-checkout) #header.header-3029 + .mkf-category-bar,
	body.single-product:not(.woocommerce-checkout) #header.header-3029 ~ .mkf-category-bar {
		display: none !important;
	}

	body.single-product:not(.woocommerce-checkout) .page-wrapper > .main {
		padding-top: 0 !important;
	}

	body.single-product:not(.woocommerce-checkout) .woocommerce-breadcrumb,
	body.single-product:not(.woocommerce-checkout) .breadcrumb {
		margin-top: 6px !important;
		margin-bottom: 8px !important;
		font-size: 12px;
		line-height: 1.35;
	}
}

/*
 * Phase 2.1 - mockup-informed mobile header density.
 * CSS-only: compacts the current Elementor/Wolmart header DOM.
 */
@media (max-width: 767px) {
	body.single-product:not(.woocommerce-checkout) #header.header-3029 {
		--mkf-header-x: 14px;
		--mkf-header-icon-size: 34px;
		box-shadow: 0 4px 14px rgba(15, 23, 42, 0.045);
	}

	body.single-product:not(.woocommerce-checkout) #header.header-3029 .welcome-msg {
		max-height: 20px;
	}

	body.single-product:not(.woocommerce-checkout) #header.header-3029 .welcome-msg .elementor-heading-title {
		font-size: 10px !important;
		line-height: 20px !important;
	}

	body.single-product:not(.woocommerce-checkout) #header.header-3029 .sticky-content {
		padding: 7px 0 6px !important;
	}

	body.single-product:not(.woocommerce-checkout) #header.header-3029 .elementor-widget-wrap {
		gap: 6px;
	}

	body.single-product:not(.woocommerce-checkout) #header.header-3029 .site-logo {
		max-width: 118px !important;
		max-height: 32px !important;
	}

	body.single-product:not(.woocommerce-checkout) #header.header-3029 .account .login,
	body.single-product:not(.woocommerce-checkout) #header.header-3029 .cart-toggle,
	body.single-product:not(.woocommerce-checkout) #header.header-3029 .mobile-menu-toggle {
		border-radius: 10px;
	}

	body.single-product:not(.woocommerce-checkout) #header.header-3029 .w-icon-account,
	body.single-product:not(.woocommerce-checkout) #header.header-3029 .w-icon-cart,
	body.single-product:not(.woocommerce-checkout) #header.header-3029 .w-icon-hamburger {
		width: 22px;
		height: 22px;
		font-size: 22px;
	}

	body.single-product:not(.woocommerce-checkout) #header.header-3029 .cart-count {
		top: -6px;
		right: -7px;
		min-width: 16px;
		height: 16px;
		padding: 0 4px;
		font-size: 9px;
	}

	body.single-product:not(.woocommerce-checkout) #header.header-3029 .custom-search-box {
		position: relative;
		z-index: 40;
		padding-bottom: 6px !important;
		overflow: visible !important;
	}

	body.single-product:not(.woocommerce-checkout) #header.header-3029 .custom-search-box form.input-wrapper {
		position: relative;
		z-index: 41;
		min-height: 36px;
		border-radius: 11px;
		background: #f8fafc;
		overflow: visible !important;
	}

	body.single-product:not(.woocommerce-checkout) #header.header-3029 .custom-search-box input[name="s"] {
		height: 36px !important;
		min-height: 36px !important;
		padding-right: 6px !important;
		padding-left: 12px !important;
		font-size: 12.25px !important;
		line-height: 36px !important;
	}

	body.single-product:not(.woocommerce-checkout) #header.header-3029 .custom-search-box .btn-search {
		flex-basis: 36px;
		width: 36px !important;
		height: 36px !important;
		min-width: 36px !important;
		font-size: 16px !important;
	}

	body.single-product:not(.woocommerce-checkout) #header.header-3029 .custom-category-section {
		padding-bottom: 6px !important;
	}

	body.single-product:not(.woocommerce-checkout) #header.header-3029 .custom-category-section .elementor-container {
		padding-right: 8px !important;
		padding-left: 8px !important;
	}

	body.single-product:not(.woocommerce-checkout) #header.header-3029 .mkf-mini-banner-row {
		gap: 5px !important;
		padding-bottom: 1px !important;
		scroll-snap-type: x proximity;
	}

	body.single-product:not(.woocommerce-checkout) #header.header-3029 .mkf-mini-banner {
		flex-basis: 78px !important;
		min-width: 78px !important;
		max-width: 78px !important;
		min-height: 60px !important;
		padding: 7px 7px !important;
		border-radius: 11px !important;
		box-shadow: 0 4px 12px rgba(15, 23, 42, 0.07) !important;
		scroll-snap-align: start;
	}

	body.single-product:not(.woocommerce-checkout) #header.header-3029 .mkf-mini-banner--small {
		flex-basis: 56px !important;
		min-width: 56px !important;
		max-width: 56px !important;
	}

	body.single-product:not(.woocommerce-checkout) #header.header-3029 .mkf-mini-banner-tag {
		max-width: 100%;
		margin-bottom: 4px !important;
		padding: 2px 5px !important;
		font-size: 7.5px !important;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	body.single-product:not(.woocommerce-checkout) #header.header-3029 .mkf-mini-banner-title {
		display: -webkit-box;
		font-size: 10px !important;
		line-height: 1.03 !important;
		overflow: hidden;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
	}

	body.single-product:not(.woocommerce-checkout) #header.header-3029 .mkf-mini-banner-small-icon {
		margin-bottom: 2px !important;
		font-size: 13px !important;
		line-height: 1 !important;
	}

	body.single-product:not(.woocommerce-checkout) #header.header-3029 .mkf-mini-banner-small-title {
		font-size: 8px !important;
		line-height: 1.05 !important;
	}

	body.single-product:not(.woocommerce-checkout) .woocommerce-breadcrumb,
	body.single-product:not(.woocommerce-checkout) .breadcrumb {
		margin-top: 5px !important;
		margin-bottom: 6px !important;
		font-size: 11.25px !important;
		line-height: 1.3 !important;
	}
}
