#afc-root { --afc-blue: #2e7d32; --afc-violet: #4caf50; --afc-navy: #1b5e20; --afc-ink: #1b5e20; --afc-body: #334d33; --afc-muted: #6e7d71; --afc-line: #c8e6c9; --afc-page: #f1f8e9; position: fixed; right: 22px; bottom: 22px; z-index: 99990; font-family: var(--af-font, "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif); line-height: 1.45; -webkit-font-smoothing: antialiased; }
#afc-root *, #afc-root *::before, #afc-root *::after { box-sizing: border-box; }
#afc-root [hidden] { display: none !important; }
#afc-root svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.afc-launch { position: relative; display: grid; place-items: center; width: 62px; height: 62px; margin: 0 0 0 auto; padding: 0; border: 0; border-radius: 50%; background: linear-gradient(135deg, var(--afc-blue), var(--afc-violet)); color: #fff; cursor: pointer; box-shadow: 0 16px 34px -10px rgba(46, 125, 50, .65), 0 4px 12px rgba(27, 94, 32, .18); transition: transform .2s ease, box-shadow .2s ease; }
.afc-launch:hover { transform: translateY(-2px) scale(1.03); }
.afc-launch:focus-visible { outline: 3px solid rgba(76, 175, 80, .45); outline-offset: 3px; }
.afc-launch svg { width: 28px; height: 28px; }
#afc-root.is-open .afc-launch svg { opacity: .9; }
.afc-badge { position: absolute; top: -3px; right: -3px; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #e5484d; color: #fff; font-size: 12px; font-weight: 800; border: 2px solid #fff; }

.afc-panel { position: absolute; right: 0; bottom: 78px; display: flex; flex-direction: column; width: 380px; height: min(600px, calc(100vh - 120px)); overflow: hidden; border-radius: 22px; background: #fff; border: 1px solid var(--afc-line); box-shadow: 0 30px 70px -20px rgba(27, 94, 32, .45), 0 8px 24px rgba(27, 94, 32, .12); animation: afc-in .22s ease-out; }
@keyframes afc-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.afc-head { display: flex; align-items: center; gap: 12px; padding: 16px 14px 16px 18px; background: radial-gradient(70% 120% at 100% 0%, rgba(76, 175, 80, .55), transparent 70%), linear-gradient(135deg, #1b5e20, var(--afc-navy)); color: #fff; }
.afc-av { display: grid; place-items: center; flex-shrink: 0; width: 42px; height: 42px; border-radius: 14px; background: linear-gradient(135deg, var(--afc-blue), var(--afc-violet)); color: #fff; font-size: 14px; font-weight: 800; letter-spacing: .02em; box-shadow: 0 0 0 3px rgba(255, 255, 255, .12); }
.afc-head__t { flex: 1; min-width: 0; }
.afc-head__t strong { display: block; font-size: 16px; font-weight: 800; color: #fff; }
.afc-head__t span { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #c8e6c9; }
.afc-head__t em { font-style: normal; }
.afc-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .25); }
.afc-icon { display: flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 10px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .1); color: #fff !important; cursor: pointer; text-decoration: none !important; transition: background .2s ease; }
.afc-icon:hover { background: rgba(255, 255, 255, .2); }
.afc-icon svg { width: 18px; height: 18px; }
.afc-icon span { display: none; font-size: 13px; font-weight: 600; }

.afc-body { flex: 1; overflow-y: auto; padding: 18px 16px 8px; background: linear-gradient(180deg, #f9fbf8, #fff 60%); scroll-behavior: smooth; }
.afc-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 86%; margin: 0 0 12px; }
.afc-msg--me { align-items: flex-end; margin-left: auto; }
.afc-who { margin: 0 0 4px 4px; font-size: 11.5px; font-weight: 800; color: var(--afc-blue); }
.afc-bubble { padding: 11px 14px; border-radius: 16px 16px 16px 6px; background: #fff; border: 1px solid var(--afc-line); color: var(--afc-ink); font-size: 14.5px; line-height: 1.5; word-wrap: break-word; overflow-wrap: anywhere; box-shadow: 0 2px 6px rgba(27, 94, 32, .04); }
.afc-msg--admin .afc-bubble { background: #e8f5e9; border-color: #c8e6c9; }
.afc-msg--me .afc-bubble { border: 0; border-radius: 16px 16px 6px 16px; background: linear-gradient(135deg, var(--afc-blue), var(--afc-violet)); color: #fff; }
.afc-bubble a { color: var(--afc-blue); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.afc-msg--me .afc-bubble a { color: #fff; }
.afc-pending { opacity: .7; }
.afc-time { margin: 4px 6px 0; font-size: 11px; color: var(--afc-muted); }
.afc-note { margin: 4px auto 12px; padding: 6px 12px; border-radius: 999px; background: #fdeceb; color: #b42318; font-size: 12.5px; text-align: center; width: fit-content; max-width: 90%; }
.afc-typing { display: flex; gap: 4px; padding: 14px 16px; }
.afc-typing i { width: 7px; height: 7px; border-radius: 50%; background: #a9b4ca; animation: afc-b 1s infinite ease-in-out; }
.afc-typing i:nth-child(2) { animation-delay: .15s; }
.afc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes afc-b { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-5px); opacity: 1; } }

/* PRODUCT CARD CSS */
.afc-prod-card { display: flex; gap: 12px; background: #fff; border: 1px solid var(--afc-line); border-radius: 12px; padding: 10px; margin-top: 6px; width: 100%; min-width: 250px; box-shadow: 0 4px 10px rgba(0,0,0,0.03); }
.afc-prod-img { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; background: #f5f5f5; flex-shrink: 0; }
.afc-prod-info { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.afc-prod-name { font-size: 14px; font-weight: 700; color: var(--afc-ink); line-height: 1.2; margin-bottom: 2px; }
.afc-prod-price { font-size: 13px; color: var(--afc-muted); margin-bottom: 8px; }
.afc-prod-actions { display: flex; gap: 6px; }
.afc-prod-btn { flex: 1; text-align: center; padding: 6px 0; border-radius: 6px; font-size: 12px; font-weight: 700; text-decoration: none !important; cursor: pointer; transition: opacity 0.2s; border: none; }
.afc-prod-btn:hover { opacity: 0.8; }
.afc-btn-view { background: #e8f5e9; color: var(--afc-blue) !important; border: 1px solid var(--afc-line); }
.afc-btn-cart { background: var(--afc-blue); color: #fff !important; }

.afc-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 16px 10px; background: #fff; }
.afc-chips button { padding: 8px 13px; border: 1px solid #c8e6c9; border-radius: 999px; background: #f1f8e9; color: var(--afc-blue); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .2s ease, border-color .2s ease; }
.afc-chips button:hover { background: #dcedc8; border-color: var(--afc-blue); }

.afc-input { display: flex; align-items: flex-end; gap: 8px; margin: 0; padding: 12px 12px 10px; border-top: 1px solid var(--afc-line); background: #fff; }
.afc-input textarea { flex: 1; min-height: 44px; max-height: 120px; margin: 0; padding: 11px 14px; border: 1px solid var(--afc-line); border-radius: 14px; background: var(--afc-page); color: var(--afc-ink); font: inherit; font-size: 14.5px; line-height: 1.45; resize: none; outline: none; box-shadow: none; transition: border-color .2s ease, background .2s ease; }
.afc-input textarea:focus { border-color: var(--afc-blue); background: #fff; }
.afc-send { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 14px; background: linear-gradient(135deg, var(--afc-blue), var(--afc-violet)); color: #fff; cursor: pointer; }
.afc-send svg { width: 19px; height: 19px; }
.afc-hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }

.afc-details { margin: 0; padding: 14px; border-top: 1px solid var(--afc-line); background: #fff; }
.afc-details p { margin: 0 0 10px; font-size: 13px; font-weight: 800; color: var(--afc-ink); }
.afc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.afc-details input { width: 100%; height: 42px; margin: 0; padding: 0 12px; border: 1px solid var(--afc-line); border-radius: 12px; background: var(--afc-page); color: var(--afc-ink); font: inherit; font-size: 14px; outline: none; box-shadow: none; }
.afc-details input:focus { border-color: var(--afc-blue); background: #fff; }
.afc-btn { width: 100%; height: 44px; border: 0; border-radius: 12px; background: linear-gradient(135deg, var(--afc-blue), var(--afc-violet)); color: #fff; font: inherit; font-size: 14.5px; font-weight: 800; cursor: pointer; }
.afc-btn[disabled] { opacity: .6; cursor: wait; }
.afc-err { display: block; min-height: 0; margin-top: 6px; color: #b42318; font-size: 12.5px; }
.afc-err:empty { display: none; }
.afc-foot { padding: 0 0 9px; background: #fff; color: #a9b4ca; font-size: 11px; text-align: center; }

@media (max-width: 760px) {
  #afc-root { right: 14px; bottom: 86px; }
  .afc-launch { width: 56px; height: 56px; }
  #afc-root.is-open { left: 0; right: 0; top: 0; bottom: 0; }
  #afc-root.is-open .afc-launch { display: none; }
  .afc-panel { position: fixed; inset: 0; width: 100%; height: 100%; border-radius: 0; border: 0; }
  .afc-head { padding-top: calc(14px + env(safe-area-inset-top)); }
  .afc-icon span { display: inline; } /* Shows the word "Close" on mobile */
  .afc-icon { background: rgba(255, 255, 255, .2); padding: 0 14px; }
  .afc-input { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .afc-row { grid-template-columns: 1fr; }
  .afc-input textarea { font-size: 16px; }
  .afc-details input { font-size: 16px; }
  .afc-prod-card { min-width: 200px; }
}
@media (prefers-reduced-motion: reduce) { .afc-panel, .afc-typing i { animation: none; } .afc-launch { transition: none; } }
