/**
 * Buldog · Sticky add to cart bar (buldog_sticky_atc widget).
 *
 * Fixed to the bottom on mobile (≤767px) always; tablet/desktop opt-in via widget
 * classes. The widget's .elementor-element node is portaled to <body> by JS so
 * Elementor's own stacking contexts cannot trap the fixed bar. Widget style controls
 * write the --bsa-* custom properties on the bar root (they survive the portal
 * because the portal carries the Elementor document class).
 *
 * Z ladder: issue-report 9990 < Cookiez pill 9999 < bar 20000 < Cookiez dialog 99999 < mini cart 1000000.
 */

.buldog-sticky-atc__portal {
	position: relative;
	z-index: var(--buldog-sticky-atc-z, 20000);
}

.buldog-sticky-atc {
	--bsa-bg: #fff;
	--bsa-border: #eceff2;
	--bsa-pad-top: 8px;
	--bsa-pad-right: 12px;
	--bsa-pad-bottom: 10px;
	--bsa-pad-left: 12px;
	--bsa-ctrl-h: 50px;
	--bsa-radius: 10px;
	--bsa-btn-bg: #477a2b;
	--bsa-btn-color: #fff;
	--bsa-btn-bg-hover: #365f20;
	/* "Choose options" state: same green as add by default (own widget controls can change it). */
	--bsa-btn-select-bg: var(--bsa-btn-bg);
	--bsa-btn-select-color: var(--bsa-btn-color);
	--bsa-btn-select-bg-hover: var(--bsa-btn-bg-hover);
	--bsa-btn-disabled-bg: #edf0e9;
	--bsa-btn-disabled-color: #66705e;
	--bsa-checkout-bg: #e23434;
	--bsa-checkout-color: #fff;
	--bsa-checkout-bg-hover: #c42a2a;
	--bsa-qty-border: #d9dde3;
	--bsa-qty-color: #111;
	--bsa-qty-bg: #fff;
	--bsa-price-color: #111;
	--bsa-remove-color: #4b4b4b;
	--bsa-status-color: #365d21;
	--bsa-status-bg: #fff;

	position: fixed;
	inset-inline: 0;
	bottom: 0;
	z-index: var(--buldog-sticky-atc-z, 20000);
	display: none;
	flex-direction: column;
	gap: 6px;
	box-sizing: border-box;
	width: 100%;
	max-width: 100vw;
	margin: 0;
	padding: var(--bsa-pad-top) var(--bsa-pad-right) calc(var(--bsa-pad-bottom) + env(safe-area-inset-bottom, 0px)) var(--bsa-pad-left);
	background: var(--bsa-bg);
	border-top: 1px solid var(--bsa-border);
	box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.12);
	direction: rtl;
	font-size: 15px;
	line-height: 1.2;
}

@media (max-width: 767px) {
	.buldog-sticky-atc {
		display: flex;
	}
	body.buldog-has-sticky-atc {
		padding-bottom: calc(var(--buldog-sticky-atc-h, 70px) + 8px);
	}
}
@media (min-width: 768px) and (max-width: 1024px) {
	.buldog-sticky-atc--tablet {
		display: flex;
	}
	body.buldog-has-sticky-atc {
		padding-bottom: calc(var(--buldog-sticky-atc-h, 70px) + 8px);
	}
}
@media (min-width: 1025px) {
	.buldog-sticky-atc--desktop {
		display: flex;
	}
	body.buldog-has-sticky-atc {
		padding-bottom: calc(var(--buldog-sticky-atc-h, 70px) + 8px);
	}
}

/* Accessibility widget (Ally, #ea11y-root): its floating button is `position:fixed` inside a
 * shadow root with inline `bottom:24px !important` and z-index 2147483645, so it sat on top of
 * the bar's minus button and cannot be restyled from outside. Turning the host into a
 * zero-height fixed box on the bar's top edge with a transform makes the host the containing
 * block of the button and of the menu panel: "bottom: 24px" now means 24px above the bar.
 * Zero height = it captures no taps; only applies while the bar is showing. */
