/* Find Shops page – map with markers + list */

/* Map section: full-width map with shop markers */
.find-shops-map-section {
  position: relative;
  width: 100%;
  margin-bottom: 1rem;
}

.find-shops-map {
  width: 100%;
  height: 360px;
  background: var(--muted);
}

@media (min-width: 640px) {
  .find-shops-map {
    height: 450px;
  }
}

@media (min-width: 1024px) {
  .find-shops-map {
    height: 500px;
  }
}

/* Map controls bar: below map so map stays fully visible */
.find-shops-map-controls {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto 1rem;
  padding: 0.75rem 1rem 0;
  background: var(--background);
}

.find-shops-map-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .find-shops-map-controls {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .find-shops-map-controls {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.find-shops-map-select {
  min-height: 2.25rem;
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--foreground);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.find-shops-map-select:hover,
.find-shops-map-select:focus {
  border-color: var(--primary);
  outline: none;
}


/* In-page directions panel (no redirect to Google) */
.find-shops-directions-panel {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  max-height: 40vh;
  overflow-y: auto;
  z-index: 350;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 0.8125rem;
}
.find-shops-directions-panel.hidden {
  display: none !important;
}
.find-shops-directions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.find-shops-directions-title {
  font-weight: 600;
  color: var(--foreground);
  margin: 0;
  font-size: 1rem;
}
.find-shops-directions-from-to {
  color: var(--muted-foreground);
}
.find-shops-directions-status {
  color: var(--primary);
}
.find-shops-directions-steps {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  color: var(--foreground);
}
.find-shops-directions-steps li {
  margin-bottom: 0.35rem;
}
.find-shops-directions-error {
  margin: 0;
}

.find-shops-map-controls-row .find-shops-map-search-wrap {
  flex: 1;
  min-width: 140px;
}

.find-shops-map-select {
  min-width: 0;
}

@media (max-width: 480px) {
  .find-shops-map-select {
    flex: 1 1 100%;
  }
}

.find-shops-map-search-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--background);
  border-radius: 9999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
}

.find-shops-map-search-icon {
  position: absolute;
  left: 1rem;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.find-shops-map-search-input {
  width: 100%;
  padding: 0.625rem 1rem 0.625rem 2.75rem;
  border: none;
  border-radius: 9999px;
  background: transparent;
  font-size: 0.9375rem;
  color: var(--foreground);
  outline: none;
}

.find-shops-map-search-input::placeholder {
  color: var(--muted-foreground);
}

/* Category legend on map */
.find-shops-map-legend {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  z-index: 350;
  pointer-events: auto;
  max-height: 40vh;
  overflow-y: auto;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  font-size: 0.75rem;
}
.find-shops-map-legend.hidden {
  display: none;
}
.find-shops-legend-title {
  font-weight: 600;
  color: var(--foreground);
  margin: 0 0 0.35rem 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.find-shops-legend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.find-shops-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--foreground);
}
.find-shops-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* Popup content on marker click */
.find-shops-popup {
  min-width: 140px;
  padding: 0.25rem 0;
}

.find-shops-popup-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.find-shops-popup a:hover {
  opacity: 0.9;
}

.find-shops-page {
  min-height: calc(100vh - 80px);
  padding: 1rem 0 2rem;
}

.find-shops-container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .find-shops-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .find-shops-container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Filters section */
.find-shops-filters {
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .find-shops-filters {
    margin-bottom: 2rem;
  }
}

/* Shops list section – full width, clear heading */
.find-shops-list {
  width: 100%;
}

/* Grid of shop cards – 1 col mobile, 2 tablet, 3 desktop */
.find-shops-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  min-height: 120px;
}

@media (min-width: 640px) {
  .find-shops-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

@media (min-width: 1024px) {
  .find-shops-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

/* Individual shop card */
.find-shop-card {
  display: flex;
  flex-direction: column;
  break-inside: avoid;
  overflow: visible;
}

.find-shop-card > div:first-of-type {
  flex-shrink: 0;
}

/* Shop profile picture – small, beside shop name (normal avatar size) */
.find-shop-card-pic,
.find-shop-card-pic-placeholder {
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  min-height: 2rem;
  max-width: 2rem;
  max-height: 2rem;
  border-radius: 9999px;
  font-size: 0.75rem;
}

.find-shop-card .btn {
  white-space: nowrap;
}

/* Action buttons – visible and touch-friendly on mobile */
.find-shop-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
  align-items: center;
  flex-shrink: 0;
}

.find-shop-card-actions .find-shop-btn {
  flex-shrink: 0;
  min-height: 36px;
}

@media (max-width: 639px) {
  .find-shop-card-actions {
    gap: 0.625rem;
  }

  .find-shop-card-actions .find-shop-btn {
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }
}

/* Empty state when no cards (sibling of .find-shop-card) */
#shop-list-empty {
  grid-column: 1 / -1;
}
