/* Boba's Plants — one button style for the whole site (mu-plugins/bobas-buttons.php), 2026-12-03.
   Grandt: "only the buttons, not all the styling from the members area … there are different colours for the
   buttons so yes, they can share a style". So: the members-area button (bobas-members-home/members.css, .bmh-btn)
   on every theme / WooCommerce / page button, each keeping its own colour:
     a leaf-shaped corner that turns over on hover, a pressable lip, a sweep of light, a leaf that sprouts from the
     top, and a ripple from where you press (bobas-buttons.php adds it). The main call to action on a page breathes.
   The sweep is a background layer, not ::before, because the Christmas plugin's snow cap lives on ::before.
   Every rule starts with `PREFIX` = html body:not(#bsb):not(#bsb-x):not(#bsb-x), so it outranks the theme's many !important
   rules and the checkout's `body.bobas-co #place_order` (each id in :not() counts as an id). The shared rules list
   the buttons in :where() (no extra weight), so the colour and size rules below, which name one class, win. The members area keeps its own copy (.bmh-btn) and is not touched here.
   The two campaign landing pages are reached through bobas_buttons_head() in their templates.
   Not covered: carousel arrows, filter chips, swatches. */

/* where the sweep of light sits. Registered so it can glide (an animation can't move a !important background
   position, but it can move the variable the position reads). */
@property --bsb-x { syntax: '<percentage>'; inherits: false; initial-value: 125%; }

/* ------------------------------------------------------------------ every button, the shared shape --- */
html body:not(#bsb):not(#bsb-x) :where(
	.button.button-primary, .bco-card__add, .btn-boba-compact, .bco-bar__go, main .search-submit, .btn-boba-hub,
	.single_add_to_cart_button, main .btn.btn-primary, main .btn.btn-dark, main .btn.btn-boba-plum, .os-btn,
	.bpc-login-btn, a.d-inline-block[href="#bpc-signup"], .bobas-archive__cta, .woocommerce .button, .bco-btn,
	#place_order, .product__card .reserve, header .nav-button > a.nav-link, header .bpc-members-nav-btn > a.nav-link,
	.bsb-landing .btn, .bsb-landing .add, .bsb-landing .go
) {
	--c: #8b3f5d;
	--c2: #9d4a6c;
	--lip: #551f36;
	--ink: #fff;
	--leaf: #a9d873;
	--ring: 236, 160, 192;
	--r1: 6px;
	--r2: 22px;
	--lip-h: 5px;
	--edge: 0 0 0 0 transparent;
	position: relative !important;
	isolation: isolate;
	overflow: visible !important;
	border: 0 !important;
	border-radius: var(--r1) var(--r2) var(--r1) var(--r2) !important;
	background-color: var(--c) !important;
	background-image:
		linear-gradient(105deg, rgba(255, 255, 255, 0) 36%, rgba(255, 255, 255, .55) 47%, rgba(255, 255, 255, .14) 54%, rgba(255, 255, 255, 0) 64%),
		linear-gradient(180deg, rgba(255, 255, 255, .26) 0%, rgba(255, 255, 255, .06) 50%, rgba(0, 0, 0, .1) 100%) !important;
	background-size: 260% 100%, 100% 100% !important;
	--bsb-x: 125%;
	background-position: var(--bsb-x) 0, 0 0 !important;
	background-repeat: no-repeat !important;
	color: var(--ink) !important;
	font-weight: 800 !important;
	letter-spacing: .01em !important;
	text-transform: none !important;
	text-decoration: none !important;
	text-shadow: 0 1px 0 rgba(0, 0, 0, .28);
	cursor: pointer;
	box-shadow: var(--edge), 0 var(--lip-h) 0 var(--lip), 0 14px 22px -10px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .38) !important;
	transform: translateY(0) !important;
	transition: transform .2s cubic-bezier(.3, .7, .4, 1.6), box-shadow .2s ease, border-radius .45s cubic-bezier(.3, .7, .3, 1), background-color .2s ease, color .2s ease !important;
	-webkit-tap-highlight-color: transparent;
}
/* the leaf that sprouts from the top */
html body:not(#bsb):not(#bsb-x) :where(
	.button.button-primary, .bco-card__add, .btn-boba-compact, .bco-bar__go, main .search-submit, .btn-boba-hub,
	.single_add_to_cart_button, main .btn.btn-primary, main .btn.btn-dark, main .btn.btn-boba-plum, .os-btn,
	.bpc-login-btn, a.d-inline-block[href="#bpc-signup"], .bobas-archive__cta, .woocommerce .button, .bco-btn,
	#place_order, .product__card .reserve, header .nav-button > a.nav-link, header .bpc-members-nav-btn > a.nav-link,
	.bsb-landing .btn, .bsb-landing .add, .bsb-landing .go
)::after {
	content: "" !important;
	position: absolute !important;
	right: 16%;
	top: -16px;
	left: auto;
	bottom: auto;
	width: 22px;
	height: 22px;
	margin: 0;
	border: 0;
	pointer-events: none;
	background: var(--leaf) !important;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 21C4 11 10 3.5 22 2.5 21.5 14.5 14 21 5.5 21Z'/%3E%3Cpath d='M1.2 23.2 6.5 17.6 8 19 2.7 24.6Z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 21C4 11 10 3.5 22 2.5 21.5 14.5 14 21 5.5 21Z'/%3E%3Cpath d='M1.2 23.2 6.5 17.6 8 19 2.7 24.6Z'/%3E%3C/svg%3E") center / contain no-repeat;
	filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .3));
	transform: scale(0) rotate(-60deg);
	transform-origin: 8% 96%;
	transition: transform .42s cubic-bezier(.3, 1.8, .5, 1);
	z-index: 2;
}

