﻿:root {
  --ph-green-deep:   #1a3a2a;
  --ph-green-mid:    #2d6a4f;
  --ph-green-bright: #52b788;
  --ph-green-light:  #b7e4c7;
  --ph-green-pale:   #f0faf4;
  --ph-cream:        #faf9f6;
  --ph-text-dark:    #1a2e22;
  --ph-text-mid:     #4a6155;
  --ph-text-light:   #8aab96;
  --ph-shadow:       0 16px 48px rgba(26,58,42,0.25);
}
#ph-chat-bubble {
  position: fixed; bottom: 80px; right: 28px;
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--ph-green-mid), var(--ph-green-bright));
  border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--ph-shadow);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  z-index: 999999;
  animation: ph-bubble-pulse 3s ease-in-out infinite;
}
#ph-chat-bubble:hover { transform: scale(1.1); }
#ph-chat-bubble.ph-open { animation: none; opacity: 0; pointer-events: none; }
@keyframes ph-bubble-pulse {
  0%,100% { box-shadow: var(--ph-shadow), 0 0 0 0 rgba(82,183,136,0.4); }
  50%      { box-shadow: var(--ph-shadow), 0 0 0 12px rgba(82,183,136,0); }
}
#ph-chat-bubble svg { width: 24px; height: 24px; fill: white; transition: opacity 0.2s; position: absolute; }
#ph-chat-bubble .ph-icon-chat  { opacity: 1; }
#ph-chat-bubble .ph-icon-close { opacity: 0; }
#ph-chat-bubble.ph-open .ph-icon-chat  { opacity: 0; }
#ph-chat-bubble.ph-open .ph-icon-close { opacity: 1; }
.ph-notif-dot { position: absolute; top: 1px; right: 1px; width: 12px; height: 12px; background: #ff6b6b; border-radius: 50%; border: 2px solid white; }
#ph-chat-window {
  position: fixed; top: 0; right: 0;
  width: 385px; height: 100vh; max-height: 100vh;
  background: var(--ph-cream);
  border-radius: 24px 0 0 24px;
  box-shadow: var(--ph-shadow);
  display: flex; flex-direction: column; overflow: hidden;
  z-index: 999998;
  transform: scale(0.85) translateY(20px);
  transform-origin: bottom right;
  opacity: 0; pointer-events: none;
  transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1);
  font-family: 'DM Sans', sans-serif;
}
#ph-chat-window.ph-open { transform: scale(1) translateY(0); opacity: 1; pointer-events: all; }
.ph-chat-header {
  background: linear-gradient(135deg, var(--ph-green-deep), var(--ph-green-mid));
  padding: 18px 20px 14px; position: relative; overflow: hidden; flex-shrink: 0;
}
.ph-chat-header::before { content: ''; position: absolute; right: -10px; top: -10px; font-size: 80px; opacity: 0.08; transform: rotate(20deg); }
.ph-header-top { display: flex; align-items: center; gap: 12px; }
.ph-bot-avatar { width: 44px; height: 44px; background: linear-gradient(135deg, var(--ph-green-bright), var(--ph-green-light)); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.ph-bot-info h3 { font-family: 'DM Serif Display', serif; color: white; font-size: 1.1rem; font-weight: 400; margin: 0; }
.ph-bot-status { display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.ph-status-dot { width: 7px; height: 7px; background: var(--ph-green-bright); border-radius: 50%; animation: ph-blink 2s ease-in-out infinite; }
@keyframes ph-blink { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.ph-bot-status span { color: var(--ph-green-light); font-size: 0.78rem; font-weight: 300; }
.ph-quick-topics { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 0 6px; }
.ph-topic-chip { background: var(--ph-green-pale); color: var(--ph-green-mid); border: 1.5px solid var(--ph-green-light); padding: 5px 11px; border-radius: 20px; font-size: 0.73rem; font-weight: 500; cursor: pointer; transition: all 0.2s; white-space: nowrap; font-family: 'DM Sans', sans-serif; }
.ph-topic-chip:hover { background: var(--ph-green-mid); color: white; border-color: var(--ph-green-mid); transform: translateY(-1px); }
.ph-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.ph-messages::-webkit-scrollbar { width: 8px; }
.ph-messages::-webkit-scrollbar-track { background: rgba(0,0,0,0.04); border-radius: 8px; }
.ph-messages::-webkit-scrollbar-thumb { background: var(--ph-green-mid); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
.ph-messages::-webkit-scrollbar-thumb:hover { background: var(--ph-green-deep); border-radius: 8px; }
.ph-msg { display: flex; gap: 8px; animation: ph-msg-in 0.3s cubic-bezier(0.34,1.56,0.64,1) both; }
@keyframes ph-msg-in { from { opacity:0; transform:translateY(10px) scale(0.95); } to { opacity:1; transform:translateY(0) scale(1); } }
.ph-msg.ph-user { flex-direction: row-reverse; }
.ph-msg-avatar { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; margin-top: auto; }
.ph-avatar-bot  { background: linear-gradient(135deg, var(--ph-green-bright), var(--ph-green-mid)); }
.ph-avatar-user { background: linear-gradient(135deg, #a8d5b5, var(--ph-green-bright)); }
.ph-bubble { max-width: 78%; padding: 10px 14px; border-radius: 18px; font-size: 0.87rem; line-height: 1.55; word-wrap: break-word; overflow-wrap: break-word; }
.ph-msg.ph-bot  .ph-bubble { background: white; color: var(--ph-text-dark); border-bottom-left-radius: 4px; box-shadow: 0 2px 8px rgba(26,58,42,0.08); }
.ph-msg.ph-user .ph-bubble { background: linear-gradient(135deg, var(--ph-green-mid), var(--ph-green-bright)); color: white; border-bottom-right-radius: 4px; }
.ph-msg-time { font-size: 0.68rem; color: var(--ph-text-light); margin-top: 3px; padding: 0 4px; }
.ph-msg.ph-user .ph-msg-time { text-align: right; }
.ph-msg.ph-user > div { display: flex; flex-direction: column; align-items: flex-end; max-width: calc(100% - 38px); min-width: 0; }
.ph-product-card { background: white; border: 1.5px solid var(--ph-green-light); border-radius: 14px; padding: 12px; display: flex; gap: 10px; align-items: center; margin: 3px 0; box-shadow: 0 2px 8px rgba(26,58,42,0.06); text-decoration: none; }
.ph-product-card:hover { border-color: var(--ph-green-bright); transform: translateY(-1px); transition: all 0.2s; }
.ph-product-img  { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--ph-green-pale); flex-shrink: 0; }
.ph-product-info { flex: 1; min-width: 0; }
.ph-product-name  { font-size: 0.82rem; font-weight: 600; color: var(--ph-text-dark); margin: 0 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-product-price { font-size: 0.8rem; color: var(--ph-green-mid); font-weight: 600; }
.ph-product-stock { font-size: 0.7rem; margin-top: 2px; }
.ph-in-stock  { color: #065f46; }
.ph-out-stock { color: #991b1b; }
.ph-products-wrap { max-width: 82%; padding-left: 38px; }
.ph-order-card { background: linear-gradient(135deg, #f0faf4, #e8f8ef); border: 1.5px solid var(--ph-green-light); border-radius: 14px; padding: 14px; margin-top: 4px; box-shadow: 0 4px 16px rgba(26,58,42,0.08); }
.ph-order-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ph-order-id     { font-weight: 600; color: var(--ph-green-deep); font-size: 0.85rem; }
.ph-status-badge { padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 600; }
.ph-s-processing { background: #fff3cd; color: #856404; }
.ph-s-completed  { background: #d1fae5; color: #065f46; }
.ph-s-shipped    { background: #dbeafe; color: #1e40af; }
.ph-s-cancelled  { background: #fee2e2; color: #991b1b; }
.ph-s-pending    { background: #f3f4f6; color: #374151; }
.ph-s-onhold     { background: #ede9fe; color: #5b21b6; }
.ph-s-failed     { background: #fee2e2; color: #991b1b; }
.ph-divider      { height: 1px; background: var(--ph-green-light); margin: 8px 0; opacity: 0.5; }
.ph-order-row    { display: flex; justify-content: space-between; font-size: 0.78rem; margin-bottom: 5px; }
.ph-order-row .ph-lbl { color: var(--ph-text-light); }
.ph-order-row .ph-val { color: var(--ph-text-dark); font-weight: 500; text-align: right; max-width: 60%; }
.ph-items-title  { font-size: 0.75rem; color: var(--ph-text-light); margin: 8px 0 5px; }
.ph-item         { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--ph-text-dark); padding: 3px 0; }
.ph-order-total  { display: flex; justify-content: space-between; font-size: 0.85rem; font-weight: 600; color: var(--ph-green-deep); margin-top: 8px; padding-top: 8px; border-top: 1.5px solid var(--ph-green-light); }
.ph-orders-list  { max-width: 82%; padding-left: 38px; display: flex; flex-direction: column; gap: 6px; }
.ph-order-mini   { background: white; border: 1.5px solid var(--ph-green-light); border-radius: 12px; padding: 10px 14px; cursor: pointer; transition: all 0.2s; display: flex; justify-content: space-between; align-items: center; }
.ph-order-mini:hover { border-color: var(--ph-green-bright); transform: translateY(-1px); }
.ph-order-mini-id   { font-size: 0.82rem; font-weight: 600; color: var(--ph-green-deep); }
.ph-order-mini-info { font-size: 0.75rem; color: var(--ph-text-light); margin-top: 2px; }
.ph-typing-dots { display: flex; gap: 4px; background: white; padding: 10px 14px; border-radius: 18px; border-bottom-left-radius: 4px; box-shadow: 0 2px 8px rgba(26,58,42,0.08); }
.ph-typing-dots span { width: 7px; height: 7px; background: var(--ph-green-bright); border-radius: 50%; animation: ph-typing 1.2s ease-in-out infinite; }
.ph-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.ph-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ph-typing { 0%,60%,100% { transform:translateY(0); opacity:0.4; } 30% { transform:translateY(-6px); opacity:1; } }
.ph-quick-replies { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 38px; }
.ph-qr-btn { background: var(--ph-green-pale); color: var(--ph-green-mid); border: 1.5px solid var(--ph-green-light); padding: 5px 12px; border-radius: 20px; font-size: 0.78rem; font-family: 'DM Sans', sans-serif; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.ph-qr-btn:hover { background: var(--ph-green-mid); color: white; border-color: var(--ph-green-mid); }
.ph-input-area { padding: 10px 14px 14px; background: white; border-top: 1px solid #eef5f1; flex-shrink: 0; }
.ph-input-row  { display: flex; gap: 8px; align-items: center; background: var(--ph-green-pale); border: 1.5px solid var(--ph-green-light); border-radius: 16px; padding: 8px 8px 8px 14px; transition: border-color 0.2s; }
.ph-input-row:focus-within { border-color: var(--ph-green-bright); box-shadow: 0 0 0 3px rgba(82,183,136,0.1); }
#ph-input { flex: 1; border: none; background: transparent; font-family: 'DM Sans', sans-serif; font-size: 0.88rem; color: var(--ph-text-dark); outline: none; height: 36px; line-height: 36px; }
#ph-input::placeholder { color: var(--ph-text-light); }
#ph-send { width: 40px; height: 40px; background: linear-gradient(135deg, var(--ph-green-mid), var(--ph-green-bright)); border: none; border-radius: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; font-size: 1.2rem; color: white; }
#ph-send:hover    { transform: scale(1.05); }
#ph-send:disabled { opacity: 0.5; cursor: not-allowed; }
.ph-footer-txt { text-align: center; margin-top: 7px; font-size: 0.68rem; color: var(--ph-text-light); }
.ph-footer-txt span { color: var(--ph-green-bright); font-weight: 600; }
.ph-welcome { background: linear-gradient(135deg, var(--ph-green-pale), #e8f8ef); border: 1.5px solid var(--ph-green-light); border-radius: 16px; padding: 14px; }
.ph-welcome h4 { font-family: 'DM Serif Display', serif; color: var(--ph-green-deep); font-size: 1rem; margin: 0 0 6px; }
.ph-welcome p  { font-size: 0.8rem; color: var(--ph-text-mid); line-height: 1.5; margin: 0; }
#ph-notify-popup { position: fixed; bottom: 148px; right: 28px; background: white; border-radius: 16px; padding: 14px 16px; max-width: 260px; box-shadow: 0 8px 32px rgba(26,58,42,0.2); z-index: 999997; border: 1.5px solid var(--ph-green-light); transform-origin: bottom right; }
#ph-notify-popup::after { content: ''; position: absolute; bottom: -8px; right: 22px; width: 14px; height: 14px; background: white; border-right: 1.5px solid var(--ph-green-light); border-bottom: 1.5px solid var(--ph-green-light); transform: rotate(45deg); }
.ph-popup-head    { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ph-popup-avatar  { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.ph-popup-icon    { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--ph-green-bright), var(--ph-green-mid)); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.ph-popup-meta    { min-width: 0; }
.ph-popup-name    { font-size: 0.75rem; font-weight: 700; color: var(--ph-green-deep); }
.ph-popup-status  { font-size: 0.65rem; color: var(--ph-text-light); }
.ph-popup-msg     { font-size: 0.8rem; color: var(--ph-text-dark); line-height: 1.5; }
.ph-popup-close   { -webkit-appearance: none; appearance: none; width: 30px; height: 30px; border-radius: 999px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.95rem; color: var(--ph-text-mid); cursor: pointer; line-height: 1; background: #f3f4f6; border: none; padding: 0; margin: 0; box-shadow: none; }
.ph-popup-close:hover { color: var(--ph-text-dark); background: #e5e7eb; }
.ph-popup-cta { margin-top: 10px; background: linear-gradient(135deg, var(--ph-green-mid), var(--ph-green-bright)); color: white; border: none; border-radius: 14px; padding: 7px 14px; font-size: 0.78rem; font-weight: 600; cursor: pointer; font-family: 'DM Sans', sans-serif; width: 100%; }
.ph-popup-cta:hover { opacity: 0.9; }
@keyframes ph-popup-in { from { opacity:0; transform:scale(0.8) translateY(10px); } to { opacity:1; transform:scale(1) translateY(0); } }
.ph-climate-banner { background: linear-gradient(135deg, #e8f8ef, #d1f5e0); border: 1.5px solid var(--ph-green-bright); border-radius: 14px; padding: 12px 14px; margin-left: 38px; margin-right: 8px; margin-top: 4px; font-size: 0.82rem; color: var(--ph-green-deep); font-weight: 500; word-wrap: break-word; overflow-wrap: break-word; white-space: normal; box-sizing: border-box; display: block; line-height: 1.4; }
.ph-climate-banner span { font-size: 1rem; }
@media (max-width: 600px) {
  #ph-notify-popup { right: 8px; bottom: 160px; max-width: calc(100vw - 60px); }
  #ph-chat-window  { position: fixed !important; top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important; width: 100% !important; max-width: 100% !important; height: 100% !important; max-height: 100% !important; border-radius: 0 !important; z-index: 999998 !important; }
  #ph-chat-bubble  { right: 14px !important; bottom: 130px !important; width: 50px !important; height: 50px !important; }
}
