/* زر الفتح */
#effa-fab {
  position: fixed;
  bottom: 90px;
  right: 18px;
  background: #111;
  color: #fff;
  border-radius: 999px;
  padding: 12px 16px;
  cursor: pointer;
  border: 0;
  font-size: 14px;
  z-index: 2147483647 !important;
  pointer-events: auto !important;
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Portal */
#effa-portal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483647 !important;
  display: none;
  pointer-events: none;
}
#effa-portal.open { display: block; pointer-events: auto; }

/* الخلفية */
#effa-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.25);
  z-index: 1 !important;
}

/* الشات */
#effa-chat {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 360px;
  max-width: calc(100vw - 24px);
  height: 72vh;
  max-height: 560px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2 !important;
  pointer-events: auto !important;
}
#effa-chat, #effa-chat * { pointer-events: auto !important; }

/* الهيدر */
.effa-header {
  background: #111;
  color: #fff;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.effa-title { font-weight: 900; }
#effa-close {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

/* Quickbar */
#effa-chat .effa-quickbar{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  padding:10px 12px;
  background:#111;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
#effa-chat .effa-quick-btn{
  appearance:none !important;
  -webkit-appearance:none !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  background: rgba(255,255,255,.10) !important;
  color: #fff !important;
  border-radius: 999px !important;
  padding: 9px 12px !important;
  font-size: 13px !important;
  line-height: 1 !important;
  font-weight: 900 !important;
  cursor: pointer !important;
}
#effa-chat .effa-quick-btn:active{ transform: scale(.98) !important; }

/* جسم المحادثة */
.effa-body {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}

/* الرسائل */
.msg { margin-bottom: 10px; display: flex; }
.msg span {
  padding: 10px 14px;
  border-radius: 20px;
  max-width: 86%;
  word-break: break-word;
  font-size: 15px;
  line-height: 1.45;
}
.msg.user { justify-content: flex-end; }
.msg.user span { background: #111; color: #fff; }
.msg.bot span { background: #f2f2f2; color: #111; }

.typing { font-size: 13px; color: #666; margin: 4px 0 10px; }

/* الإدخال */
.effa-input {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-top: 1px solid #eee;
  background: #fff;
}
.effa-input textarea {
  flex: 1;
  border: 2px solid #e8e8e8;
  border-radius: 12px;
  padding: 12px;
  outline: none;
  font-size: 16px;
  resize: none;
  background: #fff;
  line-height: 1.4;
  height: 44px;
  overflow-y: auto;
  -webkit-appearance: none;
}
.effa-input button {
  border: 0;
  border-radius: 12px;
  background: #111;
  color: #fff;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 900;
}

/* Product card */
.effa-card{
  border:1px solid #eee;
  border-radius:14px;
  padding:10px;
  display:flex;
  gap:10px;
  align-items:center;
  max-width: 100%;
  background:#fff;
}
.effa-card img{
  width:64px;
  height:64px;
  object-fit:cover;
  border-radius:12px;
  border:1px solid #f0f0f0;
  background:#f7f7f7;
}
.effa-card-name{ font-weight:900; margin-bottom:4px; }
.effa-card-price{ color:#111; opacity:.85; margin-bottom:6px; }
.effa-card-link{
  display:inline-block;
  background:#111;
  color:#fff;
  padding:8px 10px;
  border-radius:10px;
  text-decoration:none;
  font-weight:900;
  font-size:13px;
}

/* Choices */
#effa-chat .effa-choices{
  display:flex !important;
  gap:10px !important;
  flex-wrap:wrap !important;
  margin-top:8px;

  max-height: 180px;
  overflow-y: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
.effa-choice-btn{
  appearance:none !important;
  -webkit-appearance:none !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  background:#111 !important;
  color:#fff !important;
  border:1px solid rgba(0,0,0,0.25) !important;
  padding:10px 14px !important;
  border-radius:999px !important;
  font-size:14px !important;
  line-height:1 !important;
  min-height:38px !important;
  cursor:pointer !important;
}
.effa-choice-btn:active{ transform:scale(.98); }

/* CTA */
.effa-cta-btn{
  padding:12px 16px;
  border-radius:999px;
  border:0;
  background:#111;
  color:#fff;
  font-size:14px;
  font-weight: 900;
  cursor:pointer;
}

/* Blocks */
#effa-chat .effa-block{ margin-top:10px; }
#effa-chat .effa-block-title{ font-weight:900; margin:8px 0; font-size: 14px; }
#effa-chat .effa-block-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
#effa-chat .effa-mini-card{
  display:block;
  text-decoration:none;
  color:#111;
  background:#fff;
  border:1px solid #eee;
  border-radius:14px;
  overflow:hidden;
  padding:10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
}
#effa-chat .effa-mini-card img{
  width:100%;
  height:110px;
  object-fit:cover;
  border-radius:12px;
  border:1px solid #f0f0f0;
  background:#f7f7f7;
}
#effa-chat .effa-mini-name{ font-weight:900; margin-top:8px; font-size:13px; line-height:1.35; }
#effa-chat .effa-mini-price{ opacity:.85; margin-top:4px; font-size:13px; }
#effa-chat .effa-mini-cta{
  margin-top:8px;
  display:inline-block;
  background:#111;
  color:#fff;
  padding:8px 10px;
  border-radius:10px;
  font-weight:900;
  font-size:13px;
}

/* فروع كروت */
#effa-chat .effa-branches{
  display:grid;
  gap:10px;
  width:100%;
}
#effa-chat .effa-branch-card{
  background:#fff;
  border:1px solid #eee;
  border-radius:14px;
  padding:12px;
  box-shadow:0 6px 18px rgba(0,0,0,.06);
}
#effa-chat .effa-branch-name{
  font-weight:900;
  font-size:14px;
  margin-bottom:4px;
}
#effa-chat .effa-branch-addr{
  color:#444;
  font-size:13px;
  line-height:1.4;
  margin-bottom:10px;
}
#effa-chat .effa-branch-actions{
  display:flex;
  flex-direction:column;
  gap:8px;
}
#effa-chat .effa-branch-btn{
  display:block;
  text-decoration:none;
  text-align:center;
  background:#111;
  color:#fff;
  padding:10px 12px;
  border-radius:12px;
  font-weight:900;
  font-size:13px;
}
#effa-chat .effa-branch-btn.outline{
  background:#fff;
  color:#111;
  border:1px solid #ddd;
}

/* زر تغيير المدينة */
#effa-chat .effa-change-city{
  appearance:none !important;
  -webkit-appearance:none !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;

  border: 1px solid rgba(0,0,0,0.15) !important;
  background: #fff !important;
  color: #111 !important;

  padding: 10px 14px !important;
  border-radius: 999px !important;
  font-size: 14px !important;
  line-height: 1 !important;
  font-weight: 900 !important;
  cursor: pointer !important;
}
#effa-chat .effa-change-city:active{
  transform: scale(.98);
}

/* Scrollbar choices */
#effa-chat .effa-choices::-webkit-scrollbar{ width: 8px; }
#effa-chat .effa-choices::-webkit-scrollbar-thumb{
  background: rgba(0,0,0,.15);
  border-radius: 999px;
}
#effa-chat .effa-choices::-webkit-scrollbar-track{ background: transparent; }

/* موبايل */
@media (max-width: 420px){
  #effa-chat{
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 12px;
  }
  #effa-chat .effa-choice-btn{
    padding: 12px 14px !important;
    font-size: 15px !important;
    min-height: 42px !important;
  }
}
