/**
 * PrestaHU
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Commercial License
 * you can't distribute, modify or sell this code
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file
 * If you need help please contact info@presta.hu
 *
 * @author    PrestaHU <info@presta.hu>
 * @copyright PrestaHU
 * @license   commercial
 */
/* ==========================================================================
   PSHUAICHAT — BASE STRUCTURAL CSS
   The theme colour layer below gives every token its starting value; the
   active design file (pshuaichat-design-*.css) replaces them.
   ========================================================================== */

/* ==========================================================================
   THEME COLOURS — the starting values of every design token. They come from
   the shop theme (Bootstrap 5 variables, then the browser's system colours),
   so the default design matches the theme and its dark mode; a design file
   loaded after this one replaces them.
   ========================================================================== */
#chatbox,
#chatbox-toggle,
.pshuaichat-fab-hint {
  --psh-t-accent:      var(--bs-primary, var(--primary, CanvasText));
  --psh-t-on-accent:   var(--bs-body-bg, Canvas);
  --psh-t-bg:          var(--bs-body-bg, Canvas);
  --psh-t-text:        var(--bs-body-color, CanvasText);
  --psh-t-tint:        var(--bs-tertiary-bg, color-mix(in srgb, CanvasText 5%, Canvas));
  --psh-t-line:        var(--bs-border-color, color-mix(in srgb, CanvasText 16%, Canvas));
  --psh-t-muted:       var(--bs-secondary-color, color-mix(in srgb, CanvasText 62%, Canvas));

  --psh-accent:             var(--psh-t-accent);
  --psh-panel-bg:           var(--psh-t-bg);
  --psh-header-bg:          var(--psh-t-accent);
  --psh-header-text:        var(--psh-t-on-accent);
  --psh-btn-color:          var(--psh-t-on-accent);
  --psh-msgs-bg:            var(--psh-t-tint);
  --psh-bot-bg:             var(--psh-t-bg);
  --psh-bot-text:           var(--psh-t-text);
  --psh-bot-border:         1px solid var(--psh-t-line);
  --psh-card-bg:            var(--psh-t-bg);
  --psh-card-price:         var(--psh-t-accent);
  --psh-user-bg:            var(--psh-t-accent);
  --psh-user-text:          var(--psh-t-on-accent);
  --psh-avatar-bg:          var(--psh-t-tint);
  --psh-avatar-text:        var(--psh-t-accent);
  --psh-footer-bg:          var(--psh-t-bg);
  --psh-footer-border:      1px solid var(--psh-t-line);
  --psh-input-bg:           var(--psh-t-tint);
  --psh-input-border-focus: 1px solid var(--psh-t-accent);
  --psh-input-text:         var(--psh-t-text);
  --psh-input-placeholder:  var(--psh-t-muted);
  --psh-send-bg:            var(--psh-t-accent);
  --psh-send-text:          var(--psh-t-on-accent);
  --psh-chip-border:        1.5px solid var(--psh-t-accent);
  --psh-chip-text:          var(--psh-t-accent);
  --psh-chip-hover-bg:      var(--psh-t-accent);
  --psh-chip-hover-text:    var(--psh-t-on-accent);
  --psh-counter-text:       var(--psh-t-muted);
  --psh-counter-bg:         var(--psh-t-bg);
  --psh-consent-card:       var(--psh-t-bg);
  --psh-typing-dot:         var(--psh-t-muted);
  --psh-fab-bg:             var(--psh-t-accent);
  --psh-fab-text:           var(--psh-t-on-accent);
}

@supports not (color: color-mix(in srgb, red 50%, blue)) {
  #chatbox,
  #chatbox-toggle,
  .pshuaichat-fab-hint {
    --psh-t-tint:  var(--bs-tertiary-bg, rgba(128,128,128,.08));
    --psh-t-line:  var(--bs-border-color, rgba(128,128,128,.35));
    --psh-t-muted: var(--bs-secondary-color, GrayText);
  }
}