@media (max-width: 767px) {
	body.buldog-has-sticky-atc #ea11y-root {
		position: fixed;
		left: 0;
		right: 0;
		bottom: var(--buldog-sticky-atc-h, 95px);
		height: 0;
		transform: translateZ(0);
		z-index: 19990;
	}
}

/* Editor preview: static, always visible, never fixed. */
.elementor-editor-active .buldog-sticky-atc,
.buldog-sticky-atc.is-editor {
	position: static;
	display: flex;
	max-width: none;
	box-shadow: none;
	border: 1px dashed var(--bsa-border);
	border-radius: var(--bsa-radius);
}

/* Cart panel open: the bar sits under the backdrop; make sure it cannot be tapped. */
body.buldog-mini-cart-open .buldog-sticky-atc {
	pointer-events: none;
}

/* ---------------------------------------------------------------- meta line */

.buldog-sticky-atc__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	min-height: 20px;
	font-size: 14px;
}
.buldog-sticky-atc__meta:empty {
	display: none;
}

.buldog-sticky-atc__price {
	color: var(--bsa-price-color);
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.buldog-sticky-atc__price .price,
.buldog-sticky-atc__price .amount {
	color: inherit;
	font-size: inherit;
}
.buldog-sticky-atc__price del {
	opacity: 0.6;
	font-weight: 400;
	margin-inline-end: 6px;
}
.buldog-sticky-atc__price .ppu {
	display: none;
}

.buldog-sticky-atc__remove {
	appearance: none;
	margin: 0;
	padding: 2px 4px;
	min-height: 24px;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: var(--bsa-remove-color);
	font: inherit;
	font-size: 13px;
	text-decoration: underline;
	cursor: pointer;
	white-space: nowrap;
}
.buldog-sticky-atc__remove:hover,
.buldog-sticky-atc__remove:focus-visible {
	background: transparent;
	color: var(--bsa-remove-color);
	outline: 2px solid var(--bsa-btn-bg);
	outline-offset: 1px;
}
.buldog-sticky-atc__remove:disabled {
	opacity: 0.6;
	cursor: wait;
}
.buldog-sticky-atc__remove[hidden] {
	display: none !important;
}

/* ---------------------------------------------------------------- controls row */

.buldog-sticky-atc__row {
	display: grid;
	grid-template-columns: 140px minmax(0, 1fr);
	gap: 10px;
	align-items: stretch;
	width: 100%;
	min-width: 0;
	height: var(--bsa-ctrl-h);
}
.buldog-sticky-atc--in-cart:not(.buldog-sticky-atc--no-checkout) .buldog-sticky-atc__row {
	grid-template-columns: 140px minmax(0, 1fr) minmax(0, 1fr);
	gap: 6px;
}
.buldog-sticky-atc--no-qty .buldog-sticky-atc__row,
.buldog-sticky-atc--select .buldog-sticky-atc__row {
	grid-template-columns: minmax(0, 1fr);
}
.buldog-sticky-atc--in-cart.buldog-sticky-atc--no-qty:not(.buldog-sticky-atc--no-checkout) .buldog-sticky-atc__row {
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
/* Must out-specify the `.buldog-sticky-atc .buldog-sticky-atc__qty { display: grid }` rule below. */
.buldog-sticky-atc.buldog-sticky-atc--select .buldog-sticky-atc__row .buldog-sticky-atc__qty {
	display: none;
}

/* Stepper: fixed 44 / 52 / 44 columns so nothing can drift. */
.buldog-sticky-atc .buldog-sticky-atc__qty {
	display: grid;
	grid-template-columns: 44px 52px 44px;
	align-items: stretch;
	box-sizing: border-box;
	width: 140px;
	min-width: 140px;
	height: var(--bsa-ctrl-h);
	margin: 0;
	padding: 0;
	border: 1px solid var(--bsa-qty-border);
	border-radius: var(--bsa-radius);
	background: var(--bsa-qty-bg);
	overflow: hidden;
	direction: rtl;
}
.buldog-sticky-atc .buldog-sticky-atc__qty .buldog-qty-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	min-width: 44px;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: var(--bsa-qty-bg);
	color: var(--bsa-qty-color);
	box-shadow: none;
	font: 700 23px/1 Arial, sans-serif;
	cursor: pointer;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}
.buldog-sticky-atc .buldog-sticky-atc__qty .buldog-qty-btn:hover,
.buldog-sticky-atc .buldog-sticky-atc__qty .buldog-qty-btn:focus-visible,
.buldog-sticky-atc .buldog-sticky-atc__qty .buldog-qty-btn:active {
	background: #f1f3f5;
	color: var(--bsa-qty-color);
	outline: none;
}
.buldog-sticky-atc .buldog-sticky-atc__qty .buldog-qty-btn:disabled {
	opacity: 0.45;
	cursor: default;
}
.buldog-sticky-atc .buldog-sticky-atc__qty input.buldog-sticky-atc__qty-input {
	display: block;
	box-sizing: border-box;
	width: 52px;
	min-width: 52px;
	max-width: 52px;
	height: 100%;
	min-height: 0;
	margin: 0;
	padding: 0 2px;
	border: 0;
	border-inline: 1px solid #eceff2;
	border-radius: 0;
	background: var(--bsa-qty-bg);
	color: var(--bsa-qty-color);
	box-shadow: none;
	text-align: center;
	font-size: 16px;
	font-weight: 700;
	-moz-appearance: textfield;
	appearance: textfield;
}
.buldog-sticky-atc .buldog-sticky-atc__qty input.buldog-sticky-atc__qty-input::-webkit-outer-spin-button,
.buldog-sticky-atc .buldog-sticky-atc__qty input.buldog-sticky-atc__qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
}
.buldog-sticky-atc .buldog-sticky-atc__qty input.buldog-sticky-atc__qty-input:focus {
	outline: none;
	background: #f8fafc;
}

