/*
 * Local-only responsive compatibility layer.
 * Keep selectors tied to the affected templates and third-party widgets so the
 * imported desktop design remains unchanged.
 */

.gato-table-scroll-hint {
	margin: 8px 0 4px;
	color: #5f6b76;
	font-size: 13px;
	line-height: 1.4;
	text-align: right;
}

.gato-blog-single__content .scrolltable:focus-visible {
	outline: 3px solid rgba( 0, 145, 219, 0.35 );
	outline-offset: 3px;
}

/*
 * Restore the two text-only counters on the local C3 Laser Beam page.
 * Their Elementor Pro custom CSS is stored but unavailable locally.
 */
body.page-id-12192 .elementor-element.elementor-element-9069a5e .elementor-counter-number,
body.page-id-12192 .elementor-element.elementor-element-3ae68b1 .elementor-counter-number {
	display: none !important;
}

body.page-id-12192 .elementor-element.elementor-element-9069a5e .elementor-counter-number-prefix,
body.page-id-12192 .elementor-element.elementor-element-3ae68b1 .elementor-counter-number-prefix {
	margin-right: 0;
}

@media (max-width: 1024px) {
	/* Keep the fixed header's expanded menu within the current visual viewport.
	 * !important preserves scrolling while Royal's slide animation sets overflow.
	 */
	#gato-local-header .wpr-mobile-menu-display-dropdown .wpr-mobile-mega-menu-wrap[data-gato-mobile-scroll="true"] {
		box-sizing: border-box;
		max-height: calc(var(--gato-mobile-menu-height, 100vh) - env(safe-area-inset-bottom, 0px));
		overflow-x: hidden !important;
		overflow-y: auto !important;
		overscroll-behavior-y: contain;
		-webkit-overflow-scrolling: touch;
	}

	/* Prevent long non-breaking model names from forcing the product page to 940px. */
	body.single-product .woocommerce-Tabs-panel--description table {
		width: 100% !important;
		max-width: 100% !important;
		table-layout: fixed;
	}

	body.single-product .woocommerce-Tabs-panel--description table td,
	body.single-product .woocommerce-Tabs-panel--description table th {
		width: 50% !important;
		max-width: 50%;
		box-sizing: border-box;
		white-space: normal !important;
		overflow-wrap: anywhere;
		word-break: break-word;
		vertical-align: top;
	}

	body.single-product .woocommerce-Tabs-panel--description table td > strong:first-child,
	body.single-product .woocommerce-Tabs-panel--description table th > strong:first-child {
		display: block;
		margin-bottom: 4px;
	}

	/* Keep the floating contact actions in the two lower corners on small screens. */
	.wa__btn_popup {
		right: 16px !important;
		bottom: 16px !important;
		bottom: max(16px, env(safe-area-inset-bottom)) !important;
		left: auto !important;
	}

	.wa__btn_popup .wa__btn_popup_txt {
		display: none !important;
	}

	.wa__popup_chat_box {
		right: 16px !important;
		bottom: 92px !important;
		bottom: calc(92px + env(safe-area-inset-bottom)) !important;
		left: auto !important;
		width: min(351px, calc(100vw - 32px)) !important;
		max-width: calc(100vw - 32px) !important;
		max-height: calc(100vh - 116px);
		max-height: calc(100dvh - 116px);
		overflow-y: auto;
	}

	.elementor-element.elementor-element-de468f1.elementor-fixed {
		bottom: 16px !important;
		bottom: max(16px, env(safe-area-inset-bottom)) !important;
		left: 16px !important;
	}

	body.gato-local-contact-controls-suppressed .wa__btn_popup:not([data-gato-contact-drag]),
	body.gato-local-whatsapp-suppressed .wa__btn_popup[data-gato-contact-drag],
	body.gato-local-contact-controls-suppressed .elementor-element.elementor-element-de468f1.elementor-fixed {
		opacity: 0 !important;
		visibility: hidden !important;
		pointer-events: none !important;
		transform: translateY(16px) !important;
	}

	/* Preserve the hamburger artwork while expanding its actual touch target. */
	#gato-local-header .wpr-mobile-toggle {
		display: inline-flex !important;
		width: 44px !important;
		height: 44px !important;
		box-sizing: border-box;
		align-items: stretch;
		justify-content: center;
		flex-direction: column;
		padding: 10px 7px !important;
		cursor: pointer;
	}

	#gato-local-header .wpr-mobile-toggle .wpr-mobile-toggle-line:last-child {
		margin-bottom: 0;
	}

	#gato-local-header .elementor-element-02bbee1 .elementor-button {
		display: inline-flex;
		min-height: 44px;
		align-items: center;
		justify-content: center;
	}

	/* Hide the imported icon only when the local search fallback did not validate it. */
	#gato-local-header .elementor-element-18108d5:not(.gato-local-search-enabled) {
		display: none !important;
	}
}

@media (max-width: 767px) {
	/* Keep the industry timeline arrows inside the viewport instead of 5px beyond it. */
	.ha-horizontal-timeline .slick-prev {
		left: 0 !important;
	}

	.ha-horizontal-timeline .slick-next {
		right: 0 !important;
	}

	/* Stack each product parameter pair so every value remains readable at 390px. */
	body.single-product .woocommerce-Tabs-panel--description table,
	body.single-product .woocommerce-Tabs-panel--description table tbody,
	body.single-product .woocommerce-Tabs-panel--description table tr,
	body.single-product .woocommerce-Tabs-panel--description table td,
	body.single-product .woocommerce-Tabs-panel--description table th {
		display: block;
		width: 100% !important;
		max-width: 100%;
	}

	body.single-product .woocommerce-Tabs-panel--description table tr {
		margin-bottom: 12px;
	}

	body.single-product .woocommerce-Tabs-panel--description table td + td,
	body.single-product .woocommerce-Tabs-panel--description table th + th {
		border-top: 0;
	}
}