/* hover: the leaf corner turns over, the button lifts on its lip, light sweeps across, the leaf sprouts */
html body:not(#bsb):not(#bsb-x) :where(
	.button.button-primary, .bco-card__add, .btn-boba-compact, .bco-bar__go, main .search-submit, .btn-boba-hub,
	.single_add_to_cart_button, main .btn.btn-primary, main .btn.btn-dark, main .btn.btn-boba-plum, .os-btn,
	.bpc-login-btn, a.d-inline-block[href="#bpc-signup"], .bobas-archive__cta, .woocommerce .button, .bco-btn,
	#place_order, .product__card .reserve, header .nav-button > a.nav-link, header .bpc-members-nav-btn > a.nav-link,
	.bsb-landing .btn, .bsb-landing .add, .bsb-landing .go
):hover {
	background-color: var(--c2) !important;
	color: var(--ink) !important;
	border-radius: var(--r2) var(--r1) var(--r2) var(--r1) !important;
	--bsb-x: -60%;
	transform: translateY(-3px) !important;
	box-shadow: var(--edge), 0 calc(var(--lip-h) + 3px) 0 var(--lip), 0 22px 28px -12px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .45) !important;
	transition: transform .2s cubic-bezier(.3, .7, .4, 1.6), box-shadow .2s ease, border-radius .45s cubic-bezier(.3, .7, .3, 1), background-color .2s ease, color .2s ease, --bsb-x .8s ease !important;
}
html body:not(#bsb):not(#bsb-x) :where(
	.button.button-primary, .bco-card__add, .btn-boba-compact, .bco-bar__go, main .search-submit, .btn-boba-hub,
	.single_add_to_cart_button, main .btn.btn-primary, main .btn.btn-dark, main .btn.btn-boba-plum, .os-btn,
	.bpc-login-btn, a.d-inline-block[href="#bpc-signup"], .bobas-archive__cta, .woocommerce .button, .bco-btn,
	#place_order, .product__card .reserve, header .nav-button > a.nav-link, header .bpc-members-nav-btn > a.nav-link,
	.bsb-landing .btn, .bsb-landing .add, .bsb-landing .go
):is(:hover, :focus-visible)::after { transform: scale(1) rotate(0deg); }
/* pressed: down onto the lip */
html body:not(#bsb):not(#bsb-x) :where(
	.button.button-primary, .bco-card__add, .btn-boba-compact, .bco-bar__go, main .search-submit, .btn-boba-hub,
	.single_add_to_cart_button, main .btn.btn-primary, main .btn.btn-dark, main .btn.btn-boba-plum, .os-btn,
	.bpc-login-btn, a.d-inline-block[href="#bpc-signup"], .bobas-archive__cta, .woocommerce .button, .bco-btn,
	#place_order, .product__card .reserve, header .nav-button > a.nav-link, header .bpc-members-nav-btn > a.nav-link,
	.bsb-landing .btn, .bsb-landing .add, .bsb-landing .go
):active {
	transform: translateY(4px) !important;
	box-shadow: var(--edge), 0 1px 0 var(--lip), 0 6px 10px -6px rgba(0, 0, 0, .5), inset 0 2px 5px rgba(0, 0, 0, .22) !important;
	transition-duration: .06s !important;
}
html body:not(#bsb):not(#bsb-x) :where(
	.button.button-primary, .bco-card__add, .btn-boba-compact, .bco-bar__go, main .search-submit, .btn-boba-hub,
	.single_add_to_cart_button, main .btn.btn-primary, main .btn.btn-dark, main .btn.btn-boba-plum, .os-btn,
	.bpc-login-btn, a.d-inline-block[href="#bpc-signup"], .bobas-archive__cta, .woocommerce .button, .bco-btn,
	#place_order, .product__card .reserve, header .nav-button > a.nav-link, header .bpc-members-nav-btn > a.nav-link,
	.bsb-landing .btn, .bsb-landing .add, .bsb-landing .go
):focus-visible { outline: 3px solid #2d5a27 !important; outline-offset: 4px !important; animation: none !important; }
html body:not(#bsb):not(#bsb-x) :where(
	.button.button-primary, .bco-card__add, .single_add_to_cart_button, .woocommerce .button, .bco-btn, #place_order, .bpc-login-btn,
	.bsb-landing .btn, .bsb-landing .add
):is([disabled], .disabled, .loading) { opacity: .75 !important; cursor: progress; transform: none !important; animation: none !important; }

/* the ripple (bobas-buttons.php adds <span class="bsb-fx"><i></i></span> where you press) */
.bsb-fx { position: absolute; inset: 0; z-index: -1; border-radius: inherit; overflow: hidden; pointer-events: none; }
.bsb-fx i { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .38); transform: scale(0); animation: bsb-ripple .65s ease-out forwards; }
@keyframes bsb-ripple { to { transform: scale(1); opacity: 0; } }

