/* WhatsApp — PC: sağ alt yüzen kedi; mobil: yalnızca alt şerit */

#equsto-contact-fab,
.equsto-contact-fab:not(#eq-bottom-tabbar *) {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 9999;
  width: auto;
  height: auto;
  max-width: 80px;
  max-height: 80px;
  pointer-events: none;
  box-sizing: border-box;
}

.equsto-contact-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 9999;
  pointer-events: none;
}

.equsto-contact-fab .equsto-contact-wa-fab {
  pointer-events: auto;
}

.equsto-contact-wa-fab:not(.equsto-contact-wa-fab--tabbar) {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(18, 140, 126, 0.45);
  border-radius: 16px;
  background: #25d366;
  cursor: pointer;
  line-height: 0;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.equsto-contact-wa-fab:not(.equsto-contact-wa-fab--tabbar):hover {
  transform: scale(1.04);
  background: #20bd5a;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0, 0, 0, 0.1);
}

.equsto-contact-wa-fab:not(.equsto-contact-wa-fab--tabbar):active {
  transform: scale(0.98);
}

.equsto-contact-wa-fab:not(.equsto-contact-wa-fab--tabbar) {
  flex: 0 0 auto;
  width: auto;
  height: auto;
  max-width: 64px;
  max-height: 64px;
  overflow: hidden;
}

.equsto-contact-wa-fab:not(.equsto-contact-wa-fab--tabbar) img {
  display: block;
  width: 62px;
  height: 62px;
  max-width: 62px;
  max-height: 62px;
  border-radius: 15px;
  object-fit: cover;
  background: #25d366;
}

@media (max-width: 768px) {
  body:not(.admin-app):not(.eq-pfos) #equsto-contact-fab,
  body:not(.admin-app):not(.eq-pfos) .equsto-contact-fab:not(#eq-bottom-tabbar *) {
    display: none !important;
    pointer-events: none !important;
  }
  body.eq-pfos:not(.admin-app) #equsto-contact-fab,
  body.eq-pfos:not(.admin-app) .equsto-contact-fab:not(#eq-bottom-tabbar *) {
    display: flex !important;
    pointer-events: none !important;
  }
}

body.eq-wa-in-tabbar:not(.admin-app) #equsto-contact-fab {
  display: none !important;
  pointer-events: none !important;
}

/* Alt şerit: diğer ikonlarla aynı çizgi stili (kedi görseli yok) */
.equsto-contact-wa-fab.equsto-contact-wa-fab--tabbar {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.equsto-contact-wa-fab--tabbar {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ── WhatsApp mobil sohbet arayüzü (Mr. Equsto modal) ── */

.equsto-wa-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10050;
  pointer-events: none;
}

.equsto-wa-overlay:not(.equsto-wa-overlay--open) {
  display: none !important;
  pointer-events: none !important;
}

.equsto-wa-overlay.equsto-wa-overlay--open {
  display: block;
  pointer-events: auto;
}

.equsto-wa-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: transparent;
  cursor: pointer;
}

.equsto-wa-modal {
  --wa-header: #008069;
  --wa-header-dark: #075e54;
  --wa-chat-bg: #efeae2;
  --wa-sent: #d9fdd3;
  --wa-received: #ffffff;
  --wa-input-bar: #f0f2f5;
  --wa-compose-field: #ffffff;
  --wa-meta: rgba(17, 27, 33, 0.45);
  --wa-font: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  position: absolute;
  left: auto;
  top: auto;
  right: 16px;
  bottom: 90px;
  transform: none;
  width: min(440px, calc(100vw - 16px));
  height: min(720px, calc(100dvh - 100px));
  max-height: min(90dvh, 932px);
  min-height: 480px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--wa-chat-bg);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(11, 20, 26, 0.28);
  z-index: 2;
  font-family: var(--wa-font);
}

.equsto-wa-modal-head {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  min-height: 59px;
  padding: 10px 8px 10px 4px;
  background: var(--wa-header);
  color: #ffffff;
}

.equsto-wa-back {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #ffffff;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.equsto-wa-back:hover {
  background: rgba(255, 255, 255, 0.08);
}

.equsto-wa-head-profile {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 6px;
}

.equsto-wa-ico {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  overflow: hidden;
}

.equsto-wa-ico--cat {
  background: #dfe5e7;
  border: none;
}

.equsto-wa-ico-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.equsto-wa-head-text {
  flex: 1;
  min-width: 0;
}

