/* Snappy Chat: customer chat box (built to the approved mockup). Everything is scoped to #wsc and
   resets the theme's button / input looks (WoodMart capitalises buttons and sizes inputs). */
#wsc { --wsc-ink: #1D1A17; --wsc-muted: #6B635A; --wsc-line: #ECDCC6; --wsc-cream: #FFF8EE; --wsc-gold: #F8B30F;
	position: fixed; bottom: calc(var(--wsc-y) + env(safe-area-inset-bottom)); right: 20px; z-index: 9980;
	font: 15px/1.4 Montserrat, -apple-system, "Segoe UI", system-ui, sans-serif; color: var(--wsc-ink); }
#wsc.is-left { right: auto; left: 20px; }
#wsc *, #wsc *::before, #wsc *::after { box-sizing: border-box; }
#wsc button, #wsc input, #wsc textarea { font: inherit; text-transform: none !important; letter-spacing: normal !important; margin: 0; box-shadow: none; min-height: 0; }
#wsc input, #wsc textarea { box-sizing: border-box !important; max-width: 100%; }
#wsc [hidden] { display: none !important; }
#wsc .wsc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* bubble */
#wsc .wsc-bubble { position: relative; display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 20px 0 16px; border: 0 !important;
	border-radius: 28px !important; background: var(--wsc-accent) !important; color: #fff !important; cursor: pointer; box-shadow: 0 8px 24px rgba(29, 26, 23, .25); font-weight: 700; }
#wsc .wsc-bubble:focus-visible { outline: 3px solid var(--wsc-gold); outline-offset: 2px; }
#wsc .wsc-badge { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--wsc-gold);
	color: #6E0B0B; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }
#wsc.is-open .wsc-bubble { display: none; }

/* box */
#wsc .wsc-box { position: fixed; right: 20px; bottom: calc(var(--wsc-y) + env(safe-area-inset-bottom)); width: 380px; height: min(var(--wsc-hd, 640px), calc(100vh - 40px)); height: min(var(--wsc-hd, 640px), calc(100dvh - 40px));
	background: var(--wsc-cream); border-radius: 20px; box-shadow: 0 16px 48px rgba(29, 26, 23, .28); display: flex; flex-direction: column; overflow: hidden; }
#wsc.is-left .wsc-box { right: auto; left: 20px; }
#wsc .wsc-head { background: var(--wsc-accent); color: #fff; padding: 14px 14px 14px 12px; display: flex; align-items: center; gap: 12px; flex: none; }
#wsc .wsc-x { width: 44px; height: 44px; border-radius: 50% !important; border: 0 !important; background: rgba(255, 255, 255, .16) !important; color: #fff !important;
	display: flex; align-items: center; justify-content: center; flex: none; cursor: pointer; padding: 0; }
#wsc .wsc-av { width: 44px; height: 44px; border-radius: 50%; background: var(--wsc-gold); color: #6E0B0B; display: flex; align-items: center; justify-content: center;
	font: 800 17px "Bricolage Grotesque", Montserrat, sans-serif; flex: none; }
#wsc .wsc-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#wsc .wsc-who b { font: 800 18px "Bricolage Grotesque", Montserrat, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#wsc .wsc-who span { font-size: 13px; opacity: .92; display: flex; align-items: center; gap: 6px; }
#wsc .wsc-dot { width: 8px; height: 8px; border-radius: 50%; background: #7CE0A3; flex: none; }
#wsc .wsc-dot.is-closed { background: #FFC94A; }

/* order card + reasons */
#wsc .wsc-order { margin: 12px 14px 0; background: #fff; border: 1px solid var(--wsc-line); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; flex: none; }
#wsc .wsc-order b { font: 800 16px "Bricolage Grotesque", Montserrat, sans-serif; }
#wsc .wsc-order span { font-size: 13px; color: var(--wsc-muted); }
#wsc .wsc-topics { padding: 12px 14px 0; display: flex; flex-direction: column; gap: 8px; flex: none; }
#wsc .wsc-topics p { margin: 0; font-size: 13px; font-weight: 600; color: var(--wsc-muted); }
#wsc .wsc-topics div { display: flex; flex-wrap: wrap; gap: 8px; }
#wsc .wsc-chip { min-height: 40px !important; padding: 0 14px !important; border-radius: 99px !important; border: 1px solid var(--wsc-line) !important; background: #fff !important;
	color: var(--wsc-ink) !important; font-weight: 600 !important; font-size: 14px !important; cursor: pointer; }
#wsc .wsc-chip.is-on { border: 1.5px solid var(--wsc-accent) !important; background: #FBE3DC !important; color: var(--wsc-accent) !important; }

/* messages */
#wsc .wsc-thread { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
#wsc .wsc-day { align-self: center; font-size: 12px; color: var(--wsc-muted); background: #F2E8DA; padding: 4px 12px; border-radius: 99px; }
#wsc .wsc-note { align-self: center; text-align: center; font-size: 12px; color: var(--wsc-muted); max-width: 280px; }
#wsc .wsc-m { max-width: 80%; border-radius: 4px 16px 16px 16px; padding: 9px 12px; background: #fff; box-shadow: 0 1px 2px rgba(29, 26, 23, .06);
	align-self: flex-start; display: flex; flex-direction: column; gap: 4px; word-wrap: break-word; white-space: pre-wrap; }
