/* QUARTZELLE — WhatsApp button and chat box, bottom left. Behaviour lives in js/ui/chat.js. */
.qc-launch { position: fixed; z-index: 80; left: calc(16px + env(safe-area-inset-left)); bottom: calc(16px + env(safe-area-inset-bottom)); display: flex; align-items: center; height: 56px; border: 1px solid var(--line-gold); border-radius: 28px; background: var(--teal-dark); color: var(--ivory); box-shadow: 0 18px 36px -16px rgba(0, 0, 0, .55); transition: transform .6s cubic-bezier(.34, 1.56, .64, 1), opacity .3s, background .3s, bottom .35s ease; animation: qc-arrive .8s cubic-bezier(.34, 1.56, .64, 1) 1.4s backwards; }
.qc-launch:hover { background: var(--teal); transform: translateY(-3px); }
.qc-launch:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.qc-launch::before { content: ''; position: absolute; left: -1px; top: -1px; width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--gold); opacity: 0; pointer-events: none; animation: qc-pulse 2.4s ease-out 2.4s 3; }
.qc-ico { position: relative; flex: none; width: 54px; height: 54px; display: grid; place-items: center; }
.qc-ico .icon { position: absolute; width: 28px; height: 28px; transition: transform .55s cubic-bezier(.16, 1, .3, 1), opacity .3s; }
.qc-ico .icon:last-child { width: 24px; height: 24px; opacity: 0; transform: rotate(-90deg) scale(.5); }
.qc-launch.open .qc-ico .icon:first-child { opacity: 0; transform: rotate(90deg) scale(.5); }
.qc-launch.open .qc-ico .icon:last-child { opacity: 1; transform: none; }
.qc-label { max-width: 0; overflow: hidden; white-space: nowrap; font: 500 11px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; transition: max-width .7s cubic-bezier(.16, 1, .3, 1), padding .7s cubic-bezier(.16, 1, .3, 1); }
@media (hover: hover) { .qc-launch:not(.open):hover .qc-label, .qc-launch:not(.open):focus-visible .qc-label { max-width: 190px; padding-right: 22px; } }
.qc-launch.tuck { opacity: 0; pointer-events: none; transform: scale(.5); }
@keyframes qc-arrive { from { opacity: 0; transform: translateY(30px) scale(.4); } }
@keyframes qc-pulse { 0% { opacity: .9; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.75); } }

/* the box: two floating cards, like the other panels */
.qc-panel { position: fixed; z-index: 85; left: calc(16px + env(safe-area-inset-left)); bottom: calc(84px + env(safe-area-inset-bottom)); width: min(390px, calc(100vw - 32px)); height: min(610px, calc(100vh - 108px)); height: min(610px, calc(100dvh - 108px)); display: flex; flex-direction: column; gap: 8px; visibility: hidden; pointer-events: none; transition: visibility 0s .45s; }
.qc-panel.open { visibility: visible; transition: visibility 0s; }
.qc-head, .qc-body { border-radius: 18px; box-shadow: 0 30px 70px -32px rgba(0, 0, 0, .55); transform-origin: 28px 100%; opacity: 0; transform: translateY(36px) scale(.86); transition: opacity .25s, transform .4s cubic-bezier(.65, 0, .35, 1); }
.qc-panel.open > * { pointer-events: auto; opacity: 1; transform: none; transition: opacity .35s, transform .75s cubic-bezier(.16, 1, .3, 1); }
.qc-panel.open > .qc-head { transition-delay: .07s; }
.qc-head { flex: none; display: flex; align-items: center; gap: 14px; padding: 12px 10px 12px 14px; background: var(--teal-dark); color: var(--ivory); }
.qc-head img { width: 44px; height: 44px; border-radius: 50%; }
.qc-head div { display: grid; gap: 2px; min-width: 0; }
.qc-head b { font: 400 22px/1.1 var(--serif); }
.qc-head span { font-size: 12px; line-height: 1.4; color: rgba(247, 244, 237, .78); }
.qc-close { flex: none; width: 40px; height: 40px; margin-left: auto; display: grid; place-items: center; border-radius: 50%; color: var(--ivory); transition: background .3s; }
.qc-close:hover { background: rgba(247, 244, 237, .12); }
.qc-panel .qc-head :focus-visible { outline-color: var(--gold); }
.qc-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--white); border: 1px solid rgba(7, 59, 59, .08); }
.qc-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; padding: 18px 14px 12px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.qc-msg { max-width: 86%; display: grid; gap: 8px; padding: 12px 15px; border-radius: 16px; font-size: 14.5px; line-height: 1.55; animation: qc-in .55s cubic-bezier(.16, 1, .3, 1) backwards; overflow-wrap: anywhere; }
.qc-msg p { color: inherit; }
.qc-msg.bot { align-self: flex-start; background: var(--ivory); color: var(--ink); border-bottom-left-radius: 4px; }
.qc-msg.me { align-self: flex-end; background: var(--teal-dark); color: var(--ivory); border-bottom-right-radius: 4px; }
@keyframes qc-in { from { opacity: 0; transform: translateY(16px) scale(.94); } }
.qc-msg.typing { display: flex; gap: 5px; padding: 15px 16px; }
.qc-msg.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); animation: qc-dot 1s ease-in-out infinite; }
.qc-msg.typing i:nth-child(2) { animation-delay: .14s; }
.qc-msg.typing i:nth-child(3) { animation-delay: .28s; }
@keyframes qc-dot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-5px); } }
.qc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.qc-actions :is(a, button) { display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--line-strong); background: var(--white); color: var(--ink); font: 400 13px/1.2 var(--sans); transition: background .25s, color .25s, border-color .25s; }
.qc-actions :is(a, button):hover { background: var(--teal-dark); border-color: var(--teal-dark); color: var(--ivory); }
.qc-actions a.wa { background: var(--teal-dark); border-color: var(--teal-dark); color: var(--ivory); }
.qc-actions a.wa:hover { background: var(--teal); border-color: var(--teal); }
.qc-order { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--white); }
.qc-order div { display: flex; justify-content: space-between; gap: 14px; }
.qc-order dt { color: var(--ink-soft); }
.qc-order dd { font-weight: 500; text-align: right; }
.qc-chips { flex: none; display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: 8px 14px 10px; }
.qc-chips::-webkit-scrollbar { display: none; }
.qc-chips button { flex: none; min-height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 17px; font: 400 13px/1 var(--sans); white-space: nowrap; transition: background .25s, color .25s, border-color .25s; }
.qc-chips button:hover { background: var(--ivory); border-color: var(--ink); }
.qc-chips button:focus-visible { outline-offset: -2px; }
.qc-panel.open .qc-chips button { animation: qc-in .5s cubic-bezier(.16, 1, .3, 1) calc(.25s + var(--i) * 40ms) backwards; }
.qc-form { flex: none; display: flex; align-items: center; gap: 8px; margin: 0 12px; padding: 5px 5px 5px 18px; border: 1px solid var(--line-strong); border-radius: 28px; transition: border-color .25s, box-shadow .25s; }
.qc-form:focus-within { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.qc-form input { flex: 1; min-width: 0; height: 40px; border: 0; background: none; outline: none; font-size: 16px; }
.qc-form button { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--teal-dark); color: var(--ivory); transition: background .25s, transform .5s cubic-bezier(.16, 1, .3, 1); }
.qc-form button:hover { background: var(--teal); transform: rotate(-45deg); }
.qc-form .icon { width: 18px; height: 18px; }
.qc-wa { flex: none; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 4px 12px; font: 500 11px/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--teal); }
.qc-wa .icon { width: 16px; height: 16px; }
.qc-wa:hover { text-decoration: underline; text-underline-offset: 4px; }

