/* May Cash — Agency Locator
   Scoped under .mc-locator to avoid leaking into the rest of the theme.
   Matches the supplied design: sidebar (450px) + Leaflet map, red brand,
   rounded cards, glass CTA footer. Stacks on mobile. */

/* Outer section + container give the block the same 1200px constraint
   and vertical breathing room as every other custom maycash block. */
.mc-locator-section { padding: 48px 0; }
@media (max-width: 768px) {
  .mc-locator-section { padding: 28px 0; }
}

.mc-locator {
  --mc-brand: #e31e1a;
  --mc-brand-hover: #c41916;
  --mc-brand-light: #fee2e2;
  --mc-ink-900: #0f172a;
  --mc-ink-600: #475569;
  --mc-ink-500: #64748b;
  --mc-ink-400: #94a3b8;
  --mc-line: #e2e8f0;
  --mc-line-soft: #f1f5f9;
  --mc-bg-soft: #f8fafc;
  --mc-radius: 18px;

  display: flex;
  align-items: stretch;
  width: 100%;
  height: var(--mc-locator-h, 640px);
  background: #fff;
  border: 1px solid var(--mc-line);
  border-radius: var(--mc-radius);
  overflow: hidden;
  box-shadow: 0 20px 50px -28px rgba(15, 23, 42, 0.22);
  font-family: var(--font-display, "Inter", "Plus Jakarta Sans", system-ui, sans-serif);
  color: var(--mc-ink-900);
  position: relative;
  isolation: isolate;
}

/* ----- Sidebar ----- */
.mc-locator__sidebar {
  width: 420px;
  flex: 0 0 420px;
  background: #fff;
  border-right: 1px solid var(--mc-line-soft);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
}
.mc-locator--rtl .mc-locator__sidebar {
  border-right: none;
  border-left: 1px solid var(--mc-line-soft);
}

.mc-locator__head { padding: 22px 24px 14px; }
.mc-locator__head-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.mc-locator__title {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--mc-ink-900);
}
.mc-locator__pill {
  background: var(--mc-brand-light);
  color: var(--mc-brand);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

.mc-locator__search {
  position: relative;
  display: flex;
  align-items: center;
}
.mc-locator__search-icon {
  position: absolute;
  inset-inline-start: 14px;
  display: inline-flex;
  width: 18px;
  height: 18px;
  color: var(--mc-ink-400);
  pointer-events: none;
  transition: color 0.2s ease;
}
.mc-locator__search-input {
  width: 100%;
  padding: 13px 16px 13px 44px;
  border: 1px solid var(--mc-line);
  background: var(--mc-bg-soft);
  border-radius: 16px;
  color: var(--mc-ink-900);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.mc-locator--rtl .mc-locator__search-input { padding: 13px 44px 13px 16px; }
.mc-locator__search-input::placeholder { color: var(--mc-ink-400); }
.mc-locator__search-input:focus {
  background: #fff;
  border-color: var(--mc-brand);
  box-shadow: 0 0 0 3px rgba(227, 30, 26, 0.12);
}
.mc-locator__search-input:focus + .mc-locator__search-icon,
.mc-locator__search:focus-within .mc-locator__search-icon { color: var(--mc-brand); }

/* ----- City filter dropdown -----
   Styled to match the search input above. Native <select> with a custom
   chevron and pin icon so the picker still works on mobile / keyboard. */
.mc-locator__filter {
  position: relative;
  display: flex;
  align-items: center;
  margin: 12px 24px 4px;
}
.mc-locator__filter-icon,
.mc-locator__filter-chev {
  position: absolute;
  pointer-events: none;
  color: var(--mc-ink-400);
  display: inline-flex;
}
.mc-locator__filter-icon { inset-inline-start: 14px; width: 18px; height: 18px; }
.mc-locator__filter-chev { inset-inline-end: 14px; width: 18px; height: 18px; }

.mc-locator__filter-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  padding: 13px 44px;
  border: 1px solid var(--mc-line);
  background: var(--mc-bg-soft);
  border-radius: 16px;
  color: var(--mc-ink-900);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.mc-locator__filter-select:hover { background: #fff; }
.mc-locator__filter-select:focus {
  background: #fff;
  border-color: var(--mc-brand);
  box-shadow: 0 0 0 3px rgba(227, 30, 26, 0.12);
}
.mc-locator__filter:focus-within .mc-locator__filter-icon,
.mc-locator__filter:focus-within .mc-locator__filter-chev { color: var(--mc-brand); }

/* ----- List ----- */
.mc-locator__list-wrap {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 4px 24px 100px;
  scrollbar-width: thin;
  scrollbar-color: #e2e8f0 transparent;
}
.mc-locator__list-wrap::-webkit-scrollbar { width: 6px; }
.mc-locator__list-wrap::-webkit-scrollbar-track { background: transparent; }
.mc-locator__list-wrap::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 10px; }
.mc-locator__list-wrap::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }

.mc-locator__list-label {
  margin: 12px 0 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mc-ink-400);
}
.mc-locator__list { display: flex; flex-direction: column; gap: 14px; }

.mc-locator__card {
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid var(--mc-line-soft);
  background: var(--mc-bg-soft);
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease;
}
.mc-locator__card:hover {
  background: #fff;
  border-color: var(--mc-line);
  box-shadow: 0 10px 24px -16px rgba(15, 23, 42, 0.18);
}
.mc-locator__card.is-active {
  background: #fff;
  border: 2px solid var(--mc-brand);
  padding: 17px 19px;
}
.mc-locator__card-pin {
  position: absolute;
  top: 14px;
  inset-inline-end: 16px;
  width: 18px;
  height: 18px;
  color: var(--mc-ink-400);
  opacity: 0;
  transition: opacity 0.2s ease, color 0.2s ease;
}
.mc-locator__card.is-active .mc-locator__card-pin { opacity: 1; color: var(--mc-brand); }

