/* Tealive PH store locator — Leaflet + OpenStreetMap.
 * Replaces the Agile Store Locator widget, which depended on the Google Maps
 * JavaScript API. Self-contained: no Google, no third-party JS.
 */
.tl-loc {
  --tl-purple: #45358b;
  --tl-purple-dark: #322668;
  --tl-cream: #fbf7e8;
  --tl-line: #e4e0ee;
  --tl-text: #2f2b3a;
  --tl-muted: #6f6a80;
  --tl-focus: #f5a623;
  background: var(--tl-cream);
  padding: 32px 20px 44px;
  font-family: inherit;
  color: var(--tl-text);
}
.tl-loc__inner { max-width: 1180px; margin: 0 auto; }

/* The site has a fixed social rail pinned at left:12px, 48px wide, z-index 100.
   Clear it so the outlet list never sits underneath. It is not rendered at
   phone widths, so this only applies from the tablet breakpoint up. */
@media (min-width: 861px) {
  .tl-loc { padding-left: 80px; }
}

.tl-loc__head { text-align: center; margin-bottom: 22px; }
.tl-loc__head h1.elementor-heading-title {
  /* font-family comes from .elementor-heading-title so it matches the site's
     other page titles; colour and size stay local so it reads on cream. */
  color: var(--tl-purple); font-size: clamp(24px, 4vw, 36px);
  margin: 0 0 6px; line-height: 1.15;
}
.tl-loc__count { color: var(--tl-muted); font-size: 15px; margin: 0; }

/* ---------------------------------------------------------------- controls */
.tl-loc__controls {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin: 0 auto 18px; max-width: 720px;
}
.tl-loc__search, .tl-loc__city {
  font: inherit; font-size: 15px; color: var(--tl-text);
  border: 2px solid var(--tl-line); border-radius: 999px;
  padding: 11px 16px; background: #fff; min-height: 44px;
}
.tl-loc__search { flex: 1 1 260px; }
.tl-loc__city   { flex: 0 1 200px; cursor: pointer; }
.tl-loc__search:focus, .tl-loc__city:focus,
.tl-loc__item:focus-visible, .tl-loc__clear:focus-visible {
  outline: 3px solid var(--tl-focus); outline-offset: 2px; border-color: var(--tl-purple);
}
.tl-loc__clear {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  background: #fff; color: var(--tl-purple);
  border: 2px solid var(--tl-line); border-radius: 999px; padding: 11px 18px; min-height: 44px;
}
.tl-loc__clear:hover { border-color: var(--tl-purple); }

/* ------------------------------------------------------------------ layout */
.tl-loc__body {
  display: grid; grid-template-columns: minmax(300px, 400px) 1fr;
  gap: 18px; align-items: stretch;
}
.tl-loc__list {
  background: #fff; border: 1px solid var(--tl-line); border-radius: 14px;
  overflow-y: auto; overflow-x: hidden;   /* long addresses must wrap, not scroll */
  max-height: 620px; padding: 6px;
  scrollbar-gutter: stable;
  min-width: 0;
}
.tl-loc__list * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
/* Items are <button> elements, which pick up white-space:nowrap from the
   theme — that is why the addresses ran off sideways instead of wrapping. */
.tl-loc__item, .tl-loc__item * { white-space: normal !important; }
.tl-loc__map {
  height: 620px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--tl-line); background: #e8e4f0;
  /* Leaflet's internal panes sit at z-index 400+. Without an explicit z-index
     here the container makes no stacking context and those panes paint over
     the site's floating "Order here" tab. z-index:0 contains them. */
  position: relative; z-index: 0; isolation: isolate;
}

