/* Studio Nafay Master Sales Closer — website chat widget styles.
   Black & white luxury: white panel, black header, black advisor bubbles,
   light-grey visitor bubbles. System serif for the brand name,
   system sans-serif for messages. No external fonts, no external images. */

.sn-sc-widget {
  position: fixed;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #111111;
  direction: ltr;
  text-align: left;
}

.sn-sc-widget[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

/* ---------- Bubble ---------- */

.sn-sc-bubble {
  position: fixed;
  right: 20px;
  bottom: 88px;
  width: 60px;
  height: 60px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #111111;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sn-sc-bubble:hover,
.sn-sc-bubble:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
  outline: 2px solid #111111;
  outline-offset: 2px;
}

.sn-sc-widget[dir="rtl"] .sn-sc-bubble {
  right: auto;
  left: 20px;
}

/* ---------- Avatar monogram (CSS circle — no external photo) ---------- */

.sn-sc-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: #ffffff;
  color: #111111;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid #111111;
  user-select: none;
  overflow: hidden;
}

/* Real advisor portrait fills the circle (falls back to the letter). */
.sn-sc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.sn-sc-avatar--bubble {
  width: 44px;
  height: 44px;
  font-size: 17px;
}

.sn-sc-avatar--header {
  width: 42px;
  height: 42px;
  font-size: 15px;
  background: #ffffff;
}

.sn-sc-avatar--msg {
  width: 30px;
  height: 30px;
  font-size: 11px;
  margin-top: 2px;
  background: #ffffff;
}

/* ---------- Green Online dot ---------- */

.sn-sc-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #ffffff;
}

.sn-sc-bubble .sn-sc-dot {
  right: 2px;
  bottom: 2px;
}

.sn-sc-widget[dir="rtl"] .sn-sc-bubble .sn-sc-dot {
  right: auto;
  left: 2px;
}

.sn-sc-dot--online {
  position: static;
  width: 8px;
  height: 8px;
  border: none;
  display: inline-block;
  margin-right: 5px;
  vertical-align: middle;
}

.sn-sc-widget[dir="rtl"] .sn-sc-dot--online {
  margin-right: 0;
  margin-left: 5px;
}

/* ---------- Panel ---------- */

.sn-sc-panel {
  position: fixed;
  right: 20px;
  bottom: 160px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 540px;
  /* bottom: 160px + 20px top margin = panel must fit in 100vh - 180px,
     otherwise the header is cut off at the top on short laptop screens. */
  max-height: calc(100vh - 180px);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.sn-sc-widget[dir="rtl"] .sn-sc-panel {
  right: auto;
  left: 20px;
}

.sn-sc-panel--hidden {
  display: none;
}

/* ---------- Header ---------- */

.sn-sc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 12px;
  background: #111111;
  color: #ffffff;
  flex-shrink: 0;
}

.sn-sc-header-text {
  flex: 1;
  min-width: 0;
}

.sn-sc-brand {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: #ffffff;
}

.sn-sc-advisor-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sn-sc-online {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: #bdbdbd;
}

.sn-sc-online-text {
  line-height: 1;
}

.sn-sc-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.sn-sc-close:hover,
.sn-sc-close:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  outline: none;
}

/* ---------- Product context line ---------- */

.sn-sc-product {
  padding: 9px 14px;
  background: #f7f7f7;
  border-bottom: 1px solid #eeeeee;
  font-size: 12.5px;
  font-weight: 600;
  color: #111111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

/* ---------- Messages ---------- */

.sn-sc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sn-sc-msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  max-width: 100%;
}

.sn-sc-msg--visitor {
  justify-content: flex-end;
}

.sn-sc-widget[dir="rtl"] .sn-sc-msg--visitor {
  justify-content: flex-start;
}