#wsc .wsc-m.is-me { align-self: flex-end; background: var(--wsc-accent); color: #fff; border-radius: 16px 4px 16px 16px; box-shadow: none; }
#wsc .wsc-m small.wsc-by { font-size: 12px; font-weight: 700; color: var(--wsc-accent); white-space: normal; }
#wsc .wsc-m.is-me small.wsc-by { color: #FFC94A; }
#wsc .wsc-m img { display: block; width: var(--wsc-pw, 160px); max-width: 100%; height: auto; max-height: calc(var(--wsc-pw, 160px) * 1.3); object-fit: cover; border-radius: 12px; cursor: zoom-in; } /* Setting "Photo size in the chat". */
#wsc .wsc-m.has-img { padding: 4px; }
#wsc .wsc-m.has-img .wsc-t, #wsc .wsc-m.has-img .wsc-meta { padding: 0 8px; }
#wsc .wsc-meta { font-size: 11px; color: var(--wsc-muted); align-self: flex-end; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
#wsc .wsc-m.is-me .wsc-meta { color: rgba(255, 255, 255, .85); }
#wsc .wsc-tick { color: rgba(255, 255, 255, .7); }
#wsc .wsc-tick.is-seen { color: #FFC94A; }
#wsc .wsc-m.is-sending { opacity: .6; }
#wsc .wsc-m.is-failed { outline: 2px solid #FFC94A; }
#wsc .wsc-typing { align-self: flex-start; background: #fff; border-radius: 16px; padding: 12px 14px; display: flex; gap: 5px; box-shadow: 0 1px 2px rgba(29, 26, 23, .06); }
#wsc .wsc-typing i { width: 7px; height: 7px; border-radius: 50%; background: #C9B8A3; animation: wsc-b 1.2s infinite; }
#wsc .wsc-typing i:nth-child(2) { animation-delay: .15s; } #wsc .wsc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes wsc-b { 0%, 60%, 100% { transform: translateY(0); opacity: .6; } 30% { transform: translateY(-4px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #wsc .wsc-typing i { animation: none; } }

/* guest details + composer */
#wsc .wsc-guest { padding: 10px 12px 0; background: #fff; border-top: 1px solid var(--wsc-line); display: flex; gap: 8px; flex: none; }
#wsc .wsc-guest input { flex: 1; min-width: 0; height: 40px !important; border: 1px solid var(--wsc-line) !important; border-radius: 12px !important; padding: 0 12px !important;
	background: var(--wsc-cream) !important; color: var(--wsc-ink) !important; font-size: 14px !important; }
#wsc .wsc-compose { background: #fff; padding: 10px 12px 12px; display: flex; align-items: flex-end; gap: 8px; flex: none; border-top: 1px solid var(--wsc-line); }
#wsc .wsc-guest + .wsc-compose { border-top: 0; }
#wsc .wsc-round { width: 44px; height: 44px; border-radius: 50% !important; border: 1px solid var(--wsc-line) !important; background: var(--wsc-cream) !important; color: var(--wsc-ink) !important;
	display: flex; align-items: center; justify-content: center; flex: none; cursor: pointer; padding: 0 !important; }
#wsc .wsc-send { border: 0 !important; background: var(--wsc-accent) !important; color: #fff !important; }
#wsc .wsc-send:disabled { opacity: .5; }
#wsc .wsc-input { flex: 1; min-width: 0; min-height: 44px !important; max-height: 120px; resize: none; border: 1px solid var(--wsc-line) !important; border-radius: 22px !important;
	padding: 11px 16px !important; background: var(--wsc-cream) !important; color: var(--wsc-ink) !important; font-size: 15px !important; line-height: 1.35 !important; height: 44px; }
#wsc .wsc-input:focus, #wsc .wsc-guest input:focus { outline: 2px solid var(--wsc-accent); outline-offset: 0; }
#wsc .wsc-pending { margin: 0 12px; padding: 6px 8px; background: #fff; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--wsc-muted); }
#wsc .wsc-pending img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
#wsc .wsc-pending button { margin-left: auto; border: 0 !important; background: none !important; color: var(--wsc-accent) !important; font-weight: 700; cursor: pointer; padding: 6px !important; }
#wsc .wsc-err { margin: 0; padding: 8px 14px; background: #FEF3F2; color: #912018; font-size: 13px; flex: none; }

/* photo viewer */
.wsc-view { position: fixed; inset: 0; z-index: 99999; background: rgba(0, 0, 0, .88); display: flex; align-items: center; justify-content: center; padding: 16px; cursor: zoom-out; }
.wsc-view img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* tracking page button */
.wsc-help-wrap { text-align: center; margin: 14px 0 0; }
.wsc-help { min-height: 44px; padding: 0 22px !important; border-radius: 99px !important; border: 1.5px solid #9B1111 !important; background: #fff !important; color: #9B1111 !important;
	font: 700 15px Montserrat, system-ui, sans-serif !important; text-transform: none !important; letter-spacing: normal !important; cursor: pointer; }

