/*
 * RDS Solution child theme safety fixes.
 * Keep this file scoped so parent theme and plugin files stay untouched.
 */

/*
 * Linked loop images need a stable percentage reference. Elementor's inline-
 * block link otherwise shrinks to the source image's intrinsic width, so a
 * small upload renders differently from an unlinked image with the same
 * editor controls. Size the link only; image width/max-width, height, crop,
 * alignment and radius remain controlled by Elementor. Low specificity lets
 * explicit custom link styles take precedence.
 */
:where(.e-loop-item .elementor-widget-image) a:has(> img) {
	width: 100%;
}

/*
 * Pro Elements' pre-initialization rule targets .swiper--slide, while loop
 * markup uses .swiper-slide. Size actual slides using Elementor's responsive
 * variables until Swiper takes over; never hardcode page IDs, counts or gaps.
 */
.elementor-widget-loop-carousel .swiper:not(.swiper-initialized) > .swiper-wrapper > .swiper-slide,
.elementor-widget-loop-carousel .swiper-container:not(.swiper-container-initialized) > .swiper-wrapper > .swiper-slide {
	--rds-loop-gap-count: max(calc(var(--swiper-slides-to-display, 1) - 1), 0);
	max-width: calc((100% - var(--rds-loop-gap-count) * var(--swiper-slides-gap, 10px)) / var(--swiper-slides-to-display, 1));
	min-width: 0;
}

.borbila-floating-whatsapp {
	align-items: center;
	bottom: 24px;
	display: inline-flex;
	flex-direction: row-reverse;
	gap: 10px;
	left: max(22px, env(safe-area-inset-left));
	position: fixed;
	right: auto;
	text-decoration: none !important;
	z-index: 99990;
}

.borbila-floating-whatsapp__icon {
	align-items: center;
	background: #12b955;
	border: 1px solid rgba(255, 255, 255, 0.45);
	border-radius: 999px;
	box-shadow: none;
	color: #fff;
	display: inline-flex;
	height: 58px;
	justify-content: center;
	position: relative;
	transition: transform 220ms ease, background-color 220ms ease;
	width: 58px;
}

.borbila-floating-whatsapp__icon svg {
	display: block;
	fill: currentColor;
	height: 31px;
	width: 31px;
}

.borbila-floating-whatsapp__text {
	background: #101214;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 999px;
	box-shadow: none;
	color: #fff;
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	opacity: 0;
	padding: 12px 15px;
	pointer-events: none;
	transform: translateX(-10px) scale(0.96);
	transform-origin: left center;
	transition: opacity 220ms ease, transform 220ms ease;
	white-space: nowrap;
}

.borbila-floating-whatsapp:hover .borbila-floating-whatsapp__icon,
.borbila-floating-whatsapp:focus-visible .borbila-floating-whatsapp__icon {
	background: #059447;
	transform: translateY(-3px) scale(1.04);
}

.borbila-floating-whatsapp:hover .borbila-floating-whatsapp__text,
.borbila-floating-whatsapp:focus-visible .borbila-floating-whatsapp__text {
	opacity: 1;
	transform: translateX(0) scale(1);
}

.borbila-floating-whatsapp:focus-visible {
	outline: 2px solid rgba(18, 185, 85, 0.5);
	outline-offset: 6px;
}

body.admin-bar .borbila-floating-whatsapp {
	bottom: 34px;
}

/*
 * Elementor WooCommerce Product Price widgets should fully respect the
 * typography selected in Elementor. WooCommerce wraps prices in nested
 * amount/ins/del/bdi elements, and those children can otherwise keep an
 * older generated size or weight in loop cards and product templates.
 */
.woocommerce .elementor-widget-woocommerce-product-price .price .amount,
.woocommerce .elementor-widget-woocommerce-product-price .price .amount bdi,
.woocommerce .elementor-widget-woocommerce-product-price .price ins .amount,
.woocommerce .elementor-widget-woocommerce-product-price .price ins .amount bdi,
.woocommerce .elementor-widget-woocommerce-product-price .price del .amount,
.woocommerce .elementor-widget-woocommerce-product-price .price del .amount bdi {
	font-family: inherit !important;
	font-size: inherit !important;
	font-style: inherit !important;
	font-weight: inherit !important;
	letter-spacing: inherit !important;
	line-height: inherit !important;
	text-transform: inherit !important;
}

