/* ==========================================================================
   Piroozi Branch Manager — Frontend Styles
   Version: 1.0.0 (clean rewrite, orange/white theme)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens (CSS Variables)
   تغییر ۸ متغیر زیر = تغییر کامل تم
   -------------------------------------------------------------------------- */
.piroozi-branch-manager {
  --pbm-primary:        #f97316;   /* نارنجی اصلی */
  --pbm-primary-hover:  #ea580c;   /* نارنجی تیره (هاور) */
  --pbm-primary-dark:   #c2410c;   /* نارنجی خیلی تیره */
  --pbm-primary-light:  #fff7ed;   /* نارنجی خیلی روشن (پس‌زمینه) */
  --pbm-primary-soft:   #fed7aa;   /* نارنجی نرم (بوردر) */

  --pbm-white:          #ffffff;
  --pbm-bg:             #fafafa;
  --pbm-text:           #1f2937;
  --pbm-text-muted:     #6b7280;
  --pbm-border:         #e5e7eb;

  --pbm-success:        #22c55e;   /* سبز (فعال) */
  --pbm-warning:        #f59e0b;   /* نارنجی (موقت) */
  --pbm-danger:         #ef4444;   /* قرمز (غیرفعال) */

  --pbm-radius-sm:      8px;
  --pbm-radius:         12px;
  --pbm-radius-lg:      16px;
  --pbm-shadow-sm:      0 1px 3px rgba(0,0,0,.06);
  --pbm-shadow:         0 4px 14px rgba(0,0,0,.08);
  --pbm-shadow-lg:      0 12px 32px rgba(0,0,0,.12);
  --pbm-transition:     .2s ease;

  box-sizing: border-box;
  font-family: inherit;   /* ← ارث‌بری از فونت سایت */
  color: var(--pbm-text);
  background: var(--pbm-white);
}
.piroozi-branch-manager *,
.piroozi-branch-manager *::before,
.piroozi-branch-manager *::after {
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   2. Map Manager — Container
   -------------------------------------------------------------------------- */
.pbm-map-manager {
  padding: 0;
  background: var(--pbm-white);
}

/* Toolbar (title + legend + search) */
.pbm-map-manager__toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(260px, 360px);
  align-items: center;
  gap: 16px;
  margin: 0 0 14px;
  padding: 10px 12px;
  background: var(--pbm-white);
  border: 1px solid var(--pbm-border);
  border-radius: var(--pbm-radius);
  box-shadow: var(--pbm-shadow-sm);
  direction: rtl;
}
.pbm-map-manager__toolbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.pbm-map-manager__toolbar-title h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  font-family: inherit;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pbm-map-manager__title-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--pbm-primary-light);
  color: var(--pbm-primary);
  flex: 0 0 34px;
}
.pbm-map-manager__title-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Legend */
.pbm-map-manager__legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  align-items: center;
  margin: 0;
  padding: 0;
  white-space: nowrap;
  font-family: inherit;
  font-size: 13px;
}
.pbm-map-manager__legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pbm-legend-dot,
.pbm-branch-card__status i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 12px;
}
.is-active,
.status-active .pbm-legend-dot,
.pbm-branch-card__status.status-active i { background: var(--pbm-success); }
.is-temporary,
.status-temporary .pbm-legend-dot,
.pbm-branch-card__status.status-temporary i { background: var(--pbm-warning); }
.is-inactive,
.status-inactive .pbm-legend-dot,
.pbm-branch-card__status.status-inactive i { background: var(--pbm-danger); }

/* --------------------------------------------------------------------------
   3. Search Box
   -------------------------------------------------------------------------- */
.pbm-map-manager__search-wrap,
.pbm-sidebar__search-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  z-index: 50;
}
.pbm-search-input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--pbm-border);
  border-radius: var(--pbm-radius);
  background: var(--pbm-white);
  /* فاصله از راست: ۵۰px برای آیکون ×، از چپ: ۴۴px برای ذره‌بین */
  padding: 0 50px 0 44px;
  font-family: inherit;
  font-size: 14px;
  color: var(--pbm-text);
  outline: none;
  transition: border-color var(--pbm-transition), box-shadow var(--pbm-transition);
  /* جلوگیری از قطع شدن متن زیر آیکون */
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.pbm-search-input:focus {
  border-color: var(--pbm-primary);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, .12);
}
.pbm-search-input::placeholder { color: var(--pbm-text-muted); }

