/* ==========================================================
   POUCHMART CHATBOT – Sri Gayathri Packaging Industries
   All classes/IDs start with "pou-chat"
   ========================================================== */

.pou-chat-widget {
  --pou-chat-primary: #0b3a6e;
  --pou-chat-primary-dark: #082a52;
  --pou-chat-accent: #f28c1b;
  --pou-chat-accent-dark: #d97706;
  --pou-chat-bg: #f4f6fa;
  --pou-chat-surface: #ffffff;
  --pou-chat-text: #1f2937;
  --pou-chat-muted: #6b7280;
  --pou-chat-border: #e3e8ef;
  --pou-chat-error: #d92d20;
  --pou-chat-ok: #22c55e;

  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 9999;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--pou-chat-text);
}

.pou-chat-widget *,
.pou-chat-widget *::before,
.pou-chat-widget *::after {
  box-sizing: border-box;
}

/* ---------- Toggle tab (attached to right wall) ---------- */

.pou-chat-toggle {
  position: fixed;
  right: 0;
  bottom: 248px;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 0;
  right : 15px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pou-chat-primary), var(--pou-chat-primary-dark));
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: -4px 6px 18px rgba(11, 58, 110, 0.35);
  transition: width 0.2s ease, background 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.pou-chat-toggle:hover { width: 60px; background: var(--pou-chat-accent); }
.pou-chat-toggle:focus-visible { outline: 3px solid var(--pou-chat-accent); outline-offset: 2px; }
.pou-chat-toggle svg { width: 26px; height: 26px; fill: currentColor; }

.pou-chat-toggle::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 9px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pou-chat-accent);
  box-shadow: 0 0 0 0 rgba(242, 140, 27, 0.7);
  animation: pou-chat-pulse 2s infinite;
}

.pou-chat-toggle-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%);
}

@keyframes pou-chat-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(242, 140, 27, 0.7); }
  70%  { box-shadow: 0 0 0 10px rgba(242, 140, 27, 0); }
  100% { box-shadow: 0 0 0 0 rgba(242, 140, 27, 0); }
}

/* ---------- Window ---------- */

.pou-chat-window {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--pou-chat-surface);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  outline: none;
}

.pou-chat-window.pou-chat-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* ---------- Header (logo only) ---------- */

.pou-chat-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #fff;
  border-bottom: 3px solid var(--pou-chat-accent);
}

.pou-chat-send i{
    font-size : 16px;
}

.pou-chat-logo {
  display: block;
  max-height: 36px;
  max-width: 170px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin-right: auto;
}

.pou-chat-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--pou-chat-muted);
}

.pou-chat-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pou-chat-ok);
  display: inline-block;
}

.pou-chat-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--pou-chat-primary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.pou-chat-close:hover { background: #fff;  }
.pou-chat-close:focus-visible { outline: 2px solid var(--pou-chat-accent); outline-offset: 2px; }

/* ---------- Body ---------- */

.pou-chat-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 12px;
  background: var(--pou-chat-bg);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #c2cad6 transparent;
}

.pou-chat-body::-webkit-scrollbar { width: 6px; }
.pou-chat-body::-webkit-scrollbar-thumb { background: #c2cad6; border-radius: 6px; }

.pou-chat-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 8px;
  animation: pou-chat-in 0.25s ease;
}

.pou-chat-msg-user { justify-content: flex-end; }

.pou-chat-avatar {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--pou-chat-border);
  object-fit: contain;
  padding: 3px;
}

.pou-chat-avatar-gap { flex: 0 0 28px; width: 28px; }

