/**
 * RSI storefront — header logo + primary nav + brand accents.
 *
 * Match Straightline header rhythm: logo beside the menu. Logo size is
 * forced inline too (see branding.php) because Kirki prints width:300px late.
 */

body.storefront-rsi .site-header .header-main.height .header-inner {
	min-height: 100px;
}

body.storefront-rsi .site-header .header-main.height .header-inner .klbth-menu-wrapper .klbth-menu > li > a {
	height: 100px;
}

body.storefront-rsi .site-header .header-main .site-brand {
	flex-shrink: 0;
	width: auto !important;
	max-width: 320px !important;
}

body.storefront-rsi .site-header .header-main .site-brand a {
	display: flex;
	align-items: center;
	max-width: 100%;
}

body.storefront-rsi .site-header .header-main .site-brand img,
body.storefront-rsi .site-header .header-main .site-brand a img {
	display: block !important;
	height: 84px !important;
	width: auto !important;
	max-height: 84px !important;
	max-width: 320px !important;
	object-fit: contain !important;
}

body.storefront-rsi .site-header .header-mobile .site-brand {
	width: auto !important;
	max-width: min(200px, 52vw) !important;
}

body.storefront-rsi .site-header .header-mobile .site-brand img,
body.storefront-rsi .site-drawer .site-brand img {
	display: block !important;
	height: 44px !important;
	width: auto !important;
	max-height: 44px !important;
	max-width: min(200px, 52vw) !important;
	object-fit: contain !important;
}

/* Sticky mobile header: theme uses z-index:9 — page content covers the cart while scrolled */
@media screen and (max-width: 1199.98px) {
	body.storefront-rsi header.site-header.sticky-header .header-mobile {
		position: fixed !important;
		top: 0;
		left: 0;
		right: 0;
		width: 100%;
		z-index: 10050 !important;
		background-color: #000 !important;
		overflow: visible !important;
		box-sizing: border-box;
		padding-left: env(safe-area-inset-left, 0);
		padding-right: env(safe-area-inset-right, 0);
	}

	body.storefront-rsi header.site-header.sticky-header .header-mobile > .container {
		padding-left: max(1rem, var(--theme-gutter, 0.9375rem));
		padding-right: max(1rem, var(--theme-gutter, 0.9375rem));
		box-sizing: border-box;
	}

	body.storefront-rsi .site-header .header-mobile .header-inner,
	body.storefront-rsi header.site-header.sticky-header .header-mobile .header-inner {
		position: relative !important;
		z-index: 10051 !important;
		overflow: visible !important;
		display: flex !important;
		width: 100%;
		align-items: center;
		justify-content: space-between;
		box-sizing: border-box;
	}

	body.storefront-rsi .site-header .header-mobile .column.left,
	body.storefront-rsi .site-header .header-mobile .column.right {
		flex: 0 0 2.75rem !important;
		width: 2.75rem !important;
		position: relative;
		z-index: 2;
		display: flex !important;
		align-items: center;
	}

	body.storefront-rsi .site-header .header-mobile .column.left {
		justify-content: flex-start;
	}

	body.storefront-rsi .site-header .header-mobile .column.right {
		justify-content: flex-end;
		margin-left: auto;
		padding-right: 0.15rem;
	}

	body.storefront-rsi .site-header .header-mobile .column.center {
		position: absolute !important;
		left: 50% !important;
		top: 50% !important;
		transform: translate(-50%, -50%) !important;
		flex: none !important;
		width: auto !important;
		max-width: calc(100% - 6.5rem) !important;
		padding: 0 !important;
		z-index: 1;
		display: flex !important;
		align-items: center;
		justify-content: center;
		pointer-events: none;
	}

	body.storefront-rsi .site-header .header-mobile .column.center .site-brand,
	body.storefront-rsi .site-header .header-mobile .column.center .site-brand a {
		pointer-events: auto;
	}

	body.storefront-rsi .site-header .header-mobile .column.right,
	body.storefront-rsi .site-header .header-mobile .cart-button,
	body.storefront-rsi header.site-header.sticky-header .header-mobile .column.right,
	body.storefront-rsi header.site-header.sticky-header .header-mobile .cart-button {
		display: flex !important;
		visibility: visible !important;
		opacity: 1 !important;
	}

	body.storefront-rsi .site-header .header-mobile .cart-button .count,
	body.storefront-rsi header.site-header.sticky-header .header-mobile .cart-button .count {
		right: 0.15rem;
	}

	body.storefront-rsi .site-header .header-mobile .cart-button .quick-icon,
	body.storefront-rsi .site-header .header-mobile .cart-button .quick-icon i,
	body.storefront-rsi .site-header .header-mobile .cart-button .quick-icon i::before {
		color: #fff !important;
		-webkit-text-fill-color: #fff !important;
	}
}

