/* ==========================================================================
   Store locator — "اعثر علينا" (navy/gold). Pairs with assets/js/find-us.js.
   ========================================================================== */
.gz-locator { direction: rtl; background: #fff; max-width: var(--content-max); margin: 0 auto; padding: 28px 16px 64px; min-height: 60vh; }

.gz-locator__hero { text-align: center; margin: 0 0 22px; }
.gz-locator__title {
  color: #002363; font-size: 32px; font-weight: 800; margin: 0 0 8px;
  position: relative; display: inline-block; padding-bottom: 12px;
}
.gz-locator__title::after { content: ""; position: absolute; bottom: 0; inset-inline-start: 50%; transform: translateX(50%); width: 64px; height: 4px; border-radius: 4px; background: #c9a227; }
.gz-locator__sub { color: #64748b; font-size: 15px; margin: 0; }

/* Toolbar: search + governorate filter + counter */
.gz-locator__toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 18px; }
.gz-locator__search { position: relative; flex: 1 1 280px; display: flex; align-items: center; }
.gz-locator__search-ico { position: absolute; inset-inline-start: 14px; color: #94a3b8; font-size: 18px; pointer-events: none; }
.gz-locator__search input {
  width: 100%; height: 48px; padding: 0 42px; border: 1px solid #d8dfea; border-radius: 10px;
  background: #fff; color: #002363; font: inherit; font-size: 15px;
}
.gz-locator__search input:focus { outline: none; border-color: #002f87; }
.gz-locator__filter select {
  height: 48px; min-width: 190px; padding: 0 14px; border: 1px solid #d8dfea; border-radius: 10px;
  background: #fff; color: #002363; font: inherit; font-weight: 600; cursor: pointer;
}
.gz-locator__filter select:focus { outline: none; border-color: #002f87; }
.gz-locator__count { margin-inline-start: auto; color: #64748b; font-size: 14px; }
.gz-locator__count b { color: #c9a227; font-size: 17px; }

/* Type segmented control — الكل / موزعين / صيدليات (matches legend colours). */
.gz-locator__types {
  display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px;
  background: #f1f5fb; border: 1px solid #dbe2ee;
}
.gz-loc-type {
  display: inline-flex; align-items: center; gap: 6px; line-height: 1; white-space: nowrap;
  font-family: var(--font-primary, "Cairo", "GE SS Two", Tahoma, sans-serif);
  font-size: 14px; font-weight: 700; color: #334155;
  background: transparent; border: 0; border-radius: 999px; padding: 7px 16px; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.gz-loc-type:hover { color: #002f87; }
.gz-loc-type.is-active { background: #002f87; color: #fff; box-shadow: 0 1px 4px rgba(0, 38, 99, .25); }
.gz-loc-type:focus-visible { outline: 2px solid #002f87; outline-offset: 2px; }
.gz-loc-type__sw { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.gz-loc-type__sw--distributor { background: #002f87; }
.gz-loc-type__sw--pharmacy { background: #c9a227; }
.gz-loc-type.is-active .gz-loc-type__sw--distributor { background: #fff; } /* stay visible on navy */

/* "تحديد موقعي" GPS button — navy body, gold location pin */
.gz-geo-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px;
  border: 0; border-radius: 10px; background: #1d3d7c; color: #fff;
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: background .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.gz-geo-btn:hover { background: #16305f; box-shadow: 0 6px 16px rgba(29,61,124,.28); }
.gz-geo-btn:focus-visible { outline: 2px solid #c9a227; outline-offset: 2px; }
.gz-geo-btn__ico { color: #c9a227; flex: 0 0 auto; }
.gz-geo-btn.is-loading { opacity: .8; cursor: progress; }
.gz-geo-btn.is-loading .gz-geo-btn__ico { animation: gz-geo-spin 1s linear infinite; }
@keyframes gz-geo-spin { to { transform: rotate(360deg); } }

/* Inline geolocation error/status message (full toolbar width) */
.gz-locator__geo-msg { flex: 1 0 100%; margin: 2px 0 0; color: #b91c1c; font-size: 14px; font-weight: 600; }
.gz-locator__geo-msg[hidden] { display: none; }

/* Body: side list + map */
.gz-locator__body { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: stretch; }
.gz-locator__list { display: flex; flex-direction: column; gap: 12px; max-height: 620px; overflow-y: auto; padding-inline-end: 4px; }
.gz-locator__empty { color: #64748b; text-align: center; padding: 40px 12px; }

.gz-locator__map { min-height: 620px; height: 100%; border-radius: 16px; overflow: hidden; border: 1px solid #eef1f6; background: #eef2f7; z-index: 0; }

/* Location card */
.gz-loc-card {
  position: relative; border: 1px solid #eef1f6; border-radius: 14px; padding: 14px 16px;
  background: #f8fafc; cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease, transform .12s ease;
}
.gz-loc-card:hover { border-color: #c9a227; box-shadow: 0 6px 16px rgba(0,38,99,.08); transform: translateY(-1px); }
.gz-loc-card__badge {
  display: inline-block; font-size: 12px; font-weight: 700; color: #fff; background: #002f87;
  padding: 3px 10px; border-radius: 999px; margin-bottom: 8px;
}
.gz-loc-card--pharmacy .gz-loc-card__badge { background: #c9a227; }
.gz-loc-card__name { color: #002363; font-size: 16px; font-weight: 800; margin: 0 0 4px; }
.gz-loc-card__addr { color: #475569; font-size: 14px; line-height: 1.6; margin: 0 0 10px; }
.gz-loc-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gz-loc-card__phone { color: #002f87; font-weight: 700; font-size: 14px; text-decoration: none; direction: ltr; }
.gz-loc-card__phone:hover { color: #c9a227; }
.gz-loc-card__dir {
  display: inline-flex; align-items: center; gap: 6px; background: #002f87; color: #fff;
  font-size: 13px; font-weight: 700; padding: 7px 14px; border-radius: 999px; text-decoration: none;
  transition: background .18s ease;
}
.gz-loc-card__dir::before { content: "➜"; font-size: 12px; }
.gz-loc-card__dir:hover { background: #c9a227; }

/* Distance chip (shown after GPS) — pinned top-start corner of the card */
.gz-loc-card__dist {
  position: absolute; top: 12px; inset-inline-start: 14px;
  display: inline-flex; align-items: center; gap: 4px;
  background: #eef2fb; color: #1d3d7c; font-size: 12px; font-weight: 800;
  padding: 3px 9px; border-radius: 999px; line-height: 1.4;
}
.gz-loc-card__dist::before { content: "📍"; font-size: 11px; }
.gz-loc-card__dist[hidden] { display: none; }

/* Nearest location highlight */
.gz-loc-card.is-nearest {
  border-color: #c9a227; background: #fffdf5;
  box-shadow: 0 8px 20px rgba(201,162,39,.18);
}
.gz-loc-card.is-nearest .gz-loc-card__dist { background: #c9a227; color: #fff; }

/* "You are here" pulsing blue dot (Leaflet divIcon) */
.gz-user-wrap { background: none; border: 0; }
.gz-user-dot {
  position: relative; display: block; width: 22px; height: 22px;
}
.gz-user-dot::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: rgba(37,99,235,.35); animation: gz-user-pulse 1.8s ease-out infinite;
}
.gz-user-dot__core {
  position: absolute; top: 50%; left: 50%; width: 12px; height: 12px;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: #2563eb; border: 2px solid #fff; box-shadow: 0 0 4px rgba(0,0,0,.35);
}
@keyframes gz-user-pulse {
  0%   { transform: scale(.5); opacity: .9; }
  100% { transform: scale(2.4); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .gz-user-dot::before { animation: none; }
  .gz-geo-btn.is-loading .gz-geo-btn__ico { animation: none; }
}

/* Branded map pins (Leaflet divIcon) — Granzia "G" inside a coloured teardrop. */
.gz-pin-wrap { background: none; border: 0; }
.gz-pin { position: relative; width: 38px; height: 50px; }
.gz-pin__circle {
  position: absolute; top: 0; left: 1px; width: 36px; height: 36px; box-sizing: border-box;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .4);
}
.gz-pin__tail {
  position: absolute; top: 31px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent;
  border-top: 15px solid #002f87; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .25));
}
.gz-pin__logo { width: 24px; height: 24px; object-fit: contain; display: block; }
.gz-pin__g { font-weight: 800; font-size: 20px; line-height: 1; }
/* Distributor: navy circle + white logo (navy PNG recoloured to white). */
.gz-pin--distributor .gz-pin__circle { background: #002f87; }
.gz-pin--distributor .gz-pin__tail { border-top-color: #002f87; }
.gz-pin--distributor .gz-pin__logo { filter: brightness(0) invert(1); }
.gz-pin--distributor .gz-pin__g { color: #fff; }
/* Pharmacy: gold circle + navy logo (original colour). */
.gz-pin--pharmacy .gz-pin__circle { background: #c9a227; }
.gz-pin--pharmacy .gz-pin__tail { border-top-color: #c9a227; }
.gz-pin--pharmacy .gz-pin__g { color: #002f87; }

/* Map legend */
.gz-loc-legend {
  background: #fff; padding: 8px 11px; border-radius: 10px; box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
  font-size: 13px; font-weight: 600; color: #1f2937; line-height: 1.9; direction: rtl;
}
/* Leaflet controls/popups ship their own font-family (Helvetica stack) that
   overrides inheritance — scope the site font high enough to actually win. */
.leaflet-container .gz-loc-legend,
.leaflet-container .gz-loc-legend__row,
.leaflet-container .gz-loc-pop,
.leaflet-popup-content .gz-loc-pop,
.leaflet-popup-content .gz-loc-pop b,
.leaflet-popup-content .gz-loc-pop span {
  font-family: var(--font-primary, "Cairo", "GE SS Two", Tahoma, sans-serif);
}
.gz-loc-legend__row { display: flex; align-items: center; gap: 7px; }
.gz-loc-legend__sw { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .18); }
.gz-loc-legend__sw--distributor { background: #002f87; }
.gz-loc-legend__sw--pharmacy { background: #c9a227; }
.gz-loc-pop { direction: rtl; text-align: right; min-width: 160px; }
.gz-loc-pop b { color: #002363; display: block; font-size: 15px; margin-bottom: 2px; }
.gz-loc-pop span { display: block; color: #475569; font-size: 13px; line-height: 1.6; }
.gz-loc-pop a { display: inline-block; margin-top: 8px; background: #002f87; color: #fff; font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; text-decoration: none; }
.gz-loc-pop a:hover { background: #c9a227; }

@media (max-width: 860px) {
  .gz-locator__body { grid-template-columns: 1fr; }
  .gz-locator__list { max-height: none; order: 2; }
  .gz-locator__map { order: 1; min-height: 380px; }
  .gz-locator__count { margin-inline-start: 0; width: 100%; }
}
