/* ════════════════════════════════════════════════════════════════════════════
   INSÔNIA — Coruja (chat do site)  ·  botão no canto + balão + conversa
   ════════════════════════════════════════════════════════════════════════════ */
.owl {
  --ow-bg: var(--bg1, #111); --ow-bg2: var(--bg2, #1a1a1a); --ow-bg3: var(--bg3, #222);
  --ow-gold: var(--gold, #D4AF37); --ow-gold-l: var(--gold-l, #F0C84A); --ow-gold-b: var(--gold-b, rgba(212,175,55,.28)); --ow-gold-bg: var(--gold-bg, rgba(212,175,55,.08));
  --ow-t0: var(--t0, #fff); --ow-t1: var(--t1, #a8a8a8); --ow-t2: var(--t2, #8a8a8a);
  --ow-line: var(--border-md, rgba(255,255,255,.11)); --ow-green: var(--green, #34C759);
  --ow-ease: cubic-bezier(.34, 1.26, .64, 1);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
.owl *, .owl *::before, .owl *::after { box-sizing: border-box; }
.owl[hidden], .owl [hidden] { display: none !important; }

/* ── botão ─────────────────────────────────────────────────────────────── */
.owl-fab {
  position: fixed; z-index: 1985;
  left: max(1.25rem, env(safe-area-inset-left, 0px));
  bottom: max(1.25rem, calc(env(safe-area-inset-bottom, 0px) + .75rem));
  width: 62px; height: 62px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 2px solid var(--ow-gold); background: #0b0a07;
  box-shadow: 0 10px 28px rgba(0,0,0,.55), 0 0 0 5px rgba(212,175,55,.14);
  transition: transform .25s var(--ow-ease), opacity .2s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
}
.owl-fab img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
@media (hover: hover) { .owl-fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 34px rgba(0,0,0,.6), 0 0 0 6px rgba(212,175,55,.22); } }
.owl-fab { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.owl-fab img { pointer-events: none; }
.owl-fab:active { transform: scale(.94); }
.owl-fab:focus-visible { outline: 3px solid var(--ow-gold-l); outline-offset: 3px; }
.owl-fab .owl-dot { position: absolute; right: 1px; top: 1px; width: 14px; height: 14px; border-radius: 50%; background: var(--ow-green); border: 2px solid #0b0a07; }
.owl-fab .owl-dot.off { background: var(--ow-t2); }
.owl-fab.away { transform: scale(.6); opacity: 0; pointer-events: none; }
.owl-fab.wiggle { animation: owl-wig .9s ease both; }
@keyframes owl-wig { 0%,100% { transform: rotate(0) } 20% { transform: rotate(-9deg) } 40% { transform: rotate(7deg) } 60% { transform: rotate(-4deg) } 80% { transform: rotate(2deg) } }

/* ── balão "fala comigo" ──────────────────────────────────────────────── */
.owl-tip {
  position: fixed; z-index: 1984;
  left: calc(max(1.25rem, env(safe-area-inset-left, 0px)) + 74px);
  bottom: max(1.6rem, calc(env(safe-area-inset-bottom, 0px) + 1.1rem));
  max-width: min(260px, calc(100vw - 120px));
  display: flex; align-items: flex-start; gap: .5rem;
  padding: .7rem .6rem .7rem .9rem; border-radius: 16px 16px 16px 4px;
  background: var(--ow-gold); color: #120f06; font-size: .84rem; font-weight: 700; line-height: 1.3;
  box-shadow: 0 12px 30px rgba(0,0,0,.5); cursor: pointer;
  animation: owl-pop .45s var(--ow-ease) both;
}
.owl-tip button { flex: none; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(0,0,0,.14); color: #120f06; font-size: .8rem; cursor: pointer; display: grid; place-items: center; padding: 0; }
.owl-tip.bye { animation: owl-out .25s ease both; }
@keyframes owl-pop { from { opacity: 0; transform: translateY(10px) scale(.92); transform-origin: left bottom; } }
@keyframes owl-out { to { opacity: 0; transform: translateY(6px) scale(.96); } }

/* ── janela do chat ───────────────────────────────────────────────────── */
.owl-panel {
  position: fixed; z-index: 1996;
  left: max(1.25rem, env(safe-area-inset-left, 0px));
  bottom: max(1.25rem, calc(env(safe-area-inset-bottom, 0px) + .75rem));
  width: min(390px, calc(100vw - 2.5rem)); height: min(620px, calc(100dvh - 7rem));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--ow-bg); color: var(--ow-t0);
  border: 1px solid var(--ow-gold-b); border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0,0,0,.7);
  transform-origin: left bottom; animation: owl-open .32s var(--ow-ease) both;
}
@keyframes owl-open { from { opacity: 0; transform: translateY(16px) scale(.94); } }
.owl-panel.bye { animation: owl-out .2s ease both; }

.owl-hd { flex: none; display: flex; align-items: center; gap: .7rem; padding: .8rem .8rem .8rem .9rem; border-bottom: 1px solid var(--ow-line);
  background: radial-gradient(120% 140% at 0% 0%, rgba(212,175,55,.16), transparent 60%), var(--ow-bg); }
.owl-hd img { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--ow-gold); object-fit: cover; flex: none; }
.owl-hd .owl-who { min-width: 0; flex: 1; }
.owl-hd b { display: block; font-size: .95rem; font-weight: 800; letter-spacing: -.01em; }
.owl-hd small { display: flex; align-items: center; gap: .35rem; font-size: .72rem; color: var(--ow-t1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.owl-hd small i { width: 7px; height: 7px; border-radius: 50%; background: var(--ow-green); flex: none; }
.owl-hd small i.off { background: var(--ow-t2); }
.owl-x { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--ow-line); background: var(--ow-bg2); color: var(--ow-t0); font-size: 1rem; cursor: pointer; display: grid; place-items: center; }
.owl-x:hover { border-color: var(--ow-gold-b); }

.owl-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 1rem .85rem .5rem; display: flex; flex-direction: column; gap: .55rem; scroll-behavior: smooth; }
.owl-log::-webkit-scrollbar { width: 3px; }
.owl-m { max-width: 88%; padding: .62rem .85rem; border-radius: 16px; font-size: .88rem; line-height: 1.42; animation: owl-msg .28s ease both; overflow-wrap: anywhere; }
.owl-m.o { align-self: flex-start; background: var(--ow-bg3); border-bottom-left-radius: 5px; }
.owl-m.u { align-self: flex-end; background: var(--ow-gold); color: #120f06; font-weight: 600; border-bottom-right-radius: 5px; }
.owl-m b { color: var(--ow-gold-l); }
.owl-m.u b { color: inherit; }
.owl-m small { display: block; color: var(--ow-t1); font-size: .76rem; margin-top: .25rem; }
.owl-m a { color: var(--ow-gold-l); font-weight: 700; }
.owl-m.wide { max-width: 100%; width: 100%; padding: .7rem; }
@keyframes owl-msg { from { opacity: 0; transform: translateY(6px); } }
.owl-typing { align-self: flex-start; display: flex; gap: 4px; padding: .75rem .9rem; border-radius: 16px; border-bottom-left-radius: 5px; background: var(--ow-bg3); }
.owl-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ow-t1); animation: owl-dots 1s infinite ease-in-out; }
.owl-typing i:nth-child(2) { animation-delay: .15s; } .owl-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes owl-dots { 0%,80%,100% { opacity: .3; transform: translateY(0) } 40% { opacity: 1; transform: translateY(-3px) } }

/* respostas rápidas */
.owl-ft { flex: none; border-top: 1px solid var(--ow-line); padding: .6rem .7rem calc(.6rem + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: .55rem; background: var(--ow-bg); }
.owl-chips { display: flex; flex-wrap: wrap; gap: .4rem; max-height: 132px; overflow-y: auto; }
.owl-chips:empty { display: none; }
.owl-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .5rem .8rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--ow-gold-b); background: var(--ow-gold-bg); color: var(--ow-t0); font: 600 .8rem/1.2 inherit; text-align: left; transition: background .15s, border-color .15s, transform .15s; }
.owl-chip:hover { background: rgba(212,175,55,.16); border-color: var(--ow-gold); }
.owl-chip:active { transform: scale(.96); }
.owl-chip.ghost { border-color: var(--ow-line); background: transparent; color: var(--ow-t1); }
.owl-chip:focus-visible, .owl-in input:focus-visible, .owl-x:focus-visible, .owl-ib:focus-visible, .owl-btn:focus-visible { outline: 2px solid var(--ow-gold-l); outline-offset: 2px; }
.owl-in { display: flex; gap: .45rem; }
.owl-in input { flex: 1; min-width: 0; height: 42px; padding: 0 .9rem; border-radius: 999px; border: 1px solid var(--ow-line); background: var(--ow-bg2); color: var(--ow-t0); font: 500 16px inherit; outline: none; }
.owl-in input::placeholder { color: var(--ow-t2); }
.owl-in input:focus { border-color: var(--ow-gold-b); }
.owl-in button { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--ow-gold); color: #120f06; font-size: 1.05rem; cursor: pointer; display: grid; place-items: center; }

/* cartões de produto dentro do chat */
.owl-cards { display: flex; flex-direction: column; gap: .45rem; }
.owl-card { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: .6rem; padding: .45rem; border-radius: 12px; background: var(--ow-bg2); border: 1px solid transparent; }
.owl-card.added { border-color: rgba(52,199,89,.45); }
.owl-card img { width: 48px; height: 48px; border-radius: 9px; object-fit: contain; background: #000; }
.owl-card .nm { min-width: 0; font-size: .82rem; font-weight: 600; line-height: 1.25; cursor: pointer; }
.owl-card .nm span { display: block; color: var(--ow-t1); font-size: .72rem; font-weight: 500; margin-top: .1rem; }
.owl-card .nm em { font-style: normal; color: var(--ow-gold-l); font-weight: 700; }
.owl-card .ac { display: flex; gap: .3rem; }
.owl-ib { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--ow-line); background: var(--ow-bg3); color: var(--ow-t0); cursor: pointer; display: grid; place-items: center; font-size: .95rem; padding: 0; }
.owl-ib.gold { background: var(--ow-gold); border-color: var(--ow-gold); color: #120f06; }
.owl-card.added .owl-ib.gold { background: var(--ow-green); border-color: var(--ow-green); }
.owl-kit-hd { display: flex; align-items: center; gap: .55rem; margin-bottom: .55rem; }
.owl-kit-hd .ic { font-size: 1.5rem; }
.owl-kit-hd small { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ow-gold); font-weight: 800; }
.owl-kit-hd b { color: var(--ow-t0); font-size: .98rem; }
.owl-tot { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-top: .6rem; font-size: .8rem; color: var(--ow-t1); }
.owl-tot b { font-size: 1.1rem; color: var(--ow-gold-l); font-variant-numeric: tabular-nums; }
.owl-tot .over { color: #ff9f0a; }
.owl-btn { display: flex; align-items: center; justify-content: center; gap: .45rem; width: 100%; margin-top: .6rem; padding: .7rem; border-radius: 12px; border: 0; background: var(--ow-gold); color: #120f06; font: 800 .86rem inherit; cursor: pointer; text-decoration: none; }
.owl-btn[disabled] { opacity: .55; cursor: default; }
.owl-btn.ghost { background: transparent; border: 1px solid var(--ow-gold-b); color: var(--ow-gold-l); }
.owl-status { display: flex; align-items: center; gap: .4rem; margin-top: .35rem; font-weight: 800; }
.owl-status i { width: 9px; height: 9px; border-radius: 50%; background: var(--ow-gold); }

/* resumo do pedido e PIX dentro do chat */
.owl-sum { display: flex; flex-direction: column; gap: .3rem; margin-top: .55rem; padding: .6rem .7rem; border-radius: 12px; background: var(--ow-bg2); }
.owl-li { display: flex; justify-content: space-between; gap: .6rem; font-size: .8rem; }
.owl-li span { min-width: 0; }
.owl-li em { font-style: normal; color: var(--ow-t1); }
.owl-li b { color: var(--ow-t0); white-space: nowrap; font-variant-numeric: tabular-nums; }
.owl-li.tot { margin-top: .2rem; padding-top: .4rem; border-top: 1px solid var(--ow-line); font-weight: 800; }
.owl-li.tot b { color: var(--ow-gold-l); font-size: .95rem; }
.owl-qr { width: min(210px, 70%); margin: .7rem auto .2rem; padding: .5rem; background: #fff; border-radius: 12px; line-height: 0; }
.owl-qr svg { width: 100%; height: auto; }

/* ── celular: chat vira gaveta de baixo ───────────────────────────────── */
@media (max-width: 600px) {
  .owl-fab { width: 56px; height: 56px; left: max(1rem, env(safe-area-inset-left, 0px)); bottom: max(1rem, calc(env(safe-area-inset-bottom, 0px) + .65rem)); }
  /* no celular o balão fica em cima da coruja (o aviso de aberto/fechado ocupa o canto direito) */
  .owl-tip { left: max(1rem, env(safe-area-inset-left, 0px)); bottom: calc(max(1rem, calc(env(safe-area-inset-bottom, 0px) + .65rem)) + 66px); max-width: min(250px, calc(100vw - 2rem)); border-radius: 16px 16px 16px 4px; }
  .owl-panel { left: 0; right: 0; bottom: 0; width: 100%; height: min(86dvh, 680px); border-radius: 22px 22px 0 0; border-bottom: 0;
    padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); transform-origin: center bottom; }
  .owl-chips { max-height: 150px; }
}
body.owl-lock { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .owl-fab, .owl-tip, .owl-panel, .owl-m, .owl-fab.wiggle { animation: none !important; transition: none !important; }
  .owl-log { scroll-behavior: auto; }
}

/* 7.1: ícones no lugar dos emojis */
.owl-chip .ti { color: var(--ow-gold, #D4AF37); font-size: 1.02rem; }
.owl-chip.ghost .ti { color: inherit; }
.owl-kit-hd .ic .ti { color: var(--ow-gold, #D4AF37); }
.owl-msg .ti, .owl-b .ti { color: var(--ow-gold, #D4AF37); vertical-align: -2px; }
