/* YourShoppy WhatsApp Chat — frontend */
:root { --ysw-brand: #25D366; --ysw-brand-dark: #128C7E; --ysw-bg: #fff; --ysw-text: #1f2937; --ysw-muted: #6b7280; --ysw-border: #e5e7eb; --ysw-radius: 16px; }

.ysw-widget { position: fixed; bottom: 20px; z-index: 2147483000; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif; }
.ysw-widget.ysw-pos-right { right: 20px; }
.ysw-widget.ysw-pos-left  { left: 20px; }

.ysw-btn {
	background: var(--ysw-brand); color: #fff; border: 0; border-radius: 999px;
	padding: 12px 20px 12px 16px; display: inline-flex; align-items: center; gap: 10px;
	box-shadow: 0 8px 24px rgba(0,0,0,.18), 0 2px 6px rgba(0,0,0,.08);
	cursor: pointer; font-size: 15px; font-weight: 600; letter-spacing: .1px;
	transition: transform .15s ease, box-shadow .15s ease; position: relative;
}
.ysw-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,.22); }
.ysw-btn:focus-visible { outline: 3px solid rgba(37,211,102,.4); outline-offset: 2px; }
.ysw-btn-icon { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ysw-btn-icon svg { width: 26px; height: 26px; display: block; }
.ysw-pulse { position: absolute; inset: 0; border-radius: 999px; pointer-events: none; }
.ysw-pulse::before { content: ""; position: absolute; inset: 0; border-radius: 999px; border: 2px solid var(--ysw-brand); animation: ysw-pulse 2s ease-out infinite; }
@keyframes ysw-pulse { 0% { transform: scale(1); opacity: .6 } 100% { transform: scale(1.45); opacity: 0 } }

.ysw-box {
	position: absolute; bottom: 72px; width: 340px; max-width: calc(100vw - 32px);
	background: var(--ysw-bg); color: var(--ysw-text);
	border-radius: var(--ysw-radius); overflow: hidden;
	box-shadow: 0 20px 60px rgba(0,0,0,.22), 0 4px 16px rgba(0,0,0,.1);
	transform-origin: bottom right; animation: ysw-pop .18s ease-out;
}
.ysw-widget.ysw-pos-right .ysw-box { right: 0; }
.ysw-widget.ysw-pos-left  .ysw-box { left: 0; transform-origin: bottom left; }
@keyframes ysw-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.ysw-box-head { background: var(--ysw-brand-dark); color: #fff; padding: 16px; display: flex; align-items: flex-start; gap: 10px; }
.ysw-box-title { font-size: 16px; font-weight: 700; line-height: 1.2; }
.ysw-box-sub   { font-size: 12px; opacity: .92; margin-top: 2px; }
.ysw-status { font-weight: 600; }
.ysw-status.is-online  { color: #aef0c5; }
.ysw-status.is-offline { color: #ffd9a8; }
.ysw-close { margin-left: auto; background: transparent; border: 0; color: #fff; font-size: 18px; cursor: pointer; line-height: 1; padding: 4px 6px; border-radius: 6px; }
.ysw-close:hover { background: rgba(255,255,255,.15); }

.ysw-box-body { padding: 14px; background: #f4f6f8; max-height: 60vh; overflow-y: auto; }
.ysw-bubble { background: #fff; padding: 10px 12px; border-radius: 0 12px 12px 12px; font-size: 14px; line-height: 1.4; box-shadow: 0 1px 2px rgba(0,0,0,.05); margin-bottom: 12px; white-space: pre-line; }
.ysw-offline-note { background: #fff3cd; color: #665214; font-size: 13px; padding: 8px 10px; border-radius: 8px; margin-bottom: 10px; border: 1px solid #ffe69c; }

.ysw-agents-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ysw-agent-link { display: flex; align-items: center; gap: 12px; padding: 10px; background: #fff; border-radius: 12px; text-decoration: none; color: var(--ysw-text); box-shadow: 0 1px 2px rgba(0,0,0,.05); transition: transform .12s ease, box-shadow .12s ease; }
.ysw-agent-link:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.ysw-agent-avatar-wrap { position: relative; width: 44px; height: 44px; flex-shrink: 0; }
.ysw-agent-avatar-wrap img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #eee; }
.ysw-agent-dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; }
.ysw-agent-dot.is-online  { background: #22c55e; }
.ysw-agent-dot.is-offline { background: #9ca3af; }
.ysw-agent-info { flex: 1; min-width: 0; }
.ysw-agent-name { display: block; font-weight: 600; font-size: 14px; color: #111; }
.ysw-agent-role { display: block; font-size: 12px; color: var(--ysw-muted); }
.ysw-agent-status { display: block; font-size: 11px; margin-top: 2px; color: var(--ysw-muted); }
.ysw-agent-status.is-online  { color: #15803d; }
.ysw-agent-status.is-offline { color: #b45309; }
.ysw-agent-cta { color: var(--ysw-brand); width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; }
.ysw-agent-cta svg { width: 20px; height: 20px; }

.ysw-gdpr { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--ysw-muted); margin-top: 12px; }
.ysw-gdpr input { margin-top: 3px; }

.ysw-box-foot { padding: 8px 14px; font-size: 11px; color: var(--ysw-muted); text-align: center; border-top: 1px solid var(--ysw-border); background: #fff; }

.ysw-widget[hidden], .ysw-box[hidden] { display: none !important; }

/* Mobile sticky bar */
@media (max-width: 640px) {
	.ysw-widget.ysw-mobile-sticky .ysw-btn { border-radius: 12px; width: calc(100vw - 32px); justify-content: center; }
	.ysw-widget.ysw-mobile-sticky.ysw-pos-right,
	.ysw-widget.ysw-mobile-sticky.ysw-pos-left { left: 16px; right: 16px; }
	.ysw-box { width: calc(100vw - 32px); }
}