.sn-sc-bubble-text {
  max-width: 78%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Advisor: black bubble, white text. */
.sn-sc-msg--advisor .sn-sc-bubble-text {
  background: #111111;
  color: #ffffff;
  border-bottom-left-radius: 4px;
}

.sn-sc-widget[dir="rtl"] .sn-sc-msg--advisor .sn-sc-bubble-text {
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 4px;
}

/* Visitor: light-grey bubble, dark text. */
.sn-sc-msg--visitor .sn-sc-bubble-text {
  background: #f0f0f0;
  color: #111111;
  border-bottom-right-radius: 4px;
}

.sn-sc-widget[dir="rtl"] .sn-sc-msg--visitor .sn-sc-bubble-text {
  border-bottom-right-radius: 16px;
  border-bottom-left-radius: 4px;
}

/* ---------- Typing indicator ---------- */

.sn-sc-typing {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 16px 10px;
  font-size: 12.5px;
  font-style: italic;
  color: #666666;
  background: #ffffff;
  flex-shrink: 0;
}

.sn-sc-typing--hidden {
  display: none;
}

.sn-sc-typing-dots {
  letter-spacing: 2px;
  animation: sn-sc-blink 1.2s ease-in-out infinite;
}

@keyframes sn-sc-blink {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

/* ---------- Payment link ---------- */

.sn-sc-payment {
  max-width: 78%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sn-sc-payment-btn {
  display: block;
  padding: 12px 14px;
  background: #111111;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  border-radius: 12px;
  border: 1px solid #111111;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.sn-sc-payment-btn:hover,
.sn-sc-payment-btn:focus-visible {
  background: #000000;
  outline: 2px solid #111111;
  outline-offset: 2px;
}

.sn-sc-payment-note {
  font-size: 11.5px;
  line-height: 1.5;
  color: #666666;
}

/* ---------- Contact capture ---------- */

.sn-sc-capture {
  padding: 10px 14px;
  border-top: 1px solid #eeeeee;
  background: #fafafa;
  flex-shrink: 0;
}

.sn-sc-capture--hidden {
  display: none;
}

.sn-sc-capture-title {
  font-size: 13px;
  font-weight: 600;
  color: #111111;
  margin-bottom: 8px;
}

.sn-sc-capture-row {
  display: flex;
  gap: 8px;
}

.sn-sc-capture-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: #111111;
  background: #ffffff;
  outline: none;
}

.sn-sc-capture-input:focus {
  border-color: #111111;
}

.sn-sc-capture-btn {
  flex-shrink: 0;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: #111111;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.sn-sc-capture-btn:hover,
.sn-sc-capture-btn:focus-visible {
  background: #000000;
  outline: none;
}

/* ---------- Input row ---------- */

.sn-sc-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #eeeeee;
  background: #ffffff;
  flex-shrink: 0;
}

.sn-sc-input {
  flex: 1;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid #d9d9d9;
  border-radius: 24px;
  font-size: 14px;
  font-family: inherit;
  color: #111111;
  background: #ffffff;
  outline: none;
}

.sn-sc-input:focus {
  border-color: #111111;
}

.sn-sc-send {
  flex-shrink: 0;
  padding: 11px 18px;
  border: none;
  border-radius: 24px;
  background: #111111;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.sn-sc-send:hover,
.sn-sc-send:focus-visible {
  background: #000000;
  outline: none;
}

/* ---------- Responsive: mobile ---------- */

@media (max-width: 480px) {
  .sn-sc-bubble {
    right: 14px;
    bottom: 88px;
    width: 56px;
    height: 56px;
  }

  .sn-sc-widget[dir="rtl"] .sn-sc-bubble {
    right: auto;
    left: 14px;
  }

  .sn-sc-panel {
    right: 8px;
    left: 8px;
    bottom: 156px;
    width: auto;
    max-width: none;
    height: 68vh;
    /* bottom: 156px + 20px top margin — same cut-off fix as desktop. */
    max-height: calc(100vh - 176px);
    border-radius: 14px;
  }

  .sn-sc-widget[dir="rtl"] .sn-sc-panel {
    right: 8px;
    left: 8px;
  }

  .sn-sc-bubble-text {
    max-width: 82%;
  }

  .sn-sc-payment {
    max-width: 82%;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .sn-sc-typing-dots {
    animation: none;
  }

  .sn-sc-bubble {
    transition: none;
  }
}
