.mapboxgl-map {
  font-size: 13px;
}

.mapboxgl-ctrl-top-right {
  top: 70px;
}

/* ===== MAP COMPONENT WRAPPER ===== */
/* Wrap #geocoder-div and #flex-map in a container, or use this structure */

/* ===== MAP CONTAINER - Overlay Layout ===== */
#flex-map {
  position: relative;
  width: 100%;
  height: 550px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.sidebar {
  position: absolute;
  bottom: 0;
  left: 10px;
  right: 0;
  height: auto;
  overflow: hidden;
  background-color: transparent;
  border: none;
  z-index: 10;
}

.map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 16px;
}

#map {
  width: 100%;
  height: 100%;
}

/* ===== SEARCH BAR - Top Overlay ===== */
#geocoder-div {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 50px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  padding: 6px 6px 6px 16px;
}

#geocoder-div .mapboxgl-ctrl-geocoder {
  flex: 1;
  min-width: 0;
  max-width: none;
  width: 100%;
  box-shadow: none;
  background: transparent;
}

/* Input field */
#geocoder-div .mapboxgl-ctrl-geocoder--input {
  border: none;
  padding: 6px 35px;
  height: 40px;
  font-size: 15px;
}

#geocoder-div .mapboxgl-ctrl-geocoder--input:focus {
  border: none;
  outline: none;
}

/* Search icon - left side */
#geocoder-div .mapboxgl-ctrl-geocoder--icon-search {
  position: absolute;
  left: 8px;
  top: 10px;
  width: 20px;
  height: 20px;
}

/* Right side icons container */
#geocoder-div .mapboxgl-ctrl-geocoder--pin-right > * {
  top: 10px;
  right: 8px;
}

/* Close button */
#geocoder-div .mapboxgl-ctrl-geocoder--icon-close {
  width: 16px;
  height: 16px;
  margin: 0;
}

/* Loading icon */
#geocoder-div .mapboxgl-ctrl-geocoder--icon-loading {
  width: 26px;
  height: 26px;
  margin: -5px 0 0 0;
}

.find-location-btn {
  background: #6b4eff;
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 12px 24px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.find-location-btn:hover {
  background: #5a3de8;
}

.heading {
  display: none;
}

/* ===== LOCATION CARDS - Bottom Carousel ===== */
.listings {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  margin-bottom: 16px;
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 0 16px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline-start: 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border: none;
  height: auto;
  max-height: 180px;
}

.listings::-webkit-scrollbar {
  display: none;
}

.listings .item {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

/* ===== LISTING CARD - Redesigned ===== */
.map-listing-partner {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  width: 200px;
  min-width: 200px;
  border-radius: 12px;
  background: #fff;
  margin: 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}

.map-listing-partner:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Card header: logo + distance */
.listing-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
}

.listing-operator-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: contain;
}

.listing-distance {
  white-space: nowrap;
  font-weight: 600;
  font-size: 13px;
  color: #666;
  margin: 0;
  margin-left: auto;
}

.no-listing-distance {
  display: none;
}

/* Card title: numbered store name */
.listing-store-name {
  font-family: 'Red Hat', Sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #130c34;
}

