/* Halfskull: layout, tap target, focus and mobile-viewport fixes (24 Nov 2026 audit). */

/* 1. Checkout step bar: on phones show the label of the current step only (others stay readable to screen readers). */
@media (max-width: 480px) {
	body.hs-co3 .hs-co-steps { gap: 10px; }
	body.hs-co3 .hs-co-step:not(.is-active) .hs-co-step__t {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
	body.hs-co3 .hs-co-step + .hs-co-step::before { width: 22px; }
}

/* 2. Tap targets: JS adds .hs-tap to small controls; the pseudo element grows the hit area to 44px without moving anything. */
.hs-tap-static { position: relative; }
.hs-tap::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: max(100%, 44px);
	height: max(100%, 44px);
	transform: translate(-50%, -50%);
}
@media (pointer: coarse) {
	.quantity input.qty { min-height: 44px; }
}

/* 3. Keyboard focus: visible ring for keyboard users only. */
html body :is(a, button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])):focus-visible {
	outline: 3px solid #e11d2e !important;
	outline-offset: 2px !important;
}
html body :is(.hs-co-top, .woocommerce-store-notice, [class*="topbar"], footer) :is(a, button):focus-visible {
	outline-color: #fff !important;
}

/* 4. Form fields at 16px on phones so iOS does not zoom the page on focus. */
@media (max-width: 767px) {
	html body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
	html body select,
	html body textarea {
		font-size: 16px !important;
	}
}

/* 5. Dynamic viewport height so full-height panels do not jump when the mobile browser bar shows or hides. */
@supports (height: 100dvh) {
	.mm-menu_fullscreen.mm-menu_position-top,
	.mm-menu_fullscreen.mm-menu_position-bottom { height: 100dvh; }
	.filter-mobile .content { height: 100dvh; }
	#sidebar-shop.sidebar-desktop { height: 100dvh; }
	#tbay-search-form-canvas .sidebar-canvas-search:before { height: 100dvh; }
	[class*="mm-wrapper_sidebar-collapsed-"] .mm-page,
	[class*="mm-wrapper_sidebar-expanded-"] .mm-page { min-height: 100dvh; }
}
