/* ============================================================
   FoodBot - Widget CSS - Responsive Full Pro
   ============================================================ */



*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --fb-deep:          #0d0d2b;
  --fb-mid:           #14143f;
  --fb-acento:        #7c3aed;
  --fb-glow:          rgba(124,58,237,.35);
  --fb-white:         #ffffff;
  --fb-surface:       #f5f6fa;
  --fb-border:        #e4e6f0;
  --fb-text:          #1e1e3f;
  --fb-muted:         #8b8fb5;
  --fb-success:       #22c55e;
  --fb-radius:        16px;
  --fb-font-h:        'Outfit', sans-serif;
  --fb-font-b:        'Inter', sans-serif;
  --fb-trigger-size:  110px;
  --fb-win-w:         750px;
  --fb-win-h:         850px;
  --fb-panel-w:       180px;
  --fb-panel-mascot:  155px;
  --fb-msg-font:      1rem;
  --fb-bubble-max:    78%;
}

/* TRIGGER */
#fb-trigger {
  position: fixed;
  bottom: 24px;
  right: 28px;
  width: var(--fb-trigger-size);
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 9998;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
  animation: fb-float 4s ease-in-out infinite;
}
#fb-trigger:hover { transform: scale(1.1) translateY(-5px); }
#fb-trigger.fb-hidden { opacity: 0; transform: scale(0); pointer-events: none; }

.fb-trigger-mascot {
  width: var(--fb-trigger-size);
  height: auto;
  filter: drop-shadow(0 10px 28px rgba(124,58,237,.55));
}

.fb-trigger-badge {
  background: var(--fb-acento);
  color: #fff;
  font-family: var(--fb-font-b);
  font-size: .76rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  margin-top: 8px;
  white-space: nowrap;
  box-shadow: 0 4px 14px var(--fb-glow);
  animation: fb-pulse-badge 2.5s ease-in-out infinite;
}

/* CONTAINER */
#fb-container {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0 24px 24px 0;
}
#fb-container.visible { pointer-events: all; }

/* WINDOW */
#fb-window {
  display: flex;
  width: var(--fb-win-w);
  height: var(--fb-win-h);
  max-height: 95vh;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 32px 90px rgba(13,13,43,.55), 0 0 0 1px rgba(255,255,255,.07);
  transform: translateY(32px) scale(.93);
  opacity: 0;
  transition: transform .42s cubic-bezier(.34,1.4,.64,1), opacity .3s ease;
}
#fb-container.visible #fb-window {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* PANEL LATERAL */
#fb-side-panel {
  width: var(--fb-panel-w);
  min-width: var(--fb-panel-w);
  background: linear-gradient(175deg, var(--fb-deep) 0%, var(--fb-mid) 50%, #1e1260 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 14px 24px;
  position: relative;
  overflow: hidden;
}
#fb-side-panel::before {
  content: '. . . . . . . . . . . . . . . . . .';
  position: absolute;
  top: 0; left: 0; right: 0;
  font-size: .4rem;
  color: rgba(255,255,255,.08);
  line-height: 2.2;
  padding: 8px;
  pointer-events: none;
}

.fb-panel-logo {
  font-family: var(--fb-font-h);
  font-size: .72rem;
  font-weight: 700;
  color: rgba(255,255,255,.5);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.fb-panel-mascot {
  width: var(--fb-panel-mascot);
  height: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 12px 32px rgba(124,58,237,.65));
  animation: fb-float 5s ease-in-out infinite;
  margin: 4px 0 12px;
}

.fb-panel-name {
  font-family: var(--fb-font-h);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 5px;
  text-align: center;
}

.fb-panel-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--fb-font-b);
  font-size: .7rem;
  color: rgba(255,255,255,.55);
}
.fb-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fb-success);
  box-shadow: 0 0 0 3px rgba(34,197,94,.3);
  animation: fb-status-pulse 2s ease-in-out infinite;
}

/* CHAT AREA */
#fb-chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--fb-white);
  overflow: hidden;
  min-width: 0;
}

