/* BB Translate AI: language switcher, suggestion banner and popup.
   Tokens: --bbtr-accent, --bbtr-r, --bbtr-btn-r, --bbtr-font, --bbtr-head, --bbtr-bg, --bbtr-fg (Settings → Design).
   Proprietary software by Business Boost, https://businessboost.it */

.bbtr-ui {
	--bbtr-accent: var(--wp--preset--color--primary, var(--wp--preset--color--accent, #2563eb));
	--bbtr-bg: #fff;
	--bbtr-fg: #141821;
	--bbtr-muted: #5d6577;
	--bbtr-line: rgba(15, 23, 42, .12);
	--bbtr-hover: rgba(15, 23, 42, .05);
	--bbtr-r: 14px;
	--bbtr-btn-r: 999px;
	--bbtr-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 14px 36px -16px rgba(15, 23, 42, .32);
	font-family: var(--bbtr-font, inherit);
	-webkit-font-smoothing: antialiased;
	box-sizing: border-box;
}
.bbtr-ui *, .bbtr-ui *::before, .bbtr-ui *::after { box-sizing: border-box; }
.bbtr-ui.is-dark, .bbtr-ui .is-dark {
	--bbtr-bg: #151922;
	--bbtr-fg: #f2f4f8;
	--bbtr-muted: #a6aec0;
	--bbtr-line: rgba(255, 255, 255, .14);
	--bbtr-hover: rgba(255, 255, 255, .07);
	--bbtr-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 40px -16px rgba(0, 0, 0, .6);
}
.bbtr-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.bbtr-flag { display: block; flex: none; width: 22px; height: auto; border-radius: 3px; filter: drop-shadow(0 0 .5px rgba(0, 0, 0, .35)); }
.bbtr-flag.is-round { width: 20px; height: 20px; border-radius: 50%; }
.bbtr-i { flex: none; }

/* ---------- switcher ---------- */
.bbtr-sw { position: relative; display: inline-block; font-size: 14px; line-height: 1.25; color: var(--bbtr-fg); }
.bbtr-sw ul { list-style: none; margin: 0; padding: 0; }
.bbtr-sw li { margin: 0; padding: 0; }
.bbtr-sw li::before, .bbtr-sw li::marker { content: none; }
.bbtr-sw__btn {
	display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 12px 8px 11px; margin: 0;
	border: 1px solid var(--bbtr-line); border-radius: var(--bbtr-btn-r); background: var(--bbtr-bg); color: var(--bbtr-fg);
	font: inherit; font-weight: 500; letter-spacing: 0; text-transform: none; cursor: pointer; box-shadow: var(--bbtr-shadow);
	transition: border-color .2s, box-shadow .2s, transform .2s;
}
.bbtr-sw__btn:hover { border-color: color-mix(in srgb, var(--bbtr-accent) 45%, var(--bbtr-line)); }
.bbtr-sw__btn:focus-visible, .bbtr-sw__item:focus-visible, .bbtr-b__btn:focus-visible, .bbtr-b__x:focus-visible { outline: 2px solid var(--bbtr-accent); outline-offset: 2px; }
.bbtr-sw__btn .bbtr-i { opacity: .7; transition: transform .25s ease; }
.bbtr-sw__btn[aria-expanded="true"] .bbtr-i { transform: rotate(180deg); }
.bbtr-sw__list {
	position: absolute; top: calc(100% + 8px); inset-inline-start: 0; z-index: 99999; min-width: 210px; max-width: calc(100vw - 32px);
	max-height: min(62vh, 440px); overflow: auto; padding: 6px !important; background: var(--bbtr-bg); color: var(--bbtr-fg);
	border: 1px solid var(--bbtr-line); border-radius: var(--bbtr-r); box-shadow: 0 24px 60px -20px rgba(15, 23, 42, .42);
	transform-origin: top left; animation: bbtr-in .18s ease-out;
}
.bbtr-sw.is-up .bbtr-sw__list { top: auto; bottom: calc(100% + 8px); transform-origin: bottom left; }
.bbtr-float--bottom-right .bbtr-sw__list, .bbtr-float--top-right .bbtr-sw__list { inset-inline-start: auto; inset-inline-end: 0; }
.bbtr-sw__item {
	display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 10px; border-radius: max(4px, calc(var(--bbtr-r) - 6px));
	color: inherit !important; text-decoration: none !important; font-weight: 450; white-space: nowrap; transition: background .15s;
}
.bbtr-sw__item:hover { background: var(--bbtr-hover); }
.bbtr-sw__item.is-current { font-weight: 600; }
.bbtr-sw__list .bbtr-sw__item.is-current::after { content: ""; width: 7px; height: 7px; margin-inline-start: auto; border-radius: 50%; background: var(--bbtr-accent); }
.bbtr-sw__t { overflow: hidden; text-overflow: ellipsis; }
.bbtr-sw__draft { margin-inline-start: 6px; padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #fff3d6; color: #8a5a00; }

.bbtr-sw--list .bbtr-sw__row { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.bbtr-sw--list .bbtr-sw__item { min-height: 36px; padding: 6px 10px; }
.bbtr-sw--list .bbtr-sw__item.is-current { box-shadow: inset 0 -2px 0 var(--bbtr-accent); border-radius: 0; }

.bbtr-sw--pills .bbtr-sw__row { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--bbtr-btn-r); background: var(--bbtr-hover); border: 1px solid var(--bbtr-line); }
.bbtr-sw--pills .bbtr-sw__item { min-height: 36px; padding: 6px 14px; border-radius: var(--bbtr-btn-r); }
.bbtr-sw--pills .bbtr-sw__item.is-current { background: var(--bbtr-bg); color: var(--bbtr-fg) !important; box-shadow: 0 1px 2px rgba(15, 23, 42, .1), 0 6px 16px -8px rgba(15, 23, 42, .3); }

/* ---------- floating ---------- */
.bbtr-float { position: fixed; z-index: 2147482000; }
.bbtr-float.is-above-chat { margin-bottom: 84px; }
.bbtr-float--bottom-right { right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); }
.bbtr-float--bottom-left { left: max(20px, env(safe-area-inset-left)); bottom: max(20px, env(safe-area-inset-bottom)); }
.bbtr-float--top-right { right: 20px; top: 20px; }
.bbtr-float--top-left { left: 20px; top: 20px; }
.admin-bar .bbtr-float--top-right, .admin-bar .bbtr-float--top-left { top: 52px; }
@media (max-width: 480px) {
	.bbtr-float--bottom-right { right: 12px; bottom: 12px; }
	.bbtr-float--bottom-left { left: 12px; bottom: 12px; }
	.bbtr-float .bbtr-sw__btn { min-height: 44px; padding: 8px 11px; }
	.bbtr-float .bbtr-sw__btn .bbtr-sw__t { max-width: 96px; }
}

/* ---------- suggestion banner and popup ---------- */
.bbtr-b {
	position: fixed; z-index: 2147483600; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%);
	display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; width: min(600px, calc(100vw - 32px)); padding: 14px 52px 14px 16px;
	background: var(--bbtr-bg); color: var(--bbtr-fg); border: 1px solid var(--bbtr-line); border-radius: var(--bbtr-r);
	box-shadow: 0 28px 70px -24px rgba(15, 23, 42, .5); font-size: 14.5px; line-height: 1.45; animation: bbtr-up .28s cubic-bezier(.2, .8, .2, 1);
}
.bbtr-b__msg { display: flex; align-items: center; gap: 10px; flex: 1 1 240px; min-width: 0; margin: 0; font-weight: 500; }
.bbtr-b__msg .bbtr-flag { width: 26px; }
.bbtr-b__acts { display: flex; flex-wrap: wrap; gap: 8px; }
.bbtr-b__btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px; margin: 0;
	border-radius: var(--bbtr-btn-r); border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 14px; letter-spacing: 0;
	text-transform: none; text-decoration: none !important; cursor: pointer; transition: transform .15s, filter .15s, background .15s;
}
.bbtr-b__btn.is-main { background: var(--bbtr-accent); color: var(--bbtr-on-accent, #fff) !important; }
.bbtr-b__btn.is-main:hover { filter: brightness(1.06); transform: translateY(-1px); }
.bbtr-b__btn.is-ghost { background: transparent; color: var(--bbtr-fg); border-color: var(--bbtr-line); }
.bbtr-b__btn.is-ghost:hover { background: var(--bbtr-hover); }
.bbtr-b > .bbtr-b__x { position: absolute; top: 8px; right: 8px; }
body.bbtr-has-banner .bbtr-float { opacity: 0; pointer-events: none; }
.bbtr-b__x { display: inline-grid; place-items: center; width: 36px; height: 36px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--bbtr-muted); cursor: pointer; }
.bbtr-b__x:hover { background: var(--bbtr-hover); color: var(--bbtr-fg); }

.bbtr-m { position: fixed; inset: 0; z-index: 2147483600; display: grid; place-items: center; padding: 16px; background: rgba(10, 14, 25, .5); backdrop-filter: blur(3px); animation: bbtr-fade .2s ease-out; }
.bbtr-m__card { position: relative; width: min(420px, 100%); padding: 28px 24px 22px; text-align: center; background: var(--bbtr-bg); color: var(--bbtr-fg); border-radius: calc(var(--bbtr-r) + 6px); box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .6); animation: bbtr-up .3s cubic-bezier(.2, .8, .2, 1); }
.bbtr-m__card .bbtr-flag { width: 54px; margin: 0 auto 14px; border-radius: 6px; }
.bbtr-m__msg { margin: 0 0 18px; font-family: var(--bbtr-head, var(--bbtr-font, inherit)); font-size: 19px; line-height: 1.35; font-weight: 600; }
.bbtr-m__acts { display: grid; gap: 8px; }
.bbtr-m__acts .bbtr-b__btn { width: 100%; min-height: 46px; }
.bbtr-m .bbtr-b__x { position: absolute; top: 10px; right: 10px; }

@keyframes bbtr-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes bbtr-up { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
.bbtr-m__card { animation-name: bbtr-card; }
@keyframes bbtr-card { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes bbtr-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bbtr-ui *, .bbtr-b, .bbtr-m, .bbtr-m__card { animation: none !important; transition: none !important; } }
[dir="rtl"] .bbtr-b { direction: rtl; }
@media (max-width: 420px) {
	.bbtr-b { padding: 14px 48px 14px 14px; }
	.bbtr-b__acts { width: 100%; }
	.bbtr-b__acts .bbtr-b__btn { flex: 1 1 0; }
}