.woocommerce .elementor-widget-woocommerce-product-price .price ins {
	text-decoration: none;
}


@media (max-width: 767px) {
	.borbila-floating-whatsapp {
		bottom: calc(63px + var(--rds-floating-nav-offset, 0px) + env(safe-area-inset-bottom, 0px));
		left: max(16px, env(safe-area-inset-left));
		right: auto;
	}

	body.admin-bar .borbila-floating-whatsapp {
		bottom: calc(63px + var(--rds-floating-nav-offset, 0px) + env(safe-area-inset-bottom, 0px));
	}

	.borbila-floating-whatsapp__icon {
		height: 48px;
		width: 48px;
	}

	.borbila-floating-whatsapp__icon svg {
		height: 29px;
		width: 29px;
	}

	.borbila-floating-whatsapp__text {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.borbila-floating-whatsapp__icon,
	.borbila-floating-whatsapp__text { transition: none; }
	.borbila-floating-whatsapp:hover .borbila-floating-whatsapp__icon,
	.borbila-floating-whatsapp:focus-visible .borbila-floating-whatsapp__icon { transform: none; }
}

/*
 * Auto Checkout Replacer: remove all visual shadows from the custom checkout.
 * Keep this in the child theme so plugin updates do not bring the shadows back.
 */
.acr-checkout-scope,
.acr-checkout-scope *,
.acr-checkout-scope *::before,
.acr-checkout-scope *::after {
	box-shadow: none !important;
	text-shadow: none !important;
}

.acr-checkout-scope [style*="box-shadow"] {
	box-shadow: none !important;
}

.acr-checkout-scope [style*="text-shadow"] {
	text-shadow: none !important;
}

.acr-checkout-scope [style*="drop-shadow"] {
	filter: none !important;
}

/*
 * Elementor Posts card thumbnails: keep blog images crisp on the live site.
 * Elementor adds a tiny 1.01 scale and 1px offset for cover thumbnails, which
 * can make detailed blog images look soft even when the full image is selected.
 */
.elementor-widget-posts .elementor-posts-container.elementor-has-item-ratio .elementor-post__thumbnail img {
	filter: none !important;
	left: 50% !important;
	top: 50% !important;
	transform: translate(-50%, -50%) scale(1) !important;
}

.elementor-widget-posts .elementor-posts-container.elementor-has-item-ratio .elementor-post__thumbnail:not(.elementor-fit-height) img {
	width: 100% !important;
}

/*
 * Header Elementor Search: remove the unintended browser/Elementor focus ring
 * that appears as a white border around the search field while typing.
 */
.elementor-location-header .elementor-widget-search,
.elementor-location-header .elementor-widget-search.e-focus,
.elementor-location-header .elementor-widget-search .e-search,
.elementor-location-header .elementor-widget-search .e-search:focus-within,
.elementor-location-header .elementor-widget-search .e-search-input-wrapper,
.elementor-location-header .elementor-widget-search .e-search-input-wrapper:focus-within,
.elementor-location-header .elementor-widget-search .e-search-input,
.elementor-location-header .elementor-widget-search .e-search-input:focus,
.elementor-location-header .elementor-widget-search .e-search-input:focus-visible {
	outline: none !important;
	box-shadow: none !important;
}

.elementor-location-header .elementor-widget-search .e-search-input,
.elementor-location-header .elementor-widget-search .e-search-input:focus,
.elementor-location-header .elementor-widget-search .e-search-input:focus-visible {
	border-color: transparent !important;
	border-style: none !important;
}

.elementor-location-header .elementor-widget-search .e-search,
.elementor-location-header .elementor-widget-search .e-search:focus-within,
.elementor-location-header .elementor-widget-search .e-search-input-wrapper,
.elementor-location-header .elementor-widget-search .e-search-input-wrapper:focus-within {
	border-color: inherit !important;
}

/*
 * Popup Search: remove Hello Elementor's default 4px white focus halo.
 * Keep specificity below Elementor's generated widget styles so editor-defined
 * borders and normal/focus shadows still win. The surrounding container keeps
 * its own border, and unrelated controls retain their keyboard focus styles.
 */
:where([data-elementor-type="popup"]) .elementor-widget-search .e-search-input:focus,
:where([data-elementor-type="popup"]) .elementor-widget-search .e-search-input:focus-visible {
	outline: none;
	box-shadow: none;
}

/*
 * Checkout Page: Top Error Notice Banner
 * Enforce pure black text (#000000) for all text and links, and remove error icon.
 */
.woocommerce-checkout .woocommerce-NoticeGroup-checkout,
.woocommerce-checkout .woocommerce-NoticeGroup,
.woocommerce-checkout ul.woocommerce-error,
.woocommerce-checkout .woocommerce-error,
.acr-checkout-scope .woocommerce-NoticeGroup-checkout,
.acr-checkout-scope .woocommerce-NoticeGroup,
.acr-checkout-scope ul.woocommerce-error,
.acr-checkout-scope .woocommerce-error {
	color: #000000 !important;
}

.woocommerce-checkout ul.woocommerce-error::before,
.woocommerce-checkout .woocommerce-error::before,
.woocommerce-checkout ul.woocommerce-error::after,
.woocommerce-checkout .woocommerce-error::after,
.woocommerce-checkout ul.woocommerce-error li::before,
.woocommerce-checkout .woocommerce-error li::before,
.woocommerce-checkout ul.woocommerce-error svg,
.woocommerce-checkout .woocommerce-error svg,
.woocommerce-checkout ul.woocommerce-error i,
.woocommerce-checkout .woocommerce-error i,
.acr-checkout-scope ul.woocommerce-error::before,
.acr-checkout-scope .woocommerce-error::before,
.acr-checkout-scope ul.woocommerce-error::after,
.acr-checkout-scope .woocommerce-error::after,
.acr-checkout-scope ul.woocommerce-error li::before,
.acr-checkout-scope .woocommerce-error li::before,
.acr-checkout-scope ul.woocommerce-error svg,
.acr-checkout-scope .woocommerce-error svg,
.acr-checkout-scope ul.woocommerce-error i,
.acr-checkout-scope .woocommerce-error i {
	content: none !important;
	display: none !important;
	background: none !important;
	width: 0 !important;
	height: 0 !important;
}

.woocommerce-checkout .woocommerce-NoticeGroup-checkout *,
.woocommerce-checkout .woocommerce-NoticeGroup *,
.woocommerce-checkout ul.woocommerce-error *,
.woocommerce-checkout .woocommerce-error *,
.acr-checkout-scope .woocommerce-NoticeGroup-checkout *,
.acr-checkout-scope .woocommerce-NoticeGroup *,
.acr-checkout-scope ul.woocommerce-error *,
.acr-checkout-scope .woocommerce-error * {
	color: #000000 !important;
	font-family: "Hind Siliguri", sans-serif !important;
}

.woocommerce-checkout .woocommerce-NoticeGroup-checkout a,
.woocommerce-checkout .woocommerce-NoticeGroup-checkout a:link,
.woocommerce-checkout .woocommerce-NoticeGroup-checkout a:visited,
.woocommerce-checkout .woocommerce-NoticeGroup-checkout a:hover,
.woocommerce-checkout .woocommerce-NoticeGroup-checkout a:focus,
.woocommerce-checkout .woocommerce-NoticeGroup-checkout a:active,
.woocommerce-checkout ul.woocommerce-error a,
.woocommerce-checkout ul.woocommerce-error a:link,
.woocommerce-checkout ul.woocommerce-error a:visited,
.woocommerce-checkout ul.woocommerce-error a:hover,
.woocommerce-checkout ul.woocommerce-error a:focus,
.woocommerce-checkout ul.woocommerce-error a:active,
.acr-checkout-scope .woocommerce-NoticeGroup-checkout a,
.acr-checkout-scope .woocommerce-NoticeGroup-checkout a:link,
.acr-checkout-scope .woocommerce-NoticeGroup-checkout a:visited,
.acr-checkout-scope .woocommerce-NoticeGroup-checkout a:hover,
.acr-checkout-scope .woocommerce-NoticeGroup-checkout a:focus,
.acr-checkout-scope .woocommerce-NoticeGroup-checkout a:active,
.acr-checkout-scope ul.woocommerce-error a,
.acr-checkout-scope ul.woocommerce-error a:link,
.acr-checkout-scope ul.woocommerce-error a:visited,
.acr-checkout-scope ul.woocommerce-error a:hover,
.acr-checkout-scope ul.woocommerce-error a:focus,
.acr-checkout-scope ul.woocommerce-error a:active {
	color: #000000 !important;
	text-decoration: none !important;
	font-weight: 600 !important;
}