/* دکمه پاک کردن */
.pbm-search-clear {
  position: absolute;
  right: 12px;  /* ← کمی راست‌تر */
  left: auto;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;   /* ← کمی بزرگ‌تر */
  height: 30px;
  padding: 0;
  border: 1px solid var(--pbm-border);
  border-radius: 50%;
  background: var(--pbm-bg);
  color: var(--pbm-text-muted);
  font-family: Arial, sans-serif;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: background var(--pbm-transition), color var(--pbm-transition);
}
.pbm-search-clear:hover { background: var(--pbm-border); color: var(--pbm-text); }
.pbm-search-clear.is-empty { display: none; }

/* آیکن ذره‌بین */
.pbm-map-manager__search-wrap > span[aria-hidden] {
  position: absolute;
  left: 14px;
  right: auto;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  line-height: 1;
  color: var(--pbm-text-muted);
  pointer-events: none;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   4. Map Container
   -------------------------------------------------------------------------- */
.pbm-map-manager__body {
  display: block;
  direction: ltr;
}
.pbm-map-manager__map-wrap {
  position: relative;
  min-width: 0;
  height: 420px;
  border: 1px solid var(--pbm-border);
  border-radius: var(--pbm-radius);
  overflow: hidden;
  background: #f4ede1;
  box-shadow: var(--pbm-shadow-sm);
}
.pbm-leaflet-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: #f4ede1;
}
.pbm-leaflet-map .leaflet-tile-pane {
  filter: saturate(.75) sepia(.06) brightness(1.02);
}
.pbm-leaflet-map .leaflet-control-zoom {
  border: 0 !important;
  box-shadow: var(--pbm-shadow) !important;
}
.pbm-leaflet-map .leaflet-control-zoom a {
  width: 36px;
  height: 36px;
  line-height: 36px;
  font-size: 20px;
  border: 0 !important;
  background: var(--pbm-white);
  color: var(--pbm-text);
}
.pbm-leaflet-map .leaflet-control-attribution {
  font-size: 10px;
  background: rgba(255,255,255,.88);
  padding: 2px 5px;
}
.pbm-map-loading,
.pbm-map-error {
  position: absolute;
  z-index: 900;
  top: 14px;
  left: 14px;
  right: 14px;
  padding: 10px 14px;
  border-radius: var(--pbm-radius-sm);
  background: rgba(255,255,255,.94);
  box-shadow: var(--pbm-shadow);
  text-align: center;
  font-size: 12px;
}
.pbm-map-error {
  color: var(--pbm-danger);
  border: 1px solid #fecaca;
}
.pbm-leaflet-map.pbm-map-ready + .pbm-map-loading { display: none !important; }

/* Map pins */
.pbm-leaflet-icon {
  background: transparent !important;
  border: 0 !important;
}
.pbm-leaflet-pin {
  position: relative;
  display: block;
  width: 38px;
  height: 48px;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.26));
}
.pbm-leaflet-pin::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--pbm-success);
  border: 3px solid var(--pbm-white);
}
.pbm-leaflet-pin::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 11px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pbm-white);
  z-index: 2;
}
.pbm-leaflet-pin--temporary::before { background: var(--pbm-warning); }
.pbm-leaflet-pin--inactive::before  { background: var(--pbm-danger); }
.pbm-province-tooltip {
  font-family: inherit !important;
  font-size: 12px;
  font-weight: 700;
  color: var(--pbm-text-muted);
  border: 1px solid var(--pbm-border);
  background: rgba(255,255,255,.93);
  box-shadow: var(--pbm-shadow-sm);
  direction: rtl;
}
.pbm-map-manager__map-wrap .leaflet-container {
  font-family: inherit;
  direction: ltr;
}

/* --------------------------------------------------------------------------
   5. Modal
   -------------------------------------------------------------------------- */
.pbm-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
}
.pbm-modal.is-open { display: block; }
.pbm-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(2px);
}
.pbm-modal__dialog {
  font-family: inherit;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(360px, calc(100% - 30px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--pbm-white);
  border-radius: var(--pbm-radius-lg);
  padding: 24px;
  box-shadow: var(--pbm-shadow-lg);
  direction: rtl;
}
.pbm-modal__close {
  position: absolute;
  left: 14px;
  top: 12px;
  border: 0;
  background: transparent;
  font-size: 22px;
  color: var(--pbm-text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--pbm-transition);
}
.pbm-modal__close:hover { background: var(--pbm-bg); }
.pbm-modal__header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  margin: 0 0 10px;
  direction: rtl;
  padding-left: 28px;
}
.pbm-modal__title {
  margin: 0;
  font-size: 19px;
  line-height: 1.4;
  font-weight: 800;
}
.pbm-modal__status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
  color: var(--pbm-text-muted);
}
.pbm-modal__status::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pbm-success);
  display: inline-block;
  flex: 0 0 10px;
}
.pbm-status-temporary::before { background: var(--pbm-warning); }
.pbm-status-inactive::before  { background: var(--pbm-danger); }

