/* =====================================================================
   Oswego Towne Square — Interactive Map widget
   Scoped to .osq-map. Category colours come from Elementor controls as
   CSS custom properties (--osq-dining / --osq-retail / --osq-service /
   --osq-empty) so they stay editable without code.
   ===================================================================== */

.osq-map {
  --navy: #1f2855;
  --sage-deep: #5a8a7a;
  --border: #d6d6d6;
  --accent: #c44536;
  --display: 'Outfit', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  --osq-dining: #89a757;
  --osq-retail: #1f2855;
  --osq-service: #5a8a7a;
  --osq-empty: #999999;
  font-family: var(--body);
  color: #1a1a1a;
  line-height: 1.5;
  margin: 0 auto;
  max-width: 1280px;
}
.osq-map *, .osq-map *::before, .osq-map *::after { box-sizing: border-box; }

/* ---- Floor / level selector tabs ---- */
.osq-floor-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: center;
  margin-bottom: 16px;
}
/* The tabs are plain <button>s. The site's Elementor global Button styles
   (border box, white hover text, radius, shadow — stored in the Elementor kit,
   which differs per-site) can bleed onto them, so every visual property below
   is forced with !important to guarantee the same look on staging and live. */
.osq-map .osq-floor-tab {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.1;
  color: #9aa0ad !important;
  background: transparent !important;
  background-color: transparent !important;
  border: 0 !important;
  border-bottom: 3px solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  padding: 2px 4px 6px !important;
  margin: 0 !important;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.osq-map .osq-floor-tab:hover,
.osq-map .osq-floor-tab:focus {
  color: var(--sage-deep) !important;
  background: transparent !important;
  background-color: transparent !important;
  border-bottom-color: transparent !important;
  box-shadow: none !important;
}
.osq-map .osq-floor-tab.active {
  color: var(--navy) !important;
  border-bottom-color: var(--osq-service) !important;
}
/* Don't show the focus box on mouse click; keep it for keyboard users */
.osq-map .osq-floor-tab:focus { outline: none !important; }
.osq-map .osq-floor-tab:focus-visible { outline: 2px solid var(--osq-service) !important; outline-offset: 2px; }

/* ---- Map canvas ---- */
.osq-map-rel { position: relative; }
.osq-canvas {
  width: 100%;
  height: 1043px;
  background: #d8e0d3;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: grab;
}
.osq-canvas:active { cursor: grabbing; }
.osq-map.osq-admin .osq-canvas { cursor: crosshair; }

.osq-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(216, 224, 211, 0.95);
  z-index: 1000;
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--sage-deep);
  pointer-events: none;
  transition: opacity 0.4s;
}
.osq-loading.done { opacity: 0; }

/* ---- Admin coordinate readout ----
   Floated to the top-right of the *viewport* (not the map) so it sits clear of
   the map image on every screen size. Admin-only, so overlapping page content
   is fine; pulled below the WP admin bar so it stays readable. */
