/*
 * kognito: layout-shift (CLS) fixes for the header, 2026-11.
 * Loaded after the theme styles from functions.php (webdigify_scripts_styles).
 */

/*
 * Arial sized to Heebo's width (menu text measures 93.5% as wide in Heebo,
 * 600 weight). While Heebo is still downloading, the fallback takes the same
 * space, so the desktop menu no longer wraps to two rows at 1280-1499px and
 * snaps back when the font arrives.
 */
@font-face {
	font-family: "Heebo Fallback";
	src: local("Arial");
	size-adjust: 93.5%;
}

.header-middle .main-navigation {
	font-family: Heebo, "Heebo Fallback", Arial, Helvetica, sans-serif;
}

/*
 * The search form's category dropdown is shown until jQuery customSelect runs,
 * then hidden by the Additional CSS rule (.hasCustomSelect). Hide it from the
 * first paint instead so the mobile search row doesn't collapse 25px after
 * load. A hidden select still submits its value (All Categories).
 */
.header-search .woocommerce-product-search select.orderby,
.header-search .woocommerce-product-search span.customSelect {
	display: none !important;
}

/*
 * Product gallery. WooCommerce keeps it invisible (opacity 0) until FlexSlider
 * and the theme's Owl thumbnail carousel have run, but its height still pushes
 * the summary down, and the summary jumped as the gallery changed shape.
 */

/* Before FlexSlider: lay the extra images out like the final thumbnail strip
   (one row, 93px images with 10px padding, 20px below the main image) instead
   of the theme's 25%-wide grid. */
.woocommerce-product-gallery > .woocommerce-product-gallery__wrapper {
	white-space: nowrap;
	overflow: hidden;
}

.woocommerce-product-gallery > .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:nth-child(n+2) {
	width: auto;
	padding: 10px;
	margin-top: 20px;
	vertical-align: top;
}

.woocommerce-product-gallery > .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:nth-child(n+2) img {
	width: 93px;
	height: auto;
	border: 1px solid transparent;
}

/* While FlexSlider sets up: its track is already N x 100% wide before it gives
   the slides their pixel widths, so the theme's 25% rule made each slide 1.5x
   the gallery and stacked them (~900px tall for one frame). One gallery-width
   per slide from the start; FlexSlider's inline widths take over after. */
.woocommerce-product-gallery .flex-viewport {
	container-type: inline-size;
}

.woocommerce-product-gallery .flex-viewport .woocommerce-product-gallery__image {
	width: 100cqw;
	float: left;
	display: block;
}

.woocommerce-product-gallery .flex-viewport .woocommerce-product-gallery__image img {
	display: block;
}

/* The thumbnail list is inserted one frame before Owl Carousel takes it over;
   the theme's li { width: 100% } stacked every thumbnail. Keep it to one row. */
.woocommerce-product-gallery .flex-control-thumbs:not(.owl-carousel) {
	overflow: hidden;
	white-space: nowrap;
}

.woocommerce-product-gallery .flex-control-thumbs:not(.owl-carousel) li {
	float: none;
	display: inline-block;
	width: auto;
	padding: 10px;
	vertical-align: top;
}

.woocommerce-product-gallery .flex-control-thumbs:not(.owl-carousel) img {
	width: 93px;
	height: auto;
}
