/* Shop Buddy 3D */
.sb3d { --sb3d-accent: #2f4bb0; --sb3d-ink: #1c2133; --sb3d-muted: #5b6380; --sb3d-chip: #eef0f8; font-size: 15px; line-height: 1.45; }
.sb3d *, .sb3d *::before, .sb3d *::after { box-sizing: border-box; }
.sb3d-stage { position: fixed; inset: 0; z-index: 99990; pointer-events: none; transition: opacity .5s; }
.sb3d-stage canvas { display: block; }
.sb3d-stage.is-front { z-index: 99992; } /* only while a product flies out of the bubble */

.sb3d-bubble {
	position: fixed; z-index: 99991; width: min(368px, calc(100vw - 24px));
	background: #fff; color: var(--sb3d-ink); border: 1px solid #dfe3ee; border-radius: 20px;
	padding: 18px 18px 16px; box-shadow: 0 18px 40px -18px rgba(35, 48, 107, .45);
	opacity: 0; transform: scale(.85); transform-origin: right top; pointer-events: none;
	transition: opacity .25s, transform .3s cubic-bezier(.3, 1.6, .5, 1);
}
.sb3d-bubble.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.sb3d-bubble.tail-down { transform-origin: right bottom; }
.sb3d-bubble::after { content: ""; position: absolute; width: 16px; height: 16px; background: #fff; border: 1px solid #dfe3ee; border-left: 0; border-bottom: 0; }
.sb3d-bubble:not(.tail-right):not(.tail-down)::after { display: none; }
.sb3d-bubble.is-compact .sb3d-promo { margin: 10px 0 0; }
.sb3d-bubble.tail-right::after { right: -9px; top: 30px; transform: rotate(45deg); }
.sb3d-bubble.tail-down::after { right: 56px; bottom: -9px; transform: rotate(135deg); }

.sb3d-close { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--sb3d-muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0; }
.sb3d-text { margin: 0 26px 12px 0; font-weight: 600; font-size: 16px; color: var(--sb3d-ink); }
.sb3d-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.sb3d-btn { border: 0; border-radius: 999px; padding: 8px 15px; background: var(--sb3d-chip); color: var(--sb3d-ink); font: inherit; font-weight: 700; cursor: pointer; line-height: 1.3; }
.sb3d-btn.is-primary { background: var(--sb3d-accent); color: #fff; }
.sb3d-btn:hover { filter: brightness(.95); }

.sb3d-card { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; background: var(--sb3d-chip); margin-bottom: 8px; }
.sb3d-card img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex: none; background: #fff; }
.sb3d-info { flex: 1; min-width: 0; font-size: 14px; line-height: 1.3; }
.sb3d-name { display: block; font-weight: 600; color: var(--sb3d-ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb3d-info span { color: var(--sb3d-muted); }
.sb3d-add { border: 0; border-radius: 999px; padding: 6px 12px; background: var(--sb3d-accent); color: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.sb3d-add.is-done { background: #2f8f6b; cursor: default; }


.sb3d-body { max-height: calc(100vh - 70px); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; margin: -4px; padding: 4px; }
.sb3d-bubble.is-compact { width: auto; max-width: min(300px, calc(100vw - 24px)); padding: 12px 14px; }
.sb3d-head { display: flex; align-items: center; gap: 10px; margin: 0 30px 12px 0; }
.sb3d-ava { width: 34px; height: 34px; border-radius: 50%; background: var(--sb3d-accent); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.sb3d-who { line-height: 1.25; }
.sb3d-who b { display: block; font-size: 15px; color: var(--sb3d-ink); }
.sb3d-who span { font-size: 12px; color: var(--sb3d-muted); }

.sb3d-shelfhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sb3d-shelfhead .sb3d-text { margin-right: 0; }
.sb3d-navs { display: flex; gap: 6px; margin-bottom: 12px; flex: none; }
.sb3d-nav { width: 30px; height: 30px; border-radius: 50%; border: 1px solid #dfe3ee; background: #fff; color: var(--sb3d-ink); font-size: 18px; line-height: 1; cursor: pointer; padding: 0; }
.sb3d-row { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 8px; margin: 0 -2px 8px; scrollbar-width: thin; }
.sb3d-tile { flex: 0 0 132px; scroll-snap-align: start; background: var(--sb3d-chip); border-radius: 14px; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.sb3d-pic { display: block; }
.sb3d-tile img { width: 116px; height: 116px; object-fit: cover; border-radius: 10px; background: #fff; display: block; }
.sb3d-tile .sb3d-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 13px; line-height: 1.3; min-height: 2.6em; margin-top: 4px; }
.sb3d-price { font-size: 13px; color: var(--sb3d-muted); }
.sb3d-tile .sb3d-add { margin-top: auto; text-align: center; padding: 7px 10px; }

.sb3d-promo { background: #fff6e0; border: 1px solid #f3d48a; color: #5a4100; border-radius: 12px; padding: 9px 11px; font-size: 13px; font-weight: 600; margin: 0 0 12px; }
.sb3d-promo.is-done { background: #e7f6ee; border-color: #9fd8b9; color: #1d5c3d; }
.sb3d-bar { height: 6px; border-radius: 999px; background: rgba(0, 0, 0, .08); margin-top: 7px; overflow: hidden; }
.sb3d-bar i { display: block; height: 100%; border-radius: inherit; background: #e8a10c; transition: width .8s cubic-bezier(.3, .8, .3, 1); }
.sb3d-promo.is-done .sb3d-bar i { background: #2f8f6b; }
.sb3d-mini { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-right: 24px; }
.sb3d-mini .sb3d-text { margin: 0; font-size: 14px; }
a.sb3d-btn { text-decoration: none; display: inline-block; }

.sb3d-dots { display: flex; gap: 7px; padding: 2px 0 4px; }
.sb3d-dots i { width: 11px; height: 11px; border-radius: 50%; background: #4fb3d9; animation: sb3d-dot 1s infinite ease-in-out; }
.sb3d-dots i:nth-child(2) { animation-delay: .15s; }
.sb3d-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes sb3d-dot { 0%, 100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(-5px); opacity: 1; } }

.sb3d-launcher {
	position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 99989;
	display: none; border: 0; border-radius: 999px; padding: 12px 18px; background: var(--sb3d-accent); color: #fff;
	font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 18px 40px -18px rgba(35, 48, 107, .6);
}
.sb3d-launcher.is-visible { display: block; }

.sb3d button:focus-visible, .sb3d a:focus-visible { outline: 3px solid #f2a516; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
	.sb3d-bar i { transition: none; }
	.sb3d-dots i { animation: none; }
	.sb3d-bubble { transition: opacity .2s; transform: none; }
}