/* phones: full screen box, round bubble above the shop's bottom bar */
@media (max-width: 600px) {
	#wsc { right: 14px; bottom: calc(var(--wsc-y-m) + env(safe-area-inset-bottom)); }
	#wsc.is-left { left: 14px; }
	#wsc .wsc-bubble { width: 56px; padding: 0; justify-content: center; }
	#wsc .wsc-bubble-t { display: none; }
	/* A sheet from the bottom, as tall as the "Chat height on phones" setting; the page shows dimmed above it. */
	#wsc .wsc-box, #wsc.is-left .wsc-box { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: calc(var(--wsc-hm, 80) * 1vh); height: calc(var(--wsc-hm, 80) * 1dvh); border-radius: 20px 20px 0 0; z-index: 2; animation: wscUp .22s ease-out; }
	#wsc .wsc-dim { position: fixed; inset: 0; background: rgba(29, 26, 23, .45); z-index: 1; animation: wscFade .2s ease-out; }
	#wsc .wsc-head { border-radius: 20px 20px 0 0; }
	#wsc .wsc-compose { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
	html.wsc-lock, html.wsc-lock body { overflow: hidden !important; }
}

/* Button motions (setting "Button motion", same choices as WA Live Chat). Only while closed. */
#wsc .wsc-fx, #wsc .wsc-fx2 { display: none; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
#wsc .wsc-bubble svg { position: relative; z-index: 2; }
#wsc.anim-pulse .wsc-fx { display: block; background: var(--wsc-accent); opacity: .5; animation: wscRing 1.8s ease-out infinite; will-change: transform, opacity; } /* Scale + fade only: no repaint each frame. */
#wsc.anim-ripple .wsc-fx, #wsc.anim-ripple .wsc-fx2, #wsc.anim-spiral .wsc-fx2 { display: block; border: 2px solid var(--wsc-accent); animation: wscRing 2.4s ease-out infinite; will-change: transform, opacity; }
#wsc.anim-ripple .wsc-fx2 { animation-delay: 1.2s; }
#wsc.anim-spiral .wsc-fx { display: block; inset: -5px; background: conic-gradient(from 0deg, transparent 0 60%, var(--wsc-accent) 100%);
	-webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px)); animation: wscSpin 1.6s linear infinite; }
#wsc.anim-spiral .wsc-bubble svg { animation: wscWiggle 4s ease-in-out infinite; }
#wsc.anim-glow .wsc-bubble { animation: wscGlow 2s ease-in-out infinite; }
#wsc.anim-heartbeat .wsc-bubble { animation: wscBeat 1.6s ease-in-out infinite; }
#wsc.anim-bounce .wsc-bubble { animation: wscBounce 3s ease infinite; }
#wsc.anim-shake .wsc-bubble svg { animation: wscWiggle 2.5s ease-in-out infinite; }
@keyframes wscPulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--wsc-accent) 70%, transparent), 0 8px 24px rgba(29, 26, 23, .25); } 100% { box-shadow: 0 0 0 16px color-mix(in srgb, var(--wsc-accent) 0%, transparent), 0 8px 24px rgba(29, 26, 23, .25); } }
@keyframes wscRing { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.8); opacity: 0; } }
@keyframes wscSpin { to { transform: rotate(360deg); } }
@keyframes wscGlow { 0%, 100% { box-shadow: 0 0 0 0 transparent, 0 8px 24px rgba(29, 26, 23, .25); } 50% { box-shadow: 0 0 20px 6px color-mix(in srgb, var(--wsc-accent) 55%, transparent), 0 8px 24px rgba(29, 26, 23, .25); } }
@keyframes wscBeat { 0%, 40%, 100% { transform: scale(1); } 10%, 30% { transform: scale(1.12); } 20% { transform: scale(1.02); } }
@keyframes wscBounce { 0%, 20%, 50%, 80%, 100% { transform: translateY(0); } 35% { transform: translateY(-14px); } 65% { transform: translateY(-6px); } }
@keyframes wscWiggle { 0%, 80%, 100% { transform: rotate(0); } 84% { transform: rotate(-14deg); } 88% { transform: rotate(12deg); } 92% { transform: rotate(-8deg); } 96% { transform: rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { #wsc .wsc-bubble, #wsc .wsc-bubble svg, #wsc .wsc-fx, #wsc .wsc-fx2 { animation: none !important; } }
#wsc .wsc-badge { z-index: 3; }
#wsc .wsc-dim { display: none; }
@media (max-width: 600px) { #wsc.is-open .wsc-dim { display: block; } }
@keyframes wscUp { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes wscFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #wsc .wsc-box, #wsc .wsc-dim { animation: none !important; } }