/* HEADER */
.fb-header {
  background: var(--fb-white);
  border-bottom: 1px solid var(--fb-border);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.fb-header-left { display: flex; align-items: center; }
.fb-header-mascot-mini {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(124,58,237,.6));
  margin-right: 10px;
  flex-shrink: 0;
  display: none;
}
.fb-header-info h2 {
  font-family: var(--fb-font-h);
  font-size: 1rem;
  font-weight: 700;
  color: var(--fb-text);
}
.fb-header-info p {
  font-family: var(--fb-font-b);
  font-size: .74rem;
  color: var(--fb-muted);
  margin-top: 2px;
}
.fb-header-btns { display: flex; gap: 6px; }
.fb-hbtn {
  background: var(--fb-surface);
  border: 1px solid var(--fb-border);
  color: var(--fb-muted);
  width: 32px;
  height: 32px;
  border-radius: 9px;
  cursor: pointer;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.fb-hbtn:hover,
.fb-hbtn:active { background: var(--fb-acento); border-color: var(--fb-acento); color: #fff; }

/* MESSAGES */
#fb-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--fb-surface);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
#fb-messages::-webkit-scrollbar { width: 3px; }
#fb-messages::-webkit-scrollbar-thumb { background: var(--fb-border); border-radius: 2px; }

.fb-msg { display: flex; gap: 9px; animation: fb-in .22s ease; }
.fb-msg.user { justify-content: flex-end; }

.fb-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid var(--fb-border);
}
.fb-msg.user .fb-avatar { display: none; }

.fb-bubble-wrap { display: flex; flex-direction: column; max-width: var(--fb-bubble-max); }
.fb-msg.user .fb-bubble-wrap { align-items: flex-end; }

.fb-bubble {
  background: var(--fb-white);
  border: 1px solid var(--fb-border);
  color: var(--fb-text);
  font-family: var(--fb-font-b);
  font-size: var(--fb-msg-font);
  line-height: 1.58;
  padding: 11px 14px;
  border-radius: 16px 16px 16px 4px;
  box-shadow: 0 1px 5px rgba(30,30,63,.07);
}
.fb-msg.user .fb-bubble {
  background: var(--fb-acento);
  border-color: transparent;
  color: #fff;
  border-radius: 16px 16px 4px 16px;
}

.fb-time { font-size: .65rem; color: var(--fb-muted); margin-top: 4px; font-family: var(--fb-font-b); }

/* TYPING */
.fb-typing {
  background: var(--fb-white);
  border: 1px solid var(--fb-border);
  padding: 13px 16px;
  border-radius: 16px 16px 16px 4px;
  display: flex;
  gap: 4px;
  align-items: center;
  box-shadow: 0 1px 5px rgba(30,30,63,.07);
}
.fb-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fb-muted);
  animation: fb-dot 1.2s ease-in-out infinite;
}
.fb-typing span:nth-child(2) { animation-delay: .2s; }
.fb-typing span:nth-child(3) { animation-delay: .4s; }