/* products inside an answer */
.qc-msg:has(.qc-products) { width: 86%; }
.qc-products { display: grid; gap: 6px; }
.qc-products a { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 11px; align-items: center; padding: 6px; border-radius: 12px; background: var(--white); transition: transform .5s cubic-bezier(.16, 1, .3, 1), box-shadow .3s; }
.qc-products a:hover { transform: translateX(4px); box-shadow: 0 10px 22px -14px rgba(7, 59, 59, .6); }
.qc-products img { width: 52px; height: 52px; border-radius: 9px; object-fit: cover; background: var(--beige); }
.qc-products b { display: block; font: 400 17px/1.15 var(--serif); color: var(--ink); }
.qc-products em { display: block; font: 400 12.5px/1.4 var(--sans); font-style: normal; color: var(--ink-soft); }

/* "Need any help?" beside the button */
.qc-teaser { position: fixed; z-index: 79; left: calc(84px + env(safe-area-inset-left)); bottom: calc(18px + env(safe-area-inset-bottom)); display: flex; align-items: flex-start; gap: 4px; max-width: min(290px, calc(100vw - 100px)); padding: 12px 6px 12px 16px; border-radius: 16px 16px 16px 4px; background: var(--white); border: 1px solid rgba(7, 59, 59, .08); box-shadow: 0 22px 44px -22px rgba(0, 0, 0, .5); transform-origin: 0 100%; animation: qc-in .7s cubic-bezier(.34, 1.56, .64, 1) backwards; }
.qc-teaser > button:first-child { display: grid; gap: 2px; text-align: left; }
.qc-teaser b { font: 400 19px/1.15 var(--serif); }
.qc-teaser span { font-size: 13px; line-height: 1.4; color: var(--ink-soft); }
.qc-teaser-x { flex: none; width: 30px; height: 30px; margin-top: -6px; display: grid; place-items: center; border-radius: 50%; }
.qc-teaser-x:hover { background: var(--ivory); }
.qc-teaser-x .icon { width: 14px; height: 14px; }
body.chat-open .qc-teaser, body.no-scroll .qc-teaser { display: none; }
@media (max-width: 900px) { .qc-teaser { left: 12px; bottom: calc(74px + env(safe-area-inset-bottom)); } body:has(.sticky-buy.show) .qc-teaser { display: none; } }

/* keep the button clear of other things that sit along the bottom */
.footer-bottom { padding-bottom: 92px; }
@media (max-width: 900px) { body:has(.sticky-buy.show) .qc-launch { bottom: calc(92px + env(safe-area-inset-bottom)); } }
@media (max-width: 900px) { .qc-launch { left: calc(12px + env(safe-area-inset-left)); bottom: calc(12px + env(safe-area-inset-bottom)); height: 52px; } .qc-launch::before { width: 52px; height: 52px; } .qc-ico { width: 50px; height: 50px; } }
@media (max-width: 600px) {
  .toasts { bottom: calc(76px + env(safe-area-inset-bottom)); }
  /* on a phone the chat takes the screen */
  .qc-panel { z-index: 120; left: 8px; right: 8px; top: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); width: auto; height: auto; }
  body.chat-open { overflow: hidden; }
  body.chat-open .qc-launch { opacity: 0; pointer-events: none; }
}
@media (max-height: 520px) { .qc-panel { top: 8px; bottom: 8px; left: 84px; height: auto; } .qc-chips { padding-block: 4px 6px; } .qc-wa { min-height: 34px; } }
@media (max-height: 520px) and (max-width: 600px) { .qc-panel { left: 8px; } }
