/* ---------- Layout: full-height section offset by Avada header ---------- */
:root {
  --header-h: 0px;
} /* JS sets this based on .fusion-tb-header height */

.guardian-map {
  min-height: calc(100dvh - var(--header-h, 0px));
  height: calc(100dvh - var(--header-h, 0px));
  display: flex;
  flex-direction: column;
}

/* Map filters now live inside the list; styling unchanged */
.map-filters {
  display: flex;
  width: 100%;
  flex-direction: row;
  justify-content: flex-start;
  background: #f9f9f9;
  align-items: center;
  padding: 0 15px;
}
.guardian-map .map-filters h1 {
  font-weight: 800;
  font-size: 18px;
  text-transform: uppercase;
  color: #000;
}
.map-filters .wdst-search-form {
  padding: 10px 15px;
}
.map-filters .location-search-wrapper {
  border: 1px solid #52535a;
  width: 400px;
  max-width: 100%;
  align-items: center;
  margin-left: 0;
}
.map-filters .location-search-wrapper input[type="text"] {
  font-weight: 700;
}

/* ---------- Selects ---------- */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 1px, 1px);
  white-space: nowrap;
  border: 0;
}
.wdst-select-field {
  padding: 10px 15px;
}
.wdst-select-wrap {
  position: relative;
  display: inline-block;
  width: 500px;
  max-width: 100%;
}
.wdst-region-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 14px 44px 10px 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  background: #fff;
  border: 1px solid #52535a;
  border-radius: 50px;
  color: #000;
  cursor: pointer;
  height: 54px;
}
.wdst-region-select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 22, 137, 0.2);
}
.wdst-select-wrap::after {
  content: "▾";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
  color: #001689;
}
@media (max-width: 768px) {
  .wdst-select-field {
    padding: 10px;
    max-width: 100%;
  }
  .map-filters .wdst-search-form {
    max-width: 100%;
  }
}

/* ---------- Map + List columns ---------- */
.wdst-map-container {
  display: flex;
  border: 1px solid #ddd;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0; /* allow children to scroll */
}

/* Location List */
.wdst-location-list {
  width: 40%;
  height: 100%;
  background: #f9f9f9;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: auto;
}
.location-items {
  padding: 0 10px;
}

/* Location card (used in list and in bubble clone) */
.wdst-location-link {
  display: flex;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid #eee;
  color: #333;
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
  margin: 5px 0;
  justify-content: space-between;
  width: 100%;
  border-radius: 8px;
}
.wdst-location-link:hover {
  background: #f1f1f1;
}
.wdst-location-link.active {
  background: #e6f4ff;
  border-left: 4px solid #007cba;
  font-weight: bold;
}

.wdst-location-media {
  width: 40%;
  margin-bottom: 0;
  aspect-ratio: 4.5/2;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wdst-location-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.wdst-location-details {
  width: 60%;
  padding: 4px 15px 10px;
}

.wdst-location-link .location-name {
  font-weight: 800;
  color: #001689;
  margin-bottom: 5px;
  font-size: 16px;
}
.wdst-location-link .wdst-review-inline {
  display: inline-block;
  margin-left: 6px;
  font-weight: 700;
  font-size: 12px;
}

.side-card-bot {
  display: flex;
}
.wdst-location-link .sizes-available {
  width: 50%;
  margin: 0 0 5px;
}
.wdst-location-link .sizes-available li {
  line-height: 0;
  margin-bottom: 2px;
}

.wdst-location-link .wdst-location-address,
.wdst-location-link .wdst-location-phone {
  margin-bottom: 0;
  font-size: 13px;
}

.wdst-location-link .wdst-location-phone {
  padding-left: 20px;
  position: relative;
  margin-bottom: 5px;
}
.wdst-location-link .wdst-location-phone:before {
  content: "\f879";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  left: 0;
  color: #001689;
}

.wdst-location-link .wdst-location-address {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  align-items: flex-start;
}
.wdst-location-link .wdst-location-address .address-label {
  display: block;
  width: 70%;
  line-height: 1.5;
  padding-left: 20px;
  position: relative;
}
.wdst-location-link .wdst-location-address .address-label:before {
  content: "\f3c5";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  left: 0;
  color: #001689;
}
.wdst-location-link .wdst-location-address .distance {
  background-color: rgb(0 22 137 / 17%);
  padding: 0 7px;
  border-radius: 50px;
  color: #001689;
  font-size: 11px;
  font-weight: 700;
}

.wdst-location-phone {
  margin-bottom: 3px;
}
.link-to-location {
  width: 50%;
}
.link-to-location a {
  display: block;
  background-color: #fd8204;
  color: #fff;
  text-align: center;
  border-radius: 3px;
  padding: 2px 10px;
  font-size: 13px;
  letter-spacing: 2px;
  font-weight: 700;
}
.wdst-location-link .lp {
  font-size: 13px;
  line-height: 1.3;
}
.wdst-location-link .lp .size-label {
  font-weight: 800;
}
.wdst-location-link .lp .starting-at-price {
  font-weight: 800;
}

/* ---------- Map panel (desktop) ---------- */
#wdst-google-map {
  position: sticky !important; /* keep sticky on desktop */
  align-self: flex-start;
  width: 60%;
  height: 100% !important;
  /* also acts as positioned ancestor for the anchored bubble */
  /* (removed duplicate position: relative to avoid overriding sticky) */
}

