/* ============================================
   GoCheckin Rewards – Map View
   ============================================ */

/* ---- Full-screen map page ---- */
.map-page {
  position: absolute;
  inset: 0;
  z-index: 45;
  background: #c8e6c0;
  transform: translateX(100%);
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
  /* overflow: hidden removed — phone-shell already clips; keeping it here was
     causing absolutely-positioned .bottom-nav to be clipped in some cases */
}

.map-page.open {
  transform: translateX(0);
}

/* ---- Map background image ---- */
.map-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  pointer-events: none;
  z-index: 0;
}

/* ---- Top controls ---- */
.map-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 56px 16px 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  z-index: 10;
}

/* Search bar */
.map-search-bar {
  flex: 1;
  background: var(--color-on-primary, #fcfcfc);
  border-radius: 999px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.15);
}

.map-search-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--color-content-muted);
}

.map-search-placeholder {
  font-size: 14px;
  color: var(--color-content-muted, #64646c);
  line-height: 20px;
}

/* Back to explore button (purple, hamburger icon) */
.btn-map-back-explore {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: var(--color-primary, #a528e3);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.1);
  color: white;
  transition: opacity 0.15s;
}

.btn-map-back-explore:hover { opacity: 0.9; }

/* ---- Right side controls ---- */
/* Figma: left: calc(75%+41.5px) ≈ right:16px, top: 574px / 844px ≈ 68% */
.map-right-controls {
  position: absolute;
  right: 16px;
  top: 68%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 10;
}

.btn-map-location {
  width: 40px;
  height: 40px;
  background: var(--color-content-main, #222226);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.1);
  color: white;
  transition: opacity 0.15s;
}

.btn-map-favourite {
  width: 40px;
  height: 40px;
  background: var(--color-on-primary, #fcfcfc);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.1);
  color: var(--color-content-main);
  transition: opacity 0.15s;
}

.btn-map-location svg,
.btn-map-location img { width: 20px; height: 20px; }
.btn-map-favourite svg,
.btn-map-favourite img { width: 20px; height: 20px; }

.btn-map-location:hover,
.btn-map-favourite:hover { opacity: 0.85; }

/* location icon is white on dark bg */
.btn-map-location svg { color: white; }
.btn-map-favourite svg { color: var(--color-content-main); }

/* ---- My location dot ---- */
/* Figma: center 50%, top: 362/844 = 42.9% */
.map-my-location {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #3b82f6;
  border: 3px solid white;
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.2);
  left: 50%;
  top: 43%;
  transform: translateX(-50%);
  z-index: 5;
}

/* ---- Map pins ---- */
.map-pin {
  position: absolute;
  z-index: 6;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform 0.15s ease, z-index 0s;
}

.map-pin:hover {
  transform: translate(-50%, -50%) scale(1.2);
  z-index: 8;
}

.map-pin:active {
  transform: translate(-50%, -50%) scale(1.05);
}

/* Selected state: purple wrap */
.map-pin.selected {
  transform: translate(-50%, -50%) scale(1.2);
  z-index: 9;
}

.map-pin.selected .map-pin-wrap {
  background: var(--color-primary, #a528e3);
  box-shadow: 0px 4px 12px rgba(165, 40, 227, 0.4);
}

.map-pin.selected .map-pin-icon {
  background: rgba(255, 255, 255, 0.2);
}

.map-pin.selected .map-pin-icon img {
  filter: brightness(0) invert(1);
}

/* Diamond wrapper: rotated square, pointed bottom-left */
.map-pin-wrap {
  width: 36px;
  height: 36px;
  background: var(--color-on-primary, #fcfcfc);
  border-radius: 18px 18px 18px 2px;
  transform: rotate(-45deg);
  box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Inner icon container: un-rotate */
.map-pin-icon {
  transform: rotate(45deg);
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.map-pin-icon img,
.map-pin-icon svg {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* Pin color variants — background + icon color (currentColor for inlined SVGs) */
.map-pin-icon--nails  { background: #ffeaf7; color: #e879a0; }
.map-pin-icon--waxing { background: #ffe5e5; color: #f87171; }
.map-pin-icon--spa    { background: #e9f7d2; color: #4ade80; }
.map-pin-icon--facial { background: #cdfcfe; color: #22d3ee; }
.map-pin-icon--makeup { background: #eadeff; color: #a855f7; }
.map-pin-icon--hair   { background: #fff4cf; color: #eab308; }
.map-pin-icon--brow   { background: #ffecdc; color: #fb923c; }

/* Pin positions — from Figma (390 × 844 design frame) */
/* left = figma-left / 390 * 100%, top = figma-top / 844 * 100% */
.map-pin--nails   { left:  9.7%; top: 59.7%; }  /* 38px, 504px */
.map-pin--waxing  { left: 36.0%; top: 67.3%; }  /* 140px, 568px */
.map-pin--spa     { left: 73.5%; top: 58.3%; }  /* 286px, 492px */
.map-pin--facial  { left: 25.4%; top: 41.7%; }  /* 99px, 352px */
.map-pin--makeup  { left: 67.7%; top: 23.3%; }  /* 264px, 197px */
.map-pin--hair    { left: 18.5%; top: 23.3%; }  /* 72px, 197px */
.map-pin--brow    { left: 57.4%; top: 34.1%; }  /* 224px, 288px */

/* ---- Bottom sheet (Near You) ---- */
/* Sits above the map-page-nav */
.map-bottom-sheet {
  position: absolute;
  bottom: var(--nav-height, 72px); /* sit directly above bottom nav */
  left: 0;
  right: 0;
  background: var(--color-on-primary, #fcfcfc);
  border-radius: 24px 24px 0 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  max-height: 72px; /* collapsed: handle + header only */
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

.map-bottom-sheet.expanded {
  max-height: 60%;
}

/* Handle */
.map-sheet-handle-bar {
  display: flex;
  justify-content: center;
  padding: 8px 0 0;
  cursor: grab;
  flex-shrink: 0;
}

.map-sheet-handle {
  width: 40px;
  height: 4px;
  background: rgba(34, 34, 38, 0.2);
  border-radius: 9999px;
}

/* Sheet header */
.map-sheet-header {
  padding: 10px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.map-sheet-title {
  font-size: 20px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-content-main);
  line-height: 28px;
}

.map-weather-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--neutral-5, #f6f6f7);
  border: 1px solid var(--neutral-10, #ededef);
  border-radius: 8px;
  padding: 2px 8px;
}

.map-weather-icon { font-size: 14px; line-height: 1; }

.map-weather-text {
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  color: var(--color-content-main);
  line-height: 16px;
}

/* Scrollable store cards (visible when expanded) */
.map-store-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.map-store-scroll::-webkit-scrollbar { display: none; }

/* Store card */
.map-store-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
}

/* Store photo */
.map-store-photo-wrap {
  width: 100%;
  height: 200px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #e0b0f0, #c880e8);
  flex-shrink: 0;
}

.map-store-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.map-store-save-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

/* Pagination dots */
.map-store-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
}

.map-store-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
}

.map-store-dot.active {
  background: white;
  width: 18px;
  border-radius: 3px;
}

/* Store info */
.map-store-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.map-store-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.map-store-name-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.map-store-name {
  font-size: 20px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-content-main);
  line-height: 28px;
}

.map-store-verified { width: 20px; height: 20px; flex-shrink: 0; }

.map-store-rating {
  display: flex;
  align-items: center;
  gap: 4px;
}

.map-store-rating-star {
  width: 16px; height: 16px;
  color: var(--color-primary);
}

.map-store-rating-val {
  font-size: 12px;
  color: var(--color-content-main);
  line-height: 16px;
}

.map-store-rating-count {
  font-size: 12px;
  color: rgba(34,34,38,0.6);
  line-height: 16px;
}

.map-store-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.map-store-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.map-store-row span {
  font-size: 12px;
  color: var(--color-content-main);
  line-height: 16px;
}

.map-store-row .open { color: #28a146; font-weight: var(--font-weight-semibold); }
.map-store-row .dot-sep {
  width: 2px; height: 2px;
  border-radius: 50%;
  background: var(--color-content-muted);
  display: inline-block;
  flex-shrink: 0;
}

/* ---- Bottom nav bar inside map page ---- */
/* Must be above all map elements: bg(0), location(5), pins(6), controls/sheet(10) */
.map-page .bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
}
