/* Freshcafe24 Chat */
#fc-chat { --fc-green: var(--primary-color, #4d8526); --fc-dark: var(--secondary-color, #223912); --fc-bg: #f5f8f2; position: fixed; right: 20px; bottom: 20px; z-index: 100000; font-family: inherit; font-size: 14px; line-height: 1.45; color: #333; }
#fc-chat *, #fc-chat *::before, #fc-chat *::after { box-sizing: border-box; }
#fc-chat button { font-family: inherit; }

.fc-toggle { width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--fc-green); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 20px rgba(34, 57, 18, .35); transition: transform .2s, background .2s; padding: 0; margin-left: auto; }
.fc-toggle:hover { transform: scale(1.06); background: var(--fc-dark); }
.fc-toggle:focus-visible, #fc-chat a:focus-visible, #fc-chat button:focus-visible, .fc-input:focus-visible { outline: 3px solid #a6c98a; outline-offset: 2px; }
.fc-toggle svg { width: 26px; height: 26px; }
.fc-toggle .fc-x { display: none; }
.fc-open .fc-toggle svg { display: none; }
.fc-open .fc-toggle .fc-x { display: block; width: 22px; height: 22px; }

.fc-panel { position: absolute; right: 0; bottom: 72px; width: 370px; height: min(600px, calc(100vh - 110px)); background: #fff; border-radius: 16px; box-shadow: 0 12px 40px rgba(0, 0, 0, .18); display: flex; flex-direction: column; overflow: hidden; }
.fc-panel[hidden] { display: none; }

.fc-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--fc-green); color: #fff; }
.fc-avatar { width: 36px; height: 36px; border-radius: 50%; background: #fff; padding: 3px; object-fit: contain; }
.fc-head-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.fc-head-text strong { font-size: 15px; font-weight: 600; color: #fff; }
.fc-head-text span { font-size: 12px; opacity: .85; }
.fc-close { background: transparent; border: 0; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; width: 34px; height: 34px; border-radius: 50%; padding: 0; }
.fc-close:hover { background: rgba(255, 255, 255, .15); }

.fc-msgs { flex: 1; overflow-y: auto; padding: 16px 14px 8px; background: var(--fc-bg); display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.fc-msg { max-width: 85%; padding: 9px 13px; border-radius: 14px; word-wrap: break-word; white-space: normal; }
.fc-bot { background: #fff; color: #2b2b2b; align-self: flex-start; border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.fc-user { background: var(--fc-green); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.fc-bot a { color: var(--fc-green); font-weight: 600; text-decoration: underline; }

.fc-typing { display: flex; gap: 4px; padding: 12px 14px; }
.fc-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9bb68a; animation: fc-dot 1s infinite ease-in-out; }
.fc-typing i:nth-child(2) { animation-delay: .15s; }
.fc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes fc-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-4px); opacity: 1; } }

