/* ─── Overwrite GM Styles ─────────────────────────────────────────────────── */

.gm-style-iw-chr {
  position: absolute;
  right: 0;
}

.gm-style .gm-style-iw-d {
  padding-top: 1rem;
}

/* ─── Wrapper ─────────────────────────────────────────────────────────────── */
.csl-map-wrapper {
  display: flex;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(27, 45, 32, .12);
  border-radius: 8px;
}

/* ─── Sidebar ─────────────────────────────────────────────────────────────── */
.csl-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid #e2e8e4;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  gap: 16px;
  overflow-y: auto;
}

/* ─── Search block ────────────────────────────────────────────────────────── */
.csl-search-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.csl-search-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #6b7a72;
}

/* Input + locate button joined together */
.csl-search-group {
  display: flex;
}

.csl-search-input {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  padding: 9px 12px 9px 36px !important;
  border: 1px solid #cdd8d2 !important;
  border-right: none;
  border-radius: 6px 0 0 6px !important;
  font-size: 14px !important;
  color: #1b2d20 !important;
  background: #f6faf7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7a72' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 10px center;
  transition: border-color .15s, box-shadow .15s !important;
  outline: none;
  line-height: 1.4 !important;
}

.csl-search-input:focus {
  border-color: #4a7c59;
  box-shadow: 0 0 0 3px rgba(74, 124, 89, .15);
  background-color: #ffffff;
  z-index: 1;
  position: relative;
}

.csl-search-input::placeholder {
  color: #9bada4;
}

.csl-search-input--error {
  border-color: #c0392b !important;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, .15) !important;
  background-color: #fff8f7 !important;
}

.csl-search-hint {
  display: none;
  font-size: 11px;
  color: #b05a2a;
  font-style: italic;
  margin: 4px 2px 0;
}

/* ─── Map canvas ──────────────────────────────────────────────────────────── */
.csl-map {
  flex: 1;
  min-width: 0;
  background: linear-gradient(135deg, #eef3e9, #d7e4dc);
}

/* ─── Controls row: radius + zoom side by side ───────────────────────────── */
.csl-controls-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.csl-radius-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.csl-radius-select {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 26px 8px 8px;
  border: 1px solid #cdd8d2;
  border-radius: 6px;
  font-size: 13px;
  color: #1b2d20;
  background: #f6faf7;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7a72' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color .15s, box-shadow .15s;
}

.csl-radius-select:focus {
  border-color: #4a7c59;
  box-shadow: 0 0 0 3px rgba(74, 124, 89, .15);
  background-color: #ffffff;
}

.csl-radius-select:disabled {
  opacity: .4;
  cursor: not-allowed;
  background-color: #f0f0f0;
}

/* ─── Zoom controls ──────────────────────────────────────────────────────── */
.csl-zoom-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.csl-zoom-controls {
  display: flex;
  gap: 4px;
}

.csl-zoom-btn {
  width: 34px;
  height: 36px;
  border: none;
  border-radius: 6px;
  background: #1b2d20;
  color: #f6faf7;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 1px 2px rgba(0, 0, 0, .35);
  transition: background .15s, box-shadow .15s, transform .1s;
  user-select: none;
}

.csl-zoom-btn:hover {
  background: #2d4a35;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 2px 6px rgba(0, 0, 0, .4);
}

.csl-zoom-btn:active {
  background: #152318;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .4);
  transform: translateY(1px);
}

.csl-zoom-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(74, 124, 89, .45), inset 0 1px 0 rgba(255, 255, 255, .07);
}

/* ─── Locate button (icon only, attached to search input) ────────────────── */
.csl-locate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  padding: 0;
  border: none;
  border-radius: 0 6px 6px 0;
  background: #1b2d20;
  color: #f6faf7;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 1px 2px rgba(0, 0, 0, .35);
  transition: background .15s, box-shadow .15s, transform .1s;
}

.csl-locate-btn:hover {
  background: #2d4a35;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 2px 6px rgba(0, 0, 0, .4);
}