/* ---------------------------------------------------------------------------------- the colours --- */
/* plum is the default above. Terracotta (Previously in the studio). */
html body:not(#bsb):not(#bsb-x) .bobas-archive__cta { --c: #c07a54; --c2: #cc8963; --lip: #7a4329; --ring: 240, 190, 160; }
/* sage (Shop by Style "Browse") */
html body:not(#bsb):not(#bsb-x) .product__card .reserve { --c: #8da48d; --c2: #9bb39b; --lip: #5b715b; --leaf: #e4f5c4; --ring: 200, 225, 190; }
/* white on green (Join the club, top of the page) */
html body:not(#bsb):not(#bsb-x) .bpc-hero-cta { --c: #fff; --c2: #f4fbef; --lip: #9fb898; --ink: #2d5a27; --leaf: #6aa84f; --ring: 255, 255, 255; text-shadow: none; }
/* outlines: the colour becomes the edge and the lip; the inside stays as it was */
html body:not(#bsb):not(#bsb-x) :is(.btn-boba-reverse, .bco-btn--quiet) {
	--c: transparent; --c2: rgba(139, 63, 93, .08); --lip: rgba(85, 31, 54, .55); --ink: #8b3f5d;
	--edge: inset 0 0 0 2px #8b3f5d;
	text-shadow: none;
}
html body:not(#bsb):not(#bsb-x) .bco-btn--quiet { --c: #fff; --c2: #fbf3f6; }
html body:not(#bsb):not(#bsb-x) .os-btn--alt {
	--c: transparent; --c2: rgba(58, 90, 61, .08); --lip: rgba(30, 52, 32, .5); --ink: #3a5a3d; --leaf: #6aa84f; --ring: 140, 190, 140;
	--edge: inset 0 0 0 2px #3a5a3d;
	text-shadow: none;
}
html body:not(#bsb):not(#bsb-x) :is(.btn-boba-reverse, .bco-btn--quiet, .os-btn--alt) { background-image: linear-gradient(105deg, rgba(255, 255, 255, 0) 36%, rgba(255, 255, 255, .7) 47%, rgba(255, 255, 255, .2) 54%, rgba(255, 255, 255, 0) 64%) !important; background-size: 260% 100% !important; background-position: var(--bsb-x) 0 !important; }
html body:not(#bsb):not(#bsb-x) :is(.btn-boba-reverse, .bco-btn--quiet, .os-btn--alt) .bsb-fx i { background: rgba(139, 63, 93, .18); }

/* the two campaign landing pages print their own <head>; their templates call bobas_buttons_head() /
   bobas_buttons_footer() and carry body.bsb-landing + .bsb-freepot / .bsb-potoffer */
html body.bsb-landing:not(#bsb):not(#bsb-x) :is(.btn, .add, .go) { font-weight: 700 !important; }
html body.bsb-freepot:not(#bsb):not(#bsb-x) .btn { --c: #c07a54; --c2: #cc8963; --lip: #7a4329; --ring: 240, 190, 160; }
html body.bsb-potoffer:not(#bsb):not(#bsb-x) :is(.btn, .go) { --c: #f4c448; --c2: #ffd968; --lip: #a87d14; --ink: #082316; --leaf: #2f8a4d; --ring: 244, 196, 72; text-shadow: 0 1px 0 rgba(255, 255, 255, .35); }
html body.bsb-potoffer:not(#bsb):not(#bsb-x) .stage .btn { position: absolute !important; }
html body.bsb-potoffer:not(#bsb):not(#bsb-x) .add { --c: #fffdf8; --c2: #f0f8f1; --lip: rgba(13, 47, 30, .45); --ink: #1f6b3a; --leaf: #2f8a4d; --ring: 47, 138, 77; --edge: inset 0 0 0 2px #1f6b3a; text-shadow: none; }
html body.bsb-potoffer:not(#bsb):not(#bsb-x) .add .bsb-fx i { background: rgba(31, 107, 58, .18); }
html body.bsb-potoffer:not(#bsb):not(#bsb-x) .add.is-in { --c: #f4c448; --c2: #f4c448; --lip: #a87d14; --ink: #082316; --edge: 0 0 0 0 transparent; }
html body.bsb-potoffer:not(#bsb):not(#bsb-x) .card.is-sold .add { --c: transparent; --c2: transparent; --ink: #5d6660; background-image: none !important; box-shadow: inset 0 0 0 1px rgba(29, 31, 28, .2) !important; transform: none !important; cursor: default; }
html body.bsb-potoffer:not(#bsb):not(#bsb-x) .card.is-sold .add::after { display: none !important; }

/* ------------------------------------------------------------------------------------ the sizes --- */
/* the theme's main button: sentence case now, so one step bigger */
html body:not(#bsb):not(#bsb-x) :is(.button.button-primary, .bpc-login-btn) { font-size: 1rem !important; padding: 13px 28px !important; min-height: 48px; }
/* small ones keep their size, with a smaller leaf and lip */
html body:not(#bsb):not(#bsb-x) :is(.btn-boba-compact, .btn-boba-hub, main .search-submit, .bco-btn--quiet, header .nav-button > a.nav-link, header .bpc-members-nav-btn > a.nav-link) { --r1: 5px; --r2: 16px; --lip-h: 4px; }
html body:not(#bsb):not(#bsb-x) :is(.btn-boba-compact, .btn-boba-hub, main .search-submit, .bco-btn--quiet, header .nav-button > a.nav-link, header .bpc-members-nav-btn > a.nav-link)::after { width: 17px; height: 17px; top: -13px; }
html body:not(#bsb):not(#bsb-x) .btn-boba-compact { font-size: .82rem !important; padding: 9px 16px !important; }
/* Shop by Style: the strip becomes a button inside the card */
html body:not(#bsb):not(#bsb-x) .product__card .reserve { width: auto !important; margin: 0 14px 18px !important; padding: 11px 16px !important; }

/* the header buttons sit on a thin lip so the bar stays tidy */
html body:not(#bsb):not(#bsb-x) :is(header .nav-button > a.nav-link, header .bpc-members-nav-btn > a.nav-link) { --lip-h: 3px; }

/* -------------------------------------------------------------- the main call to action breathes --- */
html body:not(#bsb):not(#bsb-x) :is(.bobas-hero-cta .button-primary, .single_add_to_cart_button, .bpc-hero-cta, .wc-proceed-to-checkout .checkout-button, .bsb-freepot .hero__cta .btn, .bsb-potoffer :is(.stage, .lead__cta) .btn) {
	animation: bsb-glow 3.2s ease-out infinite, bsb-sweep 4.6s ease-in-out 1.4s infinite;
}
@keyframes bsb-glow {
	0% { outline: 2px solid rgba(var(--ring), .7); outline-offset: 0; }
	70%, 100% { outline: 2px solid rgba(var(--ring), 0); outline-offset: 14px; }
}
@keyframes bsb-sweep {
	0% { --bsb-x: 125%; }
	28%, 100% { --bsb-x: -60%; }
}

@media (prefers-reduced-motion: reduce) {
	html body:not(#bsb):not(#bsb-x) :where(
		.button.button-primary, .bco-card__add, .btn-boba-compact, .bco-bar__go, main .search-submit, .btn-boba-hub,
		.single_add_to_cart_button, main .btn.btn-primary, main .btn.btn-dark, main .btn.btn-boba-plum, .os-btn,
		.bpc-login-btn, a.d-inline-block[href="#bpc-signup"], .bobas-archive__cta, .woocommerce .button, .bco-btn,
		#place_order, .product__card .reserve, header .nav-button > a.nav-link, header .bpc-members-nav-btn > a.nav-link,
		.bsb-landing .btn, .bsb-landing .add, .bsb-landing .go
	) { animation: none !important; transition: background-color .2s ease, color .2s ease !important; transform: none !important; }
	html body:not(#bsb):not(#bsb-x) :where(
		.button.button-primary, .bco-card__add, .btn-boba-compact, .bco-bar__go, main .search-submit, .btn-boba-hub,
		.single_add_to_cart_button, main .btn.btn-primary, main .btn.btn-dark, main .btn.btn-boba-plum, .os-btn,
		.bpc-login-btn, a.d-inline-block[href="#bpc-signup"], .bobas-archive__cta, .woocommerce .button, .bco-btn,
		#place_order, .product__card .reserve, header .nav-button > a.nav-link, header .bpc-members-nav-btn > a.nav-link,
		.bsb-landing .btn, .bsb-landing .add, .bsb-landing .go
	)::after { display: none !important; }
	.bsb-fx { display: none; }
}