/* Card address */
.listing-partner-address {
  font-family: 'Red Hat', Sans-serif;
  font-size: 13px;
  color: #666;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Hide elements not needed in new design */
.map-listing-partner .listing-partner-title,
.map-listing-partner .listing-partner-info,
.map-listing-partner .listing-value-prop,
.map-listing-partner .listing-actions {
  display: none;
}

.listings .item .title small {
  font-weight: 400;
}

.listings .item .title {
  text-decoration: none;
}
.listings .item.active {
  background-color: transparent;
}
.mapboxgl-canvas-container,
.mapboxgl-container .leaflet-marker-icon,
.md-card-content .content span:hover input,
.md-card-content .content span:hover label {
  cursor: pointer;
}
.clearfix {
  display: block;
}
.clearfix:after {
  content: '.';
  display: block;
  height: 0;
  clear: both;
  visibility: hidden;
}
.mapboxgl-popup {
  padding-bottom: 30px;
}
.mapboxgl-popup-content {
  font-family: 'Red Hat', 'Helvetica Neue', Sans-serif;
  padding: 20px 12px 15px;
  width: 300px;
  min-width: 300px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
}

#listings .title h2,
#listings .title h3,
.mapboxgl-popup-content h2,
.mapboxgl-popup-content h3 {
  font: 'Red Hat', 'Helvetica Neue', Sans-serif;
  display: block;
  text-align: left;
  color: #130c34;
  margin: 0;
  font-size: 14px;
}

#listings .item div,
.mapboxgl-popup-content div {
  font-family: 'Red Hat', Sans-serif;
}
#listings .item div a.MoneyGram-store-link,
#listings .item div a.ATM-store-link,
#listings .item div a.Caseys-store-link,
#listings .item div a.RiteAid-store-link,
#listings .item div a.WinnDixie-store-link,
#listings .item div a.CVS-store-link,
#listings .item div a.GetGo-store-link,
#listings .item div a.Loves-store-link,
#listings .item div a.Weis-store-link,
#listings .item div a.Harveys-store-link,
#listings .item div a.GiantEagle-store-link,
#listings .item div a.Tops-store-link,
#listings .item div a.OfficeMax-store-link,
#listings .item div a.Walmart-store-link,
.MoneyGram-onmap-store-link,
.MoneyGram-popup .mapboxgl-popup-content a:first-of-type,
.ATM-onmap-store-link,
.ATM-popup .mapboxgl-popup-content a:first-of-type,
.Caseys-onmap-store-link,
.Caseys-popup .mapboxgl-popup-content a:first-of-type,
.RiteAid-onmap-store-link,
.RiteAid-popup .mapboxgl-popup-content a:first-of-type,
.WinnDixie-onmap-store-link,
.WinnDixie-popup .mapboxgl-popup-content a:first-of-type,
.CVS-onmap-store-link,
.CVS-popup .mapboxgl-popup-content a:first-of-type,
.GetGo-onmap-store-link,
.GetGo-popup .mapboxgl-popup-content a:first-of-type,
.Loves-onmap-store-link,
.Loves-popup .mapboxgl-popup-content a:first-of-type,
.Weis-onmap-store-link,
.Weis-popup .mapboxgl-popup-content a:first-of-type,
.Harveys-onmap-store-link,
.Harveys-popup .mapboxgl-popup-content a:first-of-type,
.GiantEagle-onmap-store-link,
.GiantEagle-popup .mapboxgl-popup-content a:first-of-type,
.Tops-onmap-store-link,
.Tops-popup .mapboxgl-popup-content a:first-of-type,
.OfficeMax-onmap-store-link,
.OfficeMax-popup .mapboxgl-popup-content a:first-of-type,
.Walmart-onmap-store-link,
.Walmart-popup .mapboxgl-popup-content a:first-of-type,
.dropdown-container #drop,
.mapboxgl-ctrl-top-right
  .mapboxgl-ctrl-geocoder.mapboxgl-ctrl {
  display: block;
}

#menuToggle {
  display: none;
}

#listings .item div > div:nth-of-type(2) {
  position: relative;
}

.geocoder {
  /* Reset old positioning - now handled by #geocoder-div */
  position: relative;
  z-index: 1;
  width: 100%;
  left: 0;
  margin-left: 0;
  top: 0;
}

.mapboxgl-popup-anchor-top > .mapboxgl-popup-content {
  margin-top: 15px;
}
.mapboxgl-popup-anchor-top > .mapboxgl-popup-tip {
  border-bottom-color: #91c949;
}
.storeDetailsBtn {
  background: green;
  color: #fff;
}
.mapboxgl-popup-close-button {
  font-size: 1.7em;
  padding: 0;
  margin-right: 12px;
}

input.mapboxgl-ctrl-geocoder--input:focus {
  border: none;
  outline: none;
}
input.mapboxgl-ctrl-geocoder--input::placeholder {
  color: #999;
}
button.mapboxgl-popup-close-button,
button.mapboxgl-popup-close-button:hover {
  color: #130c34;
  background: transparent;
}

