/**
 * Base styles for the TMS Divi 5 Map Module.
 * Divi's per-instance Design-tab CSS (list/listItem/resetButton/mapCanvas/
 * filterChip decoration groups) overrides these by source order — see
 * divi-5/modules-json/TmsMap/module.json.
 */

.tms-divi5-map-module {
  width: 100%;
}

.tms-map-shell {
  display: flex;
  gap: 16px;
  width: 100%;
  flex-wrap: wrap;
  align-items: stretch;
}

.tms-map-list {
  flex: 0 0 320px;
  width: 320px;
  min-width: 220px;
  max-height: 600px;
  overflow-y: auto;
  border: 1px solid #e6e6e6;
  border-radius: 6px;
  padding: 8px;
  background: #fff;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.tms-map-canvas {
  flex: 1 1 0%;
  min-width: 300px;
  min-height: 300px;
  align-self: stretch;
  border: 1px solid #e6e6e6;
  border-radius: 6px;
  box-sizing: border-box;
}

.tms-map-search {
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  margin-bottom: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.tms-map-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.tms-map-filter-chip {
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  cursor: pointer;
}

.tms-map-filter-chip.is-active {
  background: #006880;
  border-color: #006880;
  color: #fff;
}

.tms-map-list-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  padding: 10px;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.tms-map-list-item:hover {
  background: #fafafa;
}

.tms-map-list-item--area {
  --tms-area-color: #fbd238;
  border-left: 4px solid var(--tms-area-color);
  background: color-mix(in srgb, var(--tms-area-color) 15%, #fff);
}

.tms-map-list-item--area:hover {
  background: color-mix(in srgb, var(--tms-area-color) 25%, #fff);
}

.tms-map-item-photo {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 4px;
}

.tms-map-item-title {
  font-weight: bold;
}

.tms-map-item-body,
.tms-map-item-company,
.tms-map-item-phone {
  color: #555;
  font-size: 13px;
}

.tms-map-reset {
  display: block;
  position: sticky;
  top: 0;
  z-index: 1;
  margin-bottom: 8px;
  padding: 8px 16px;
  background: #006880;
  color: #fff;
  text-align: center;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}

.tms-map-infowindow {
  font-size: 13px;
  line-height: 1.4;
  max-width: 280px;
}

.tms-map-infowindow-photo {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 6px;
}

.tms-map-infowindow-link {
  display: inline-block;
  margin-top: 4px;
  color: #006880;
  font-weight: bold;
  text-decoration: underline;
}

@media (max-width: 900px) {
  .tms-map-shell {
    flex-direction: column;
    flex-wrap: nowrap;
  }
  .tms-map-list {
    width: 100%;
    flex: 0 0 auto;
    max-height: 320px;
  }
  .tms-map-canvas {
    width: 100%;
    flex: 0 0 auto;
    min-height: 320px;
  }
}