.equsto-wa-title {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  font-family: inherit;
  letter-spacing: 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.equsto-wa-subtitle {
  margin: 1px 0 0;
  font-size: 13px;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.equsto-wa-head-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.equsto-wa-head-btn {
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.equsto-wa-head-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.equsto-wa-head-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

.equsto-wa-close-x,
.equsto-wa-head-btn--menu {
  /* menü = kapat */
}

.equsto-wa-login-gate {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 20px 22%;
  min-height: 0;
  background-color: var(--wa-chat-bg, #efeae2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300' viewBox='0 0 300 300'%3E%3Cg fill='%23d1c7bc' fill-opacity='0.22'%3E%3Ccircle cx='40' cy='40' r='8'/%3E%3Ccircle cx='140' cy='90' r='6'/%3E%3Ccircle cx='240' cy='50' r='7'/%3E%3Ccircle cx='80' cy='180' r='5'/%3E%3Ccircle cx='200' cy='200' r='8'/%3E%3Ccircle cx='260' cy='260' r='6'/%3E%3Cpath d='M20 120h16v16H20zM170 20h12v12h-12zM110 240h14v14h-14z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 412px 412px;
  box-sizing: border-box;
}

.equsto-wa-login-gate__panel {
  width: 100%;
  max-width: 280px;
  text-align: center;
  background: transparent;
}

.equsto-wa-login-gate__btn {
  display: inline-block;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
  background: #001e50;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s ease;
  box-sizing: border-box;
}

.equsto-wa-login-gate__btn:hover {
  background: #003080;
  color: #fff;
  text-decoration: none;
}

.equsto-wa-login-gate__note {
  margin: 16px 0 0;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
}

.equsto-wa-login-gate__register {
  color: #001e50;
  font-weight: 600;
  text-decoration: none;
}

.equsto-wa-login-gate__register:hover {
  text-decoration: underline;
  color: #003080;
}

.equsto-wa-phone-gate__note {
  margin: 0 0 14px;
  text-align: center;
}

.equsto-wa-modal-body {
  flex: 1;
  min-height: 0;
  position: relative;
  background: var(--wa-chat-bg);
  display: flex;
  flex-direction: column;
}

.equsto-wa-spinner-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wa-chat-bg);
}

.equsto-wa-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(0, 128, 105, 0.15);
  border-top-color: var(--wa-header);
  border-radius: 50%;
  animation: equsto-wa-spin 0.75s linear infinite;
}

@keyframes equsto-wa-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .equsto-wa-spinner {
    animation: none;
    border-top-color: #8696a0;
  }
}

.equsto-wa-pane {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.equsto-wa-guest {
  flex: 1;
  display: none;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  text-align: left;
  min-height: 340px;
  padding: 20px 18px 24px;
  gap: 12px;
  box-sizing: border-box;
}

.equsto-wa-guest-lead {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--eq-text-muted, #667781);
  text-align: center;
}

.equsto-wa-guest-login-wrap {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 12px 0 8px;
}

.equsto-wa-compose--guest {
  width: 100%;
}

.equsto-wa-login-secondary {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  text-align: center;
  color: #008069;
  text-decoration: none;
}

.equsto-wa-login-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  min-width: 160px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  color: #ffffff;
  text-decoration: none;
  background: var(--wa-header);
  border-radius: 24px;
  border: none;
  transition: background 0.15s ease;
}

.equsto-wa-login-only:hover {
  color: #ffffff;
  background: var(--wa-header-dark);
}

.equsto-wa-member {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 0;
  padding: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.equsto-wa-history-wrap {
  display: none !important;
}

.equsto-wa-chat-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  background-color: var(--wa-chat-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300' viewBox='0 0 300 300'%3E%3Cg fill='%23d1c7bc' fill-opacity='0.22'%3E%3Ccircle cx='40' cy='40' r='8'/%3E%3Ccircle cx='140' cy='90' r='6'/%3E%3Ccircle cx='240' cy='50' r='7'/%3E%3Ccircle cx='80' cy='180' r='5'/%3E%3Ccircle cx='200' cy='200' r='8'/%3E%3Ccircle cx='260' cy='260' r='6'/%3E%3Cpath d='M20 120h16v16H20zM170 20h12v12h-12zM110 240h14v14h-14z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 412px 412px;
}

.equsto-wa-chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 16px 8px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.equsto-wa-bubble {
  position: relative;
  max-width: 82%;
  margin: 1px 0;
  font-size: 14.2px;
  line-height: 19px;
  word-break: break-word;
}

.equsto-wa-bubble__inner {
  position: relative;
  display: inline-block;
  max-width: 100%;
  padding: 6px 7px 8px 9px;
  border-radius: 7.5px;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
}

.equsto-wa-bubble--user {
  align-self: flex-end;
}

.equsto-wa-bubble--user .equsto-wa-bubble__inner {
  background: var(--wa-sent);
  border-top-right-radius: 0;
}

.equsto-wa-bubble--user::after {
  content: "";
  position: absolute;
  top: 0;
  right: -8px;
  width: 8px;
  height: 13px;
  background: linear-gradient(to bottom left, var(--wa-sent) 50%, transparent 50%);
}

.equsto-wa-bubble--team {
  align-self: flex-start;
}

.equsto-wa-bubble--team .equsto-wa-bubble__inner {
  background: var(--wa-received);
  border-top-left-radius: 0;
}

.equsto-wa-bubble--team::before {
  content: "";
  position: absolute;
  top: 0;
  left: -8px;
  width: 8px;
  height: 13px;
  background: linear-gradient(to bottom right, var(--wa-received) 50%, transparent 50%);
}

.equsto-wa-bubble__text {
  display: inline;
  white-space: pre-wrap;
  vertical-align: top;
}

.equsto-wa-bubble__meta {
  float: right;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 4px 0 -4px 12px;
  vertical-align: bottom;
  position: relative;
  top: 4px;
}

.equsto-wa-bubble__time {
  font-size: 11px;
  line-height: 15px;
  color: var(--wa-meta);
  white-space: nowrap;
}

.equsto-wa-bubble__tick {
  display: inline-flex;
  align-items: center;
  color: #53bdeb;
  line-height: 0;
}

.equsto-wa-bubble__tick-svg {
  display: block;
}

.equsto-wa-compose--chat {
  flex-shrink: 0;
  padding: 4px 8px calc(4px + env(safe-area-inset-bottom, 0px));
  margin: 0;
  background: var(--wa-input-bar);
  border-top: none;
}

.equsto-wa-input-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.equsto-wa-bar-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #54656f;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.equsto-wa-bar-btn svg {
  width: 24px;
  height: 24px;
  display: block;
}

