/* Final mobile overrides loaded after dist/style.css */

@media (max-width: 767px) {
	.mf-catalog-page {
		padding-left: 10px !important;
		padding-right: 10px !important;
	}

	.woocommerce .mf-shop-content {
		padding-left: 0 !important;
		padding-right: 0 !important;
		padding-top: 12px !important;
		padding-bottom: 12px !important;
	}

	.woocommerce .mf-catalog-layout {
		grid-template-columns: minmax(0, 1fr) !important;
		gap: 10px !important;
	}

	.woocommerce ul.products:not(.slick-slider) {
		margin-left: 0 !important;
		margin-right: 0 !important;
		gap: 10px !important;
	}

	.mobile-version.mf-catalog-page ul.products {
		margin-left: 0 !important;
		margin-right: 0 !important;
	}

	.mobile-version.mf-catalog-page ul.products li.product,
	.woocommerce ul.products:not(.slick-slider) li.product {
		padding-left: 0 !important;
		padding-right: 0 !important;
		max-width: none !important;
		width: auto !important;
		float: none !important;
		margin-bottom: 0 !important;
	}

	.woocommerce ul.products:not(.slick-slider) li.product .mf-product-content,
	.woocommerce ul.products:not(.slick-slider) li.product .mf-product-price-box,
	.woocommerce ul.products:not(.slick-slider) li.product .mf-product-details {
		padding: 10px !important;
	}

	.woocommerce ul.products:not(.slick-slider) li.product .mf-product-details h2,
	.woocommerce ul.products:not(.slick-slider) li.product .mf-product-details h2 a,
	.woocommerce ul.products li.product h2 {
		font-size: 14px !important;
		line-height: 1.3 !important;
	}

	.woocommerce ul.products:not(.slick-slider) li.product .mf-product-price-box .price,
	.woocommerce ul.products li.product .price {
		font-size: 16px !important;
		line-height: 1.2 !important;
	}

	.woocommerce .product-card-attributes {
		gap: 4px !important;
	}
}

/* Desktop: only "Post Ad" label visible (mobile span screenreader-hidden) */
@media (min-width: 992px) {
	.menu-item-post-ad .mf-post-ad-text--mobile {
		position: absolute !important;
		width: 1px !important;
		height: 1px !important;
		padding: 0 !important;
		margin: -1px !important;
		overflow: hidden !important;
		clip: rect(0, 0, 0, 0) !important;
		border: 0 !important;
	}

	.menu-item-post-ad .mf-post-ad-text--desktop {
		position: static !important;
		width: auto !important;
		height: auto !important;
		clip: auto !important;
		overflow: visible !important;
		margin: 0 !important;
	}

	/* Logged-out header: login icon + label aligned with Post Ad */
	#site-header .extras-menu .menu-item-account:not(.logined) {
		display: flex !important;
		align-items: center !important;
	}

	#site-header .extras-menu .menu-item-account:not(.logined) > a#menu-extra-login {
		display: inline-flex !important;
		align-items: center !important;
		gap: 0.35rem !important;
		padding-left: 0 !important;
		padding-top: 0 !important;
		line-height: 1 !important;
		height: auto !important;
		overflow: visible !important;
		font-size: 15px !important;
		font-weight: 600 !important;
		white-space: nowrap !important;
	}

	#site-header .extras-menu .menu-item-account:not(.logined) > a#menu-extra-login .extra-icon {
		position: static !important;
		top: auto !important;
		left: auto !important;
		display: inline-flex !important;
		align-items: center !important;
		justify-content: center !important;
		font-size: 22px !important;
		line-height: 1 !important;
	}

	#site-header .extras-menu .menu-item-account:not(.logined) > a.item-register {
		display: none !important;
	}
}

