/* ============================================================
   ELTHAM DISCOUNT BLINDS — Chatbot & Triage Styles
   Brand tokens: Ink Navy (#0A1C30), Brand Orange (#FF7518)
   ============================================================ */

.edb-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: #0A1C30;
  -webkit-font-smoothing: antialiased;
}

/* Parked under an enquiry form. The fixed corner sits on top of the form's
   own fields as the form scrolls through it — the client reported the launcher
   covering "What do you need?" — so while that form's card is on screen the
   launcher stops floating: main.js moves the widget into this slot at the foot
   of the card, below "Send enquiry", where it cannot cover anything. Once the
   card has scrolled past, the widget goes back to the fixed corner so the chat
   stays reachable down the rest of the page; the slot holds the height the
   launcher had, so that handover shifts no layout.

   .edb-chat-box is its own fixed box, positioned against the viewport, so the
   open dialog looks the same whichever state the launcher is in. */
.edb-launcher-slot {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.edb-chat-widget.edb-launcher-parked {
  position: static;
  bottom: auto;
  right: auto;
}

/* Floating Launcher Button */
.edb-chat-launcher {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #0A1C30;
  color: #FFFFFF;
  border: 2px solid #FF7518;
  border-radius: 36px;
  padding: 8px 18px 8px 10px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(10, 28, 48, 0.35);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, background 0.2s ease;
  outline: none;
  min-height: 48px;
}

.edb-chat-launcher:hover {
  background: #06111D;
  border-color: #FFA05C;
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(10, 28, 48, 0.45);
}

.edb-chat-launcher:active {
  transform: translateY(0);
}

.edb-launcher-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #FF7518;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0A1C30;
  flex-shrink: 0;
  position: relative;
  transition: background 0.2s ease, transform 0.2s ease;
}

.edb-chat-launcher:hover .edb-launcher-icon {
  background: #FFA05C;
  transform: scale(1.05);
}

.edb-launcher-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.edb-launcher-pulse {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  background: #10B981;
  border: 2px solid #0A1C30;
  border-radius: 50%;
  animation: edb-pulse 2s infinite;
}

@keyframes edb-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.edb-launcher-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.edb-launcher-title {
  font-family: 'Segoe UI', ui-sans-serif, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: #FFFFFF;
}

.edb-launcher-sub {
  font-size: 0.74rem;
  color: #FFD4B2;
  line-height: 1.25;
}

/* Chat Dialog Window */
.edb-chat-box {
  position: fixed;
  bottom: 86px;
  right: 24px;
  width: 395px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 110px);
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(10, 28, 48, 0.28), 0 0 0 1px rgba(10, 28, 48, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10000;
}

.edb-chat-box.edb-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Header */
.edb-chat-header {
  background: #0A1C30;
  color: #FFFFFF;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid #FF7518;
  position: relative;
}

.edb-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.edb-header-avatar {
  width: 40px;
  height: 40px;
  background: #FF7518;
  border: 2px solid #FFFFFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Segoe UI', ui-sans-serif, -apple-system, sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: #0A1C30;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.edb-header-titles h4 {
  margin: 0;
  font-family: 'Segoe UI', ui-sans-serif, -apple-system, sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #FFFFFF;
  line-height: 1.15;
}

.edb-header-status {
  font-size: 0.72rem;
  color: #FFD4B2;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.edb-status-dot {
  width: 7px;
  height: 7px;
  background: #10B981;
  border-radius: 50%;
  display: inline-block;
}

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

.edb-btn-icon {
  background: transparent;
  border: none;
  color: #FFD4B2;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.edb-btn-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
}

/* Chat Body */
.edb-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #FFF8F2;
  scroll-behavior: smooth;
}

/* Messages */
.edb-msg {
  display: flex;
  max-width: 90%;
  font-size: 0.88rem;
  line-height: 1.45;
  animation: edbFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes edbFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.edb-msg.edb-bot {
  align-self: flex-start;
}

.edb-msg.edb-user {
  align-self: flex-end;
}

.edb-msg-bubble {
  padding: 12px 15px;
  border-radius: 14px;
  word-break: break-word;
}

.edb-msg.edb-bot .edb-msg-bubble {
  background: #FFFFFF;
  color: #0A1C30;
  border: 1px solid rgba(10, 28, 48, 0.1);
  border-bottom-left-radius: 3px;
  box-shadow: 0 2px 6px rgba(10, 28, 48, 0.05);
}

.edb-msg.edb-user .edb-msg-bubble {
  background: #0A1C30;
  color: #FFFFFF;
  border-bottom-right-radius: 3px;
  box-shadow: 0 4px 12px rgba(10, 28, 48, 0.2);
  font-weight: 500;
}

/* Quick Option Buttons */
.edb-options-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  width: 100%;
}

.edb-option-btn {
  background: #FFFFFF;
  border: 1px solid rgba(10, 28, 48, 0.18);
  border-radius: 10px;
  padding: 12px 14px;
  min-height: 48px;
  color: #0A1C30;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  transition: all 0.18s ease;
  box-shadow: 0 2px 4px rgba(10, 28, 48, 0.04);
}

.edb-option-btn:hover {
  background: #FFF2E6;
  border-color: #FF7518;
  color: #A64E15;
  transform: translateX(3px);
  box-shadow: 0 4px 10px rgba(255, 117, 24, 0.15);
}

.edb-option-btn span {
  color: #FF7518;
  font-weight: 700;
  transition: transform 0.18s ease;
}

