/* ── Cruise Map Plugin Styles v1.2.1 ─────────────────────────────────────── */

.cruise-map-wrap {
  width: 100%;
  margin: 2rem 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.10);
  border: 1px solid #e2ddd8;
  background: #fff;
  font-family: inherit;
}

/* ── Map body: explicit height, flex row ────────────────────────────────── */

.cruise-map-body {
  display: flex;
  position: relative;
  height: 520px;
}

.cruise-map-canvas {
  flex: 1;
  height: 100%;
  min-width: 0;
  display: block;
}

/* ── Filter bar ──────────────────────────────────────────────────────────── */

.cruise-map-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #e2ddd8;
  background: #faf8f6;
}

/* Push the View Locations button to the far right */
.cruise-map-filters .cruise-map-list-toggle {
  margin-left: auto;
}

.cruise-map-filters-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9a9490;
  margin-right: 4px;
}

.cruise-map-filter-btn {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1.5px solid #ddd8d2;
  background: #f5f2ee;
  color: #7a7470;
  cursor: pointer;
  transition: all 0.14s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}

.cruise-map-filter-btn:hover {
  border-color: #1a6fa8;
  color: #1a6fa8;
  background: #e8f2f9;
}

.cruise-map-filter-btn.is-active {
  background: #1a6fa8;
  border-color: #1a6fa8;
  color: #fff;
}

.cruise-map-btn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* List toggle — pushed to far right of filter bar */
.cruise-map-list-toggle {
  display: inline-flex !important;
  align-items: center;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1.5px solid #ddd8d2;
  background: #f5f2ee;
  color: #7a7470;
  cursor: pointer;
  transition: all 0.14s ease;
  white-space: nowrap;
  visibility: visible !important;
  opacity: 1 !important;
}

.cruise-map-list-toggle:hover,
.cruise-map-list-toggle.is-active {
  border-color: #1a6fa8;
  color: #1a6fa8;
  background: #e8f2f9;
}

/* ── Stats / legend bar ──────────────────────────────────────────────────── */

.cruise-map-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 18px;
  border-top: 1px solid #e2ddd8;
  background: #fff;
  font-size: 0.75rem;
  color: #9a9490;
}

.cruise-map-footer strong {
  color: #1a1714;
  font-weight: 600;
}

.cruise-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cruise-map-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: #4a4642;
}

.cruise-map-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Popup ───────────────────────────────────────────────────────────────── */

.cruise-map-popup-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: #1a1714;
  margin-bottom: 3px;
}

.cruise-map-popup-category {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 12px;
  margin-bottom: 5px;
}

.cruise-map-popup-desc {
  font-size: 0.76rem;
  color: #7a7470;
  line-height: 1.5;
  margin-top: 4px;
}

/* ── Loading / error states ──────────────────────────────────────────────── */

.cruise-map-loading,
.cruise-map-error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.88);
  font-size: 0.85rem;
  color: #9a9490;
  gap: 10px;
  z-index: 500;
}

.cruise-map-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #e2ddd8;
  border-top-color: #1a6fa8;
  border-radius: 50%;
  animation: cruise-map-spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes cruise-map-spin {
  to { transform: rotate(360deg); }
}

.cruise-map-no-city {
  padding: 16px 20px;
  background: #fff8e8;
  border: 1px solid #f0d98a;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #7a6520;
  margin: 1rem 0;
}

/* ── Leaflet overrides ───────────────────────────────────────────────────── */

.leaflet-popup-content-wrapper {
  border-radius: 8px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12) !important;
  border: 1px solid #e2ddd8 !important;
}

.leaflet-popup-content {
  margin: 13px 15px !important;
  font-family: inherit !important;
}

.leaflet-popup-tip {
  background: #fff !important;
}

/* ── List panel ──────────────────────────────────────────────────────────── */

.cruise-map-list-panel {
  width: 0;
  min-width: 0;
  overflow: hidden;
  transition: width 0.3s ease, border-left-width 0.3s ease;
  border-left: 0 solid #e2ddd8;
  background: #fff;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.cruise-map-wrap.list-open .cruise-map-list-panel {
  width: 300px;
  min-width: 300px;
  border-left-width: 1px;
}

.cruise-map-list-header {
  padding: 12px 16px 10px;
  border-bottom: 1px solid #e2ddd8;
  background: #faf8f6;
  flex-shrink: 0;
  cursor: pointer;
}

.cruise-map-list-count {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9a9490;
}

.cruise-map-list-items {
  overflow-y: auto;
  flex: 1;
}

.cruise-map-list-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid #f0ece8;
  cursor: pointer;
  transition: background 0.12s ease;
}

.cruise-map-list-item:hover { background: #f5f2ee; }
.cruise-map-list-item.is-active { background: #e8f2f9; }

.cruise-map-list-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.cruise-map-list-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #1a1714;
  line-height: 1.3;
  margin-bottom: 2px;
}

.cruise-map-list-cat {
  font-size: 0.70rem;
  font-weight: 500;
  margin-bottom: 3px;
}

.cruise-map-list-desc {
  font-size: 0.72rem;
  color: #9a9490;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .cruise-map-body   { height: 400px; }
  .cruise-map-canvas { height: 100%; }
  .cruise-map-filters { padding: 10px 14px; }

  .cruise-map-list-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto !important;
    min-width: 0 !important;
    height: 70%;
    /* Peek 48px (handle + count) above the map bottom */
    transform: translateY(calc(100% - 48px));
    transition: transform 0.3s ease;
    border-left: none !important;
    border-top: 1px solid #e2ddd8;
    z-index: 400;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.12);
  }

  .cruise-map-wrap.list-open .cruise-map-list-panel {
    transform: translateY(0);
    width: 100% !important;
  }

  /* Make the list header a clear tap target on mobile */
  .cruise-map-list-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 8px 16px 10px;
  }

  .cruise-map-list-header::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: #ddd8d2;
    border-radius: 2px;
    margin-bottom: 6px;
    flex-shrink: 0;
  }
}
