/**
 * Keeps the "Ask Sam" bubble clear of Woodmart's bottom-fixed furniture.
 *
 * ID selectors on purpose: the bundled widget injects its own <style> at
 * runtime (so it lands after this sheet) and marks every rule !important —
 * an id beats its `.wallu-btn` / `.wallu-window` classes.
 *
 * --elf-sam-bottom-offset is maintained by sam-widget-fit.js.
 */

:root {
	--elf-sam-bottom-offset: 0px;
}

#walluChatButton {
	bottom: calc(20px + var(--elf-sam-bottom-offset)) !important;
}

#walluChatWindow {
	bottom: calc(98px + var(--elf-sam-bottom-offset)) !important;
	max-height: calc(100vh - 118px - var(--elf-sam-bottom-offset)) !important;
}

/* A side drawer (mini-cart, mobile nav) is open — get out of its way entirely. */
body.elf-sam-hidden #walluChatButton,
body.elf-sam-hidden #walluChatWindow {
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

/**
 * The theme's scroll-to-top button is fixed at right:20px/bottom:20px with
 * z-index 350 — i.e. entirely underneath the bubble, unclickable. Lift it over
 * the bubble (64px tall + its own 20px offset + a gap), inheriting whatever
 * offset the bubble itself is carrying. Gated on the bubble actually being
 * present, so a page with the widget filtered off keeps the theme's placement.
 */
body:has(#walluChatButton) .scrollToTop {
	bottom: calc(96px + var(--elf-sam-bottom-offset)) !important;
}