.pbm-modal__rule {
  height: 1px;
  background: var(--pbm-border);
  margin: 14px 0;
}
.pbm-modal__representative,
.pbm-modal__city,
.pbm-modal__address,
.pbm-modal__phone-row,
.pbm-modal__mobile-row {
  display: block;
  font-size: 14px;
  line-height: 1.9;
  margin: 6px 0;
}
.pbm-modal__field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
  vertical-align: middle;
}
.pbm-modal__field-text {
  min-width: 0;
  word-break: break-word;
}
.pbm-modal__phone-row .pbm-modal__field-text,
.pbm-modal__mobile-row .pbm-modal__field-text {
  color: var(--pbm-text);
  text-decoration: none;
}
.pbm-svg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  min-width: 17px;
  margin: 0;
  color: var(--pbm-text-muted);
  vertical-align: middle;
}
.pbm-svg-icon svg {
  display: block;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Modal actions (call / mobile / map) */
.pbm-modal__actions {
  display: flex;
  gap: 9px;
  margin-top: 16px;
}
.pbm-action {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--pbm-primary);
  border-radius: var(--pbm-radius-sm);
  color: var(--pbm-primary) !important;
  text-decoration: none;
  background: var(--pbm-white);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  transition: background var(--pbm-transition), color var(--pbm-transition);
}
.pbm-action:hover {
  background: var(--pbm-primary-light);
}
.pbm-action--call {
  background: var(--pbm-primary);
  color: var(--pbm-white) !important;
}
.pbm-action--call:hover {
  background: var(--pbm-primary-hover);
}
.pbm-action.is-disabled {
  opacity: .55;
  cursor: not-allowed;
}
.pbm-action__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  min-width: 16px;
  flex: 0 0 16px;
}
.pbm-action__icon svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
   6. Business Hours
   -------------------------------------------------------------------------- */
.pbm-modal__hours {
  display: block;
  margin: 10px 0 14px;
  padding: 12px 13px;
  border: 1px solid var(--pbm-border);
  border-radius: var(--pbm-radius);
  background: var(--pbm-bg);
  color: var(--pbm-text-muted);
  text-align: right;
  line-height: 1.6;
}
.pbm-modal__hours.is-open {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}
.pbm-modal__hours.is-closed {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}
.pbm-hours-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
  color: inherit;
}
.pbm-hours-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 29px;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: #eceff1;
  color: #667078;
}
.pbm-modal__hours.is-open .pbm-hours-icon   { background: #dcfce7; color: #15803d; }
.pbm-modal__hours.is-closed .pbm-hours-icon { background: #fee2e2; color: #b91c1c; }
.pbm-hours-icon__svg { display: block; width: 17px; height: 17px; }
.pbm-hours-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-right: 2px;
  font-size: 13px;
  line-height: 1.5;
  white-space: normal;
}
.pbm-hours-status strong { font-weight: 800; }
.pbm-hours-dot {
  display: inline-block;
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pbm-success);
}
.pbm-modal__hours.is-closed .pbm-hours-dot { background: var(--pbm-danger); }
.pbm-hours-detail {
  display: block;
  margin-top: 5px;
  padding-right: 15px;
  font-size: 13px;
  line-height: 1.8;
  color: inherit;
  opacity: .85;
}
.pbm-hours-detail b { font-weight: 800; }

/* --------------------------------------------------------------------------
   7. Lazy Map Drawer (Accordion Toggle)
   -------------------------------------------------------------------------- */