.equsto-wa-bar-btn--send {
  color: #8696a0;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.equsto-wa-bar-btn--send:disabled {
  opacity: 0.45;
  cursor: default;
}

.equsto-wa-bar-btn--send.equsto-wa-bar-btn--has-text {
  background: var(--wa-header);
  color: #ffffff;
  opacity: 1;
}

.equsto-wa-bar-btn--send.equsto-wa-bar-btn--has-text svg {
  width: 20px;
  height: 20px;
}

.equsto-wa-bar-btn--loading {
  opacity: 0.55;
  pointer-events: none;
}

.equsto-wa-input-field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.equsto-wa-msg--chat {
  width: 100%;
  box-sizing: border-box;
  min-height: 34px;
  max-height: 72px;
  padding: 7px 12px;
  font-size: 14px;
  line-height: 18px;
  font-family: inherit;
  border: none;
  border-radius: 18px;
  resize: none;
  background: var(--wa-compose-field);
  color: #111b21;
  overflow-y: auto;
}

.equsto-wa-msg--chat::placeholder {
  color: #8696a0;
}

.equsto-wa-msg--chat:focus {
  outline: none;
}

.equsto-wa-compose {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.equsto-wa-guest-hint {
  margin: 0;
  padding: 0 2px 6px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--eq-text-muted, #667781);
}

#equsto-wa-logout,
.equsto-wa-logout {
  display: none !important;
}

.equsto-wa-login-cta[hidden] {
  display: none !important;
}

.equsto-wa-login-cta {
  margin-top: 2px;
  padding: 8px 10px;
  font-size: 12px;
  font-family: inherit;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-weight: 500;
  color: #008069;
  cursor: pointer;
  text-align: center;
}

.equsto-wa-label {
  font-size: 12px;
  font-weight: 600;
  color: #54656f;
}

.equsto-wa-msg {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.45;
  font-family: inherit;
  border: none;
  border-radius: 21px;
  resize: vertical;
  min-height: 120px;
  background: var(--wa-compose-field);
}

.equsto-wa-status {
  margin: 2px 8px 0;
  min-height: 0;
  font-size: 11px;
  line-height: 1.35;
  color: #667781;
  text-align: center;
}

.equsto-wa-status--ok {
  color: #008069;
}

.equsto-wa-status--err {
  color: #ea0038;
}

.equsto-wa-handoff-link {
  color: #008069;
  font-weight: 500;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.equsto-wa-go {
  display: none;
}

@media (max-width: 768px) {
  .equsto-wa-modal {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    min-height: 0;
    border-radius: 0;
    right: auto !important;
    bottom: auto !important;
    box-shadow: none;
  }
}

html[data-theme="dark"] .equsto-wa-modal {
  --wa-header: #202c33;
  --wa-header-dark: #111b21;
  --wa-chat-bg: #0b141a;
  --wa-sent: #005c4b;
  --wa-received: #202c33;
  --wa-input-bar: #202c33;
  --wa-compose-field: #2a3942;
  --wa-meta: rgba(233, 237, 239, 0.63);
}

html[data-theme="dark"] .equsto-wa-modal-body,
html[data-theme="dark"] .equsto-wa-spinner-wrap {
  background: var(--wa-chat-bg);
}

html[data-theme="dark"] .equsto-wa-msg,
html[data-theme="dark"] .equsto-wa-msg--chat {
  color: #e9edef;
}

html[data-theme="dark"] .equsto-wa-bubble--user .equsto-wa-bubble__inner {
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.35);
}

html[data-theme="dark"] .equsto-wa-bubble--team .equsto-wa-bubble__inner {
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.35);
}

html[data-theme="dark"] .equsto-wa-bar-btn {
  color: #8696a0;
}

html[data-theme="dark"] .equsto-wa-bar-btn--send.equsto-wa-bar-btn--has-text {
  background: #008069;
  color: #ffffff;
}