html.dark #chatbox, html.dark #chatbox-toggle,
html.dark-mode #chatbox, html.dark-mode #chatbox-toggle,
html[data-theme="dark"] #chatbox, html[data-theme="dark"] #chatbox-toggle,
html[data-bs-theme="dark"] #chatbox, html[data-bs-theme="dark"] #chatbox-toggle,
body.dark #chatbox, body.dark #chatbox-toggle,
body.dark-mode #chatbox, body.dark-mode #chatbox-toggle,
body[data-theme="dark"] #chatbox, body[data-theme="dark"] #chatbox-toggle,
body[data-bs-theme="dark"] #chatbox, body[data-bs-theme="dark"] #chatbox-toggle {
  color-scheme: dark;
}

/* ==========================================================================
   CHAT PANEL — MOBILE FIRST
   ========================================================================== */
#chatbox {
  position: fixed;
  left:   var(--pshuaichat-mobile-edge, 10px);
  right:  var(--pshuaichat-mobile-edge, 10px);
  bottom: var(--pshuaichat-mobile-edge, 10px);
  top:    auto;
  width:  auto;
  height: min(75svh, 75vh, 580px);
  z-index: 9999;

  display:        flex;
  flex-direction: column;
  overflow:       hidden;

  background:    var(--psh-panel-bg);
  -webkit-backdrop-filter: var(--psh-panel-backdrop, none);
  backdrop-filter: var(--psh-panel-backdrop, none);
  border-radius: var(--psh-panel-radius, 16px);
  box-shadow:    var(--psh-panel-shadow, 0 8px 32px rgba(0,0,0,.13));
  border:        var(--psh-panel-border, none);

  font-family: var(--psh-font, system-ui, sans-serif);
  font-size:   var(--psh-font-size, 14px);
  line-height: var(--psh-line-height, 1.55);
  color:       var(--psh-bot-text);

  opacity:    0;
  visibility: hidden;
  transform:  translateY(16px);
  transition: opacity   .25s cubic-bezier(.22,1,.36,1),
              transform .3s  cubic-bezier(.22,1,.36,1),
              visibility .25s;
  pointer-events: none;
}

#chatbox.open {
  opacity:        1;
  visibility:     visible;
  transform:      translateY(0);
  pointer-events: auto;
}

@media (min-width: 640px) {
  #chatbox {
    left:   auto;
    right:  var(--pshuaichat-h-margin, 28px);
    bottom: 90px;
    width:  var(--pshuaichat-chat-width, 360px);
    height: min(640px, calc(100svh - 130px));
    height: min(640px, calc(100vh - 130px));
  }
  #chatbox.bottom_left { right: auto; left: var(--pshuaichat-h-margin, 28px); }
  #chatbox.top_right   { bottom: auto; top: 80px; }
  #chatbox.top_left    { bottom: auto; top: 80px; right: auto; left: var(--pshuaichat-h-margin, 28px); }

  #chatbox.popup-compact { width: var(--pshuaichat-chat-width, 300px); }
  #chatbox.popup-large   { width: var(--pshuaichat-chat-width, 420px); }
  #chatbox.popup-wide    { width: min(var(--pshuaichat-chat-width, 500px), 96vw); }
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.pshuaichat-header {
  flex-shrink: 0;
  background:  var(--psh-header-bg);
  color:       var(--psh-header-text);
  /* No border-radius here — #chatbox overflow:hidden clips it to the panel shape */
}

.pshuaichat-header-inner {
  display:     flex;
  align-items: center;
  gap:         8px;
  padding:     var(--psh-header-padding, 12px 14px);
}

.pshuaichat-header-title-wrap {
  flex: 1;
  min-width: 0;
  overflow:  hidden;
}

.chatbox-header-title {
  display:       block;
  font-family:   var(--psh-header-font, inherit);
  font-size:     var(--psh-header-size, 15px);
  font-weight:   var(--psh-header-weight, 600);
  color:         var(--psh-header-text);
  white-space:   nowrap;
  overflow:      hidden;
  text-overflow: ellipsis;
  line-height:   1.3;
}

.pshuaichat-header-actions {
  display:     flex;
  align-items: center;
  gap:         4px;
  flex-shrink: 0;
}