.csl-locate-btn:active {
  background: #152318;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .4);
  transform: translateY(1px);
}

.csl-locate-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(74, 124, 89, .45);
  z-index: 1;
  position: relative;
}

.csl-locate-btn.is-loading {
  opacity: .65;
  cursor: wait;
}

/* ─── InfoWindow ─────────────────────────────────────────────────────────── */
.csl-info-window {
  min-width: 200px;
  max-width: 300px;
  width: max-content;
  font-family: inherit;
  line-height: 1.5;
  overflow: hidden;
  word-break: break-word;
  white-space: normal;
}

.csl-info-window * {
  box-sizing: border-box;
}

.csl-info-og {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 10px;
}

.csl-info-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #1b2d20;
  margin-bottom: 6px;
}

.csl-info-link {
  color: #4a7c59;
  text-decoration: none;
}

.csl-info-link:hover {
  text-decoration: underline;
}

.csl-info-phone {
  display: block;
  font-size: 12px;
  color: #4a7c59;
  text-decoration: none;
  margin-bottom: 6px;
}

.csl-info-phone:hover {
  text-decoration: underline;
}

.csl-info-excerpt {
  font-size: 12px;
  color: #4a5e50;
}

.csl-info-excerpt p {
  margin: 0 0 4px;
}

/* ─── Location list ──────────────────────────────────────────────────────── */
.csl-location-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}

.csl-list-header {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #4a7c59;
  padding: 4px 2px 6px;
}

.csl-list-header--empty {
  color: #b05a2a;
}

.csl-list-header--prompt {
  color: #9bada4;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  font-style: italic;
}

.csl-list-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}

.csl-list-item:hover {
  background: #f0f7f2;
  border-color: #cdd8d2;
}

.csl-list-item:active {
  background: #e4f0e8;
}

.csl-list-title {
  font-size: 13px;
  font-weight: 600;
  color: #1b2d20;
  line-height: 1.3;
}

.csl-list-meta {
  font-size: 11px;
  color: #6b7a72;
}

/* ─── Full-width map (results_outside mode) ─────────────────────────────── */
.csl-map-wrapper--full {
  flex-direction: column;
  height: auto !important;
}

.csl-map-wrapper--full .csl-map {
  flex: none;
  width: 100%;
  height: var(--csl-map-height, 460px);
}

/* ─── Toolbar (search + controls bar above map) ──────────────────────────── */
.csl-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 16px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8e4;
}

.csl-toolbar .csl-search-group {
  flex: 1 1 220px;
  min-width: 0;
}

.csl-toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.csl-toolbar .csl-radius-wrap {
  flex: 0 0 auto;
  min-width: 120px;
}

.csl-toolbar .csl-zoom-wrap {
  flex-shrink: 0;
}

/* ─── External results panel ─────────────────────────────────────────────── */
.csl-results-panel {
  margin-top: 20px;
}

.csl-results-panel .csl-list-header {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #4a7c59;
  padding: 0 0 12px;
}

.csl-results-panel .csl-list-header--empty {
  color: #b05a2a;
}

.csl-results-panel .csl-list-header--prompt {
  color: #9bada4;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-style: italic;
}

/* ─── Cards grid ─────────────────────────────────────────────────────────── */
.csl-cards-grid {
  display: grid;
  grid-template-columns: auto auto auto;
  gap: 1em;
}

.csl-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  text-align: left;
  background: #ffffff;
  border: 1px solid #e2e8e4;
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
  box-shadow: 0 1px 4px rgba(27, 45, 32, .06);
}

.csl-card:hover {
  border-color: #4a7c59;
  box-shadow: 0 4px 14px rgba(27, 45, 32, .12);
}

.csl-card-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #1b2d20;
  line-height: 1.3;
  padding-right: 20px;
}

.csl-card-distance {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #4a7c59;
  background: #edf7f0;
  border-radius: 20px;
  padding: 2px 8px;
  margin-bottom: 2px;
  align-self: flex-start;
}

.csl-card-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.csl-card-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #9bada4;
}