.mapboxgl-ctrl-geocoder
  .mapboxgl-ctrl-geocoder--pin-right
  > * {
  z-index: 30;
}
@media screen and (min-width: 640px) {
  .mapboxgl-ctrl-geocoder {
    min-width: 100%;
    width: 100% !important;
    box-shadow: none;
  }
}
.dropdown-container {
  border-radius: 3px;
  background: #fff;
  text-align: center;
  position: relative;
}
.dropdown-container label {
  position: relative;
  display: block;
  width: 100%;
  cursor: pointer;
  background: #e7e7eb;
  color: #130c34;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  padding: 0 10px;
  font:
    400 17px/38px 'Red Hat',
    'Helvetica Neue',
    Sans-serif;
  transition: 0.2s;
  text-align: left;
}
.dropdown-container label:hover {
  background: #d9d9df;
}
.dropdown-container label:after {
  content: '›';
  position: absolute;
  width: 40px;
  font-size: 32px;
  padding-left: 0;
  bottom: 0;
  transform: rotate(90deg);
  top: 75%;
  right: -5px;
}
.dropdown-container .content {
  height: 0;
  max-height: 0;
  margin: 0;
  text-align: left;
  overflow: hidden;
  transition: 0.3s linear;
  position: relative;
  z-index: 999;
  background: #fff;
  display: flex;
  flex-wrap: wrap;
  padding: 0 8px;
}
.dropdown-container .content span {
  flex-grow: 1;
  width: 50%;
  margin: 10px 0;
  display: flex;
  align-items: center;
}
.dropdown-container .content span img {
  margin: 0 4px 0 6px;
}
.dropdown-container .content span input {
  cursor: pointer;
  width: 1em;
  height: 1em;
}
.dropdown-container #drop:checked ~ .content {
  height: auto;
  width: 100%;
  max-height: 900px;
  transition: max-height 0.2s ease-in;
  overflow: hidden;
}
.md-caption {
  font-size: 0.7em;
  line-height: 1.4rem;
  opacity: 0.7;
}
.md-button {
  display: inline-block;
  font:
    700 15px 'Red Hat',
    sans-serif;
  padding: 8px;
  min-width: 70px;
  border-radius: 2px;
  border: none;
  text-align: center;
  cursor: pointer;
  -webkit-transition: 0.3s;
  transition: 0.3s;
  color: #130c34;
}
.md-button:hover {
  background-color: #f7f7f7;
}
.md-card {
  background-color: #fff;
  border-radius: 5px;
  overflow: hidden;
}
.md-card-content {
  padding: 20px 25px;
}
@media (max-width: 767px) {
  /* Mobile: Adjust map height and card sizes */
  #flex-map {
    height: 550px;
    border-radius: 12px;
  }

  #geocoder-div {
    top: 12px;
    left: 12px;
    right: 12px;
    padding: 4px 4px 4px 12px;
  }

  #geocoder-div .mapboxgl-ctrl-geocoder--input {
    height: 36px;
    font-size: 14px;
  }

  .find-location-btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .listings {
    gap: 10px;
    padding: 0 12px;
    max-height: 160px;
    /* margin-bottom: 12px; */
  }

  .map-listing-partner {
    width: 180px;
    min-width: 180px;
    padding: 12px 14px;
    gap: 4px;
  }

  .listing-operator-icon {
    width: 24px;
    height: 24px;
  }

  .listing-store-name {
    font-size: 14px;
  }

  .listing-partner-address {
    font-size: 12px;
  }

  .listing-distance {
    font-size: 12px;
  }

  .geocoder {
    width: 100%;
    left: 0;
    margin-left: 0;
  }

  .mapboxgl-popup-content {
    width: 100%;
    min-width: 280px;
  }

  button.mapboxgl-popup-close-button:hover {
    background: transparent;
  }

  .mapboxgl-popup-content h2,
  .mapboxgl-popup-content h3 {
    font-size: 1.4em;
  }
}

.md-card-content .content {
  display: flex;
  flex-wrap: wrap;
}
.md-card-content p {
  font:
    700 15px/18px 'Red Hat',
    sans-serif;
  margin-bottom: 20px;
}
.close-x,
.md-card-btns label {
  font:
    500 15px 'Red Hat',
    sans-serif;
}
.close-container {
  background: #f7f7f7;
  float: right;
  position: absolute;
  top: 0;
  right: 0;
  border-bottom-left-radius: 5px;
  transition: 0.2s;
}
.close-container:hover {
  background: #f5f5f5;
}
.close-x {
  padding: 8px;
  color: #130c34;
}
.close-x:hover {
  cursor: pointer;
  color: #111;
}
.md-card-content .content span {
  flex-basis: 25%;
  font:
    400 15px 'Red Hat',
    sans-serif;
  color: #130c34;
  display: flex;
  align-items: center;
}