@media (max-width: 991px) {
	/*
	 * Frosted glass mobile header.
	 * #site-header beats .site-header { transparent } from style.css (ID specificity).
	 * Do not require .ds-header — some layouts omit it.
	 */
	#site-header.site-header {
		position: relative;
		z-index: 10000;
		background-color: rgba(255, 255, 255, 0.55) !important;
		-webkit-backdrop-filter: blur(24px) saturate(180%);
		backdrop-filter: blur(24px) saturate(180%);
		box-shadow: 0 8px 32px rgba(15, 23, 42, 0.06);
	}

	/* Inner rows stay transparent so one glass layer comes from #site-header */
	#site-header .header-main,
	#site-header .header-main.ds-header {
		background-color: transparent !important;
		-webkit-backdrop-filter: none !important;
		backdrop-filter: none !important;
		border-bottom: 1px solid rgba(255, 255, 255, 0.25);
		box-shadow: none !important;
	}

	.mobile-version #site-header .mobile-menu {
		background-color: transparent !important;
		-webkit-backdrop-filter: none !important;
		backdrop-filter: none !important;
		border-bottom: 1px solid rgba(15, 23, 42, 0.06);
	}

	.mobile-version.sticky-header .site-header.minimized .mobile-menu {
		background-color: transparent !important;
	}

	.header-main.ds-header .header-extras.ds-header-right {
		min-width: 0 !important;
		gap: 8px !important;
		flex-shrink: 1 !important;
	}

	.header-main.ds-header .ds-header-search {
		min-width: 0 !important;
		margin-left: 8px !important;
		margin-right: 8px !important;
		flex: 1 1 auto !important;
	}

	/*
	 * Header only: compact Sell pill (match any Martfury mobile header layout).
	 */
	#site-header .header-main .extras-menu .menu-item-post-ad .mf-post-ad-button,
	#site-header .extras-menu .menu-item-post-ad .mf-post-ad-button {
		display: inline-flex !important;
		align-items: center !important;
		justify-content: center !important;
		width: auto !important;
		min-width: 0 !important;
		max-width: 100% !important;
		height: auto !important;
		min-height: 40px !important;
		padding: 0.35rem 0.85rem !important;
		border-radius: 0.75rem !important;
		font-size: 14px !important;
		font-weight: 600 !important;
		color: #fff !important;
		background-color: #ef4444 !important;
		-webkit-tap-highlight-color: transparent;
		white-space: nowrap !important;
	}

	#site-header .header-main .extras-menu .menu-item-post-ad .mf-post-ad-icon,
	#site-header .extras-menu .menu-item-post-ad .mf-post-ad-icon {
		display: none !important;
	}

	#site-header .header-main .extras-menu .menu-item-post-ad .mf-post-ad-text--desktop,
	#site-header .extras-menu .menu-item-post-ad .mf-post-ad-text--desktop {
		position: absolute !important;
		width: 1px !important;
		height: 1px !important;
		padding: 0 !important;
		margin: -1px !important;
		overflow: hidden !important;
		clip: rect(0, 0, 0, 0) !important;
		border: 0 !important;
	}

	#site-header .header-main .extras-menu .menu-item-post-ad .mf-post-ad-text--mobile,
	#site-header .extras-menu .menu-item-post-ad .mf-post-ad-text--mobile {
		position: static !important;
		width: auto !important;
		height: auto !important;
		padding: 0 !important;
		margin: 0 !important;
		overflow: visible !important;
		clip: auto !important;
		border: 0 !important;
		color: #fff !important;
	}

	/* Logged-in account drawer: no duplicate Post Ad row */
	.primary-user-nav .extra-account .menu-item-post-ad {
		display: none !important;
	}

	/* iOS: avoid focus zoom (16px+ inputs) */
	.mobile-version .site-header .product-extra-search .search-field,
	.site-header .mobile-menu .product-extra-search .search-field,
	.header-main.ds-header .products-search .search-field,
	#site-header .header-main .products-search .search-field,
	#mf-els-modal-mobile .products-search .search-field {
		font-size: 16px !important;
	}

	/*
	 * Rounded search — mobile menu row.
	 * Do NOT use overflow:hidden on .product-extra-search — it clips .search-results dropdown.
	 */
	.mobile-version .site-header .mobile-menu .product-extra-search,
	.site-header .mobile-menu .product-extra-search {
		border-radius: 0 !important;
		overflow: visible !important;
		border: none !important;
	}

	.mobile-version .site-header .mobile-menu .product-extra-search .psearch-content,
	.site-header .mobile-menu .product-extra-search .psearch-content {
		border-radius: 0.75rem !important;
		overflow: visible !important;
		border: 1px solid rgba(226, 232, 240, 0.95) !important;
	}

	.mobile-version .site-header .mobile-menu .product-extra-search .search-field,
	.site-header .mobile-menu .product-extra-search .search-field {
		border-left: none !important;
		border-top-left-radius: 0.75rem !important;
		border-bottom-left-radius: 0.75rem !important;
		border-top-right-radius: 0 !important;
		border-bottom-right-radius: 0 !important;
	}

	.mobile-version .site-header .mobile-menu .product-extra-search .search-submit,
	.site-header .mobile-menu .product-extra-search .search-submit {
		border-radius: 0 !important;
		border-top-right-radius: 0.75rem !important;
		border-bottom-right-radius: 0.75rem !important;
		border-top-left-radius: 0 !important;
		border-bottom-left-radius: 0 !important;
	}

	/*
	 * Rounded search — main header bar (category hidden on mobile).
	 * overflow:visible on .product-extra-search so Martfury AJAX suggestions are not clipped.
	 */
	#site-header .header-main .product-extra-search,
	.header-main.ds-header .product-extra-search {
		overflow: visible !important;
	}

	#site-header .header-main .product-extra-search .psearch-content,
	.header-main.ds-header .product-extra-search .psearch-content {
		border-radius: 0.75rem !important;
		overflow: visible !important;
	}

	.header-main.ds-header .products-search .search-field,
	#site-header .header-main .products-search .search-field {
		border-top-left-radius: 0.75rem !important;
		border-bottom-left-radius: 0.75rem !important;
		border-left: none !important;
	}

	.header-main.ds-header .products-search .search-submit,
	#site-header .header-main .products-search .search-submit {
		border-top-right-radius: 0.75rem !important;
		border-bottom-right-radius: 0.75rem !important;
	}

	/* Product search suggestions above page content */
	.site-header .product-extra-search .products-search.actived .search-wrapper .search-results,
	#site-header .product-extra-search .products-search.actived .search-wrapper .search-results {
		z-index: 10050 !important;
	}

	/* Full-screen search modal: results are a sibling of .search-wrapper — do not clip them */
	#mf-els-modal-mobile .search-wrapper {
		border-radius: 0.75rem !important;
		overflow: visible !important;
		align-items: stretch !important;
	}

	#mf-els-modal-mobile .products-search {
		position: relative;
	}

	#mf-els-modal-mobile .products-search.actived .search-results {
		z-index: 10060 !important;
	}

	#mf-els-modal-mobile .search-field {
		border-top-left-radius: 0.75rem !important;
		border-bottom-left-radius: 0.75rem !important;
		border-top-right-radius: 0 !important;
		border-bottom-right-radius: 0 !important;
	}

	#mf-els-modal-mobile .search-submit {
		border-radius: 0 !important;
		border-top-right-radius: 0.75rem !important;
		border-bottom-right-radius: 0.75rem !important;
	}
}