.csl-card-value {
  font-size: 13px;
  color: #3a4e40;
  line-height: 1.4;
}

.csl-card-phone,
.csl-card-link {
  color: #4a7c59;
  text-decoration: none;
  font-size: 13px;
}

.csl-card-phone:hover,
.csl-card-link:hover {
  text-decoration: underline;
}

.csl-card-pin {
  position: absolute;
  bottom: 12px;
  right: 12px;
  color: #cdd8d2;
  transition: color .15s;
}

.csl-card:hover .csl-card-pin {
  color: #4a7c59;
}

/* ─── Google Places autocomplete dropdown ────────────────────────────────── */
.pac-container {
  border-radius: 6px;
  border: 1px solid #cdd8d2;
  box-shadow: 0 6px 20px rgba(27, 45, 32, .1);
  font-family: inherit;
  margin-top: 2px;
  min-width: 320px !important;
  width: auto !important;
  box-sizing: border-box;
}

.pac-item {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}

.pac-item:hover,
.pac-item-selected {
  background: #f0f7f2;
}

.pac-item-query {
  font-size: 13px;
  color: #1b2d20;
}

.pac-icon {
  display: none;
}

/* ─── iPad landscape (769px – 1024px) ───────────────────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
  .csl-sidebar {
    width: 100%;
    flex-shrink: 0;
    border-right: none;
    border-bottom: 1px solid #e2e8e4;
    padding: 14px 16px;
  }

  .csl-map-wrapper {
    flex-direction: column;
    height: auto !important;
  }

  .csl-controls-row {
    flex-direction: row;
    width: 100%;
  }

  .csl-radius-wrap {
    flex: 1;
  }

  .csl-search-wrap,
  .csl-search-group {
    width: 100%;
  }

  .csl-map {
    flex: none;
    width: 100%;
    height: 460px;
    min-height: 460px;
  }

  .csl-location-list {
    max-height: 160px;
  }

  .csl-cards-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .csl-toolbar .csl-search-group {
    flex: 1 1 100%;
  }

  .csl-toolbar-controls {
    width: 100%;
  }

  .csl-toolbar .csl-radius-wrap {
    flex: 1;
  }
}

/* ─── iPad portrait (601px – 768px) ─────────────────────────────────────── */
@media (min-width: 601px) and (max-width: 768px) {
  .csl-map-wrapper {
    flex-direction: column;
    height: auto !important;
  }

  .csl-sidebar {
    width: 100%;
    flex-shrink: 0;
    border-right: none;
    border-bottom: 1px solid #e2e8e4;
    padding: 14px 16px;
    max-height: 320px;
  }

  .csl-controls-row {
    flex-direction: row;
    width: 100%;
  }

  .csl-radius-wrap {
    flex: 1;
  }

  .csl-search-wrap,
  .csl-search-group {
    width: 100%;
  }

  .csl-map {
    flex: none;
    width: 100%;
    height: 400px;
    min-height: 400px;
  }

  .csl-location-list {
    max-height: 140px;
  }

  .csl-cards-grid {
    grid-template-columns: 1fr 1fr;
  }

  .csl-toolbar .csl-search-group {
    flex: 1 1 100%;
  }

  .csl-toolbar-controls {
    width: 100%;
  }

  .csl-toolbar .csl-radius-wrap {
    flex: 1;
  }
}

/* ─── Responsive: sidebar on top for narrow viewports ────────────────────── */
@media (max-width: 600px) {
  .csl-map-wrapper {
    flex-direction: column;
    height: auto !important;
  }

  .csl-sidebar {
    width: 100%;
    flex-shrink: 0;
    border-right: none;
    border-bottom: 1px solid #e2e8e4;
    padding: 12px;
    max-height: 280px;
  }

  .csl-cards-grid {
    grid-template-columns: 1fr;
  }

  .csl-map {
    flex: none;
    width: 100%;
    height: 340px;
    min-height: 340px;
  }

  .csl-location-list {
    max-height: 120px;
  }
}