.chatbox-minimize-btn,
.chatbox-newchat-btn,
.chatbox-close-btn {
  background:  transparent;
  border:      none;
  color:       var(--psh-btn-color, rgba(255,255,255,.8));
  cursor:      pointer;
  padding:     4px 6px;
  border-radius: 6px;
  font-size:   12px;
  line-height: 1;
  transition:  background .15s, color .15s;
  display:     inline-flex;
  align-items: center;
  justify-content: center;
}
.chatbox-minimize-btn:hover,
.chatbox-newchat-btn:hover,
.chatbox-close-btn:hover {
  background: var(--psh-btn-hover, rgba(255,255,255,.15));
  color:      var(--psh-header-text);
}

/* ==========================================================================
   CONTENT + MESSAGES
   ========================================================================== */
.chatbox-content {
  display:        flex;
  flex-direction: column;
  flex:           1;
  overflow:       hidden;
  position:       relative;
}

.chatbox-messages {
  flex:       1;
  overflow-y: auto;
  padding:    var(--psh-msgs-padding, 14px 12px);
  background: var(--psh-msgs-bg);
  display:    flex;
  flex-direction: column;
  gap:        var(--psh-msgs-gap, 10px);
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.chatbox-messages::-webkit-scrollbar       { width: 4px; }
.chatbox-messages::-webkit-scrollbar-track { background: transparent; }
.chatbox-messages::-webkit-scrollbar-thumb { background: rgba(0,0,0,.12); border-radius: 4px; }

/* ==========================================================================
   MESSAGE ROWS
   ========================================================================== */
.pshuaichat-msg-row {
  display:   flex;
  gap:       8px;
  max-width: 100%;
}
.pshuaichat-msg-row--bot  { align-items: flex-start; }
.pshuaichat-msg-row--user { align-items: flex-end; flex-direction: row-reverse; }

/* ==========================================================================
   AVATARS
   ========================================================================== */
.pshuaichat-bot-avatar {
  flex-shrink: 0;
  width:  36px;
  height: 36px;
  border-radius: 50%;
  background: var(--psh-avatar-bg);
  color:      var(--psh-avatar-text);
  display:    flex;
  align-items: center;
  justify-content: center;
  font-size:   15px;
  font-weight: 700;
  overflow:    hidden;
}
.pshuaichat-bot-avatar img {
  width:  100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   CHAT BUBBLES
   ========================================================================== */
.message {
  padding:       var(--psh-bubble-padding, 9px 13px);
  font-family:   var(--psh-font, system-ui, sans-serif);
  font-size:     var(--psh-font-size, 14px);
  line-height:   var(--psh-line-height, 1.55);
  word-break:    break-word;
  white-space:   pre-line;
  max-width:     calc(100% - 52px);
}

#chatbox .message.chatbot,
#chatbox .message.response {
  background:    var(--psh-bot-bg) !important;
  color:         var(--psh-bot-text) !important;
  border:        var(--psh-bot-border);
  box-shadow:    var(--psh-bot-shadow, 0 1px 4px rgba(0,0,0,.06));
  border-radius: var(--psh-bot-radius, 4px 16px 16px 16px);
}

#chatbox .message.user {
  background:    var(--psh-user-bg) !important;
  color:         var(--psh-user-text) !important;
  border:        var(--psh-user-border, none);
  box-shadow:    var(--psh-user-shadow, none);
  border-radius: var(--psh-user-radius, 16px 4px 16px 16px);
  max-width:     calc(100% - 16px);
}

.message a { color: inherit; text-decoration: underline; opacity: .85; }
.message a:hover { opacity: 1; }

.pshuaichat-ts {
  font-size:  10px;
  opacity:    .5;
  margin-top: 3px;
  text-align: right;
}

/* ==========================================================================
   QUICK-REPLY CHIPS
   ========================================================================== */
.chatbox-quick-questions,
.pshuaichat-quick-replies {
  display:   flex;
  flex-wrap: wrap;
  gap:       6px;
  padding:   4px 0 2px;
}

.chatbox-quick-q {
  background:    var(--psh-chip-bg, transparent);
  border:        var(--psh-chip-border);
  color:         var(--psh-chip-text);
  border-radius: var(--psh-chip-radius, 8px);
  padding:       6px 12px;
  font-size:     13px;
  font-family:   var(--psh-font, system-ui, sans-serif);
  cursor:        pointer;
  transition:    background .15s, color .15s, border-color .15s;
  line-height:   1.4;
}
.chatbox-quick-q:hover {
  background:   var(--psh-chip-hover-bg);
  color:        var(--psh-chip-hover-text);
  border-color: transparent;
}