.pbm-map-drawer-toggle {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  align-items: center;
  column-gap: 20px;
  min-height: 90px;
  margin: 16px 0 0;
  padding: 14px 18px;
  border: 1px solid var(--pbm-primary-soft);
  border-radius: var(--pbm-radius-lg);
  background: linear-gradient(105deg, var(--pbm-white) 0%, var(--pbm-primary-light) 100%);
  color: var(--pbm-text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  line-height: 1.5;
  text-align: right;
  direction: rtl;
  box-shadow: var(--pbm-shadow-sm);
  overflow: hidden;
  transition: transform var(--pbm-transition), border-color var(--pbm-transition), box-shadow var(--pbm-transition);
}
.pbm-map-drawer-toggle::before {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: 6px;
  background: linear-gradient(180deg, var(--pbm-primary) 0%, var(--pbm-accent, #fb923c) 100%);
  border-radius: 0 var(--pbm-radius-lg) var(--pbm-radius-lg) 0;
}
.pbm-map-drawer-toggle:hover {
  transform: translateY(-2px);
  border-color: var(--pbm-primary);
  box-shadow: var(--pbm-shadow);
}
.pbm-map-drawer-toggle:active { transform: translateY(0); }
.pbm-map-drawer-toggle:focus-visible {
  outline: 3px solid rgba(249, 115, 22, .18);
  outline-offset: 2px;
}
.pbm-map-drawer-toggle.is-open {
  border-color: var(--pbm-primary);
  background: linear-gradient(105deg, var(--pbm-primary-light) 0%, var(--pbm-white) 100%);
}

.pbm-map-drawer-toggle__location-icon {
  grid-column: 1;
  justify-self: end;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--pbm-primary) 0%, var(--pbm-primary-hover) 100%);
  color: var(--pbm-white);
  box-shadow: 0 6px 16px rgba(249, 115, 22, .28);
}
.pbm-map-drawer-toggle__location-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pbm-map-drawer-toggle__text {
  grid-column: 2;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 60px;
  padding: 0 20px 0 16px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.45;
  text-align: right;
  color: var(--pbm-text);
}
.pbm-map-drawer-toggle__text::before {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--pbm-primary);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, .12);
  animation: pbm-pulse 2.2s ease-in-out infinite;
}
.pbm-map-drawer-toggle__text::after {
  content: "برای مشاهده موقعیت شعب و جزئیات، کلیک کنید";
  display: block;
  margin-top: 0;
  color: var(--pbm-text-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
}
.pbm-map-drawer-toggle.is-open .pbm-map-drawer-toggle__text::after {
  content: "برای بستن نقشه، دوباره کلیک کنید";
}
.pbm-map-drawer-toggle__icon {
  grid-column: 3;
  justify-self: start;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--pbm-primary) 0%, var(--pbm-primary-dark) 100%);
  color: var(--pbm-white);
  font-size: 28px;
  line-height: 1;
  box-shadow: 0 6px 16px rgba(249, 115, 22, .28);
  transition: transform var(--pbm-transition), background var(--pbm-transition);
}
.pbm-map-drawer-toggle:hover .pbm-map-drawer-toggle__icon {
  transform: scale(1.05);
}
.pbm-map-drawer-toggle.is-open .pbm-map-drawer-toggle__icon {
  background: linear-gradient(145deg, var(--pbm-primary-dark) 0%, var(--pbm-primary-hover) 100%);
}
@keyframes pbm-pulse {
  0%, 100% { transform: scale(.75); opacity: .45; }
  50%      { transform: scale(1.15); opacity: 1; }
}

/* Drawer body */
.pbm-map-drawer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .38s ease, opacity .25s ease;
  opacity: .65;
  overflow: hidden;
}
.pbm-map-drawer.is-open { grid-template-rows: 1fr; opacity: 1; }
.pbm-map-drawer__inner {
  min-height: 0;
  overflow: hidden;
  padding-top: 0;
  transition: padding-top .38s ease;
}
.pbm-map-drawer.is-open .pbm-map-drawer__inner { padding-top: 10px; }

/* --------------------------------------------------------------------------
   8. Sidebar (Branch Cards)
   -------------------------------------------------------------------------- */