.mc-locator__card-name {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--mc-ink-900);
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}
.mc-locator__card:hover .mc-locator__card-name { color: var(--mc-brand); }
.mc-locator__card-addr {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--mc-ink-500);
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.mc-locator__card-addr svg { flex: 0 0 auto; margin-top: 2px; color: var(--mc-ink-400); }

.mc-locator__card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.mc-locator__card-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--mc-ink-600);
}
.mc-locator__card-status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--mc-ink-400);
}
.mc-locator__card.is-active .mc-locator__card-status { color: #059669; }
.mc-locator__card.is-active .mc-locator__card-status::before {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
  animation: mc-loc-pulse 1.8s ease-in-out infinite;
}
@keyframes mc-loc-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18); }
  50%      { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.06); }
}

.mc-locator__card-directions {
  font-size: 12px;
  font-weight: 700;
  color: var(--mc-ink-400);
  text-decoration: none;
  transition: color 0.2s ease;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 0;
}
.mc-locator__card-directions:hover { color: var(--mc-brand); text-decoration: underline; }
.mc-locator__card.is-active .mc-locator__card-directions { color: var(--mc-brand); }

.mc-locator__empty {
  padding: 30px 14px;
  text-align: center;
  color: var(--mc-ink-500);
  font-size: 13px;
}

/* ----- CTA footer ----- */
.mc-locator__cta-wrap {
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  inset-inline-end: 0;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--mc-line-soft);
  width: 420px;
}
.mc-locator__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 22px;
  background: var(--mc-brand);
  color: #fff;
  border-radius: 16px;
  font-weight: 700;
  font-size: 14.5px;
  text-decoration: none;
  box-shadow: 0 14px 32px -16px rgba(227, 30, 26, 0.55);
  transition: background 0.2s ease, transform 0.1s ease;
}
.mc-locator__cta:hover { background: var(--mc-brand-hover); }
.mc-locator__cta:active { transform: scale(0.98); }

/* ----- Map ----- */
.mc-locator__map-wrap {
  flex: 1 1 auto;
  position: relative;
  background: #edeef0;
  min-width: 0;
}
.mc-locator__map { width: 100%; height: 100%; z-index: 1; }
.mc-locator__map .leaflet-container { background: #edeef0 !important; }

/* Custom red marker matching the design */
.mc-loc-marker {
  width: 22px;
  height: 22px;
  background: var(--mc-brand);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 14px rgba(227, 30, 26, 0.35);
  cursor: pointer;
  transition: transform 0.18s ease;
}
.mc-loc-marker:hover { transform: scale(1.18); }
.mc-loc-marker--active {
  transform: scale(1.18);
  box-shadow: 0 0 0 6px rgba(227, 30, 26, 0.18), 0 0 14px rgba(227, 30, 26, 0.5);
}

.leaflet-popup-content-wrapper { border-radius: 12px; }
.leaflet-popup-content { margin: 12px 14px; font-family: inherit; }
.mc-loc-popup__name { font-weight: 700; font-size: 14px; color: var(--mc-ink-900); }
.mc-loc-popup__addr { font-size: 12.5px; color: var(--mc-ink-500); margin-top: 2px; }

/* Zoom controls (override Leaflet's default) */
.mc-locator__zoom {
  position: absolute;
  top: 18px;
  inset-inline-end: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 400;
}
.mc-locator__zoom-btn {
  width: 44px;
  height: 44px;
  background: #fff;
  border: 1px solid var(--mc-line-soft);
  border-radius: 14px;
  box-shadow: 0 14px 30px -18px rgba(15, 23, 42, 0.25);
  color: var(--mc-ink-600);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
}
.mc-locator__zoom-btn:hover { background: #f8fafc; }
.mc-locator__zoom-btn:active { transform: scale(0.96); }

/* Locate-me pill */
.mc-locator__locate {
  position: absolute;
  bottom: 28px;
  inset-inline-end: 28px;
  z-index: 400;
  background: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--mc-line-soft);
  box-shadow: 0 14px 30px -16px rgba(15, 23, 42, 0.28);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--mc-ink-900);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}
.mc-locator__locate:hover { background: #f8fafc; }
.mc-locator__locate-dot {
  width: 8px;
  height: 8px;
  background: var(--mc-brand);
  border-radius: 999px;
}
.mc-locator__locate.is-loading .mc-locator__locate-dot {
  animation: mc-loc-pulse 1.4s ease-in-out infinite;
}

/* Responsive: stack on small screens */
@media (max-width: 860px) {
  .mc-locator {
    flex-direction: column;
    height: auto;
  }
  .mc-locator__sidebar {
    width: 100%;
    flex: none;
    border-right: none;
    border-bottom: 1px solid var(--mc-line-soft);
  }
  .mc-locator--rtl .mc-locator__sidebar { border-left: none; border-bottom: 1px solid var(--mc-line-soft); }
  .mc-locator__cta-wrap { position: static; width: 100%; }
  .mc-locator__list-wrap {
    max-height: 380px;
    padding-bottom: 16px;
  }
  .mc-locator__map-wrap {
    height: 380px;
    min-height: 380px;
  }
}