/* ==========================================================================
   TURN COUNTER
   ========================================================================== */
#chatbox-turn-counter {
  font-size:    12px;
  color:        var(--psh-counter-text);
  background:   var(--psh-counter-bg);
  text-align:   center;
  padding:      4px 0;
  flex-shrink:  0;
  border-top:   var(--psh-footer-border);
}

/* ==========================================================================
   INPUT FOOTER
   ========================================================================== */
.pshuaichat-input,
.chatbox-input {
  flex-shrink: 0;
  display:     flex;
  align-items: center;
  gap:         8px;
  padding:     var(--psh-footer-padding, 10px 12px);
  background:  var(--psh-footer-bg);
  border-top:  var(--psh-footer-border);
  border-radius: var(--psh-footer-radius, 0 0 16px 16px);
}

.pshuaichat-tawk-input,
#chatbox-input-text {
  flex:          1;
  min-width:     0;
  width:         auto;
  background:    var(--psh-input-bg);
  border:        var(--psh-input-border, 1px solid transparent);
  border-radius: var(--psh-input-radius, 10px);
  color:         var(--psh-input-text);
  font-family:   var(--psh-font, system-ui, sans-serif);
  font-size:     var(--psh-font-size, 14px);
  padding:       var(--psh-input-padding, 8px 12px);
  outline:       none;
  transition:    border .15s;
  line-height:   1.4;
}
.pshuaichat-tawk-input::placeholder,
#chatbox-input-text::placeholder {
  color: var(--psh-input-placeholder);
}
.pshuaichat-tawk-input:focus,
#chatbox-input-text:focus {
  border: var(--psh-input-border-focus);
}

.pshuaichat-tawk-send-fallback,
#chatbox-send-button {
  display:         var(--psh-send-show, none);
  align-items:     center;
  justify-content: center;
  flex-shrink:     0;
  width:           var(--psh-send-size, 40px);
  height:          var(--psh-send-size, 40px);
  background:      var(--psh-send-bg);
  color:           var(--psh-send-text);
  border:          none;
  border-radius:   var(--psh-send-radius, 10px);
  cursor:          pointer;
  padding:         0;
  position:        relative;
  overflow:        visible;
  clip:            unset;
  transition:      opacity .15s, transform .1s;
}
.pshuaichat-tawk-send-fallback:hover,
#chatbox-send-button:hover {
  opacity:   .88;
  transform: scale(1.06);
}
.pshuaichat-tawk-send-fallback svg,
#chatbox-send-button svg {
  width:  18px;
  height: 18px;
  display: block;
}

/* ==========================================================================
   PRE-CHAT FORM
   ========================================================================== */
.pshuaichat-prechat {
  padding:    16px;
  background: var(--psh-msgs-bg);
  border-bottom: var(--psh-footer-border);
}
.pshuaichat-prechat-title {
  font-size:     14px;
  font-weight:   600;
  color:         var(--psh-bot-text);
  margin-bottom: 10px;
}
.pshuaichat-prechat input[type="email"] {
  width:         100%;
  background:    var(--psh-input-bg);
  border:        var(--psh-input-border, 1px solid transparent);
  border-radius: var(--psh-input-radius, 10px);
  color:         var(--psh-input-text);
  font-family:   var(--psh-font, system-ui, sans-serif);
  font-size:     var(--psh-font-size, 14px);
  padding:       8px 12px;
  margin-bottom: 10px;
  outline:       none;
  box-sizing:    border-box;
}
.pshuaichat-prechat-terms {
  font-size:     13px;
  color:         var(--psh-bot-text);
  display:       flex;
  align-items:   center;
  gap:           6px;
  margin-bottom: 10px;
}
.pshuaichat-prechat-links a { font-size: 12px; color: var(--psh-accent); }
#pshuaichat-prechat-submit {
  width:         100%;
  background:    var(--psh-send-bg);
  color:         var(--psh-send-text);
  border:        none;
  border-radius: var(--psh-send-radius, 10px);
  padding:       10px;
  font-family:   var(--psh-font, system-ui, sans-serif);
  font-size:     14px;
  font-weight:   600;
  cursor:        pointer;
  transition:    opacity .15s;
}
#pshuaichat-prechat-submit:hover { opacity: .88; }