@media screen and (min-width: 1200px) {
	body.storefront-rsi .site-header .header-main .header-inner {
		align-items: center;
	}

	body.storefront-rsi .site-header .header-main .header-inner > .column.left {
		display: flex;
		align-items: center;
		flex: 1 1 auto;
		min-width: 0;
		flex-wrap: nowrap;
	}

	body.storefront-rsi .site-header .header-main .header-inner > .column.right {
		display: flex;
		align-items: center;
		flex-shrink: 0;
	}

	/* Sit beside the logo like Straightline — not margin-left:auto to the icons */
	body.storefront-rsi .site-header .header-main .site-brand + .klbth-menu-wrapper {
		margin-left: 1rem !important;
	}

	body.storefront-rsi .site-header .header-main .klbth-menu-wrapper.primary {
		flex: 0 1 auto;
		min-width: 0;
		margin-left: 1rem;
		display: flex;
		align-items: center;
		justify-content: flex-start;
	}

	body.storefront-rsi .site-header .header-main .klbth-menu-wrapper.primary .klbth-menu {
		flex-wrap: nowrap !important;
		align-items: center;
		justify-content: flex-start;
		width: auto;
		max-width: 100%;
	}

	body.storefront-rsi .site-header .header-main .klbth-menu-wrapper.primary .klbth-menu > .menu-item {
		flex-shrink: 0;
	}

	body.storefront-rsi
		.site-header
		.header-main
		.klbth-menu-wrapper.primary
		.klbth-menu
		> .menu-item
		> a {
		display: inline-flex;
		align-items: center;
		padding-left: 0.625rem;
		padding-right: 0.625rem;
		font-size: 0.9375rem;
		line-height: 1.2;
		white-space: nowrap;
	}
}

/*
 * RSI brand blue (#0331F2 from storefront primary_color).
 * Override Straightline red accents on YMM bar, GO, dots, focus rings.
 */
