/* ub/whatsapp. In the editor it sits where it is placed; on the site (.is-live) it is fixed to a bottom corner, clear
   of the notch and the home indicator (viewport-fit=cover, UB Kit's safe-area.php). The button is the theme's own: this
   file only places it and draws the icon. */
.wp-block-ub-whatsapp.is-live {
	position: fixed; z-index: 39; margin: 0;
	bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
	right: calc(1rem + env(safe-area-inset-right, 0px));
}
.wp-block-ub-whatsapp.is-live[data-side="left"] { right: auto; left: calc(1rem + env(safe-area-inset-left, 0px)); }
.wp-block-ub-whatsapp > .wp-block-buttons.wp-block-buttons { margin: 0; }
.wp-block-ub-whatsapp .wp-block-button { margin: 0; }
.wp-block-ub-whatsapp .wp-block-button__link {
	box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
	min-block-size: 3rem; white-space: nowrap;
	box-shadow: 0 10px 24px -12px rgb(0 0 0 / 0.5);
}
/* The icon, a mask in the text's colour: a speech bubble with a handset */
.wp-block-ub-whatsapp .wp-block-button__link::before {
	content: ""; flex: none; inline-size: 1.375em; block-size: 1.375em; background: currentColor;
	-webkit-mask: var(--ub-whatsapp-icon) center / contain no-repeat; mask: var(--ub-whatsapp-icon) center / contain no-repeat;
}
.wp-block-ub-whatsapp { --ub-whatsapp-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5a8.4 8.4 0 0 1-11.9 7.6L3 21l1.9-5.7A8.4 8.4 0 1 1 21 11.5z'/%3E%3Cpath stroke-width='1.6' d='M10.4 7.6H9.3a.8.8 0 0 0-.8.8 6.6 6.6 0 0 0 6.6 6.6.8.8 0 0 0 .8-.8v-1.1a.5.5 0 0 0-.3-.4l-1.4-.5a.5.5 0 0 0-.5.1l-.6.6a5 5 0 0 1-2.2-2.2l.6-.6a.5.5 0 0 0 .1-.5l-.5-1.4a.5.5 0 0 0-.4-.3z'/%3E%3C/svg%3E"); }
/* Icon only: a round button, the text kept for screen readers */
.wp-block-ub-whatsapp[data-icon-only="true"] .wp-block-button__link { inline-size: 3.5rem; block-size: 3.5rem; padding: 0; border-radius: 50%; }
.wp-block-ub-whatsapp[data-icon-only="true"] .wp-block-button__link::before { inline-size: 1.75rem; block-size: 1.75rem; }
.wp-block-ub-whatsapp[data-icon-only="true"] .ub-whatsapp__text {
	position: absolute; inline-size: 1px; block-size: 1px; margin: -1px; padding: 0;
	overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* The end of the page leaves room for it, so the footer's last links never stay under it */
:root { --ub-whatsapp-room: calc(4.5rem + env(safe-area-inset-bottom, 0px)); }
.ub-whatsapp-room { block-size: var(--ub-whatsapp-room); margin: 0; }
/* The rooms of UB Kit's fixed blocks (ub/whatsapp, ub/call-bar), placed last in the footer part: their space goes inside
   the last element before them (the footer's own group), so it takes the footer's background instead of a band of the
   page's colour under it (upperbiz-ro H82). That element is the last sibling that isn't one of ours; a flex or grid
   row, or none, keeps the room itself. Each room's height is a custom property (0 where it's hidden), the space the
   larger of the two. Browsers without :has() keep the rooms. Same rule in both blocks' style.css. */
@supports selector(:has(+ *)) {
	:not(.ub-call-bar-room, .wp-block-ub-call-bar, .ub-whatsapp-room, .wp-block-ub-whatsapp, style, script, template, link, .is-layout-flex, .is-layout-grid):has(~ :is(.ub-call-bar-room, .ub-whatsapp-room)):not(:has(~ :not(.ub-call-bar-room, .wp-block-ub-call-bar, .ub-whatsapp-room, .wp-block-ub-whatsapp, style, script, template, link))) ~ :is(.ub-call-bar-room, .ub-whatsapp-room) { display: none; }
	:not(.ub-call-bar-room, .wp-block-ub-call-bar, .ub-whatsapp-room, .wp-block-ub-whatsapp, style, script, template, link, .is-layout-flex, .is-layout-grid):has(~ :is(.ub-call-bar-room, .ub-whatsapp-room)):not(:has(~ :not(.ub-call-bar-room, .wp-block-ub-call-bar, .ub-whatsapp-room, .wp-block-ub-whatsapp, style, script, template, link)))::after {
		content: ""; display: block; block-size: max(var(--ub-call-bar-room, 0px), var(--ub-whatsapp-room, 0px));
	}
}

/* Out of the way: on the cart and checkout (the order comes first), while a menu, a drawer, a dialog or the cookie
   banner is open (grun-ro's and dinumobile-ro's own rules for WP Chat App's bubble, dinumobile-ro H4), and in print.
   Separate rules: a browser without :has() drops only that one; an open overlay hides the button, not the room, so the
   page doesn't move under it. Where the button goes for good, its room is 0. */
:is(.woocommerce-cart, .woocommerce-checkout) .wp-block-ub-whatsapp.is-live { display: none; }
:is(.woocommerce-cart, .woocommerce-checkout) { --ub-whatsapp-room: 0px; }
html.has-modal-open .wp-block-ub-whatsapp.is-live { display: none; }
body:has(.wp-block-navigation__responsive-container.is-menu-open, .wc-block-product-filters.is-overlay-opened, .wc-block-components-drawer__screen-overlay:not(.wc-block-components-drawer__screen-overlay--is-hidden), .wc-block-product-gallery-dialog[open], dialog[open], .ub-consent:not([hidden])) .wp-block-ub-whatsapp.is-live { display: none; }
@media print { .wp-block-ub-whatsapp.is-live { display: none; } :root:root { --ub-whatsapp-room: 0px; } }
