/* ===== TOUR STOP LIST (desktop / full) ===== */
.tour-stops-list { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }

.tour-stop-card {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--color-card); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 14px 16px;
}
.tour-stop-card.tour-stop-visited   { border-left: 4px solid var(--color-success); }
.tour-stop-card.tour-stop-absent    { border-left: 4px solid var(--color-danger); opacity: 0.75; }
.tour-stop-card.tour-stop-postponed { border-left: 4px solid var(--color-warning); }
.tour-stop-card.tour-stop-pending   { border-left: 4px solid var(--color-border-dark); }

.tour-stop-order {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  background: var(--color-primary-light); color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
}
.tour-stop-drag-handle {
  cursor: grab; color: var(--color-text-muted); font-size: 1.1rem;
  padding: 4px; user-select: none; display: none;
}
.tour-stops-list.reordering .tour-stop-drag-handle { display: block; }
.tour-stops-list.reordering .tour-stop-card { cursor: grab; }
.tour-stop-card.dragging { opacity: 0.4; }

.tour-stop-body { flex: 1; min-width: 0; }
.tour-stop-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.tour-stop-name { font-weight: 700; }
.tour-stop-meta { font-size: 0.82rem; color: var(--color-text-secondary); margin-bottom: 8px; }
.tour-stop-notes-view { font-size: 0.82rem; color: var(--color-text-secondary); font-style: italic; margin-top: 6px; }

.tour-stop-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tour-stop-notes-row { display: flex; gap: 8px; margin-top: 8px; }
.tour-stop-notes-row input { flex: 1; }

/* ===== MOBILE FOCUSED "NEXT STOP" VIEW ===== */
.tour-mobile-focus {
  background: var(--color-card); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 24px 18px; margin: 16px 0;
  text-align: center;
}
.tour-mobile-focus-progress {
  font-size: 0.8rem; color: var(--color-text-muted); text-transform: uppercase;
  letter-spacing: 0.05em; font-weight: 700; margin-bottom: 12px;
}
.tour-mobile-focus-name { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.tour-mobile-focus-address { font-size: 1.05rem; color: var(--color-text-secondary); margin-bottom: 4px; }
.tour-mobile-focus-meta { font-size: 0.9rem; color: var(--color-text-muted); margin-bottom: 18px; }

.tour-mobile-focus-btn {
  display: block; width: 100%; padding: 18px; margin-bottom: 12px;
  font-size: 1.1rem; font-weight: 700; border-radius: var(--radius-md);
  border: none; cursor: pointer;
}
.tour-mobile-focus-btn-maps   { background: var(--color-primary-light); color: var(--color-primary); }
.tour-mobile-focus-btn-visit  { background: var(--color-success); color: #fff; }
.tour-mobile-focus-btn-absent { background: var(--color-danger-light); color: var(--color-danger); }

.tour-mobile-focus textarea {
  width: 100%; margin-bottom: 14px; min-height: 70px;
}

.tour-mobile-focus-nav {
  display: flex; align-items: center; justify-content: space-between; margin-top: 6px;
}
.tour-mobile-focus-nav button {
  background: none; border: none; color: var(--color-primary);
  font-weight: 700; font-size: 0.95rem; padding: 8px 12px; cursor: pointer;
}
.tour-mobile-focus-nav button:disabled { color: var(--color-text-muted); cursor: not-allowed; }

.tour-mobile-focus-done {
  padding: 30px 16px; font-size: 1.2rem; font-weight: 700; color: var(--color-success);
}

/* ===== MAP PLACEHOLDER (shown only when a tour has no stops yet) ===== */
.tour-map-placeholder {
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px;
  min-height: 160px; padding: 24px; text-align: center;
  color: var(--color-text-secondary); background: var(--color-bg-subtle);
}

/* ===== GOOGLE MAPS TOUR MAP ===== */
.tour-map-embed-wrap { position: relative; width: 100%; }
.tour-map-iframe { display: block; width: 100%; height: 520px; border: 0; }
.tour-map-fullscreen-btn { position: absolute; top: 10px; right: 60px; box-shadow: var(--shadow-md, 0 2px 8px rgba(0,0,0,.25)); }
.tour-map-note { padding: 8px 14px; font-size: 0.8rem; color: var(--color-warning); }
@media (max-width: 640px) {
  .tour-map-iframe { height: 85vh; min-height: 420px; }
  .tour-map-fullscreen-btn { right: 10px; top: auto; bottom: 14px; }
}

.tour-map-popup { font-size: 0.85rem; line-height: 1.5; }
.tour-map-popup em { color: var(--color-warning); }

/* ===== GOOGLE MAPS COMMERCE MAP (Clients section) ===== */
/* The parent (#commerce-map-placeholder) is a flex container with
   align-items: center, so a flex item with no explicit width shrinks to
   fit its content instead of filling the row — and this wrapper's only
   in-flow child is width:100% of *it*, which collapses to 0 in that
   situation. Without an explicit width here, the map ends up initialized
   against a near-zero-size container and renders blank. */
.commerce-map-wrap { position: relative; width: 100%; }
.commerce-map {
  height: 640px; width: 100%; border-radius: var(--radius-md); z-index: 0;
}
@media (max-width: 640px) {
  .commerce-map { height: 420px; }
}

.commerce-map-hint {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  pointer-events: none; z-index: 5; max-width: 80%; text-align: center;
  background: rgba(17, 24, 39, 0.75); color: #fff; padding: 10px 18px;
  border-radius: var(--radius-md); font-size: 0.9rem; font-weight: 600;
}

.commerce-map-hint-top { top: 14px; transform: translateX(-50%); }

.commerce-map-popup { font-size: 0.85rem; line-height: 1.5; }
.commerce-delete-confirm { margin-top: 8px; font-weight: 600; }
.commerce-popup-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }


.commerce-map-legend {
  display: flex; align-items: center; gap: 16px; font-size: 0.85rem; color: var(--color-text-secondary);
}
.commerce-map-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.commerce-map-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
}