@media (max-width: 360px) {
	.buldog-sticky-atc__row,
	.buldog-sticky-atc--in-cart:not(.buldog-sticky-atc--no-checkout) .buldog-sticky-atc__row {
		grid-template-columns: 128px minmax(0, 1fr);
	}
	.buldog-sticky-atc--in-cart:not(.buldog-sticky-atc--no-checkout) .buldog-sticky-atc__row {
		grid-template-columns: 128px minmax(0, 1fr) minmax(0, 1fr);
	}
	.buldog-sticky-atc .buldog-sticky-atc__qty {
		grid-template-columns: 40px 48px 40px;
		width: 128px;
		min-width: 128px;
	}
	.buldog-sticky-atc .buldog-sticky-atc__qty .buldog-qty-btn {
		width: 40px;
		min-width: 40px;
	}
	.buldog-sticky-atc .buldog-sticky-atc__qty input.buldog-sticky-atc__qty-input {
		width: 48px;
		min-width: 48px;
		max-width: 48px;
	}
}

/* Main button + checkout link share the row height. */
.buldog-sticky-atc button.buldog-sticky-atc__btn,
.buldog-sticky-atc a.buldog-sticky-atc__checkout {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
	height: var(--bsa-ctrl-h);
	min-height: var(--bsa-ctrl-h);
	margin: 0;
	padding: 0 12px;
	border: 0;
	border-radius: var(--bsa-radius);
	background: var(--bsa-btn-bg);
	color: var(--bsa-btn-color);
	box-shadow: none;
	font-family: 'Varela Round', 'Heebo', Arial, sans-serif;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	cursor: pointer;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	transition: background-color 0.15s ease, transform 0.15s ease;
}
.buldog-sticky-atc button.buldog-sticky-atc__btn:hover,
.buldog-sticky-atc button.buldog-sticky-atc__btn:focus-visible,
.buldog-sticky-atc button.buldog-sticky-atc__btn:active {
	background: var(--bsa-btn-bg-hover);
	color: var(--bsa-btn-color);
	outline: none;
}
.buldog-sticky-atc button.buldog-sticky-atc__btn:active {
	transform: scale(0.985);
}
.buldog-sticky-atc button.buldog-sticky-atc__btn[data-state='select'] {
	background: var(--bsa-btn-select-bg);
	color: var(--bsa-btn-select-color);
}
.buldog-sticky-atc button.buldog-sticky-atc__btn[data-state='select']:hover,
.buldog-sticky-atc button.buldog-sticky-atc__btn[data-state='select']:active {
	background: var(--bsa-btn-select-bg-hover);
}
.buldog-sticky-atc button.buldog-sticky-atc__btn:disabled,
.buldog-sticky-atc button.buldog-sticky-atc__btn[data-state='disabled'] {
	background: var(--bsa-btn-disabled-bg);
	color: var(--bsa-btn-disabled-color);
	opacity: 1;
	cursor: default;
	transform: none;
}
.buldog-sticky-atc.is-busy .buldog-sticky-atc__btn {
	cursor: wait;
}
.buldog-sticky-atc.is-busy .buldog-sticky-atc__btn-label {
	opacity: 0.75;
}
.buldog-sticky-atc button.buldog-sticky-atc__btn:focus-visible {
	outline: 2px solid #111;
	outline-offset: 2px;
}
.buldog-sticky-atc--in-cart:not(.buldog-sticky-atc--no-checkout) .buldog-sticky-atc__btn,
.buldog-sticky-atc--in-cart:not(.buldog-sticky-atc--no-checkout) a.buldog-sticky-atc__checkout {
	padding: 0 4px;
	font-size: 15px;
}

