/* mb-farmacii-map — Leaflet + sidebar listing + filters */

.mbm-layout {
  display: grid;
  grid-template-columns: 240px 380px 1fr;
  height: calc(100vh - 100px);
  min-height: 600px;
  background: #f8f9fa;
  font-family: inherit;
}

.mbm-filters {
  background: #fff;
  border-right: 1px solid #e5e7eb;
  padding: 1rem 1.2rem;
  overflow-y: auto;
}
.mbm-filter-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.mbm-filter-head h3 { margin: 0; font-size: 1rem; }
.mbm-reset {
  background: none; border: none; padding: 2px 6px;
  color: #6b7280; font-size: .8rem; cursor: pointer;
}
.mbm-reset:hover { color: #10b981; }

.mbm-filters .mbm-filter-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  color: #6b7280;
  letter-spacing: .04em;
  margin: .85rem 0 .35rem;
  font-weight: 600;
}
.mbm-filters .mbm-checkbox-label {
  display: flex; align-items: center; gap: .4rem;
  text-transform: none; letter-spacing: 0;
  font-weight: 400; color: #374151; font-size: .85rem;
  margin: .65rem 0 0; cursor: pointer;
}
.mbm-filters input[type="search"],
.mbm-filters select {
  width: 100%;
  padding: .45rem .6rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: .9rem;
  background: #fff;
}
.mbm-filters input[type="search"]:focus,
.mbm-filters select:focus { outline: none; border-color: #10b981; box-shadow: 0 0 0 2px rgba(16,185,129,.15); }
.mbm-filters input[type="checkbox"] { width: auto; }

/* Listings column */
.mbm-listings {
  background: #fff;
  border-right: 1px solid #e5e7eb;
  display: flex; flex-direction: column;
  min-height: 0;
}
.mbm-listings-head {
  padding: .75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  font-size: .85rem; color: #374151;
  display: flex; align-items: baseline; gap: .35rem;
  background: #fafbfc;
}
.mbm-listings-head #mbm-count { font-weight: 700; color: #111827; }
.mbm-listings-head small { color: #9ca3af; font-size: .8rem; }
.mbm-list {
  flex: 1; overflow-y: auto;
}
.mbm-loading { padding: 2rem 1rem; text-align: center; color: #9ca3af; }
.mbm-empty { padding: 2rem 1rem; text-align: center; color: #6b7280; }

.mbm-card {
  display: block;
  padding: .75rem 1rem;
  border-bottom: 1px solid #f1f3f5;
  text-decoration: none !important;
  color: inherit;
  cursor: pointer;
  transition: background .12s;
}
.mbm-card:hover { background: #f8f9fa; }
.mbm-card.mbm-card-active {
  background: #ecfdf5;
  box-shadow: inset 3px 0 0 #10b981;
}
.mbm-card-name { font-weight: 600; color: #111827; font-size: .92rem; margin: 0 0 .15rem; line-height: 1.35; }
.mbm-card-addr { color: #6b7280; font-size: .8rem; line-height: 1.35; }
.mbm-card-meta { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .35rem; font-size: .72rem; }
.mbm-card-meta span {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 1px 6px; background: #f3f4f6; border-radius: 3px; color: #4b5563;
}
.mbm-card-meta .mbm-tag-tip { background: #d1fae5; color: #065f46; }
.mbm-card-actions { margin-top: .4rem; display: flex; gap: .4rem; }
.mbm-card-actions button {
  font-size: .75rem; padding: 2px 8px;
  background: #fff; border: 1px solid #d1d5db; border-radius: 3px; cursor: pointer;
  color: #374151;
}
.mbm-card-actions button:hover { border-color: #10b981; color: #10b981; }

/* Map column */
.mbm-map-wrap { position: relative; min-height: 0; }
.mbm-map { width: 100%; height: 100%; }

/* Pin */
.mbm-pin { background: none; border: none; }
.mbm-cluster-icon { background: none; border: none; }
.mbm-cluster {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #10b981; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  border: 2px solid #fff;
}
.mbm-cluster-lg { background: #047857; }
.mbm-cluster-md { background: #059669; }

/* Popup */
.mbm-popup { font-family: inherit; max-width: 240px; }
.mbm-popup h4 { margin: 0 0 4px; font-size: 14px; color: #111827; }
.mbm-popup .mbm-popup-addr { color: #6b7280; font-size: 12px; margin-bottom: 6px; }
.mbm-popup .mbm-popup-meta { color: #374151; font-size: 12px; margin: 2px 0; }
.mbm-popup .mbm-popup-meta a { color: #10b981; text-decoration: none; }
.mbm-popup .mbm-popup-actions { margin-top: 6px; display: flex; gap: 4px; flex-wrap: wrap; }
.mbm-popup .mbm-popup-actions a {
  padding: 3px 8px; background: #10b981; color: #fff; border-radius: 3px;
  text-decoration: none; font-size: 11px;
}
.mbm-popup .mbm-popup-actions a:hover { background: #047857; }

/* Mobile drawer */
.mbm-drawer-toggle {
  display: none;
  position: fixed; bottom: 20px; right: 20px; z-index: 1000;
  padding: .65rem 1.1rem;
  background: #111827; color: #fff;
  border: none; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  cursor: pointer; font-size: .9rem;
}
.mbm-drawer-toggle:hover { background: #374151; }

@media (max-width: 1024px) {
  .mbm-layout { grid-template-columns: 220px 320px 1fr; }
}
@media (max-width: 768px) {
  .mbm-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: 100vh;
  }
  .mbm-filters {
    border-right: none; border-bottom: 1px solid #e5e7eb;
    max-height: 50vh;
  }
  .mbm-listings {
    position: fixed; top: 0; right: -100%; width: min(90vw, 380px);
    height: 100vh; z-index: 1001;
    transition: right .3s;
    box-shadow: -4px 0 16px rgba(0,0,0,.15);
  }
  .mbm-listings.mbm-open { right: 0; }
  .mbm-drawer-toggle { display: inline-flex; align-items: center; gap: .35rem; }
  .mbm-map-wrap { height: 100%; }
}