.pbm-map-manager__sidebar {
  display: none;
  background: var(--pbm-bg);
  border: 1px solid var(--pbm-border);
  border-radius: var(--pbm-radius);
  padding: 12px;
  direction: rtl;
}
.pbm-sidebar__scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 3px 4px;
  scrollbar-width: thin;
}
.pbm-branch-card {
  position: relative;
  overflow: hidden;
  background: var(--pbm-white);
  border: 1px solid var(--pbm-border);
  border-radius: var(--pbm-radius);
  padding: 13px 14px 12px 16px;
  margin: 0 0 10px;
  box-shadow: var(--pbm-shadow-sm);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  direction: rtl;
}
.pbm-branch-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 5px;
  background: var(--pbm-success);
}
.pbm-branch-card[data-status="temporary"]::before { background: var(--pbm-warning); }
.pbm-branch-card[data-status="inactive"]::before  { background: var(--pbm-danger); }
.pbm-branch-card:hover,
.pbm-branch-card:focus,
.pbm-branch-card.is-selected {
  transform: translateY(-1px);
  border-color: var(--pbm-primary-soft);
  box-shadow: var(--pbm-shadow);
  outline: none;
}
.pbm-branch-card__title {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin: 0 0 7px;
  padding-right: 4px;
  line-height: 1.5;
}
.pbm-branch-card__name {
  min-width: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--pbm-text);
}
.pbm-branch-card__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--pbm-text-muted);
  white-space: nowrap;
}
.pbm-branch-card__status i {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
}
.pbm-branch-card__location {
  margin: 0 0 5px;
  padding-right: 4px;
  color: var(--pbm-text-muted);
  font-size: 12px;
  line-height: 1.8;
}

/* Sidebar header (search + count) */
.pbm-sidebar__header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  height: 48px;
  margin: 0 0 10px;
  padding: 4px 6px;
  direction: rtl;
  font-family: inherit;
  visibility: visible !important;
  opacity: 1 !important;
}
.pbm-sidebar__header-main {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
}
.pbm-sidebar__header-title {
  display: block;
  margin: 0;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--pbm-text);
  white-space: nowrap;
}
.pbm-sidebar__status-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  direction: ltr;
}
.pbm-sidebar__status-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.pbm-sidebar__status-dot--active    { background: var(--pbm-success); box-shadow: 0 0 0 3px rgba(34,197,94,.12); }
.pbm-sidebar__status-dot--temporary { background: var(--pbm-warning); box-shadow: 0 0 0 3px rgba(245,158,11,.12); }
.pbm-sidebar__status-dot--inactive  { background: var(--pbm-danger);  box-shadow: 0 0 0 3px rgba(239,68,68,.12); }
.pbm-sidebar__header-count {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 34px;
  padding: 4px 10px;
  border: 1px solid var(--pbm-border);
  border-radius: var(--pbm-radius-sm);
  background: var(--pbm-white);
  box-shadow: var(--pbm-shadow-sm);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--pbm-text-muted);
  white-space: nowrap;
  visibility: visible !important;
  opacity: 1 !important;
}
.pbm-sidebar__header-count::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pbm-success);
  flex: 0 0 auto;
}
.pbm-sidebar__header-count strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 26px;
  padding: 0 6px;
  border-radius: 7px;
  background: #ecfdf5;
  color: #15803d;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}
.pbm-sidebar__header-count-label { color: var(--pbm-text-muted); }
.pbm-sidebar__header-count-unit  { display: none; }

/* --------------------------------------------------------------------------
   9. Desktop Layout (map + sidebar grid)
   -------------------------------------------------------------------------- */
@media (min-width: 801px) {
  .pbm-map-drawer .pbm-map-manager__body {
    display: grid;
    grid-template-columns: minmax(0, 28fr) minmax(0, 72fr);
    grid-template-rows: 52px 600px;
    column-gap: 12px;
    row-gap: 10px;
    direction: ltr;
    align-items: stretch;
  }
  .pbm-map-drawer .pbm-map-manager__toolbar {
    grid-column: 2;
    grid-row: 1;
    height: 52px;
    margin: 0;
    padding: 8px 10px;
    direction: rtl;
  }
  .pbm-map-drawer .pbm-map-manager__sidebar {
    grid-column: 1;
    grid-row: 1 / 3;
    display: flex !important;
    flex-direction: column;
    height: auto;
    min-height: 0;
    overflow: hidden;
  }
  .pbm-map-drawer .pbm-map-manager__sidebar > .pbm-sidebar__search-wrap {
    order: 1;
    flex: 0 0 auto;
    width: 100%;
    margin: 0 0 8px;
  }
  .pbm-map-drawer .pbm-map-manager__sidebar > .pbm-sidebar__header {
    order: 2;
    flex: 0 0 auto;
  }
  .pbm-map-drawer .pbm-map-manager__sidebar > .pbm-sidebar__scroll {
    order: 3;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }
  .pbm-map-drawer .pbm-map-manager__map-wrap {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    height: 100%;
    min-height: 600px;
    direction: ltr;
  }
}
@media (max-width: 800px) {
  .pbm-map-drawer .pbm-map-manager__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .pbm-map-drawer .pbm-map-manager__map-wrap { order: 1; width: 100%; }
  .pbm-map-drawer .pbm-map-manager__sidebar  { order: 2; display: block; width: 100%; height: auto; }
  .pbm-map-drawer .pbm-sidebar__scroll        { height: auto; max-height: 380px; overflow-y: auto; }
}

