/* Interbikes BR — chat com o assistente virtual (visual premium: preto, marfim e dourado; vermelho só nas ações). */
.ibc { --ink: #111418; --ink2: #1c2026; --gold: #B08D57; --gold-l: #D9BE8A; --gold-d: #7C5E2E; --ivory: #FAF8F4; --hair: #E7E1D6; --muted: #6b7078;
  --red: #E10E17; --red-d: #B80B12; --green: #16A34A;
  position: fixed; right: 24px; bottom: 24px; z-index: 9999; font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 14px; color: var(--ink); }
.ibc [hidden] { display: none !important; } /* sem isto o display:flex dos elementos anula o atributo hidden (era o bug do botão de fechar) */
.ibc *, .ibc *::before, .ibc *::after { box-sizing: border-box; }
.ibc button { font: inherit; cursor: pointer; }
.ibc a { color: inherit; }
.ibc :focus-visible { outline: 3px solid #1D4ED8; outline-offset: 2px; }

/* Botão flutuante */
.ibc-fab { position: relative; display: flex; align-items: center; justify-content: center; width: 60px; height: 60px; margin-left: auto; border-radius: 50%; border: 0; color: #fff;
  background: linear-gradient(145deg, #2a2f36, #0B0D10); box-shadow: 0 0 0 2px var(--gold), 0 14px 28px -8px rgba(17, 20, 24, .6); transition: transform .15s, box-shadow .15s; }
.ibc-fab:hover { transform: translateY(-2px) scale(1.04); }
.ibc-fab:active { transform: scale(.96); }
.ibc-fab svg { width: 26px; height: 26px; }
.ibc-fab-dot { position: absolute; right: 3px; bottom: 3px; width: 13px; height: 13px; border-radius: 50%; background: var(--green); border: 2px solid #15181d; }
.ibc-badge { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff; animation: ibc-pop .3s ease; }
.ibc.has-unread .ibc-fab { animation: ibc-ring 2.4s ease-out 3; }
.ibc.compact .ibc-fab { width: 50px; height: 50px; }
.ibc.compact { right: 16px; bottom: 16px; }
@keyframes ibc-pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes ibc-ring { 0% { box-shadow: 0 0 0 2px var(--gold), 0 0 0 0 rgba(176, 141, 87, .55), 0 14px 28px -8px rgba(17, 20, 24, .6); } 70%, 100% { box-shadow: 0 0 0 2px var(--gold), 0 0 0 16px rgba(176, 141, 87, 0), 0 14px 28px -8px rgba(17, 20, 24, .6); } }

/* Convite (aparece uma vez, fora de checkout e pedido) */
.ibc-teaser { position: absolute; right: 0; bottom: 76px; width: 268px; background: #fff; border-radius: 18px 18px 6px 18px; border: 1px solid var(--hair);
  box-shadow: 0 18px 36px -16px rgba(17, 20, 24, .45); animation: ibc-up .35s ease; }
.ibc-teaser-body { display: block; width: 100%; padding: 14px 40px 14px 16px; background: none; border: 0; text-align: left; line-height: 1.45; }
.ibc-teaser-body strong { display: block; font-size: 13px; }
.ibc-teaser-x { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 18px; line-height: 1; }
.ibc-teaser-x:hover { background: var(--ivory); color: var(--ink); }

/* Painel */
.ibc-panel { position: absolute; right: 0; bottom: 74px; display: flex; flex-direction: column; width: 392px; max-width: calc(100vw - 32px); height: min(680px, calc(100vh - 120px)); height: min(680px, calc(100dvh - 120px));
  background: var(--ivory); border-radius: 22px; overflow: hidden; box-shadow: 0 34px 70px -22px rgba(17, 20, 24, .6), 0 0 0 1px rgba(17, 20, 24, .08); animation: ibc-up .22s ease; }
.ibc.compact .ibc-panel { bottom: 66px; }
@keyframes ibc-up { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

.ibc-head { position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 12px 16px 16px; color: #fff;
  background: radial-gradient(22rem 9rem at 95% -30%, rgba(176, 141, 87, .4), transparent 65%), linear-gradient(135deg, #171A1F, #0B0D10); box-shadow: inset 0 -1px 0 rgba(176, 141, 87, .6); }
.ibc-avatar { position: relative; flex: none; display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%; font-family: 'Barlow Condensed', Oswald, sans-serif; font-weight: 800; font-size: 22px;
  background: linear-gradient(145deg, #2a2f36, #14171b); box-shadow: 0 0 0 2px var(--gold), 0 0 0 5px rgba(176, 141, 87, .2); }
.ibc-presence { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: var(--green); border: 2px solid #15181d; }
.ibc-who { flex: 1; min-width: 0; }
.ibc-who strong { display: block; font-size: 16px; line-height: 1.2; }
.ibc-who > span { display: block; margin-top: 2px; font-size: 12px; color: var(--gold-l); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ibc-iconbtn { flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: #fff; opacity: .85; transition: background-color .15s, opacity .15s; }
.ibc-iconbtn:hover { background: rgba(255, 255, 255, .12); opacity: 1; }
.ibc-iconbtn svg { width: 20px; height: 20px; }

/* Conversa */
.ibc-log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin;
  background: radial-gradient(30rem 14rem at 100% 0, rgba(176, 141, 87, .08), transparent 70%), var(--ivory); }
.ibc-day { align-self: center; display: flex; align-items: center; gap: 10px; width: 100%; font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-d); }
.ibc-day::before, .ibc-day::after { content: ""; flex: 1; height: 1px; background: var(--hair); }
.ibc-row { display: flex; flex-direction: column; max-width: 86%; animation: ibc-in .22s ease; }
.ibc-row--assistant { align-self: flex-start; }
.ibc-row--user { align-self: flex-end; align-items: flex-end; }
.ibc-row--wide { max-width: 100%; align-self: stretch; }
@keyframes ibc-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ibc-bubble { padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: #fff; border: 1px solid var(--hair); line-height: 1.5; word-break: break-word; font-size: 14.5px;
  box-shadow: 0 1px 0 rgba(17, 20, 24, .03), 0 8px 18px -14px rgba(17, 20, 24, .35); }
.ibc-row--user .ibc-bubble { border: 0; border-radius: 18px 18px 6px 18px; color: #fff; background: linear-gradient(145deg, #262b32, #111418); }
.ibc-bubble a { color: var(--red-d); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.ibc-row--user .ibc-bubble a { color: var(--gold-l); }
.ibc-meta { margin-top: 3px; padding: 0 4px; font-size: 11px; color: #8a8f98; }
.ibc-tick { margin-left: 4px; letter-spacing: -2px; }
.ibc-tick.is-read { color: var(--gold-d); }
.ibc-typing .ibc-bubble { display: flex; align-items: center; gap: 5px; padding: 13px 16px; }
.ibc-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: ibc-bounce 1s infinite; }
.ibc-dot:nth-child(2) { animation-delay: .15s; } .ibc-dot:nth-child(3) { animation-delay: .3s; }
@keyframes ibc-bounce { 0%, 70%, 100% { transform: translateY(0); opacity: .55; } 35% { transform: translateY(-5px); opacity: 1; } }

/* Atalhos de resposta */
.ibc-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 12px; background: var(--ivory); }
.ibc-chip { min-height: 38px; padding: 0 14px; border: 1.5px solid var(--hair); border-radius: 999px; background: #fff; font-size: 13px; font-weight: 600; color: var(--ink); transition: border-color .15s, background-color .15s; }
.ibc-chip:hover { border-color: var(--ink); }
.ibc-chip--primary { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Cartões de produto */
.ibc-cards { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 8px; scrollbar-width: none; }
.ibc-cards::-webkit-scrollbar { display: none; }
.ibc-card { flex: none; width: 206px; scroll-snap-align: start; display: flex; flex-direction: column; text-decoration: none; background: #fff; border: 1px solid var(--hair); border-radius: 16px; overflow: hidden;
  box-shadow: 0 10px 22px -16px rgba(17, 20, 24, .45); transition: transform .15s, border-color .15s; }
.ibc-card:hover { transform: translateY(-2px); border-color: #CFC7B7; }
.ibc-card-img { display: block; aspect-ratio: 1 / 1; background: var(--ivory); }
.ibc-card-img img { width: 100%; height: 100%; object-fit: contain; padding: 8px; display: block; }
.ibc-card-body { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 4px; }
.ibc-card-body small { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-d); }
.ibc-card-body strong { font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.ibc-card-pix { margin-top: 4px; font-family: 'Barlow Condensed', Oswald, sans-serif; font-weight: 800; font-size: 24px; line-height: 1; color: #15803D; font-variant-numeric: tabular-nums; }
.ibc-card-pix i { font-family: Inter, sans-serif; font-style: normal; font-size: 11px; font-weight: 700; }
.ibc-card-alt { font-size: 11.5px; color: var(--muted); }
.ibc-card-low { font-size: 11.5px; font-weight: 700; color: #92400E; }
.ibc-card-cta { margin: 8px 12px 12px; padding: 9px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; text-align: center; }

/* Oferta exclusiva (voucher) */
.ibc-offer { position: relative; color: #fff; border-radius: 18px; padding: 14px 16px 16px; border: 1px solid rgba(176, 141, 87, .7);
  background: radial-gradient(18rem 8rem at 100% -20%, rgba(176, 141, 87, .35), transparent 65%), linear-gradient(160deg, #1b1f25, #0B0D10); box-shadow: 0 20px 36px -20px rgba(17, 20, 24, .7); }
.ibc-offer::before, .ibc-offer::after { content: ""; position: absolute; top: 112px; width: 18px; height: 18px; border-radius: 50%; background: var(--ivory); border: 1px solid rgba(176, 141, 87, .7); }
.ibc-offer::before { left: -10px; } .ibc-offer::after { right: -10px; }
.ibc-eyebrow { font-size: 10.5px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-l); }
.ibc-offer-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ibc-timer { font-size: 12px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .1); }
.ibc-timer.is-low { background: var(--red); }
.ibc-offer-prod { display: flex; gap: 12px; align-items: center; margin: 12px 0 14px; }
.ibc-offer-prod img { flex: none; width: 58px; height: 58px; object-fit: contain; border-radius: 12px; background: #fff; padding: 4px; }
.ibc-offer-prod strong { font-size: 13.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ibc-offer-split { border-top: 1px dashed rgba(217, 190, 138, .5); margin: 0 -16px; }
.ibc-offer-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-top: 16px; }
.ibc-offer-price s { font-size: 13px; color: rgba(255, 255, 255, .55); }
.ibc-offer-price b { font-family: 'Barlow Condensed', Oswald, sans-serif; font-weight: 800; font-size: 38px; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.ibc-offer-price span { font-size: 11px; font-weight: 800; letter-spacing: .06em; padding: 3px 9px; border-radius: 999px; background: var(--gold); color: #1a1405; }
.ibc-save { margin-top: 6px; font-size: 12.5px; color: var(--gold-l); font-weight: 600; }
.ibc-bar { height: 4px; border-radius: 999px; background: rgba(255, 255, 255, .14); margin: 12px 0 14px; overflow: hidden; }
.ibc-bar span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-l)); transform-origin: left; transition: transform 1s linear; }
.ibc-offer-cta { display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 12px; text-decoration: none; color: #fff; font-weight: 800; font-size: 13.5px; letter-spacing: .08em; text-transform: uppercase;
  background: linear-gradient(180deg, #EC1B24, #C30C14); box-shadow: 0 12px 22px -12px rgba(225, 14, 23, .85), inset 0 1px 0 rgba(255, 255, 255, .25); }
.ibc-offer-cta:hover { filter: brightness(1.06); }
.ibc-offer-note { margin: 10px 0 0; font-size: 11.5px; color: rgba(255, 255, 255, .6); text-align: center; }
.ibc-offer.is-over { background: #fff; color: var(--ink); border-color: var(--hair); box-shadow: none; }
.ibc-offer.is-over::before, .ibc-offer.is-over::after { display: none; }
.ibc-over { margin: 0; font-size: 13.5px; font-weight: 600; color: #7f1d1d; }

/* Cupom */
.ibc-coupon { border: 1.5px dashed var(--gold); border-radius: 16px; background: #fff; padding: 14px 16px; }
.ibc-coupon .ibc-eyebrow { color: var(--gold-d); }
.ibc-code { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0 6px; }
.ibc-code b { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 22px; letter-spacing: .12em; }
.ibc-copy { min-height: 38px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ibc-coupon p { margin: 0; font-size: 12px; color: var(--muted); }

/* Campo de mensagem */
.ibc-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 6px; background: #fff; border-top: 1px solid var(--hair); }
.ibc-input { field-sizing: content; flex: 1; min-height: 46px; max-height: 120px; resize: none; padding: 12px 14px; border: 1.5px solid var(--hair); border-radius: 16px; background: var(--ivory); font: inherit; font-size: 15px; line-height: 1.35; color: var(--ink); }
.ibc-input:focus { outline: none; border-color: var(--ink); background: #fff; box-shadow: 0 0 0 4px rgba(17, 20, 24, .08); }
.ibc-send { flex: none; display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; border: 0; border-radius: 50%; color: #fff; background: linear-gradient(180deg, #EC1B24, #C30C14); box-shadow: 0 10px 18px -10px rgba(225, 14, 23, .9); transition: transform .12s; }
.ibc-send:hover { transform: scale(1.06); }
.ibc-send svg { width: 20px; height: 20px; }
.ibc-send:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.ibc-foot { margin: 0; padding: 4px 14px 10px; background: #fff; text-align: center; font-size: 11px; color: #8a8f98; }
.ibc-foot a { color: var(--gold-d); font-weight: 700; }

/* Celular: o painel vira tela cheia, com botão de fechar sempre à vista */
@media (max-width: 520px) {
  .ibc { right: 16px; bottom: 16px; }
  .ibc-panel { position: fixed; inset: 0; right: 0; bottom: 0; width: 100%; max-width: none; height: 100vh; height: 100dvh; border-radius: 0; animation: ibc-in .2s ease; }
  .ibc-head { padding-top: calc(16px + env(safe-area-inset-top)); }
  .ibc-foot { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .ibc.is-open .ibc-fab, .ibc.is-open .ibc-teaser { display: none; }
  .ibc-teaser { width: min(268px, calc(100vw - 32px)); }
  html.ibc-lock { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .ibc *, .ibc *::before, .ibc *::after { animation: none !important; transition: none !important; } }