.commerce-map-selection-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding: 10px 16px; margin-bottom: 12px;
  background: var(--color-primary-light); border: 1px solid var(--color-primary);
  border-radius: var(--radius-md); font-size: 0.85rem; font-weight: 700; color: var(--color-primary);
}
.commerce-map-selection-actions { display: flex; gap: 8px; }



@media (max-width: 640px) {
  .tour-stop-card { flex-wrap: wrap; }
  .tour-stop-actions { width: 100%; }
}

.btn-prospect { font-weight: 700; padding: 12px 24px; font-size: 1.05rem; box-shadow: 0 2px 8px rgba(0,112,56,0.35); }
.btn-prospect.btn-success { box-shadow: 0 2px 8px rgba(5,150,105,0.35); }

.map-search-control {
  margin: 10px; width: 340px; max-width: calc(100vw - 90px); position: relative;
}
.map-search-input {
  width: 100%; box-sizing: border-box; padding: 12px 16px; font-size: 0.95rem;
  border: 0; border-radius: 8px; background: #fff; color: #202124;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3); outline: none;
}
.map-search-input:focus { box-shadow: 0 2px 8px rgba(66,133,244,0.6); }
.map-search-suggestions {
  list-style: none; margin: 4px 0 0; padding: 4px 0; background: #fff; color: #202124;
  border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,0.3); font-size: 0.9rem;
}
.map-search-suggestions li { padding: 9px 16px; cursor: pointer; }
.map-search-suggestions li:hover { background: #f1f3f4; }
.map-search-clear {
  margin-top: 6px; padding: 7px 14px; border: 0; border-radius: 8px; cursor: pointer;
  background: #fff; color: #d93025; font-weight: 600; font-size: 0.85rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* ===== TOUR CREATION BAR (drawn on the commerce map) ===== */
.tour-creation-bar {
  position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 6;
  display: flex; flex-direction: column; gap: 8px; padding: 10px 12px;
  background: var(--color-bg, #fff); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.tour-creation-stops { display: flex; flex-wrap: wrap; gap: 6px; max-height: 96px; overflow-y: auto; }
.tour-creation-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px;
  background: var(--color-primary-light); color: var(--color-primary);
  border-radius: 999px; font-size: 0.82rem; font-weight: 600;
}
.tour-creation-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 2px 6px; font-size: 0.85rem; }
.tour-creation-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tour-creation-controls .form-control { flex: 1 1 200px; min-width: 160px; }