.md-card-content
  .content
  span:hover
  .md-card-content
  .content
  span:hover
  label {
  color: #111;
  font-weight: 400;
}
.md-card-content .content span label {
  margin-top: 2.5px;
}
.md-card-content .content input {
  margin-right: 4px;
}
.md-card-btns {
  border-top: 1px solid #ddd;
  padding: 8px 12px;
  min-height: 55px;
}
.md-card-btns label:first-of-type {
  position: absolute;
  left: 15px;
}
.md-card-btns label:nth-of-type(2) {
  position: absolute;
  right: 15px;
}
.toggleButtonContainer {
  border-bottom: 2px solid #130c34;
  max-width: 100px;
  margin: 0 auto 22px;
}
.toggleButton {
  margin: 0 auto;
  display: block;
  max-width: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toggleButton img {
  margin-left: 6px;
}
.infobox {
  visibility: hidden;
  opacity: 0;
  position: fixed;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  min-width: 400px;
  max-width: 520px;
  z-index: 3;
  box-shadow:
    0 19px 38px rgba(0, 0, 0, 0.3),
    0 15px 12px rgba(0, 0, 0, 0.22);
  -webkit-transition:
    visibility 0s 0.4s,
    opacity 0.4s;
  transition:
    visibility 0s 0.4s,
    opacity 0.4s;
}
:checked + .infobox {
  visibility: visible;
  opacity: 1;
  -webkit-transition:
    visibility,
    opacity 0.4s 0.1s;
  transition:
    visibility,
    opacity 0.4s 0.1s;
}
@media (min-width: 768px) {
  input[type='radio']:after,
  input[type='radio']:checked:after {
    width: 15px;
    height: 15px;
    top: -2px;
    left: -1px;
    position: relative;
    content: '';
    display: inline-block;
    visibility: visible;
  }
  input[type='radio']:after {
    border-radius: 15px;
    background-color: #130c34;
    border: 2px solid #130c34;
  }
  input[type='radio']:checked:after {
    border-radius: 15px;
    background-color: #1ee66e;
    border: 2px solid #130c34;
  }
}

.popup-distance {
  white-space: nowrap;
  font-weight: 700;
  font-size: 13px;
  color: #130c34;
  margin: 0;
}

.no-popup-distance {
  display: none;
}

.mapboxgl-popup-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.map-popup-partner-cmc {
  display: flex;
  flex-direction: column;
  align-items: start;
  padding-top: 0 !important;
}

.popup-partner-title {
  display: flex;
  align-items: center;
  gap: 8px;

  h2 {
    margin: 0;
    font-size: clamp(18px, 1vw, 24px) !important;
    color: #130c34;
  }
}

.popup-partner-info {
  width: 100%;
  p {
    margin: 0;
  }
}

.partner-address {
  width: 100%;
  margin: 0;
  font-family: 'Red Hat', Sans-serif;
  font-size: 13px;
}

.cmc-icon {
  width: 24px;
  height: 24px;
}

.cm-btn-icon {
  width: 80px;
  height: 53px;
}

.popup-value-prop,
.listing-value-prop {
  background: linear-gradient(
    135deg,
    #e6f7ff 0%,
    #f0fdf4 100%
  );
  padding: 8px !important;
  border-radius: 4px;
  width: 100%;
}

.marketing-highlight,
.listing-marketing-highlight {
  display: flex;
  align-items: center;
  gap: 6px;
}

.marketing-highlight {
  p {
    margin: 0 !important;
    font-size: 13px;
    color: #130c34;
  }
}

.marketing-icon {
  font-size: 20px;
}

.popup-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.map-popup-btn_secondary {
  width: 100%;
  color: #130c34;
  padding: 10px 16px;
  font-weight: 500;
  border: 1px solid #ddd;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s;
  text-align: center;
  font-size: 13px !important;
  white-space: nowrap;
  outline: none;
}

.map-popup-btn_secondary:focus {
  outline: none;
}

.map-popup-btn_secondary:hover {
  background: #f5f5f5;
  color: #130c34 !important;
}

/* OLD SIDEBAR STYLES - Keep only for popup, not listing cards */
.listing-partner-title {
  a {
    display: flex;
    align-items: center;
    gap: 8px;
  }
}

.listing-partner-title h2 {
  margin: 0;
  font-family: 'Red Hat', 'Helvetica Neue', Sans-serif;
  font-size: 14px;
  color: #130c34;
}
.listing-partner-info {
  width: 100%;
}
.listing-partner-info p {
  font-size: 13px;
  color: #130c34;
  opacity: 0.9;
  margin: 0;
}

.listing-address {
  font-size: 13px;
  color: #130c34;
  opacity: 0.7;
  margin: 0;
}

.listing-marketing-highlight p {
  margin: 0;
  font-size: 13px;
  color: #130c34;
}

.marketing-icon {
  font-size: 20px;
}

.listing-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.map-listing-btn_secondary {
  width: 100%;
  color: #130c34;
  padding: 10px 16px;
  font-weight: 500;
  border: 1px solid #ddd;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s;
  font-size: 13px;
  text-align: center;
}
.map-listing-btn_secondary:hover {
  background: #f5f5f5;
  color: #130c34 !important;
}

@media (max-width: 767px) {
  .listing-cmc-primary-cta,
  .map-listing-btn_secondary,
  .listing-marketing-highlight > p,
  .listing-partner-info p,
  .listing-address {
    font-size: 12px;
  }
}

@media (max-width: 375px) {
  .mapboxgl-popup-content {
    min-width: 220px;
  }
}