/* --------------------------------------------------------------------------
   10. Branch List Widget
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   7. Branch List Widget
   -------------------------------------------------------------------------- */
.pbm-branch-list {
  --pbm-list-gap: 16px;
  background: var(--pbm-white);
}
.pbm-branch-list__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 16px;
  padding: 0 2px;
}
.pbm-branch-list__head h2 {
  margin: 10px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--pbm-text);
}
.pbm-branch-list__head p {
  margin: 10px;
  font-size: 16px;
  color: var(--pbm-text-muted);
}
.pbm-branch-list__count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--pbm-border);
  border-radius: 999px;
  background: var(--pbm-white);
  font-size: 14px;
  font-weight: 600;
  color: var(--pbm-text-muted);
  white-space: nowrap;
}

/* ---------- Tools (search + filters) ---------- */
.pbm-branch-list__tools {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 16px;
}
.pbm-branch-list__search {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}
.pbm-branch-list__query {
  width: 100%;
  height: 44px;
  border: 1px solid var(--pbm-border);
  border-radius: var(--pbm-radius);
  background: var(--pbm-white);
  padding: 0 48px 0 14px;
  font-family: inherit;
  font-size: 13px;
  color: var(--pbm-text);
  outline: none;
  transition: border-color var(--pbm-transition), box-shadow var(--pbm-transition);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.pbm-branch-list__query:focus {
  border-color: var(--pbm-primary);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, .10);
}
.pbm-branch-list__query::placeholder {
  color: var(--pbm-text-muted);
}
/* حذف × پیش‌فرض مرورگر */
.pbm-branch-list__query::-webkit-search-cancel-button,
.pbm-branch-list__query::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

/* دکمه پاک کردن همه فیلترها (داخل فیلد جستجو، سمت راست) */
.pbm-branch-list__reset {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--pbm-border);
  border-radius: 50%;
  background: var(--pbm-bg);
  color: var(--pbm-text-muted);
  font-family: Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  transition: background var(--pbm-transition), color var(--pbm-transition), border-color var(--pbm-transition);
}
.pbm-branch-list__reset:hover {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}
.pbm-branch-list__reset:focus {
  outline: none;
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .10);
}

/* ردیف فیلترها — همه در یک خط */
.pbm-branch-list__filters {
  display: flex;
  gap: 10px;
  width: 100%;
  min-width: 0;
}
.pbm-branch-list__filter {
  flex: 1 1 0;
  min-width: 0;
  height: 44px;
  padding: 0 14px 0 36px;
  border: 1px solid var(--pbm-border);
  border-radius: var(--pbm-radius);
  background-color: var(--pbm-white);
  font-family: inherit;
  font-size: 14px;
  color: var(--pbm-text);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  background-size: 14px;
  transition: border-color var(--pbm-transition), box-shadow var(--pbm-transition);
}
.pbm-branch-list__filter:hover {
  border-color: var(--pbm-primary-soft);
}
.pbm-branch-list__filter:focus {
  outline: none;
  border-color: var(--pbm-primary);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, .10);
}

