/* bhchat — chat web propio de Bioherbolario. Verde de la marca (bh2026.css). Claudia, 19-oct-2026 */
.bhchat { --c-g: var(--bh-g-ink, #4a842c); --c-g-d: var(--bh-g-d, #1f5a2e); --c-bg: var(--bh-bg, #f1f7ec); --c-line: var(--bh-line, #cfe0c3); --c-text: var(--bh-text, #23301f); --c-muted: var(--bh-muted, #5f6b59);
  position: fixed; right: 18px; bottom: 18px; z-index: 1000; font-size: 15px; line-height: 1.45; font-family: inherit; color: var(--c-text); }
.bhchat *, .bhchat *::before, .bhchat *::after { box-sizing: border-box; }
.bhchat button { font-family: inherit; }

/* burbuja flotante */
.bhchat-fab { position: relative; display: flex; align-items: center; justify-content: center; width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--c-g); color: #fff; cursor: pointer; box-shadow: 0 4px 16px rgba(0, 0, 0, .25); transition: transform .15s ease, background .15s ease; }
.bhchat-fab:hover { background: var(--bh-g-hov, #3f7425); transform: scale(1.05); }
.bhchat-fab:focus-visible, .bhchat-x:focus-visible, .bhchat-chip:focus-visible, .bhchat-send:focus-visible, .bhchat-persona:focus-visible, .bhchat-in:focus-visible, .bhchat-msgs:focus-visible { outline: 3px solid #1b6bd1; outline-offset: 2px; }
.bhchat-badge { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--bh-pink-ink, #d63a63); color: #fff; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; }
.bhchat-badge[hidden] { display: none; }
.bhchat.bhchat-open .bhchat-fab { display: none; }

/* panel */
.bhchat-panel { display: flex; flex-direction: column; width: 370px; max-width: calc(100vw - 24px); height: 540px; max-height: calc(100vh - 36px); background: #fff; border: 1px solid var(--c-line); border-radius: 14px; box-shadow: 0 10px 40px rgba(0, 0, 0, .28); overflow: hidden; }
.bhchat-panel[hidden] { display: none; }
.bhchat-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--c-g); color: #fff; }
.bhchat-av { flex: none; width: 38px; height: 38px; border-radius: 50%; background: #fff; color: var(--c-g-d); font-weight: 700; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.bhchat-tt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bhchat-tt strong { font-size: 16px; line-height: 1.2; }
.bhchat-sub { font-size: 13px; opacity: .95; }
.bhchat-x { flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
.bhchat-x:hover { background: rgba(255, 255, 255, .18); }

.bhchat-msgs { flex: 1; overflow-y: auto; padding: 14px 12px 6px; background: var(--c-bg); display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.bhchat-m { display: flex; flex-direction: column; max-width: 86%; }
.bhchat-m .bhchat-b { padding: 9px 12px; border-radius: 14px; word-wrap: break-word; overflow-wrap: anywhere; }
.bhchat-m .bhchat-b a { color: inherit; text-decoration: underline; }
.bhchat-bot, .bhchat-age { align-self: flex-start; }
.bhchat-bot .bhchat-b, .bhchat-age .bhchat-b { background: #fff; border: 1px solid var(--c-line); border-bottom-left-radius: 4px; }
.bhchat-age .bhchat-b { border-color: var(--c-g); }
.bhchat-quien { font-size: 12px; font-weight: 600; color: var(--c-g-d); margin: 0 0 2px 6px; }
.bhchat-cli { align-self: flex-end; }
.bhchat-cli .bhchat-b { background: var(--c-g); color: #fff; border-bottom-right-radius: 4px; }
.bhchat-sis { align-self: center; max-width: 92%; }
.bhchat-sis .bhchat-b { background: transparent; color: var(--c-muted); font-size: 13px; text-align: center; padding: 2px 8px; }

.bhchat-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0 4px; }
.bhchat-chip { border: 1.5px solid var(--c-g); background: #fff; color: var(--c-g-d); border-radius: 18px; padding: 8px 14px; font-size: 14px; cursor: pointer; text-align: left; min-height: 38px; }
.bhchat-chip:hover { background: var(--c-g); color: #fff; }
.bhchat-nueva { text-align: center; color: var(--c-muted); padding: 10px 0; }
.bhchat-nueva p { margin: 0 0 8px; }

.bhchat-typing { padding: 0 14px 4px; background: var(--c-bg); }
.bhchat-msgs .bhchat-typing { padding: 0; background: transparent; align-self: flex-start; }
.bhchat-typing[hidden] { display: none; }
.bhchat-dots { display: inline-flex; gap: 4px; background: #fff; border: 1px solid var(--c-line); border-radius: 14px; border-bottom-left-radius: 4px; padding: 10px 12px; }
.bhchat-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--c-muted); animation: bhchat-b 1.2s infinite ease-in-out; }
.bhchat-dots i:nth-child(2) { animation-delay: .15s; } .bhchat-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bhchat-b { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.bhchat-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.bhchat-aviso { padding: 8px 14px; background: #fff3cd; color: #5c4400; font-size: 13px; border-top: 1px solid #f0dc9a; }
.bhchat-aviso[hidden] { display: none; }

.bhchat-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--c-line); background: #fff; }
.bhchat-form[hidden] { display: none; }
.bhchat-in { flex: 1; min-width: 0; border: 1.5px solid var(--c-line); border-radius: 22px; padding: 10px 14px; font-size: 16px; font-family: inherit; background: #fff; color: var(--c-text); }
.bhchat-in:disabled { background: #f3f3f3; }
.bhchat-send { flex: none; border: 0; border-radius: 22px; background: var(--c-g); color: #fff; padding: 0 18px; font-size: 15px; font-weight: 600; cursor: pointer; min-height: 42px; }
.bhchat-send:hover { background: var(--bh-g-hov, #3f7425); }
.bhchat-send:disabled { opacity: .5; cursor: default; }
.bhchat-foot { padding: 0 12px 10px; text-align: center; background: #fff; }
.bhchat-foot:has(.bhchat-persona[hidden]) { display: none; }
.bhchat-persona { border: 0; background: transparent; color: var(--c-muted); font-size: 13px; text-decoration: underline; cursor: pointer; padding: 6px 8px; min-height: 32px; }
.bhchat-persona:hover { color: var(--c-g-d); }
.bhchat-persona[hidden] { display: none; }

/* la burbuja sube sobre las barras fijas de compra del movil */
@media (max-width: 767px) { .bhchat-up { bottom: 84px; } }

/* movil: pantalla completa */
@media (max-width: 640px) {
  .bhchat { right: 14px; bottom: 14px; }
  .bhchat.bhchat-open { right: 0; bottom: 0; left: 0; top: 0; }
  .bhchat.bhchat-up.bhchat-open { bottom: 0; }
  .bhchat-panel { width: 100%; max-width: none; height: 100vh; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
  .bhchat-head { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  .bhchat-form { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
}
html.bhchat-bloqueo { }
@media (max-width: 640px) { html.bhchat-bloqueo, html.bhchat-bloqueo body { overflow: hidden; } }
@media (prefers-reduced-motion: reduce) { .bhchat-fab, .bhchat-dots i { transition: none; animation: none; } }
@media print { .bhchat { display: none; } }

/* Desvío de llamadas (19-oct): tarjeta móvil y enlace del pie en PC */
.bhchat-tel { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 2147483000; display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.bhchat-tel-c { background: #fff; border-radius: 16px; padding: 20px; width: 100%; max-width: 360px; box-shadow: 0 10px 30px rgba(0,0,0,.3); text-align: center; font-family: inherit; }
.bhchat-tel-c strong { display: block; font-size: 18px; color: #1f3d2b; }
.bhchat-tel-c p { margin: 6px 0 16px; color: #555; font-size: 15px; }
.bhchat-tel-ver { display: block; width: 100%; padding: 14px; border: 0; border-radius: 10px; background: #3f8a52; color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; margin-bottom: 10px; }
.bhchat-tel-llamar { display: block; padding: 12px; color: #3f8a52; font-size: 15px; text-decoration: underline; }
.bhchat-pedido-link { font-size: 13px; color: #3f8a52; text-decoration: underline; cursor: pointer; white-space: nowrap; }

/* Tarjetas de producto (19-oct) */
.bhchat-prods { background: transparent !important; padding: 0 !important; max-width: 100% !important; }
.bhchat-cards { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 8px; -webkit-overflow-scrolling: touch; }
.bhchat-card { flex: 0 0 168px; scroll-snap-align: start; background: #fff; border: 1px solid #dfe8e0; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 6px; box-sizing: border-box; }
.bhchat-card-img { display: block; text-align: center; }
.bhchat-card-img img { width: 110px; height: 110px; object-fit: contain; max-width: 100%; }
.bhchat-card-nom { font-size: 13px; line-height: 1.25; color: #1f3d2b; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.bhchat-card-pr { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.bhchat-card-pr strong { font-size: 16px; color: #1f3d2b; }
.bhchat-card-pr s { font-size: 12px; color: #888; }
.bhchat-card-dto { font-size: 11px; font-weight: 700; color: #fff; background: #c2185b; border-radius: 4px; padding: 1px 5px; }
.bhchat-card-st { font-size: 12px; color: #8a6d00; }
.bhchat-card-st.ok { color: #2e7d32; }
.bhchat-card-add { margin-top: auto; display: block; text-align: center; background: #3f8a52; color: #fff !important; border-radius: 8px; padding: 9px 6px; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; }
.bhchat-card-add:hover { background: #33723f; }
@media (max-width: 767px) {
  .bhchat-cards { flex-direction: column; overflow-x: visible; }
  .bhchat-card { flex: 0 0 auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .bhchat-card-img { flex: 0 0 72px; }
  .bhchat-card-img img { width: 72px; height: 72px; }
  .bhchat-card-nom { flex: 1 1 0; min-width: 0; }
  .bhchat-card-pr, .bhchat-card-st, .bhchat-card-add { flex: 1 1 100%; }
}

/* Avatar (19-oct) */
.bhchat-av { overflow: hidden; background: #dcefe0; }
.bhchat-av img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.bhchat-conav { position: relative; padding-left: 34px; }
.bhchat-av-s { position: absolute; left: 0; bottom: 0; width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: #dcefe0; }
.bhchat-av-ini { display: flex; align-items: center; justify-content: center; background: #3f8a52; color: #fff; font-size: 13px; font-weight: 700; }
/* Posición: el tema fija #bhchat con !important; en móvil el panel abierto ocupa todo el alto pase lo que pase.
   Variable para quien quiera mover la burbuja sin pelearse: --bhchat-bottom (por defecto 18px). */
.bhchat { bottom: var(--bhchat-bottom, 18px); }
@media (max-width: 767px) { #bhchat.bhchat-open { bottom: 0 !important; top: 0 !important; } }