/* ACTIONS / CHIPS */
#fb-actions {
  background: var(--fb-white);
  border-top: 1px solid var(--fb-border);
  padding: 11px 14px 9px;
  flex-shrink: 0;
}
.fb-actions-lbl {
  font-family: var(--fb-font-b);
  font-size: .68rem;
  font-weight: 600;
  color: var(--fb-muted);
  letter-spacing: .7px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
#fb-chips { display: flex; flex-wrap: wrap; gap: 7px; }

.fb-chip {
  background: var(--fb-white);
  border: 1.5px solid var(--fb-border);
  color: var(--fb-text);
  font-family: var(--fb-font-b);
  font-size: .82rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 30px;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
  touch-action: manipulation;
}
.fb-chip:hover,
.fb-chip:active {
  border-color: var(--fb-acento);
  color: var(--fb-acento);
  background: rgba(124,58,237,.05);
  transform: translateY(-1px);
}
.fb-chip.primary { background: var(--fb-acento); border-color: var(--fb-acento); color: #fff; font-weight: 600; }
.fb-chip.primary:hover,
.fb-chip.primary:active { background: #6d28d9; }

/* LEAD INPUTS */
.fb-lead-wrap {
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: var(--fb-white);
  border: 1px solid var(--fb-border);
  border-radius: var(--fb-radius);
  padding: 15px;
  animation: fb-in .22s ease;
}
.fb-lead-input {
  width: 100%;
  border: 1.5px solid var(--fb-border);
  border-radius: 11px;
  padding: 11px 15px;
  font-family: var(--fb-font-b);
  font-size: 16px;
  color: var(--fb-text);
  outline: none;
  background: var(--fb-surface);
  transition: border-color .2s;
}
.fb-lead-input:focus { border-color: var(--fb-acento); }
.fb-lead-input.shake { animation: fb-shake .4s ease; }
.fb-lead-btn {
  background: var(--fb-acento);
  border: none;
  color: #fff;
  font-family: var(--fb-font-b);
  font-size: .9rem;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 11px;
  cursor: pointer;
  transition: background .2s;
  align-self: flex-end;
  touch-action: manipulation;
}
.fb-lead-btn:hover,
.fb-lead-btn:active { background: #6d28d9; }
.fb-inline-hint { color: #dc2626; font-family: var(--fb-font-b); font-size: .76rem; }

/* CHECKBOXES */
.fb-check-wrap {
  background: var(--fb-white);
  border: 1px solid var(--fb-border);
  border-radius: var(--fb-radius);
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  animation: fb-in .22s ease;
}
.fb-check-row { display: flex; align-items: center; gap: 9px; }
.fb-check-copy { display: flex; flex-direction: column; gap: 2px; }
.fb-check-title { font-family: var(--fb-font-b); font-size: .86rem; color: var(--fb-text); }
.fb-check-price { color: var(--fb-muted); font-family: var(--fb-font-b); font-size: .74rem; }
.fb-check-row input[type=checkbox],
.fb-check-row input[type=radio] {
  width: 18px;
  height: 18px;
  accent-color: var(--fb-acento);
  cursor: pointer;
  flex-shrink: 0;
}
.fb-check-row label { font-family: var(--fb-font-b); font-size: .86rem; color: var(--fb-text); cursor: pointer; }
.fb-check-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.fb-btn-ok {
  background: var(--fb-acento);
  border: none;
  color: #fff;
  font-family: var(--fb-font-b);
  font-size: .86rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 11px;
  cursor: pointer;
  align-self: flex-start;
  transition: background .2s;
  margin-top: 4px;
  touch-action: manipulation;
}
.fb-btn-ok:hover,
.fb-btn-ok:active { background: #6d28d9; }
.fb-btn-skip {
  background: transparent;
  border: 1.5px solid var(--fb-border);
  color: var(--fb-muted);
  font-family: var(--fb-font-b);
  font-size: .82rem;
  padding: 8px 16px;
  border-radius: 11px;
  cursor: pointer;
  align-self: flex-start;
  transition: all .2s;
  margin-top: 4px;
  touch-action: manipulation;
}
.fb-btn-skip:hover,
.fb-btn-skip:active { border-color: var(--fb-acento); color: var(--fb-acento); }

/* CONTADOR DE UNIDADES */
.fb-counter-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--fb-white);
  border: 1px solid var(--fb-border);
  border-radius: var(--fb-radius);
  padding: 16px;
  animation: fb-in .22s ease;
  flex-wrap: wrap;
}
.fb-counter-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--fb-acento);
  background: transparent;
  color: var(--fb-acento);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .18s;
  touch-action: manipulation;
}
.fb-counter-btn:hover,
.fb-counter-btn:active {
  background: var(--fb-acento);
  color: #fff;
  transform: scale(1.1);
}
.fb-counter-display {
  font-family: var(--fb-font-h);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--fb-text);
  min-width: 40px;
  text-align: center;
  flex-shrink: 0;
}
.fb-counter-confirm {
  flex: 1;
  min-width: 140px;
  background: var(--fb-acento);
  border: none;
  color: #fff;
  font-family: var(--fb-font-b);
  font-size: .9rem;
  font-weight: 600;
  padding: 11px 16px;
  border-radius: 30px;
  cursor: pointer;
  transition: background .2s;
  touch-action: manipulation;
}
.fb-counter-confirm:hover,
.fb-counter-confirm:active { background: #6d28d9; }

/* PRODUCT CARD */
.fb-product-card { display: flex; gap: 13px; align-items: flex-start; }
.fb-product-image { width: 80px; height: 80px; object-fit: cover; border-radius: 14px; border: 1px solid var(--fb-border); flex-shrink: 0; }
.fb-product-info { display: flex; flex-direction: column; gap: 6px; }
.fb-product-copy { font-size: .82rem; color: var(--fb-muted); }
.fb-product-price { color: var(--fb-acento); font-weight: 700; }
.fb-mod-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-mod-badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; background: #ede9fe; color: #6d28d9; font-size: .7rem; font-weight: 700; }
.fb-mod-badge.req { background: #fee2e2; color: #b91c1c; }
.fb-mod-note { display: block; margin-top: 6px; color: var(--fb-muted); }
.fb-total-highlight { color: var(--fb-acento); }

/* KEYFRAMES */
@keyframes fb-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-11px); }
}
@keyframes fb-pulse-badge {
  0%, 100% { box-shadow: 0 4px 14px var(--fb-glow); }
  50%      { box-shadow: 0 7px 24px var(--fb-glow); }
}
@keyframes fb-status-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(34,197,94,.3); }
  50%      { box-shadow: 0 0 0 7px rgba(34,197,94,.08); }
}
@keyframes fb-dot {
  0%, 80%, 100% { transform: scale(.55); opacity: .4; }
  40%           { transform: scale(1);   opacity: 1; }
}
@keyframes fb-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fb-shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}

