/**
 * BotBut sticky bar — front-end styles.
 *
 * Every custom property has a fallback, so the bar looks correct in BOTH render
 * modes: the global footer bar (where a dynamic <style> sets the vars) and the
 * Elementor widget (where Elementor's generated CSS sets them). Layout uses CSS
 * logical properties where practical for RTL support.
 */

.botbut-bar {
	position: fixed;
	inset-inline: 0;
	inset-block-end: var(--botbut-offset, 0px);
	z-index: var(--botbut-z, 9990);
	inline-size: 100%;
	max-inline-size: var(--botbut-max-width, 100%);
	margin-inline: auto;
	box-sizing: border-box;
	font-family: inherit;
	padding-block-end: env(safe-area-inset-bottom, 0px);
	background: transparent;
	pointer-events: none; /* re-enabled on the inner container */
}

.botbut-bar * {
	box-sizing: border-box;
}

.botbut-bar__inner {
	display: grid;
	grid-template-columns: repeat(var(--botbut-count, 1), 1fr);
	gap: var(--botbut-gap, 0px);
	block-size: var(--botbut-height, 62px);
	border-radius: var(--botbut-radius, 0px);
	overflow: hidden;
	pointer-events: auto;
}

.botbut-bar--shadow .botbut-bar__inner {
	box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.18);
}

/* Individual button. */
.botbut-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	text-decoration: none;
	line-height: 1.1;
	background: var(--botbut-btn-bg, #333333);
	color: var(--botbut-btn-fg, #ffffff);
	transition: filter 0.15s ease, opacity 0.15s ease;
	position: relative;
	padding: 4px 6px;
	min-inline-size: 0;
	text-align: center;
}

.botbut-btn:hover,
.botbut-btn:focus-visible {
	filter: brightness(1.08);
	color: var(--botbut-btn-fg, #ffffff);
}

.botbut-btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -3px;
}

.botbut-btn__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: relative;
}

.botbut-btn__icon svg,
.botbut-btn__icon .dashicons {
	inline-size: var(--botbut-icon-size, 22px);
	block-size: var(--botbut-icon-size, 22px);
	font-size: var(--botbut-icon-size, 22px);
	display: block;
}

.botbut-btn__label {
	display: block;
	font-size: var(--botbut-font-size, 13px);
	font-weight: 600;
	max-inline-size: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.botbut-bar--no-labels .botbut-btn__label {
	display: none;
}

/* WooCommerce cart count badge. */
.botbut-cart-count {
	position: absolute;
	inset-block-start: -8px;
	inset-inline-end: -10px;
	min-inline-size: 17px;
	block-size: 17px;
	padding: 0 4px;
	border-radius: 9px;
	background: #e02b2b;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 17px;
	text-align: center;
}

.botbut-cart-count.is-empty {
	display: none;
}

/* Per-button visibility helpers (device-level). */
@media (max-width: 767px) {
	.botbut-btn--only-desktop {
		display: none;
	}
}

@media (min-width: 768px) {
	.botbut-btn--only-mobile {
		display: none;
	}
}

/* Appear animations. */
@media (prefers-reduced-motion: no-preference) {
	.botbut-bar--anim-slide .botbut-bar__inner {
		animation: botbut-slide-up 0.28s cubic-bezier(0.23, 1, 0.32, 1);
	}

	.botbut-bar--anim-fade .botbut-bar__inner {
		animation: botbut-fade 0.32s ease;
	}
}

@keyframes botbut-slide-up {
	from {
		transform: translateY(100%);
	}
	to {
		transform: translateY(0);
	}
}

@keyframes botbut-fade {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}