.pou-chat-bubble {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 14px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.pou-chat-msg-bot .pou-chat-bubble {
  background: var(--pou-chat-surface);
  border-bottom-left-radius: 4px;
}

.pou-chat-msg-user .pou-chat-bubble {
  background: var(--pou-chat-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.pou-chat-bubble a { color: var(--pou-chat-primary); font-weight: 600; }
.pou-chat-msg-user .pou-chat-bubble a { color: #fff; }

/* typing */
.pou-chat-typing {
  display: inline-flex;
  gap: 4px;
  padding: 12px 14px;
}

.pou-chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aa5b5;
  animation: pou-chat-bounce 1.2s infinite ease-in-out;
}

.pou-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.pou-chat-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes pou-chat-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

@keyframes pou-chat-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Quick replies ---------- */

.pou-chat-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 10px 36px;
}

.pou-chat-quick-btn {
  display: inline-block;
  padding: 7px 12px;
  border: 1.5px solid var(--pou-chat-primary);
  border-radius: 18px;
  background: #fff;
  color: var(--pou-chat-primary);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.pou-chat-quick-btn:hover,
.pou-chat-quick-btn:focus-visible {
  background: var(--pou-chat-primary);
  color: #fff;
  outline: none;
}

.pou-chat-quick-link { border-color: var(--pou-chat-accent); color: var(--pou-chat-accent-dark); }
.pou-chat-quick-link:hover, .pou-chat-quick-link:focus-visible { background: var(--pou-chat-accent); border-color: var(--pou-chat-accent); color: #fff; }

/* ---------- Composer ---------- */

.pou-chat-composer {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid var(--pou-chat-border);
}

.pou-chat-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border: 1.5px solid var(--pou-chat-border);
  border-radius: 21px;
  background: var(--pou-chat-bg);
  font: inherit;
  color: var(--pou-chat-text);
}

.pou-chat-input:focus { outline: none; border-color: var(--pou-chat-primary); background: #fff; }

.pou-chat-send {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--pou-chat-accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.pou-chat-send:hover { background: var(--pou-chat-accent-dark); }
.pou-chat-send:focus-visible { outline: 2px solid var(--pou-chat-primary); outline-offset: 2px; }
.pou-chat-send svg { width: 20px; height: 20px; fill: currentColor; }

/* ---------- Enquiry form ---------- */

.pou-chat-form-wrap {
  margin: 6px 0 10px;
  animation: pou-chat-in 0.25s ease;
}

.pou-chat-form {
  background: #fff;
  border: 1px solid var(--pou-chat-border);
  border-top: 4px solid var(--pou-chat-accent);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.pou-chat-form-title {
  margin: 0 0 2px;
  font-size: 16px;
  font-weight: 700;
  color: var(--pou-chat-primary);
}

.pou-chat-form-note {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--pou-chat-muted);
}

.pou-chat-field { margin-bottom: 10px; }

.pou-chat-field label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--pou-chat-text);
}

.pou-chat-req { color: var(--pou-chat-error); }

.pou-chat-field input,
.pou-chat-field select,
.pou-chat-field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1.5px solid var(--pou-chat-border);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  color: var(--pou-chat-text);
}

.pou-chat-field textarea { resize: vertical; min-height: 70px; }

.pou-chat-field input:focus,
.pou-chat-field select:focus,
.pou-chat-field textarea:focus {
  outline: none;
  border-color: var(--pou-chat-primary);
  box-shadow: 0 0 0 3px rgba(11, 58, 110, 0.12);
}

.pou-chat-invalid input,
.pou-chat-invalid select,
.pou-chat-invalid textarea { border-color: var(--pou-chat-error); }

.pou-chat-error {
  margin: 3px 0 0;
  min-height: 0;
  font-size: 12px;
  color: var(--pou-chat-error);
}

.pou-chat-error:empty { display: none; }

.pou-chat-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.pou-chat-turnstile-field { overflow-x: auto; }
.pou-chat-turnstile-invalid { outline: 2px solid var(--pou-chat-error); border-radius: 6px; }

.pou-chat-submit {
  width: 100%;
  padding: 11px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--pou-chat-primary), var(--pou-chat-primary-dark));
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
}

.pou-chat-submit:hover { background: var(--pou-chat-accent); }
.pou-chat-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.pou-chat-submit:focus-visible { outline: 3px solid var(--pou-chat-accent); outline-offset: 2px; }

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
  .pou-chat-window {
    right: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }
  
.pou-chat-toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 9px;
  width: 8px;
}

  .pou-chat-input,
  .pou-chat-field input,
  .pou-chat-field select,
  .pou-chat-field textarea { font-size: 16px; }

  .pou-chat-toggle {
    bottom: 252px;
    width: 40px;
    height: 40px;
    right: 7px;
  } 
  .pou-chat-bubble { max-width: 86%; }
}

@media (max-height: 520px) and (min-width: 481px) {
  .pou-chat-window { height: calc(100vh - 24px); bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .pou-chat-widget *,
  .pou-chat-widget *::before,
  .pou-chat-widget *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================
   ENHANCEMENTS
   ========================================================== */

/* ---------- Trust strip under the logo header ---------- */

.pou-chat-trust {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 14px;
  padding: 7px 10px;
  background: #eef3fa;
  border-bottom: 1px solid var(--pou-chat-border);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--pou-chat-primary);
}

.pou-chat-trust span::before {
  content: "\2713";
  margin-right: 4px;
  color: var(--pou-chat-accent-dark);
  font-weight: 800;
}

/* ---------- Step tag + timestamps ---------- */

.pou-chat-step {
  display: block;
  margin-bottom: 3px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pou-chat-accent-dark);
}

