/**
 * Crocodile Cloth Store Locator — Styles
 * Adapted from rd-elementor-map-extension/assets/css/rd-elementor-map.css
 * Prefixed with .croc- to avoid conflicts in Shopify theme.
 */

.croc-store-locator-wrapper,
.croc-store-locator-wrapper *,
.croc-store-locator-wrapper *::before,
.croc-store-locator-wrapper *::after {
  box-sizing: border-box;
}

.croc-store-locator-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.croc-store-locator-wrapper--full-width {
  width: 100%;
}

/* ── Search bar ─────────────────────────────────────── */
.croc-map-search-bar {
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.croc-map-logo-row {
  display: flex;
  align-items: center;
}

.croc-map-logo {
  max-height: 60px;
  width: auto;
  display: block;
}

.croc-map-search-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.croc-map-location-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  min-height: 44px;
}

.croc-map-location-input:focus {
  outline: none;
  border-color: #93c90e;
  box-shadow: 0 0 0 3px rgba(147, 201, 14, 0.15);
}

.croc-map-radius-select {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
  min-height: 44px;
  min-width: 120px;
}

.croc-map-search-btn {
  padding: 10px 20px;
  background: #93c90e;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.2s;
  white-space: nowrap;
}

.croc-map-search-btn:hover {
  background: #7fb60c;
}

.croc-map-clear-btn {
  padding: 10px 16px;
  background: #e0e0e0;
  color: #333;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.2s;
  white-space: nowrap;
}

.croc-map-clear-btn:hover {
  background: #c8c8c8;
}

.croc-map-search-error {
  color: #d32f2f;
  font-size: 13px;
  padding: 4px 2px 0;
}

/* ── Body: sidebar + map ──────────────────────────── */
.croc-map-body {
  display: flex;
  gap: 16px;
  min-height: 500px;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────── */
.croc-map-sidebar {
  width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.croc-map-locations-header {
  padding: 12px 16px;
  border-bottom: 1px solid #e5e5e5;
  font-size: 13px;
  font-weight: 600;
  color: #555;
}

.croc-map-locations-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.croc-map-locations-list {
  display: flex;
  flex-direction: column;
}

.croc-map-location-item {
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.15s;
  min-height: 60px;
}

.croc-map-location-item:hover {
  background: #f8f8f8;
}

.croc-map-location-item--selected {
  background: #e8f5e9;
  border-left: 3px solid #93c90e;
}

.croc-map-location-name {
  font-size: 14px;
  font-weight: 600;
  color: #222;
  margin-bottom: 2px;
}

.croc-map-location-account {
  font-size: 12px;
  color: #888;
  font-style: italic;
  margin-bottom: 3px;
}

.croc-map-info-account {
  font-size: 12px;
  color: #888;
  font-style: italic;
  margin-bottom: 4px;
}

.croc-map-location-address {
  font-size: 13px;
  color: #666;
  margin-bottom: 2px;
}

.croc-map-location-phone a {
  font-size: 13px;
  color: #93c90e;
  text-decoration: none;
}

.croc-map-location-phone a:hover {
  text-decoration: underline;
}

.croc-map-location-dist {
  font-size: 12px;
  color: #999;
  margin-top: 2px;
}

.croc-map-no-results {
  padding: 20px 16px;
  color: #999;
  font-size: 14px;
}

/* ── Map canvas ──────────────────────────────────── */
.croc-map-canvas-wrap {
  flex: 1;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  min-height: 400px;
  height: 100%;
}

.croc-salesforce-map {
  width: 100%;
  height: 100%;
  min-height: 400px;
}

.croc-map-loading {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 20px;
  z-index: 10;
  pointer-events: none;
}

/* ── InfoWindow close button — top right ────────── */
.gm-style .gm-style-iw-chr {
  justify-content: flex-end !important;
}

/* ── Info window ─────────────────────────────────── */
.croc-map-info-window {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  max-width: 220px;
}

.croc-map-info-window strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
  color: #222;
}

.croc-map-info-window a {
  color: #93c90e;
  text-decoration: none;
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 768px) {
  .croc-map-body {
    flex-direction: column;
    height: auto !important; /* override inline height to prevent content clipping on mobile */
    overflow: visible;
  }

  .croc-map-sidebar {
    width: 100%;
    max-height: 300px;
  }

  .croc-map-canvas-wrap {
    min-height: 320px;
  }

  .croc-salesforce-map {
    min-height: 320px;
  }
}