/* ---------- Grid + cards ---------- */
.pbm-branch-list__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--pbm-list-gap);
}
.pbm-branch-list__card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--pbm-white);
  border: 1px solid var(--pbm-border);
  border-radius: var(--pbm-radius);
  box-shadow: var(--pbm-shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease;
}
.pbm-branch-list__card:hover {
  transform: translateY(-2px);
  box-shadow: var(--pbm-shadow);
}
/* فیکس: hidden attribute باید بر display غلبه کنه */
.pbm-branch-list__card[hidden] {
  display: none !important;
}
.pbm-branch-list__card-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}
.pbm-branch-list__image {
  height: 140px;
  background: var(--pbm-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pbm-primary);
  font-size: 32px;
}
.pbm-branch-list__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pbm-branch-list__image-placeholder { font-size: 32px; }
.pbm-branch-list__card-body { padding: 14px; }
.pbm-branch-list__status {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  background: #ecfdf5;
  color: #15803d;
  margin-bottom: 8px;
}
.pbm-branch-list__status.status-temporary { background: #fef3c7; color: #92400e; }
.pbm-branch-list__status.status-inactive  { background: #fee2e2; color: #991b1b; }
.pbm-branch-list__card-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 800;
  color: var(--pbm-text);
}
.pbm-branch-list__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
  font-size: 13px;
  color: var(--pbm-text-muted);
}
.pbm-branch-list__address {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 4px 0;
  font-size: 13px;
  color: var(--pbm-text-muted);
  line-height: 1.7;
}
.pbm-branch-list__hours-preview {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--pbm-text-muted);
}
.pbm-list-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}
.pbm-list-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pbm-branch-list__actions {
  display: flex;
  border-top: 1px solid var(--pbm-border);
}
.pbm-branch-list__actions a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--pbm-text-muted);
  text-decoration: none;
  border-left: 1px solid var(--pbm-border);
  transition: background var(--pbm-transition), color var(--pbm-transition);
}
.pbm-branch-list__actions a:last-child { border-left: 0; }
.pbm-branch-list__actions a:hover {
  background: var(--pbm-primary-light);
  color: var(--pbm-primary);
}
.pbm-branch-list__loading,
.pbm-branch-list__empty {
  padding: 30px;
  text-align: center;
  color: var(--pbm-text-muted);
  font-size: 14px;
}
.pbm-branch-list__pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 24px 0 0;
}
.pbm-branch-list__pagination button {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--pbm-border);
  border-radius: var(--pbm-radius-sm);
  background: var(--pbm-white);
  color: var(--pbm-text);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--pbm-transition), border-color var(--pbm-transition), color var(--pbm-transition);
}
.pbm-branch-list__pagination button:hover:not(:disabled) {
  border-color: var(--pbm-primary);
  color: var(--pbm-primary);
}
.pbm-branch-list__pagination button.is-current {
  background: var(--pbm-primary);
  border-color: var(--pbm-primary);
  color: var(--pbm-white);
}
.pbm-branch-list__pagination button:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.pbm-branch-list__pagination-more {
  display: flex;
  align-items: center;
  padding: 0 4px;
  color: var(--pbm-text-muted);
}

/* Responsive: list columns */
@media (max-width: 1024px) {
  .pbm-branch-list__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .pbm-branch-list__grid { grid-template-columns: 1fr; }
  .pbm-branch-list__filters { flex-wrap: wrap; }
  .pbm-branch-list__filter { flex: 1 1 calc(50% - 5px); }
}
@media (max-width: 420px) {
  .pbm-branch-list__filter { flex: 1 1 100%; }
}
/* --------------------------------------------------------------------------
   11. Utility
   -------------------------------------------------------------------------- */
.pbm-empty {
  padding: 30px;
  border: 1px dashed var(--pbm-border);
  border-radius: var(--pbm-radius);
  text-align: center;
  color: var(--pbm-text-muted);
}
.pbm-branch-data-list { display: none !important; }

/* --------------------------------------------------------------------------
   12. Responsive adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .pbm-map-drawer .pbm-map-manager__map-wrap { height: 400px; }
}
@media (max-width: 800px) {
  .pbm-map-manager__toolbar {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px;
  }
  .pbm-map-manager__toolbar-title { grid-column: 1 / -1; }
  .pbm-map-manager__toolbar-title h2 { font-size: 15px; }
  .pbm-map-manager__legend { justify-content: flex-start; gap: 12px; overflow: auto; }
  .pbm-map-manager__search-wrap { order: initial; }
  .pbm-map-drawer .pbm-map-manager__map-wrap { height: 340px; }

  .pbm-map-drawer-toggle {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    column-gap: 14px;
    min-height: 78px;
    padding: 10px 14px;
  }
  .pbm-map-drawer-toggle__location-icon,
  .pbm-map-drawer-toggle__icon { width: 44px; height: 44px; }
  .pbm-map-drawer-toggle__text { font-size: 15px; min-height: 52px; padding: 0 16px 0 12px; }
  .pbm-map-drawer-toggle__text::after { font-size: 11px; }
}
@media (max-width: 600px) {
  .pbm-map-manager__toolbar { grid-template-columns: 1fr; }
  .pbm-map-manager__toolbar-title { grid-column: auto; }
  .pbm-map-manager__legend { flex-wrap: wrap; white-space: normal; }
  .pbm-map-drawer .pbm-map-manager__map-wrap { height: 300px; }
}
@media (max-width: 520px) {
  .pbm-map-drawer-toggle {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    column-gap: 10px;
    min-height: 70px;
    padding: 9px 11px;
  }
  .pbm-map-drawer-toggle__location-icon,
  .pbm-map-drawer-toggle__icon { width: 38px; height: 38px; }
  .pbm-map-drawer-toggle__text { font-size: 13px; min-height: 46px; }
  .pbm-map-drawer-toggle__text::after { font-size: 10px; }
  .pbm-map-drawer .pbm-map-manager__map-wrap { height: 280px; }
  .pbm-search-input { height: 42px; font-size: 13px; }
}
@media (max-width: 480px) {
  .pbm-modal__dialog { width: calc(100% - 20px); padding: 20px; }
  .pbm-modal__actions { gap: 6px; }
  .pbm-modal__actions .pbm-action { padding: 8px 6px; font-size: 12px; }
}

/* --------------------------------------------------------------------------
   13. Motion preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .pbm-map-drawer-toggle::before,
  .pbm-map-drawer-toggle__text::before { animation: none; }
  .pbm-map-drawer,
  .pbm-map-drawer__inner,
  .pbm-map-drawer-toggle { transition: none; }
}

/* --------------------------------------------------------------------------
   14. Print
   -------------------------------------------------------------------------- */