/* RESPONSIVE */

@media (max-width: 900px) {
  :root {
    --fb-win-w:        680px;
    --fb-win-h:        780px;
    --fb-panel-w:      160px;
    --fb-panel-mascot: 138px;
    --fb-trigger-size: 100px;
  }
}

@media (max-width: 700px) {
  :root {
    --fb-panel-w:      140px;
    --fb-panel-mascot: 120px;
    --fb-trigger-size: 90px;
    --fb-msg-font:     .88rem;
  }
  #fb-container { padding: 0; }
  #fb-window    { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  #fb-trigger   { bottom: 16px; right: 16px; }
}

@media (max-width: 500px) {
  :root {
    --fb-trigger-size: 84px;
    --fb-msg-font:     .87rem;
    --fb-bubble-max:   88%;
  }
  #fb-side-panel { display: none; }
  .fb-header {
    padding: 10px 14px;
    background: linear-gradient(135deg, var(--fb-deep) 0%, var(--fb-mid) 100%);
  }
  .fb-header-mascot-mini { display: block; }
  .fb-header-info h2     { color: #fff; font-size: .95rem; }
  .fb-header-info p      { color: rgba(255,255,255,.55); }
  .fb-hbtn               { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); color: #fff; }
  .fb-hbtn:hover,
  .fb-hbtn:active        { background: var(--fb-acento); border-color: var(--fb-acento); }
  #fb-messages           { padding: 13px 12px 8px; gap: 10px; }
  .fb-chip               { font-size: .8rem; padding: 8px 13px; }
  #fb-chips              { gap: 6px; }
  .fb-product-image      { width: 68px; height: 68px; }
  #fb-trigger            { bottom: 14px; right: 14px; }
  .fb-trigger-badge      { font-size: .7rem; padding: 5px 11px; }
}

@media (max-width: 380px) {
  :root {
    --fb-trigger-size: 76px;
    --fb-bubble-max:   92%;
  }
  #fb-messages        { padding: 10px 10px 6px; }
  .fb-bubble          { padding: 9px 11px; }
  .fb-chip            { font-size: .76rem; padding: 7px 11px; }
  .fb-trigger-badge   { display: none; }
  .fb-counter-btn     { width: 38px; height: 38px; font-size: 1.3rem; }
  .fb-counter-display { font-size: 1.5rem; }
  .fb-counter-confirm { font-size: .82rem; padding: 9px 12px; }
}

@media (max-height: 500px) and (orientation: landscape) {
  #fb-side-panel { display: none; }
  .fb-header {
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--fb-deep) 0%, var(--fb-mid) 100%);
  }
  .fb-header-mascot-mini { display: block; }
  .fb-header-info h2     { color: #fff; }
  .fb-header-info p      { color: rgba(255,255,255,.55); }
  .fb-hbtn     { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); color: #fff; }
  #fb-messages { padding: 8px 12px; gap: 7px; }
  #fb-actions  { padding: 7px 12px 6px; }
}
/* ELIMINAR PRODUCTOS DEL CARRITO */
.fb-elim-wrap {
  background: #fff8f8;
  border: 1.5px solid #fecaca;
  border-radius: var(--fb-radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fb-in .22s ease;
  margin-top: 4px;
}
.fb-elim-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.fb-chip-elim {
  background: #fff !important;
  border-color: #fca5a5 !important;
  color: #dc2626 !important;
  font-size: .8rem !important;
}
.fb-chip-elim:hover,
.fb-chip-elim:active {
  background: #fee2e2 !important;
  border-color: #dc2626 !important;
  color: #b91c1c !important;
  transform: none !important;
}

/* Separador en chips del carrito */
.fb-elim-sep {
  width: 100%;
  font-family: var(--fb-font-b);
  font-size: .68rem;
  font-weight: 600;
  color: var(--fb-muted);
  letter-spacing: .7px;
  text-transform: uppercase;
  padding-top: 6px;
  margin-top: 2px;
  border-top: 1px solid var(--fb-border);
}