.osq-coord-readout {
  position: fixed;
  top: 42px;            /* clear the WP admin bar (32px desktop) + small gap */
  right: 16px;
  left: auto;
  bottom: auto;
  z-index: 99990;       /* above page content, below the WP admin bar (99999) */
  background: rgba(31, 40, 85, 0.92);
  color: #fff;
  font: 600 12px/1.4 'Courier New', monospace;
  padding: 6px 10px;
  border-radius: 4px;
  pointer-events: none;
  white-space: nowrap;
  max-width: 60vw;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.osq-coord-readout .hint { display: block; font-weight: 400; opacity: .8; font-size: 10px; }
/* The WP admin bar grows to 46px once the viewport is <= 782px */
@media screen and (max-width: 782px) {
  .osq-coord-readout { top: 56px; right: 10px; }
}

/* ---- Markers ---- */
.osq-map .store-marker {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  background: var(--osq-service);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.3), 0 2px 5px rgba(0,0,0,0.35);
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, background 0.2s ease;
}
.osq-map .store-marker::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 5px; height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
}
.osq-map .store-marker:hover { transform: scale(1.4); z-index: 1000 !important; }
.osq-map .store-marker.dining  { background: var(--osq-dining); }
.osq-map .store-marker.retail  { background: var(--osq-retail); }
.osq-map .store-marker.service { background: var(--osq-service); }
.osq-map .store-marker.empty   { background: var(--osq-empty); opacity: 0.65; }
/* Instruction #4: non-matching pins turn gray when a category is active */
.osq-map .store-marker.dim { background: #b9bcc4 !important; opacity: 0.7; }
.osq-map .store-marker.highlight {
  transform: scale(1.6);
  box-shadow: 0 0 0 5px rgba(196, 69, 54, 0.25), 0 4px 10px rgba(0,0,0,0.4);
}

@media (max-width: 720px) {
  .osq-map .store-marker { width: 13px; height: 13px; border-width: 2px; }
  .osq-map .store-marker::after { width: 3px; height: 3px; margin: -1.5px 0 0 -1.5px; }
  .osq-map .store-marker:hover { transform: none; }
  .osq-map .store-marker.highlight { transform: scale(1.4); }
  .osq-canvas { touch-action: none; }
  .osq-floor-tab { font-size: 17px; }
}

/* ---- Popups (ported from reference design) ---- */
.osq-map .leaflet-popup-content-wrapper {
  border-radius: 6px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.18), 0 4px 10px rgba(0,0,0,0.08);
  padding: 0;
}
.osq-map .leaflet-popup-content { margin: 0; width: 500px !important; max-width: calc(100vw - 60px) !important; }
.osq-map .leaflet-popup-tip { background: #fff; box-shadow: none; }
.osq-map .popup { padding: 18px 20px 16px; font-family: var(--body); }
.osq-map .popup-unit {
  font-family: var(--display);
  font-size: 12px; font-weight: 700; letter-spacing: 0.18em;
  color: var(--sage-deep); text-transform: uppercase; margin: 0 0 10px;
}
.osq-map .popup h3 {
  font-family: var(--display);
  font-size: 35px; font-weight: 600; line-height: 1.15;
  color: var(--navy); margin: 0 0 12px; letter-spacing: -0.01em;
}
.osq-map .popup-website { font-size: 13.5px; margin-bottom: 12px; }
.osq-map .popup-website strong { font-weight: 700; }
.osq-map .popup-website a { color: #000; text-decoration: none; font-weight: 500; }
.osq-map .popup-website a:hover { text-decoration: underline; }
.osq-map .popup-desc {
  font-size: 13px; line-height: 1.5; color: #2a2a2a; margin: 0 0 14px;
  white-space: pre-line; max-height: 140px; overflow-y: auto; padding-right: 6px;
}
.osq-map .popup-desc::-webkit-scrollbar { width: 6px; }
.osq-map .popup-desc::-webkit-scrollbar-thumb { background: #d6d6d6; border-radius: 3px; }
.osq-map .popup-btn {
  display: inline-block; background: #004c45; color: #fff;
  font-family: var(--display); font-size: 13px; font-weight: 600;
  padding: 10px 18px; border-radius: 3px; text-decoration: none; transition: background 0.15s ease;
}
.osq-map .popup-btn:hover { background: var(--navy); color: #fff; }
.osq-map .popup.popup-empty { padding: 22px 24px; }
.osq-map .popup.popup-empty h3 { font-size: 22px; margin-bottom: 12px; }
.osq-map .popup.popup-empty p { font-size: 13.5px; line-height: 1.5; color: #555; margin-bottom: 16px; }

@media (max-width: 520px) {
  .osq-map .leaflet-popup-content { width: 300px !important; }
  .osq-map .popup { padding: 16px 16px 14px; }
  .osq-map .popup h3 { font-size: 24px; margin-bottom: 10px; }
}
@media (max-width: 320px) {
  .osq-map .leaflet-popup-content { width: 240px !important; }
}