/* ==========================================================================
   CONSENT OVERLAY
   ========================================================================== */
.consent-overlay {
  position:    absolute;
  inset:       0;
  background:  var(--psh-consent-overlay, rgba(15,23,42,.5));
  display:     flex;
  align-items: flex-end;
  z-index:     10;
}
.consent-container {
  background:    var(--psh-consent-card);
  border-radius: var(--psh-panel-radius, 16px) var(--psh-panel-radius, 16px) 0 0;
  padding:       20px 16px 24px;
  width:         100%;
}
.consent-message {
  font-size:     14px;
  color:         var(--psh-input-text) !important;
  margin-bottom: 12px;
  line-height:   1.5;
}
.consent-policy-link-wrap { margin-bottom: 12px; }
.consent-policy-link { font-size: 13px; color: var(--psh-input-text); text-decoration: underline; text-underline-offset: 2px; }
.consent-btn {
  width:         100%;
  background:    var(--psh-send-bg);
  color:         var(--psh-send-text);
  border:        none;
  border-radius: var(--psh-send-radius, 10px);
  padding:       11px;
  font-family:   var(--psh-font, system-ui, sans-serif);
  font-size:     14px;
  font-weight:   600;
  cursor:        pointer;
  transition:    opacity .15s;
}
.consent-btn:hover { opacity: .88; }

/* ==========================================================================
   FAB TOGGLE BUTTON
   ========================================================================== */
.pshuaichat-toggle,
.chatbox-toggle-button {
  position:        fixed;
  bottom:          20px;
  right:           var(--pshuaichat-h-margin, 20px);
  width:           56px;
  height:          56px;
  background:      var(--psh-fab-bg);
  color:           var(--psh-fab-text);
  border:          var(--psh-fab-border, none);
  border-radius:   var(--psh-fab-radius, 50%);
  box-shadow:      var(--psh-fab-shadow, 0 4px 16px rgba(37,99,235,.35));
  cursor:          pointer;
  display:         flex;
  align-items:     center;
  justify-content: center;
  z-index:         9998;
  padding:         0;
  transition:      transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
}
.pshuaichat-toggle:hover,
.chatbox-toggle-button:hover {
  transform: scale(1.08);
}
.pshuaichat-toggle.bottom_left,
.chatbox-toggle-button.bottom_left { right: auto; left: var(--pshuaichat-h-margin, 20px); }
.pshuaichat-toggle.top_right,
.chatbox-toggle-button.top_right   { bottom: auto; top: 20px; }
.pshuaichat-toggle.top_left,
.chatbox-toggle-button.top_left    { bottom: auto; top: 20px; right: auto; left: var(--pshuaichat-h-margin, 20px); }

.pshuaichat-toggle.has-text {
  width:         auto;
  padding:       0 20px;
  gap:           8px;
  border-radius: 28px;
}
.chatbox-toggle-text {
  font-size:   14px;
  font-weight: 600;
  white-space: nowrap;
}
.chatbox-toggle-icon svg { display: block; }

.chatbox-launcher-pill   { border-radius: 999px; width: auto; padding: 0 20px; gap: 8px; }
.chatbox-launcher-round  { border-radius: 50%; }
.chatbox-launcher-square { border-radius: 8px; }

@keyframes psh-fab-pulse {
  0%, 100% { box-shadow: var(--psh-fab-shadow, 0 4px 16px rgba(37,99,235,.35)), 0 0 0 0 rgba(37,99,235,.45); }
  50%       { box-shadow: var(--psh-fab-shadow, 0 4px 16px rgba(37,99,235,.35)), 0 0 0 10px rgba(37,99,235,0); }
}
.chatbox-toggle-button.fab-pulse,
#chatbox.fab-pulse ~ .chatbox-toggle-button {
  animation: psh-fab-pulse 2.4s ease-in-out infinite;
}

/* ==========================================================================
   TYPING INDICATOR
   ========================================================================== */