.fc-actions { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; max-width: 95%; }
.fc-action { display: inline-block; padding: 6px 12px; border-radius: 18px; border: 1px solid var(--fc-green); color: var(--fc-green) !important; background: #fff; font-size: 13px; font-weight: 500; text-decoration: none !important; }
.fc-action:hover { background: var(--fc-green); color: #fff !important; }

.fc-products { display: flex; flex-direction: column; gap: 6px; align-self: stretch; }
.fc-product { display: flex; gap: 10px; align-items: center; background: #fff; border-radius: 12px; padding: 8px; text-decoration: none !important; color: inherit !important; border: 1px solid #e6ece1; transition: border-color .2s; }
.fc-product:hover { border-color: var(--fc-green); }
.fc-product img { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; background: var(--fc-bg); flex-shrink: 0; }
.fc-product-info { display: flex; flex-direction: column; min-width: 0; }
.fc-product-name { font-weight: 600; color: var(--fc-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-product-price { font-size: 13px; color: var(--fc-dark); }
.fc-product-price del { color: #999; margin-right: 2px; }
.fc-stock { font-size: 12px; color: var(--fc-green); }
.fc-stock.fc-out { color: #c0392b; }

.fc-order { background: #fff; border: 1px solid #e6ece1; border-radius: 12px; padding: 12px 14px; align-self: stretch; }
.fc-order-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fc-order-top strong { color: var(--fc-dark); font-size: 15px; }
.fc-badge { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 12px; background: #eef3ea; color: var(--fc-dark); white-space: nowrap; }
.fc-badge.fc-processing { background: #fff4d6; color: #8a6100; }
.fc-badge.fc-completed { background: #dff3d6; color: #2e6b12; }
.fc-badge.fc-on-hold, .fc-badge.fc-pending { background: #fde9cf; color: #8a4b00; }
.fc-badge.fc-cancelled, .fc-badge.fc-failed, .fc-badge.fc-refunded { background: #fbe1df; color: #a02a1d; }
.fc-order-date { font-size: 12px; color: #777; margin-top: 2px; }
.fc-order-msg { margin: 8px 0 6px; font-size: 13px; }
.fc-order-items { list-style: none; margin: 8px 0; padding: 8px 0; border-top: 1px dashed #dde5d6; border-bottom: 1px dashed #dde5d6; }
.fc-order-items li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 2px 0; }
.fc-order-sum { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: 13px; }
.fc-order-sum dt { color: #777; }
.fc-order-sum dd { margin: 0; text-align: right; color: var(--fc-dark); }
.fc-order-sum .fc-total { font-weight: 700; }
.fc-order-note { font-size: 12px; color: #555; background: var(--fc-bg); border-radius: 8px; padding: 6px 8px; margin: 8px 0 0; }

.fc-quick { display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; background: #fff; border-top: 1px solid #eef1ea; scrollbar-width: none; }
.fc-quick:empty { display: none; }
.fc-quick::-webkit-scrollbar { display: none; }
.fc-chip { flex-shrink: 0; border: 1px solid #cfdcc5; background: #fff; color: var(--fc-dark); border-radius: 16px; padding: 6px 12px; font-size: 13px; cursor: pointer; white-space: nowrap; line-height: 1.2; }
.fc-chip:hover { border-color: var(--fc-green); color: var(--fc-green); }

.fc-form { display: flex; gap: 8px; padding: 10px 12px 12px; background: #fff; }
.fc-input { flex: 1; min-width: 0; height: 42px; border: 1px solid #d5dfcd; border-radius: 21px; padding: 0 16px; font-size: 15px; color: #222; background: #fff; margin: 0; }
.fc-input:focus { border-color: var(--fc-green); outline: none; }
.fc-send { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--fc-green); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0; }
.fc-send:hover { background: var(--fc-dark); }
.fc-send svg { width: 20px; height: 20px; }

/* keep the theme's back-to-top button clear of the chat button */
body.fc-chat-on .pxl-scroll-top, body.fc-chat-on .pxl-scroll-top.pxl-on { right: 26px; bottom: 92px; }

@media (max-width: 575px) {
  #fc-chat { right: 14px; bottom: 14px; }
  .fc-toggle { width: 54px; height: 54px; }
  .fc-panel { position: fixed; left: 0; right: 0; bottom: 0; width: 100%; height: 88vh; height: 88dvh; border-radius: 16px 16px 0 0; }
  .fc-open .fc-toggle { display: none; }
  body.fc-chat-on .pxl-scroll-top, body.fc-chat-on .pxl-scroll-top.pxl-on { right: 19px; bottom: 82px; }
  body.fc-chat-panel-open { overflow: hidden; }
}

/* The theme styles every <button> (padding 0 30px, line-height 48px, white text, pill radius).
   Reset that for the chat's own buttons. */
#fc-chat button.fc-toggle, #fc-chat button.fc-send, #fc-chat button.fc-close, #fc-chat button.fc-chip {
  padding: 0 !important; min-width: 0 !important; min-height: 0 !important; line-height: 1 !important;
  text-transform: none !important; letter-spacing: normal !important; box-shadow: none; font-weight: 500;
}
#fc-chat button.fc-toggle { display: flex !important; width: 58px !important; height: 58px !important; border-radius: 50% !important; box-shadow: 0 6px 20px rgba(34, 57, 18, .35); }
#fc-chat button.fc-send { display: flex !important; width: 42px !important; height: 42px !important; border-radius: 50% !important; }
#fc-chat button.fc-close { display: flex !important; align-items: center; justify-content: center; width: 34px !important; height: 34px !important; border-radius: 50% !important; font-size: 26px !important; color: #fff !important; background: transparent; }
#fc-chat button.fc-close:hover { background: rgba(255, 255, 255, .15) !important; }
#fc-chat button.fc-chip { display: inline-flex !important; align-items: center; height: 32px !important; padding: 0 12px !important; border-radius: 16px !important; color: var(--fc-dark) !important; background: #fff !important; font-size: 13px !important; border: 1px solid #cfdcc5 !important; }
#fc-chat button.fc-chip:hover { border-color: var(--fc-green) !important; color: var(--fc-green) !important; }
#fc-chat .fc-input { height: 42px !important; line-height: 42px !important; border-radius: 21px !important; padding: 0 16px !important; box-shadow: none !important; }
@media (max-width: 575px) { #fc-chat button.fc-toggle { width: 54px !important; height: 54px !important; } .fc-open button.fc-toggle { display: none !important; } }
@media (max-width: 575px) { #fc-chat.fc-open button.fc-toggle { display: none !important; } }

/* ---------- attractive launcher ---------- */
#fc-chat button.fc-toggle { position: relative; overflow: visible; background: linear-gradient(145deg, #5f9e33 0%, var(--fc-green) 45%, #2f5a17 100%) !important; border: 3px solid #fff !important; box-shadow: 0 8px 24px rgba(34, 57, 18, .38), 0 0 0 1px rgba(77, 133, 38, .25) !important; }
#fc-chat button.fc-toggle:hover { transform: translateY(-2px) scale(1.04); }
#fc-chat .fc-toggle .fc-ico { width: 30px; height: 30px; }
#fc-chat:not(.fc-seen) .fc-toggle .fc-ico circle { animation: fc-typing 1.4s infinite ease-in-out; }
#fc-chat .fc-toggle .fc-dot2 { animation-delay: .2s !important; }
#fc-chat .fc-toggle .fc-dot3 { animation-delay: .4s !important; }
@keyframes fc-typing { 0%, 60%, 100% { transform: translateY(0); opacity: .55; } 30% { transform: translateY(-2px); opacity: 1; } }
#fc-chat .fc-toggle .fc-ico circle { transform-box: fill-box; transform-origin: center; }

/* pulse rings until the visitor has seen the chat */
#fc-chat:not(.fc-seen):not(.fc-open) .fc-toggle::before,
#fc-chat:not(.fc-seen):not(.fc-open) .fc-toggle::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--fc-green); opacity: 0; animation: fc-pulse 2.4s infinite cubic-bezier(.2, .6, .4, 1); pointer-events: none; }
#fc-chat:not(.fc-seen):not(.fc-open) .fc-toggle::after { animation-delay: 1.2s; }
@keyframes fc-pulse { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(1.65); opacity: 0; } }

/* online dot + unread badge */
.fc-online { position: absolute; right: 1px; bottom: 2px; width: 13px; height: 13px; border-radius: 50%; background: #3ddc5b; border: 2px solid #fff; }
.fc-open .fc-online { display: none; }
.fc-badge-count { position: absolute; top: -6px; right: -6px; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 11px; background: #e53935; color: #fff; font-size: 12px; font-weight: 700; line-height: 21px; text-align: center; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.fc-seen .fc-badge-count, .fc-open .fc-badge-count { display: none; }

/* greeting bubble */
.fc-teaser { position: absolute; right: 0; bottom: 74px; width: 280px; background: #fff; border-radius: 16px 16px 4px 16px; box-shadow: 0 12px 32px rgba(0, 0, 0, .18); padding: 14px 14px 12px; cursor: pointer; opacity: 0; transform: translateY(10px) scale(.96); transform-origin: bottom right; transition: opacity .3s ease, transform .3s ease; }
.fc-teaser.fc-teaser-in { opacity: 1; transform: none; }
.fc-teaser::after { content: ''; position: absolute; right: 22px; bottom: -7px; width: 14px; height: 14px; background: #fff; transform: rotate(45deg); box-shadow: 3px 3px 5px rgba(0, 0, 0, .06); }
.fc-teaser-top { display: flex; gap: 10px; align-items: flex-start; padding-right: 18px; }
.fc-teaser-av { width: 38px; height: 38px; border-radius: 50%; background: var(--fc-bg); padding: 4px; flex-shrink: 0; object-fit: contain; }
.fc-teaser-text { display: flex; flex-direction: column; gap: 2px; }
.fc-teaser-text strong { color: var(--fc-dark); font-size: 15px; }
.fc-teaser-text span { color: #555; font-size: 13px; line-height: 1.4; }
.fc-teaser-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
#fc-chat button.fc-teaser-chip { padding: 0 10px !important; height: 28px !important; line-height: 1 !important; min-width: 0 !important; border-radius: 14px !important; border: 1px solid var(--fc-green) !important; background: #fff !important; color: var(--fc-green) !important; font-size: 12px !important; font-weight: 600; text-transform: none !important; letter-spacing: normal !important; }
#fc-chat button.fc-teaser-chip:hover { background: var(--fc-green) !important; color: #fff !important; }
#fc-chat button.fc-teaser-x { position: absolute; top: 6px; right: 6px; width: 24px !important; height: 24px !important; padding: 0 !important; min-width: 0 !important; line-height: 1 !important; border-radius: 50% !important; border: 0 !important; background: #f1f4ee !important; color: #666 !important; font-size: 16px !important; display: flex !important; align-items: center; justify-content: center; }
#fc-chat button.fc-teaser-x:hover { background: #e3e9dd !important; color: #222 !important; }
.fc-open .fc-teaser { display: none; }

@media (max-width: 575px) {
  .fc-teaser { width: min(290px, calc(100vw - 28px)); bottom: 68px; }
}
@media (prefers-reduced-motion: reduce) {
  #fc-chat .fc-toggle::before, #fc-chat .fc-toggle::after, #fc-chat .fc-toggle .fc-ico circle { animation: none !important; }
  .fc-teaser { transition: none; }
}