@media print {
  .pbm-map-manager__toolbar,
  .pbm-modal,
  .pbm-map-drawer-toggle { display: none !important; }
}
/* فیکس: hidden attribute باید روی flex غلبه کنه */
.pbm-branch-list__card[hidden] {
  display: none !important;
}
.pbm-branch-list__card[hidden] {
  display: none !important;
}
/* حذف دکمه‌ی پیش‌فرض مرورگر در input[type="search"] */
.pbm-branch-list__query::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
/* ======================================================================
   Unified Widget — Switch (Segmented Control, Full Width)
   ====================================================================== */
.pbm-unified {
  --pbm-switch-bg: #f1f3f5;
  --pbm-switch-active: var(--pbm-primary, #f97316);
  --pbm-switch-text: #6b7280;
  --pbm-switch-text-active: #ffffff;
  --pbm-switch-radius: 14px;
}

.pbm-unified__switch {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  gap: 4px;
  padding: 5px;
  margin: 0 0 24px;
  background: var(--pbm-switch-bg);
  border: 1px solid var(--pbm-border);
  border-radius: var(--pbm-switch-radius);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
  direction: rtl;
  user-select: none;
  isolation: isolate;
}

.pbm-unified__switch-indicator {
  position: absolute;
  top: 5px;
  bottom: 5px;
  right: 5px;
  width: calc(50% - 7px);
  background: linear-gradient(135deg, var(--pbm-switch-active) 0%, var(--pbm-switch-active) 100%);
  border-radius: calc(var(--pbm-switch-radius) - 4px);
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35), 0 1px 3px rgba(249, 115, 22, 0.2);
  transition: transform .35s cubic-bezier(.4, 0, .2, 1), box-shadow .35s ease;
  z-index: 0;
  pointer-events: none;
}

.pbm-unified__switch[data-active="map"] .pbm-unified__switch-indicator {
  transform: translateX(calc(-100% - 4px));
}

.pbm-unified__tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: calc(var(--pbm-switch-radius) - 4px);
  background: transparent;
  color: var(--pbm-switch-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: color .3s ease;
  -webkit-tap-highlight-color: transparent;
}

.pbm-unified__tab:hover:not(.is-active) {
  color: #374151;
}

.pbm-unified__tab:focus-visible {
  outline: 2px solid var(--pbm-switch-active);
  outline-offset: 2px;
}

.pbm-unified__tab.is-active {
  color: var(--pbm-switch-text-active);
}

.pbm-unified__tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  transition: transform .3s ease;
}

.pbm-unified__tab-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pbm-unified__tab.is-active .pbm-unified__tab-icon {
  transform: scale(1.1);
}

.pbm-unified__tab-text {
  line-height: 1;
}

/* پنل‌ها */
.pbm-unified__panel {
  display: none;
}
.pbm-unified__panel.is-active {
  display: block;
}
.pbm-unified__panel[hidden] {
  display: none !important;
}

/* موبایل */
@media (max-width: 640px) {
  .pbm-unified__tab {
    padding: 0 12px;
    font-size: 13px;
  }
  .pbm-unified__tab-icon {
    width: 16px;
    height: 16px;
  }
}