.pshuaichat-typing {
  display:       flex;
  align-items:   center;
  gap:           4px;
  padding:       10px 14px;
  background:    var(--psh-bot-bg);
  border:        var(--psh-bot-border);
  box-shadow:    var(--psh-bot-shadow, none);
  border-radius: var(--psh-bot-radius, 4px 16px 16px 16px);
  width:         fit-content;
}
.pshuaichat-typing span {
  display:       block;
  width:         7px;
  height:        7px;
  border-radius: 50%;
  background:    var(--psh-typing-dot);
  opacity:       .4;
  animation:     psh-bounce .9s ease-in-out infinite;
}
.pshuaichat-typing span:nth-child(2) { animation-delay: .15s; }
.pshuaichat-typing span:nth-child(3) { animation-delay: .30s; }
@keyframes psh-bounce {
  0%, 100% { transform: translateY(0); opacity: .4; }
  50%       { transform: translateY(-4px); opacity: 1; }
}

/* ==========================================================================
   PRODUCT CARDS
   ========================================================================== */
.pshuaichat-products-row {
  display:    flex;
  gap:        8px;
  flex-wrap:  nowrap;
  overflow-x: auto;
  padding:    4px 0;
  -webkit-overflow-scrolling: touch;
}
.pshuaichat-product-card {
  background:    var(--psh-bot-bg);
  border:        var(--psh-bot-border);
  border-radius: var(--psh-bot-radius, 4px 16px 16px 16px);
  overflow:      hidden;
  width:         180px;
  flex-shrink:   0;
}
.pshuaichat-product-card img { width: 100%; height: 110px; object-fit: cover; display: block; }
.pshuaichat-product-card-body { padding: 8px 10px; }
.pshuaichat-product-card-name {
  font-size: 13px; font-weight: 600; color: var(--psh-bot-text);
  margin-bottom: 4px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pshuaichat-product-card-price { font-size: 13px; font-weight: 700; color: var(--psh-card-price); }
.pshuaichat-product-card-link {
  display: block; margin-top: 8px; text-align: center;
  background: var(--psh-send-bg); color: var(--psh-send-text);
  border-radius: var(--psh-send-radius, 10px); padding: 6px 10px;
  font-size: 12px; font-weight: 600; text-decoration: none; transition: opacity .15s;
}
.pshuaichat-product-card-link:hover { opacity: .88; }

/* Product card wrapper — reset bot-bubble styles so cards show correctly */
#chatbox .message.response.product-cards,
#chatbox .message.chatbot.product-cards {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 4px 0 !important;
  max-width: 100% !important;
  white-space: normal !important;
}

/* Product card grid — 2-column layout */
.pshuaichat-product-cards,
.gptchatbox-product-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.pshuaichat-pc-card,
.gc-card {
  background: var(--psh-card-bg) !important;
  color: var(--psh-bot-text) !important;
  border: var(--psh-bot-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.pshuaichat-pc-thumb {
  display: block;
  width: 100%;
}

.pshuaichat-pc-thumb img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
}

.pshuaichat-pc-body,
.gc-card-body {
  padding: 8px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pshuaichat-pc-title,
.gc-card-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pshuaichat-pc-title a,
.gc-card-title a {
  color: var(--psh-bot-text) !important;
  text-decoration: none;
}

.pshuaichat-pc-title a:hover,
.gc-card-title a:hover {
  color: var(--psh-card-price) !important;
  text-decoration: underline;
}

.pshuaichat-pc-price,
.gc-card-price,
.gc-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--psh-card-price) !important;
  margin-top: auto;
}

/* ==========================================================================
   WHATSAPP BUTTON
   ========================================================================== */