.buldog-sticky-atc a.buldog-sticky-atc__checkout {
	background: var(--bsa-checkout-bg);
	color: var(--bsa-checkout-color);
}
.buldog-sticky-atc a.buldog-sticky-atc__checkout:hover,
.buldog-sticky-atc a.buldog-sticky-atc__checkout:focus-visible,
.buldog-sticky-atc a.buldog-sticky-atc__checkout:active {
	background: var(--bsa-checkout-bg-hover);
	color: var(--bsa-checkout-color);
}
.buldog-sticky-atc a.buldog-sticky-atc__checkout[aria-disabled='true'] {
	pointer-events: none;
	opacity: 0.7;
}
.buldog-sticky-atc a.buldog-sticky-atc__checkout[hidden] {
	display: none !important;
}

/* Ripple host inside the button (pure cosmetics, driven by the Web Animations API). */
.buldog-sticky-atc__fx {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 120%;
	padding-top: 120%;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.35);
	transform: translate(-50%, -50%) scale(0);
	opacity: 0;
	pointer-events: none;
}
.buldog-sticky-atc__particle {
	position: absolute;
	width: 6px;
	height: 6px;
	border-radius: 2px;
	transform: translate(-50%, -50%);
	pointer-events: none;
	z-index: 1;
}

/* ---------------------------------------------------------------- status toast */

.buldog-sticky-atc__status {
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: calc(100% + 8px);
	padding: 10px;
	border: 1px solid #dbe7d2;
	border-radius: 8px;
	background: var(--bsa-status-bg);
	color: var(--bsa-status-color);
	box-shadow: 0 2px 14px rgba(0, 0, 0, 0.13);
	text-align: center;
	font-size: 14px;
	line-height: 1.4;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
}
.buldog-sticky-atc__status.is-shown {
	visibility: visible;
	animation: bsa-toast 3s ease forwards;
}
@keyframes bsa-toast {
	0% {
		opacity: 0;
		transform: translateY(6px);
	}
	10%,
	85% {
		opacity: 1;
		transform: translateY(0);
	}
	100% {
		opacity: 0;
		transform: translateY(6px);
	}
}
@media (prefers-reduced-motion: reduce) {
	.buldog-sticky-atc__status.is-shown {
		animation-duration: 2.6s;
		animation-timing-function: steps(1, end);
	}
	.buldog-sticky-atc button.buldog-sticky-atc__btn {
		transition: none;
	}
}