/* ---------- (Legacy) InfoWindow (harmless to keep) ---------- */
.wdst-infowindow {
  max-width: 320px;
  font-family: Arial, sans-serif;
}
.wdst-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
}
.wdst-review {
  color: #ff9900;
  font-weight: bold;
}
.wdst-price {
  font-weight: bold;
  color: #2c7b2f;
  text-align: right;
}
.wdst-bottom-row {
  display: flex;
  align-items: flex-start;
}
.wdst-bottom-row img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  margin-right: 10px;
  border-radius: 8px;
}
.wdst-infowindow-content h4 {
  margin: 0 0 5px 0;
  font-size: 16px;
}
.wdst-infowindow-content p {
  margin: 0;
  font-size: 13px;
}

/* Google Maps InfoWindow overrides */
.gm-style-iw {
  padding: 0 !important;
  overflow: hidden !important;
}
.gm-style-iw-chr {
  display: none !important;
}
.gm-style-iw-tc,
.gm-style-iw-c {
  padding: 0 !important;
}
.gm-ui-hover-effect {
  top: 5px !important;
  right: 5px !important;
}
.gm-ui-hover-effect > span {
  background: transparent !important;
}
.gm-style .gm-style-iw-c {
  box-shadow: none !important;
  border-radius: 8px !important;
}

/* Misc */
.wdst-child-term-title {
  font-size: 1.2em;
  font-weight: bold;
  margin-top: 20px;
}
.price-marker-label {
  background: #fff;
  border: 2px solid #001689;
  border-radius: 20px;
  padding: 3px 8px;
  font-size: 13px;
  font-weight: bold;
  color: #001689;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}
.price-marker-label:hover {
  background: #fd8204;
  color: #fff;
  border-color: #fd8204;
}

/* This gets toggled by JS when it appends extra-nearby results */
.wdst-nearest-heading {
  text-align: center;
  display: none !important;
}

/* ---------- Slider (list & bubble) ---------- */
.wdst-slider {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 10px 0 0 10px;
}
.wdst-slides {
  display: flex;
  flex-wrap: nowrap;
  transition: transform 300ms ease;
  will-change: transform;
  height: 100%;
}
.wdst-slide {
  flex: 0 0 100%;
  height: 100%;
}
.wdst-slide-img,
.wdst-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wdst-slide-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  line-height: 1;
}
.wdst-prev {
  left: 8px;
}
.wdst-next {
  right: 8px;
}
.wdst-slide-nav:disabled {
  opacity: 0.5;
  cursor: default;
}
.wdst-slider[data-count="1"] .wdst-slide-nav {
  display: none;
}

/* ---------- Anchored bubble inside the map ---------- */
.wdst-bottom-bubble {
  position: absolute;
  z-index: 1000;
  pointer-events: auto;
  width: 700px;
  max-width: 90%;
  /* JS sets left/top dynamically to anchor under the marker */
}
.wdst-bottom-bubble .wdst-bubble-inner {
  width: 100%;
  max-width: none;
  margin: 0;
}
.wdst-bottom-bubble .wdst-location-link {
  margin: 0;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}