/* the WhatsApp green darkened so the white label keeps a contrast of 4.5 */
#chatbox .wa-btn {
  display: inline-flex; align-items: center; gap: 8px;
  /* pshu-gate: allow front-fixed-palette — WhatsApp brand green, not a shop colour */
  background: #0a7d4a; color: #ffffff; border: none; border-radius: 999px;
  padding: 9px 18px; font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.2;
  cursor: pointer; text-decoration: none; box-shadow: none; transition: background-color .15s;
}
/* pshu-gate: allow front-fixed-palette — WhatsApp brand green, not a shop colour */
#chatbox .wa-btn:hover { background: #086a3e; color: #ffffff; }
/* pshu-gate: allow front-fixed-palette — WhatsApp brand green, not a shop colour */
#chatbox .wa-btn:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; box-shadow: 0 0 0 4px #0a7d4a; }
#chatbox .wa-btn-icon { display: inline-flex; flex: none; }
#chatbox .chatbox-wa-top {
  padding: 6px 12px; font-size: 13px; max-width: 200px; min-height: 32px; white-space: nowrap;
}
#chatbox .chatbox-wa-top .wa-btn-label { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) {
  #chatbox .chatbox-wa-top { padding: 6px; min-width: 32px; justify-content: center; }
  #chatbox .chatbox-wa-top .wa-btn-label { display: none; }
}

/* ==========================================================================
   CATEGORY LINK (below product cards)
   ========================================================================== */
#chatbox .pshuaichat-category-link-wrap {
  padding: 4px 0 8px 0;
  text-align: center;
}

#chatbox .pshuaichat-category-link {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  background: transparent;
  border: 1.5px solid var(--psh-accent);
  color: var(--psh-accent) !important;
  transition: background 0.15s, color 0.15s;
}

#chatbox .pshuaichat-category-link:hover {
  background: var(--psh-accent);
  color: var(--psh-send-text) !important;
}

/* ==========================================================================
   UTILITY
   ========================================================================== */
.pshuaichat-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Loading dots — animated typing indicator */
#chatbox .message.response.loading,
#chatbox .message.chatbot.loading {
  background:    var(--psh-bot-bg) !important;
  padding:       10px 16px !important;
  min-height:    0 !important;
  line-height:   1 !important;
  white-space:   normal !important;
}

#chatbox .loading-dots {
  display:    inline-flex;
  align-items: center;
  gap:         5px;
  background: transparent !important;
  color:      transparent !important;
  padding:    0 !important;
}

#chatbox .loading-dots .dot {
  display:       block;
  width:         8px;
  height:        8px;
  border-radius: 50%;
  background:    var(--psh-typing-dot, rgba(255,255,255,.75)) !important;
  opacity:       0.5;
  animation:     psh-bounce .9s ease-in-out infinite;
}
#chatbox .loading-dots .dot:nth-child(2) { animation-delay: .18s; }
#chatbox .loading-dots .dot:nth-child(3) { animation-delay: .36s; }

/* ==========================================================================
   MOBILE WIDTH (appearance setting)
   ========================================================================== */
@media (max-width: 639px) {
  #chatbox {
    left:   0;
    right:  0;
    margin: 0 auto;
    width:  min(var(--pshuaichat-mobile-width-pct, 100%), calc(100% - 2 * var(--pshuaichat-mobile-edge, 10px)));
  }
}

/* ==========================================================================
   OWN ACCENT COLOUR (appearance setting, overrides the design colours)
   ========================================================================== */
#chatbox.pshuaichat-has-accent,
#chatbox-toggle.pshuaichat-has-accent {
  --psh-accent:      var(--pshuaichat-user-accent);
  --psh-header-bg:   var(--pshuaichat-user-accent);
  --psh-header-text: var(--pshuaichat-user-accent-ink);
  --psh-btn-color:   var(--pshuaichat-user-accent-ink);
  --psh-user-bg:     var(--pshuaichat-user-accent);
  --psh-user-text:   var(--pshuaichat-user-accent-ink);
  --psh-user-border: none;
  --psh-send-bg:     var(--pshuaichat-user-accent);
  --psh-send-text:   var(--pshuaichat-user-accent-ink);
  --psh-fab-bg:      var(--pshuaichat-user-accent);
  --psh-fab-text:    var(--pshuaichat-user-accent-ink);
  --psh-fab-border:  none;
}

/* ==========================================================================
   DARK WINDOW (appearance setting, for the designs with a light window)
   ========================================================================== */
