/* مبدّل مزوّد الخريطة — يتبع هوية الموقع (أخضر داكن #173F3A على أبيض) */

.amtar-mps {
  position: absolute;
  z-index: 600;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: #fff;
  border: 1px solid rgba(221, 227, 231, .9);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(11, 44, 58, .12);
  font-family: inherit;
  direction: rtl;
  max-width: calc(100% - 24px);
}

.amtar-mps-btn {
  appearance: none;
  border: none;
  background: none;
  color: #5b6067;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  padding: 9px 14px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .18s ease, color .18s ease;
}

.amtar-mps-btn:hover:not(.is-active):not(:disabled) {
  background: #F1F5F9;
  color: #16211F;
}

.amtar-mps-btn.is-active {
  background: #173F3A;
  color: #fff;
}

.amtar-mps-btn:disabled {
  cursor: default;
}

.amtar-mps-btn:focus-visible {
  outline: 2px solid #173F3A;
  outline-offset: 2px;
}

/* وسم «تجريبي» يوضّح أن المزوّد قيد التجربة */
.amtar-mps-tag {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 5px;
  background: #EEF2F4;
  color: #5b6067;
}

.amtar-mps-btn.is-active .amtar-mps-tag {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

/* مؤشّر انتظار أثناء تحميل مكتبة المزوّد */
.amtar-mps-btn.is-busy::after {
  content: "";
  width: 11px;
  height: 11px;
  border: 2px solid rgba(91, 96, 103, .3);
  border-top-color: #173F3A;
  border-radius: 50%;
  animation: amtar-mps-spin .7s linear infinite;
}

@keyframes amtar-mps-spin {
  to { transform: rotate(360deg); }
}

/* رسالة الرجوع للخريطة الأساسية — تُوضَع أسفل زر التبديل مباشرةً
   (الجافاسكربت يضبط top/left) حتى تبقى في مرأى العين مهما كان طول الخريطة */
.amtar-mps-toast {
  position: absolute;
  z-index: 601;
  transform: translate(-50%, -6px);
  max-width: min(92%, 420px);
  padding: 10px 16px;
  border-radius: 10px;
  background: #16211F;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.6;
  text-align: center;
  box-shadow: 0 6px 20px rgba(11, 44, 58, .28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}

.amtar-mps-toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

/* الجوال: أصغر وأخف حتى لا يحجب الخريطة */
@media (max-width: 800px) {
  .amtar-mps { padding: 2px; border-radius: 10px; }
  .amtar-mps-btn { font-size: 11.5px; padding: 8px 11px; gap: 5px; }
  .amtar-mps-tag { display: none; }
  .amtar-mps-toast { font-size: 11.5px; padding: 9px 13px; }
}

@media (max-width: 380px) {
  .amtar-mps-btn { font-size: 11px; padding: 7px 9px; }
}

/* أثناء ملء الشاشة تبقى فوق الخريطة كبقيّة الأدوات */
:fullscreen .amtar-mps { z-index: 10001; }

@media (prefers-reduced-motion: reduce) {
  .amtar-mps-btn,
  .amtar-mps-toast { transition: none; }
  .amtar-mps-btn.is-busy::after { animation: none; }
}