body.storefront-rsi {
	--storefront-brand-color: #0331f2;
	--color-primary: var(--storefront-brand-color, #0331f2);
	--rsi-brand: var(--storefront-brand-color, #0331f2);
	--rsi-brand-light: #2f56f7;
	--rsi-brand-dark: #0226c4;
}

body.storefront-rsi .elementor-section:has(.wpce-filter-widget-inner),
body.storefront-rsi .elementor-section.ymm-hero-red {
	background-color: var(--rsi-brand) !important;
	background-image: none !important;
}

body.storefront-rsi .wpce-filter-widget-inner {
	box-shadow: 0 14px 42px rgba(0, 0, 0, 0.45),
		0 0 0 1px rgba(3, 49, 242, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

body.storefront-rsi .wpce-filter-widget-inner .wpce-field select:focus,
body.storefront-rsi .wpce-filter-widget-inner .wpce-field input:focus {
	border-color: rgba(3, 49, 242, 0.95) !important;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18),
		0 0 0 3px rgba(3, 49, 242, 0.35) !important;
}

body.storefront-rsi .wpce-filter-widget-inner .wpce-field-buttons input[type="submit"] {
	background: linear-gradient(
		180deg,
		var(--rsi-brand-light) 0%,
		var(--rsi-brand) 55%,
		var(--rsi-brand-dark) 100%
	) !important;
	box-shadow: 0 4px 16px rgba(3, 49, 242, 0.55),
		inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

body.storefront-rsi
	.wpce-filter-widget-inner
	.wpce-field-buttons
	input[type="submit"]:hover {
	background: linear-gradient(
		180deg,
		#4a6ff8 0%,
		var(--rsi-brand-light) 55%,
		var(--rsi-brand) 100%
	) !important;
	box-shadow: 0 7px 22px rgba(3, 49, 242, 0.6);
}

body.storefront-rsi .klbth-slider-wrapper .slick-dots li.slick-active button,
body.storefront-rsi .klbth-slider-wrapper .slick-dots li button:hover {
	background-color: var(--rsi-brand) !important;
}

/*
 * Homepage hero: Elementor forces min-height:400px + vertical centering, which
 * left black gaps around a shorter banner. On mobile, style-inner banners use
 * position:absolute images, so height must come from the banner box itself —
 * use the slide aspect ratio instead of stretching the image to fill 400px.
 */
@media (max-width: 1024px) {
	body.storefront-rsi .elementor-62596 .elementor-element-aa18497 > .elementor-container,
	body.storefront-rsi.elementor-page-62596 .elementor-element-aa18497 > .elementor-container {
		min-height: 0 !important;
		height: auto !important;
		align-items: stretch !important;
	}

	body.storefront-rsi .elementor-62596 .elementor-element-aa18497 .klbth-banner.style-inner {
		position: relative;
		width: 100%;
		aspect-ratio: 5 / 2;
		min-height: 160px;
		overflow: hidden;
	}

	body.storefront-rsi .elementor-62596 .elementor-element-aa18497 .klbth-banner.style-inner .entry-wrapper {
		position: absolute;
		inset: 0;
		z-index: 1;
		height: 100%;
		box-sizing: border-box;
	}

	body.storefront-rsi .elementor-62596 .elementor-element-aa18497 .klbth-slider.dots-align-center .slick-dots {
		margin-top: 0.5rem;
		margin-bottom: 0;
	}
}

@media (max-width: 767px) {
	body.storefront-rsi .elementor-62596 .elementor-element-aa18497 .klbth-banner.style-inner {
		aspect-ratio: 2 / 1;
		min-height: 140px;
	}
}

/*
 * Links + primary buttons → RSI blue (theme contact links use --color-danger;
 * child/Additional CSS often hardcode Straightline red).
 */
body.storefront-rsi {
	--color-primary-dark: var(--rsi-brand-dark);
	--color-primary-lighter: #e8edff;
}

body.storefront-rsi .contact-iconboxes .iconbox .detail a,
body.storefront-rsi .contact-iconboxes .iconbox .detail a:hover,
body.storefront-rsi .contact-iconboxes .iconbox .detail a:focus,
body.storefront-rsi .contact-iconboxes .iconbox .detail p a,
body.storefront-rsi .contact-iconboxes .iconbox .detail p a:hover {
	color: var(--rsi-brand) !important;
	-webkit-text-fill-color: var(--rsi-brand) !important;
}

body.storefront-rsi .elementor-widget-partdo-contact-icon-box a,
body.storefront-rsi .elementor-widget-partdo-contact-icon-box a:hover {
	color: var(--rsi-brand) !important;
	-webkit-text-fill-color: var(--rsi-brand) !important;
}

body.storefront-rsi .btn.primary,
body.storefront-rsi .btn.primary:hover,
body.storefront-rsi a.btn.primary,
body.storefront-rsi button.btn.primary,
body.storefront-rsi .button.alt,
body.storefront-rsi .single_add_to_cart_button,
body.storefront-rsi .single_add_to_cart_button:hover,
body.storefront-rsi button.single_add_to_cart_button,
body.storefront-rsi .checkout-button,
body.storefront-rsi .woocommerce a.button.alt,
body.storefront-rsi .woocommerce button.button.alt,
body.storefront-rsi .woocommerce input.button.alt,
body.storefront-rsi .woocommerce #respond input#submit.alt,
body.storefront-rsi .gform_button,
body.storefront-rsi .gform_footer input[type="submit"],
body.storefront-rsi .gform_page_footer input[type="submit"],
body.storefront-rsi #gform_submit_button_4,
body.storefront-rsi #gform_submit_button_6,
body.storefront-rsi #gform_submit_button_9,
body.storefront-rsi .eael-gravity-form .gform_footer input[type="submit"],
body.storefront-rsi .elementor-button,
body.storefront-rsi .elementor-button-link {
	background-color: var(--rsi-brand) !important;
	background-image: none !important;
	border-color: var(--rsi-brand) !important;
	color: #fff !important;
	-webkit-text-fill-color: #fff !important;
}

/*
 * Loop cards: Partdo marks every CTA with .primary — don’t let brand blue
 * paint Add to cart / Read more. Keep light pill + dark text (kits stay blue).
 */
body.storefront-rsi .product:not(.pk-kit-card-inner) .product-footer a.button,
body.storefront-rsi .product:not(.pk-kit-card-inner) .product-footer a.primary,
body.storefront-rsi .product:not(.pk-kit-card-inner) .product-footer .button,
body.storefront-rsi .product:not(.pk-kit-card-inner) .product-cart-form a.button {
	background-color: #f1f3f5 !important;
	border-color: #dee2e6 !important;
	color: #212529 !important;
	-webkit-text-fill-color: #212529 !important;
	background-image: none !important;
}

body.storefront-rsi .product:not(.pk-kit-card-inner) .product-footer a.button i,
body.storefront-rsi .product:not(.pk-kit-card-inner) .product-footer a.button i::before,
body.storefront-rsi .product:not(.pk-kit-card-inner) .product-footer a.primary i,
body.storefront-rsi .product:not(.pk-kit-card-inner) .product-footer a.primary i::before {
	color: #212529 !important;
	-webkit-text-fill-color: #212529 !important;
}

body.storefront-rsi .product:not(.pk-kit-card-inner) .product-footer a.button:hover,
body.storefront-rsi .product:not(.pk-kit-card-inner) .product-footer a.primary:hover,
body.storefront-rsi .product:not(.pk-kit-card-inner) .product-footer .button:hover,
body.storefront-rsi .product:not(.pk-kit-card-inner) .product-cart-form a.button:hover {
	background-color: var(--rsi-brand) !important;
	border-color: var(--rsi-brand) !important;
	color: #fff !important;
	-webkit-text-fill-color: #fff !important;
}

body.storefront-rsi .product:not(.pk-kit-card-inner) .product-footer a.button:hover i,
body.storefront-rsi .product:not(.pk-kit-card-inner) .product-footer a.button:hover i::before,
body.storefront-rsi .product:not(.pk-kit-card-inner) .product-footer a.primary:hover i,
body.storefront-rsi .product:not(.pk-kit-card-inner) .product-footer a.primary:hover i::before {
	color: #fff !important;
	-webkit-text-fill-color: #fff !important;
}

body.storefront-rsi .btn.primary:hover,
body.storefront-rsi .single_add_to_cart_button:hover,
body.storefront-rsi .gform_footer input[type="submit"]:hover,
body.storefront-rsi .elementor-button:hover {
	background-color: var(--rsi-brand-dark) !important;
	border-color: var(--rsi-brand-dark) !important;
}

/* Kit archive “Build your package” — same light pill as other loop CTAs */
body.storefront-rsi .pk-kit-archive-products .pk-kit-card-inner .product-footer .button,
body.storefront-rsi .pk-kit-archive-products .pk-kit-card-inner .product-footer .add_to_cart_button {
	background-color: #f1f3f5 !important;
	border-color: #dee2e6 !important;
	color: #212529 !important;
	-webkit-text-fill-color: #212529 !important;
	background-image: none !important;
}

body.storefront-rsi .pk-kit-archive-products .pk-kit-card-inner .product-footer .button:hover,
body.storefront-rsi .pk-kit-archive-products .pk-kit-card-inner .product-footer .add_to_cart_button:hover {
	background-color: var(--rsi-brand) !important;
	border-color: var(--rsi-brand) !important;
	color: #fff !important;
	-webkit-text-fill-color: #fff !important;
}

@media screen and (max-width: 991.98px) {
	body.storefront-rsi .pk-kit-archive-products .pk-kit-card-inner .product-footer,
	body.storefront-rsi .pk-kit-archive-products .pk-kit-card-inner .product-footer-inner,
	body.storefront-rsi .pk-kit-archive-products .pk-kit-card-inner .product-content-fade {
		background-color: transparent !important;
		border-top: 0;
		box-shadow: none;
	}
}

/* Free-shipping progress bar (cart / mini-cart / checkout) */
body.storefront-rsi .klbth-free-shipping .shipping-progress span {
	background-color: var(--rsi-brand) !important;
	background: var(--rsi-brand) !important;
}

body.storefront-rsi .klbth-free-shipping .free-shipping-notice .woocommerce-Price-amount,
body.storefront-rsi .klbth-free-shipping .free-shipping-notice .woocommerce-Price-amount bdi {
	color: var(--rsi-brand) !important;
}