#chatbox.pshuaichat-forced-dark {
  color-scheme: dark;
  --psh-panel-bg:           Canvas;
  --psh-panel-border:       1px solid color-mix(in srgb, CanvasText 16%, Canvas);
  --psh-msgs-bg:            Canvas;
  --psh-bot-bg:             color-mix(in srgb, CanvasText 9%, Canvas);
  --psh-bot-text:           CanvasText;
  --psh-bot-border:         1px solid color-mix(in srgb, CanvasText 16%, Canvas);
  --psh-bot-shadow:         none;
  --psh-card-bg:            color-mix(in srgb, CanvasText 9%, Canvas);
  --psh-avatar-bg:          color-mix(in srgb, CanvasText 16%, Canvas);
  --psh-avatar-text:        CanvasText;
  --psh-footer-bg:          color-mix(in srgb, CanvasText 5%, Canvas);
  --psh-footer-border:      1px solid color-mix(in srgb, CanvasText 16%, Canvas);
  --psh-input-bg:           Canvas;
  --psh-input-border:       1px solid color-mix(in srgb, CanvasText 22%, Canvas);
  --psh-input-text:         CanvasText;
  --psh-input-placeholder:  color-mix(in srgb, CanvasText 60%, Canvas);
  --psh-chip-bg:            transparent;
  --psh-chip-border:        1px solid color-mix(in srgb, CanvasText 22%, Canvas);
  --psh-chip-text:          CanvasText;
  --psh-chip-hover-bg:      color-mix(in srgb, CanvasText 16%, Canvas);
  --psh-chip-hover-text:    CanvasText;
  --psh-counter-text:       color-mix(in srgb, CanvasText 60%, Canvas);
  --psh-counter-bg:         color-mix(in srgb, CanvasText 5%, Canvas);
  --psh-consent-overlay:    rgba(0,0,0,.6);
  --psh-consent-card:       color-mix(in srgb, CanvasText 9%, Canvas);
  --psh-typing-dot:         color-mix(in srgb, CanvasText 60%, Canvas);
}
#chatbox.pshuaichat-forced-dark .pshuaichat-prechat input[type="email"] {
  background: var(--psh-input-bg);
  color:      var(--psh-input-text);
  border:     var(--psh-input-border);
}

/* ==========================================================================
   NEW MESSAGE ANIMATION (appearance setting)
   ========================================================================== */
#chatbox .message.pshuaichat-bubble-fade {
  animation: psh-bubble-fade .24s cubic-bezier(.22,1,.36,1) both;
}
#chatbox .message.pshuaichat-bubble-pop {
  animation: psh-bubble-pop .32s cubic-bezier(.34,1.56,.64,1) both;
}
#chatbox .message.user.pshuaichat-bubble-pop     { transform-origin: bottom right; }
#chatbox .message.response.pshuaichat-bubble-pop { transform-origin: bottom left; }
@keyframes psh-bubble-fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@keyframes psh-bubble-pop {
  from { opacity: 0; transform: scale(.86); }
  to   { opacity: 1; transform: none; }
}

/* ==========================================================================
   CHAT BUTTON HINT (appearance setting)
   ========================================================================== */
.pshuaichat-fab-hint {
  position:       fixed;
  z-index:        9998;
  max-width:      min(260px, calc(100vw - 32px));
  padding:        9px 13px;
  background:     var(--psh-bot-bg);
  color:          var(--psh-bot-text);
  border:         var(--psh-bot-border);
  border-radius:  12px;
  box-shadow:     0 8px 24px rgba(15,23,42,.16);
  font-family:    var(--psh-font, system-ui, sans-serif);
  font-size:      14px;
  line-height:    1.4;
  opacity:        0;
  visibility:     hidden;
  transform:      translateY(6px);
  pointer-events: none;
  transition:     opacity .2s cubic-bezier(.22,1,.36,1), transform .2s cubic-bezier(.22,1,.36,1), visibility .2s;
}
.pshuaichat-fab-hint--show {
  opacity:    1;
  visibility: visible;
  transform:  none;
}

@media (prefers-reduced-motion: reduce) {
  #chatbox,
  .pshuaichat-fab-hint,
  .pshuaichat-toggle,
  .chatbox-toggle-button { transition: none; }
  #chatbox .message.pshuaichat-bubble-fade,
  #chatbox .message.pshuaichat-bubble-pop,
  .chatbox-toggle-button.fab-pulse,
  .pshuaichat-typing span,
  #chatbox .loading-dots .dot { animation: none; }
}