/*
 * Apple Homepage — hero under glass header (mobile).
 * Loads after global mobile header rules; body class from template-homepage-apple.php.
 */
@media (max-width: 991px) {
	body.page-template-template-homepage-apple.mobile-version #site-header.site-header {
		position: absolute !important;
		top: 0 !important;
		left: 0 !important;
		right: 0 !important;
		width: 100% !important;
		z-index: 10000 !important;
		background-color: rgba(255, 255, 255, 0.5) !important;
		-webkit-backdrop-filter: blur(24px) saturate(180%) !important;
		backdrop-filter: blur(24px) saturate(180%) !important;
		box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06) !important;
		border-bottom: 1px solid rgba(255, 255, 255, 0.35) !important;
	}

	body.page-template-template-homepage-apple.mobile-version #site-header .header-main,
	body.page-template-template-homepage-apple.mobile-version #site-header .header-main.ds-header,
	body.page-template-template-homepage-apple.mobile-version #site-header .mobile-menu {
		background-color: transparent !important;
		-webkit-backdrop-filter: none !important;
		backdrop-filter: none !important;
	}

	body.page-template-template-homepage-apple.mobile-version #content,
	body.page-template-template-homepage-apple.mobile-version .site-content {
		padding-top: 0 !important;
		margin-top: 0 !important;
	}

	body.page-template-template-homepage-apple.mobile-version .apple-hero {
		padding-top: 7.5rem;
		min-height: 100svh;
	}

	body.page-template-template-homepage-apple .apple-home-section-title {
		font-size: 22px !important;
		margin-bottom: 8px !important;
	}

	body.page-template-template-homepage-apple .apple-home-section-lead {
		font-size: 16px !important;
	}

	body.page-template-template-homepage-apple .apple-hero-subtitle {
		font-size: 20px !important;
	}

	body.page-template-template-homepage-apple .apple-category-card__title {
		font-size: 15px !important;
		margin-bottom: 4px !important;
	}

	body.page-template-template-homepage-apple .apple-category-card__desc {
		font-size: 13px !important;
		line-height: 1.4 !important;
	}

	body.page-template-template-homepage-apple .apple-category-card__icon {
		width: 3.5rem !important;
		height: 3.5rem !important;
		margin-bottom: 0.75rem !important;
	}

	body.page-template-template-homepage-apple .apple-category-card__icon svg {
		width: 1.75rem !important;
		height: 1.75rem !important;
	}

	body.page-template-template-homepage-apple .apple-feature-card__head {
		display: flex;
		align-items: center;
		gap: 10px;
		margin-bottom: 8px;
		min-height: 2.75rem;
	}

	body.page-template-template-homepage-apple .apple-feature-card__icon {
		margin-bottom: 0 !important;
		align-self: center;
	}

	body.page-template-template-homepage-apple .apple-feature-card__title {
		margin: 0 !important;
		align-self: center;
	}

	body.page-template-template-homepage-apple .apple-cta-title {
		font-size: 28px !important;
		margin-bottom: 12px !important;
	}

	body.page-template-template-homepage-apple .apple-cta-lead {
		font-size: 16px !important;
		line-height: 1.55 !important;
		margin-bottom: 1.75rem !important;
	}

	body.page-template-template-homepage-apple .apple-feature-card__title {
		font-size: 16px !important;
	}

	body.page-template-template-homepage-apple .apple-feature-card__desc {
		font-size: 14px !important;
	}
}