/* ------------------------------------------------------------------- items */
.tl-loc__item {
  display: block; width: 100%; text-align: left; font: inherit;
  background: transparent; border: 0; border-radius: 10px;
  border-bottom: 1px solid var(--tl-line);
  padding: 14px 14px; cursor: pointer;
}
.tl-loc__item:last-child { border-bottom: 0; }
.tl-loc__item:hover { background: #f6f3ff; }
.tl-loc__item[aria-current="true"] { background: #efe9ff; box-shadow: inset 3px 0 0 var(--tl-purple); }
.tl-loc__name { display: block; font-weight: 700; color: var(--tl-purple); font-size: 16px; line-height: 1.3; }
.tl-loc__city-tag { display: block; font-size: 13px; color: var(--tl-muted); margin-top: 2px; }
.tl-loc__addr { display: block; font-size: 14px; color: var(--tl-text); margin-top: 6px; line-height: 1.45; }
.tl-loc .tl-loc__dir,
.tl-loc .tl-loc__dir:link,
.tl-loc .tl-loc__dir:visited {
  display: inline-block; margin-top: 10px; padding: 8px 15px;
  font-size: 13px; font-weight: 700; line-height: 1.2;
  /* the theme sets a global link colour of #fff900, unreadable on purple */
  color: #ffffff !important; background: var(--tl-purple);
  border-radius: 999px; text-decoration: none; min-height: 34px;
}
.tl-loc .tl-loc__dir:hover, .tl-loc .tl-loc__dir:focus { background: var(--tl-purple-dark); color: #ffffff !important; }
.tl-loc__dir:focus-visible { outline: 3px solid var(--tl-focus); outline-offset: 2px; }
.tl-loc__empty { padding: 28px 16px; text-align: center; color: var(--tl-muted); font-size: 15px; }

/* ------------------------------------------------------------------- hours */
.tl-loc__hours {
  display: block; margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--tl-line);
}
.tl-loc__hrow {
  display: flex; flex-wrap: wrap; gap: 4px 12px;
  justify-content: space-between; align-items: baseline;
  font-size: 13px; line-height: 1.5; color: var(--tl-muted);
}
.tl-loc__hday  { flex: 0 0 auto; }
.tl-loc__htime { flex: 1 1 auto; text-align: right; min-width: 0; }
.tl-loc__hrow.is-today { color: var(--tl-text); font-weight: 700; }
.tl-loc__hours.is-compact { margin-top: 8px; }
.tl-loc__hours.is-compact .tl-loc__hrow { font-size: 12.5px; }

/* ------------------------------------------------------------------ popups */
.tl-loc .leaflet-popup-content { margin: 12px 14px; font-family: inherit; }
.tl-loc__pop-name { font-weight: 700; color: var(--tl-purple); font-size: 15px; display: block; }
.tl-loc__pop-addr { font-size: 13px; color: var(--tl-text); display: block; margin-top: 4px; line-height: 1.45; }
.tl-loc__pop-dir {
  display: inline-block; margin-top: 10px; padding: 7px 14px;
  font-size: 13px; font-weight: 700; color: #fff !important;
  background: var(--tl-purple); border-radius: 999px; text-decoration: none;
}
.tl-loc__pop-dir:hover { background: var(--tl-purple-dark); }

/* ------------------------------------------------------------------ mobile */
@media (max-width: 860px) {
  .tl-loc { padding: 24px 16px 32px; }
  .tl-loc__body { grid-template-columns: 1fr; }
  .tl-loc__map { height: 340px; order: 1; }
  .tl-loc__list { order: 2; max-height: 460px; }
  .tl-loc__city { flex: 1 1 100%; }
  .tl-loc__clear { flex: 1 1 100%; }
}
.tl-loc__noscript { text-align: center; color: var(--tl-muted); padding: 16px; }


/* Elementor renders popup templates inline in the document and only moves them
   into a modal once its JS runs. Until then they paint in normal flow — on a
   slow mobile load the "Order here" panel flashes at the bottom of the page,
   mid-animation. Hide the template until it is actually inside a modal. */
.elementor-location-popup { display: none; }
.elementor-popup-modal .elementor-location-popup,
.dialog-widget-content .elementor-location-popup { display: block; }