.wdst-bubble-close {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.wdst-map-overlay {
  display: none;
}

/* ---------- Responsive ---------- */
@media (min-width: 769px) {
  .location-items {
    display: flex !important;
    flex-direction: column;
  }
}

/* ===== Mobile overlay & floating button ===== */
@media (max-width: 768px) {
  .guardian-map {
    height: auto !important;
    min-height: auto !important;
  }

  .map-filters {
    flex-direction: column;
  }

  /* Hide inline/embedded map on mobile */
  #wdst-google-map {
    display: none !important;
    position: static !important;
    width: 100%;
    height: 0 !important;
    z-index: 0;
    top: 0 !important;
  }
  #wdst-google-map iframe {
    width: 100%;
    height: 100%;
    display: block;
  }

  .wdst-map-container {
    display: block;
    position: relative;
    height: auto;
    min-height: 0; /* keep for safety */
  }

  .guardian-map .map-filters h1 {
    margin: 10px 0 0;
  }

  .wdst-location-list {
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 20;
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    max-height: calc(100dvh - var(--header-h, 0px));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: unset;
    max-height: none;
    overflow: visible; /* ← remove the inner scroller */
    -webkit-overflow-scrolling: auto; /* avoid momentum scroll on iOS */
    padding-bottom: 72px; /* space for the fixed "VIEW MAP" button */
  }
  .wdst-location-list.active {
    transform: translateY(0);
  }

  .location-items {
    flex-direction: column;
  }
  .wdst-location-media {
    width: 35%;
  }
  .wdst-location-details {
    width: 65%;
  }
  .wdst-location-link .location-name {
    margin-bottom: 2px;
    font-size: 12px;
  }
  .wdst-review-inline {
    margin-left: 0;
    font-size: 9px;
  }
  .wdst-location-link .wdst-location-address .distance {
    font-size: 9px;
  }
  .wdst-location-link .lp {
    font-size: 9px;
  }
  .wdst-location-link .wdst-location-address,
  .wdst-location-link .wdst-location-phone {
    font-size: 9px;
  }
  .link-to-location a {
    font-size: 9px;
  }

  /* Floating "View Map" button */
  .wdst-view-map-btn {
    position: fixed;
    left: 50%;
    bottom: 70px;
    transform: translateX(-50%);
    z-index: 1001;
    padding: 12px 18px;
    font-weight: 800;
    font-size: 14px;
    border-radius: 999px;
    border: 0;
    letter-spacing: 1px;
    background: #001689;
    color: #fff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
    cursor: pointer;
  }
  .wdst-view-map-btn:active {
    transform: translateX(-50%) scale(0.98);
  }

  /* Full-height overlay below header */
  .wdst-map-overlay {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--header-h, 0px); /* start below header */
    height: calc(100dvh - var(--header-h, 0px)); /* fill remaining viewport */
    z-index: 9990; /* keep header above if its z-index is higher */
    background: #fff;
    display: none; /* .open toggles visibility */
    flex-direction: column; /* header + body */
  }
  .wdst-map-overlay.open {
    display: flex;
  }

  /* Overlay top bar */
  .wdst-map-overlay__header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 12px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
  }
  .wdst-map-overlay__close {
    flex: 0 0 auto;
    border: 0;
    border-radius: 999px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    font-size: 20px;
    background: #000;
    color: #fff;
  }
  .wdst-map-overlay__form {
    flex: 1 1 auto;
    border: 2px solid #000;
    border-radius: 50px;
  }

  /* Map area (takes the rest of overlay) */
  .wdst-map-overlay__body {
    flex: 1 1 auto;
    min-height: 0; /* allow child to grow */
    position: relative; /* safe anchor for any absolutely positioned children if needed */
  }
  .wdst-map-overlay__body #wdst-google-map {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    position: relative !important; /* provides positioned ancestor for anchored bubble */
  }

  /* Bubble stays anchored by JS; keep only size constraints here */
  .wdst-bottom-bubble {
    width: 700px;
    max-width: 90%;
  }

  .wdst-map-overlay__form .location-live-search {
    width: 100%;
  }
  .wdst-map-overlay__form input[type="text"] {
    width: 100%;
    font-size: 14px;
  }
}

.fusion-tb-footer {
  z-index: 1;
  position: relative;
}