.edb-option-btn:hover span {
  transform: translateX(3px);
}

.edb-option-btn.edb-highlight {
  border-color: rgba(255, 117, 24, 0.5);
  background: #FFF5EC;
}

.edb-option-btn.edb-highlight:hover {
  background: #FFE8D6;
  border-color: #FF7518;
}

/* Call Card */
.edb-call-card {
  background: #FFFFFF;
  border: 2px solid #FF7518;
  border-radius: 12px;
  padding: 16px;
  margin: 6px 0;
  text-align: center;
  box-shadow: 0 4px 14px rgba(255, 117, 24, 0.14);
}

.edb-call-card h5 {
  margin: 0 0 6px 0;
  font-family: 'Segoe UI', ui-sans-serif, sans-serif;
  font-size: 0.96rem;
  font-weight: 700;
  color: #0A1C30;
}

.edb-call-card p {
  margin: 0 0 12px 0;
  font-size: 0.8rem;
  color: rgba(10, 28, 48, 0.72);
  line-height: 1.35;
}

.edb-call-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  background: #FF7518;
  color: #0A1C30 !important;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 11px 14px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.18s ease, transform 0.18s ease;
  box-shadow: 0 4px 12px rgba(255, 117, 24, 0.25);
}

.edb-call-btn:hover {
  background: #E65F00;
  color: #FFFFFF !important;
  transform: translateY(-1px);
}

/* Form Card */
.edb-form-card {
  background: #FFFFFF;
  border: 1px solid rgba(10, 28, 48, 0.16);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(10, 28, 48, 0.08);
  width: 100%;
}

.edb-input-field {
  margin-bottom: 12px;
}

.edb-input-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #0A1C30;
  margin-bottom: 4px;
}

.edb-input-field input,
.edb-input-field select,
.edb-input-field textarea {
  width: 100%;
  border: 1px solid rgba(10, 28, 48, 0.22);
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 48px;
  font-size: 0.88rem;
  font-family: inherit;
  color: #0A1C30;
  background: #FDFEFE;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.edb-input-field textarea {
  min-height: 72px;
  resize: vertical;
}

.edb-input-field input:focus,
.edb-input-field select:focus,
.edb-input-field textarea:focus {
  outline: none;
  border-color: #FF7518;
  box-shadow: 0 0 0 3px rgba(255, 117, 24, 0.2);
}

.edb-submit-btn {
  width: 100%;
  min-height: 48px;
  background: #0A1C30;
  color: #FFFFFF;
  border: 2px solid #0A1C30;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
  box-shadow: 0 4px 12px rgba(10, 28, 48, 0.25);
  margin-top: 4px;
}

.edb-submit-btn:hover {
  background: #FF7518;
  border-color: #FF7518;
  color: #0A1C30;
  transform: translateY(-1px);
}

.edb-submit-btn:disabled {
  background: #94A3B8;
  border-color: #94A3B8;
  color: #FFFFFF;
  cursor: not-allowed;
  transform: none;
}

/* Success Card */
.edb-success-card {
  background: #ECFDF5;
  border: 1px solid #10B981;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  color: #065F46;
  margin: 6px 0;
}

.edb-success-card h5 {
  margin: 0 0 4px 0;
  font-size: 0.96rem;
  font-weight: 800;
  color: #047857;
}

.edb-success-card p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

/* Footer */
.edb-chat-footer {
  background: #FFFFFF;
  border-top: 1px solid rgba(10, 28, 48, 0.1);
  padding: 12px 16px;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(10, 28, 48, 0.72);
}

.edb-chat-footer a {
  color: #A64E15;
  font-weight: 700;
  text-decoration: underline;
  display: inline-block;
  min-height: 24px;
  padding: 2px 4px;
}

.edb-chat-footer a:hover {
  color: #FF7518;
}

/* ============================================================
   MOBILE VIEWPORT OPTIMIZATIONS
   "ensure the mobile view just show the chat icon"
   ============================================================ */
@media (max-width: 768px) {
  .edb-chat-widget {
    /* Sit cleanly above the 60px mobile call-bar with padding. */
    bottom: calc(var(--call-bar-h, 60px) + 16px);
    right: 16px;
  }

  /* Show ONLY the circular chat icon on mobile */
  .edb-launcher-text {
    display: none !important;
  }

  .edb-chat-launcher {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 25px rgba(10, 28, 48, 0.4);
  }

  .edb-launcher-icon {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: transparent;
    color: #FF7518;
  }

  .edb-chat-launcher:hover .edb-launcher-icon {
    background: transparent;
    transform: none;
    color: #FFA05C;
  }

  .edb-launcher-icon svg {
    width: 26px;
    height: 26px;
  }

  .edb-launcher-pulse {
    top: 2px;
    right: 2px;
  }

  /* Full screen / modal experience on mobile devices */
  .edb-chat-box {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }

  .edb-chat-header {
    padding: 14px 16px;
  }

  /* The chat is a full-screen modal here, but the sticky site header still
     paints over its top edge: .edb-chat-box sits inside .edb-chat-widget
     (z-index: 99), which caps it below .site-header (z-index: 100) no matter
     how high its own z-index goes. Hide the header while the chat is open.
     visibility (not display) keeps the header in flow, so closing the chat
     can't shift the page the user scrolled to. */
  body.edb-chat-open .site-header {
    visibility: hidden;
  }
}