.pou-chat-time {
  display: block;
  margin-top: 4px;
  font-size: 10.5px;
  line-height: 1;
  text-align: right;
  opacity: 0.6;
}

/* ---------- Main menu as a card grid ---------- */

.pou-chat-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pou-chat-quick-grid .pou-chat-quick-btn {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--pou-chat-border);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  font-size: 12.5px;
  line-height: 1.25;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.pou-chat-quick-grid .pou-chat-quick-btn:hover,
.pou-chat-quick-grid .pou-chat-quick-btn:focus-visible {
  border-color: var(--pou-chat-primary);
  box-shadow: 0 3px 8px rgba(11, 58, 110, 0.18);
  transform: translateY(-1px);
  color :#0b3a6e;
}

/* ---------- Quick actions bar ---------- */

.pou-chat-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  padding: 7px 12px;
  background: #fff;
  border-top: 1px solid var(--pou-chat-border);
}

.pou-chat-action {
  flex: 1 1 0;
  padding: 6px 4px;
  border: 1px solid var(--pou-chat-border);
  border-radius: 14px;
  background: var(--pou-chat-bg);
  color: var(--pou-chat-primary);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.pou-chat-action:hover,
.pou-chat-action:focus-visible {
  background: var(--pou-chat-primary);
  border-color: var(--pou-chat-primary);
  color: #fff;
  outline: none;
}

.pou-chat-composer { border-top: 0; padding-top: 4px; }

/* ---------- Send button state ---------- */

.pou-chat-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pou-chat-send:disabled:hover { background: var(--pou-chat-accent); }

/* ---------- Form hint ---------- */

.pou-chat-form-hint {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: var(--pou-chat-muted);
}

/* ---------- Success + summary card ---------- */

.pou-chat-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--pou-chat-ok);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  vertical-align: middle;
}

.pou-chat-summary {
  min-width: 220px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--pou-chat-bg);
  border: 1px solid var(--pou-chat-border);
}

.pou-chat-summary-title {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--pou-chat-primary);
}

.pou-chat-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 0;
  font-size: 12.5px;
  border-top: 1px dashed var(--pou-chat-border);
}

.pou-chat-summary-row:first-of-type { border-top: 0; }
.pou-chat-summary-row span { color: var(--pou-chat-muted); }
.pou-chat-summary-row strong { text-align: right; word-break: break-word; }

/* ---------- Teaser bubble + badge ---------- */

.pou-chat-teaser {
  position: fixed;
 right: 76px;
  bottom: 243px;
  display: flex;
  align-items: flex-start;
  max-width: 240px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.22);
  opacity: 0;
  visibility: hidden;
  transform: translateX(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.pou-chat-teaser::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: 18px;
  width: 12px;
  height: 12px;
  background: #fff;
  transform: rotate(45deg);
  border-radius: 2px;
}

.pou-chat-teaser-show {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.pou-chat-teaser-text {
  display: block;
  padding: 12px 6px 12px 14px;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  color: var(--pou-chat-text);
  cursor: pointer;
}

.pou-chat-teaser-text strong { display: block; color: var(--pou-chat-primary); font-size: 13.5px; }
.pou-chat-teaser-text span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--pou-chat-muted); }

.pou-chat-teaser-close {
  width: 26px;
  height: 26px;
  margin: 6px 6px 0 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--pou-chat-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.pou-chat-teaser-close:hover { background: var(--pou-chat-bg); color: var(--pou-chat-primary); }

.pou-chat-has-badge::after { display: none; }

.pou-chat-has-badge::before {
  content: "1";
  position: absolute;
  top: -7px;
  left: -7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--pou-chat-error);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(217, 45, 32, 0.45);
}

@media (max-width: 480px) {
  .pou-chat-teaser { right: 58px; bottom: 240px; max-width: calc(100vw - 80px); }
  .pou-chat-quick-row { margin-left: 8px; }
  .pou-chat-quick-grid { margin-left: 8px; }
}

/* ---------- Gentle fade-in for buttons (opacity only, so hover effects still work) ---------- */

@keyframes pou-chat-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.pou-chat-quick-btn {
  animation: pou-chat-fade 0.35s ease both;
}