/* ================================================================
   Safe Food Guide · Bengaluru
   New design — mobile-first, full-screen map
   ================================================================ */

:root {
  --white: #ffffff;
  --warm-white: #fffbf8;
  --ink: #202020;
  --ink-soft: #5a5a5a;
  --ink-muted: #9e9e9e;
  --blue-label: #0b0b40;
  --border: #e4e4e4;
  --shadow-sm: 0 2px 2px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 4px 2px rgba(0, 0, 0, 0.25);
  --shadow-card: 0 3px 3px rgba(0, 0, 0, 0.25);
  --card-radius: 20px;
  --pill-radius: 30px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  overflow: hidden;
  font-family: "Manrope", sans-serif;
  background: #fef1e9;
}

/* Desktop blocker */
.desktop-block {
  display: none;
}
@media (min-width: 768px) {
  .desktop-block {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #faf8f4;
    align-items: center;
    justify-content: center;
  }
  .desktop-block p {
    font-family: "Libre Baskerville", serif;
    font-style: italic;
    font-size: 24px;
    color: var(--ink);
  }
}

/* ================================================================
   MAP — fills everything
   ================================================================ */
#map {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #fef1e9;
}

/* Allow markers to bleed outside the map canvas edges */
#map,
.maplibregl-map,
.maplibregl-canvas-container,
.maplibregl-canvas-container canvas,
.maplibregl-marker {
  overflow: visible !important;
}

/* MapLibre popup */
.maplibregl-popup-content {
  border-radius: 8px !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-md) !important;
  background: var(--white) !important;
  padding: 6px 10px 6px 8px !important;
  font-family: "Manrope", sans-serif;
  min-width: 130px;
}
.maplibregl-popup-tip {
  display: none;
}
.maplibregl-popup-close-button {
  font-size: 14px;
  color: var(--ink-muted);
  padding: 4px 6px;
}
.popup-name {
  font-family: "Manrope", sans-serif;
  font-weight: 500;
  font-size: 12px;
  color: var(--ink);
  display: block;
}
.popup-loc {
  font-family: "Libre Baskerville", serif;
  font-style: italic;
  font-size: 10px;
  color: var(--ink);
  display: block;
  margin-top: 1px;
}

/* Location pin markers */
.pin-marker {
  width: 28px;
  height: 36px;
  cursor: pointer;
  will-change: transform;
  transform-origin: center bottom;
}
.pin-marker.active {
  width: auto;
  height: auto;
}

/* Active marker label box */
.pin-label-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: #006303;
  border-radius: 12px;
  border: 1px solid #3d7a3d;
  box-shadow:
    inset 0 0 0 3px #006303,
    inset 0 0 0 4px white,
    0 4px 8px rgba(0, 0, 0, 0.6);
  padding: 8px 12px;
  white-space: nowrap;
}
.pin-label-name {
  font-family: "Manrope", sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: #ffffff;
  text-transform: capitalize;
}
.pin-label-dish {
  font-family: "Libre Baskerville", serif;
  font-style: italic;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  text-transform: capitalize;
  margin-top: 1px;
}

/* ================================================================
   TOP OVERLAY
   ================================================================ */
.top-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  pointer-events: none;
}
.top-gradient {
  position: absolute;
  inset: 0;
  height: 230px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.8) 0%,
    rgba(255, 255, 255, 0.8) 57%,
    rgba(255, 255, 255, 0) 100%
  );
}
.title-block {
  position: relative;
  padding: 44px 20px 0;
}
h1 {
  font-family: "Libre Baskerville", serif;
  font-weight: 700;
  font-style: italic;
  font-size: 40px;
  line-height: 1.05;
  color: #111;
  -webkit-text-stroke: 8px #ffffff;
  paint-order: stroke fill;
  /* text-shadow: 1px 1px 1px rgba(22, 22, 138, 0.7); */
  /* -webkit-text-stroke: 12px #fff;
  paint-order: stroke fill;*/
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.25));
  letter-spacing: -0.01em;
}
.by-line {
  font-family: "Manrope", sans-serif;
  font-weight: 400;
  font-size: 18px;
  color: var(--ink);
  paint-order: stroke fill;
  margin-top: 8px;
}
/* Subtle state message under "by Santa" — only shown when geolocation
   is denied or the user is too far from Bengaluru. */
.loc-state-msg {
  font-family: "Manrope", sans-serif;
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 12px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.loc-state-msg[hidden] {
  display: none;
}

/* ================================================================
   DISTANCE BADGE
   ================================================================ */
.distance-badge {
  position: fixed;
  z-index: 20;
  left: 50%;
  transform: translateX(-50%);
  bottom: 320px;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  border-radius: 12px;
  padding: 6px 14px 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.walk-icon {
  font-size: 14px;
}
.distance-text {
  display: flex;
  flex-direction: column;
}
.distance-main {
  font-family: "Manrope", sans-serif;
  font-weight: 500;
  font-size: 12px;
  color: var(--ink);
  line-height: 1.3;
}
.distance-sub {
  font-family: "Manrope", sans-serif;
  font-weight: 500;
  font-size: 10px;
  color: var(--ink-muted);
  line-height: 1.3;
}

/* ================================================================
   BOTTOM SECTION
   ================================================================ */
.bottom-section {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  pointer-events: none;
}
.bottom-gradient {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 380px;
  background: linear-gradient(
    0deg,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 0.92) 40%,
    rgba(255, 255, 255, 0.6) 70%,
    rgba(255, 255, 255, 0) 100%
  );
  pointer-events: none;
}

/* ================================================================
   CAROUSEL
   ================================================================ */
.carousel-wrap {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  height: 230px;
  overflow: visible;
  display: flex;
  align-items: flex-end;
  margin-bottom: 4px;
}
.carousel {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x; /* no vertical drag */
  scrollbar-width: none;
  width: 100%;
  padding: 20px calc(50vw - 73px) 0;
  gap: 20px;
  align-items: flex-end;
  padding-bottom: 8px;
}
.carousel::-webkit-scrollbar {
  display: none;
}

/* Wrapper — snap unit, also the transform unit for fan effect */
.card-wrap {
  flex-shrink: 0;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  position: relative;
  transform-origin: center center;
  will-change: transform;
  cursor: pointer;
  /* size matches the food-card inside */
  display: flex;
  align-items: flex-start;
}

.food-card {
  width: 130px;
  height: 130px;
  border-radius: var(--card-radius);
  overflow: hidden; /* clips image only */
  border: 4px solid var(--white);
  box-shadow: var(--shadow-card);
  background: #e8e0d8;
}
.food-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.food-card .card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  background:
    radial-gradient(ellipse at 30% 20%, #f5ede0 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, #e8d5c0 0%, transparent 55%),
    linear-gradient(145deg, #ede0d0, #d9c8b4);
}
.food-card.active {
  width: 160px;
  height: 160px;
  border-width: 6px;
}

/* Distance badge — white pill that floats above the active food card */
.card-distance {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  padding: 5px 14px;
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  z-index: 6;
}
.card-distance.visible {
  display: flex;
}
.dist-main {
  font-family: "Manrope", sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.2;
}
.dist-sub {
  font-family: "Manrope", sans-serif;
  font-weight: 400;
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.2;
  margin-top: 1px;
}

/* User location dot */
.user-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1f1ffb;
  border: 5px solid #fff;
  box-shadow: 0 0 0 12px rgb(31, 31, 251);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 4px rgba(31, 31, 251, 0.5);
  }
  50% {
    box-shadow: 0 0 0 16px rgba(31, 31, 251, 0.08);
  }
}

/* ================================================================
   DISH INFO
   ================================================================ */
.dish-info {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 10px 20px 6px;
  pointer-events: auto;
}
.dish-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.dish-name {
  font-family: "Manrope", sans-serif;
  font-weight: 600;
  font-size: 20px;
  color: var(--ink);
  text-transform: capitalize;
}
@keyframes dishSwapIn {
  0% {
    opacity: 0;
    transform: translateY(3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
.dish-info.swapping .dish-name,
.dish-info.swapping .dish-location {
  animation: dishSwapIn 0.16s ease-out;
}
.dish-arrow {
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
}
.dish-location {
  display: block;
  font-family: "Libre Baskerville", serif;
  font-style: italic;
  font-size: 16px;
  color: var(--ink);
  text-transform: capitalize;
  margin-top: 2px;
}

/* ================================================================
   FILTER BAR
   ================================================================ */
.filter-bar {
  position: relative;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 8px 16px 36px;
  pointer-events: auto;
  background: transparent;
}
.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  background: var(--white);
  border: none;
  border-radius: var(--pill-radius);
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  transition: all 0.15s;
}
/* Meal dropdown */
.meal-dropdown-wrap {
  position: relative;
  flex-shrink: 0;
}
.meal-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  font-family: "Manrope", sans-serif;
  /* font-style: italic; */
  font-size: 16px;
  /* font-weight: 700; */
  color: #111;
  background: none;
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.3);
  border: 2px solid #dcdce7;
  cursor: pointer;
  /* -webkit-text-stroke: 8px #f0f0ff; */
  /* paint-order: stroke fill; */
  /* text-shadow: 1px 1px 3px rgba(22, 22, 138, 0.5); */
}
.meal-chevron {
  transition: transform 0.2s ease;
}
.meal-trigger.open .meal-chevron {
  transform: rotate(180deg);
}
@keyframes unravel {
  from {
    transform: scaleY(0.4) translateY(8px);
    opacity: 0;
  }
  to {
    transform: scaleY(1) translateY(0);
    opacity: 1;
  }
}
@keyframes furle {
  from {
    transform: scaleY(1) translateY(0);
    opacity: 1;
  }
  to {
    transform: scaleY(0.4) translateY(8px);
    opacity: 0;
  }
}
.meal-dropdown-panel {
  display: none;
  flex-direction: column;
  position: fixed;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0px -4px 12px rgba(0, 0, 0, 0.4);
  padding: 8px;
  min-width: 110px;
  z-index: 1000;
  transform-origin: bottom center;
  gap: 8px;
}
.meal-dropdown-panel.open {
  display: flex;
  animation: unravel 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.meal-dropdown-panel.closing {
  display: flex;
  animation: furle 0.25s cubic-bezier(0.4, 0, 1, 1) forwards;
}
.meal-option-item {
  font-family: "Manrope", sans-serif;
  font-size: 14px;
  color: var(--ink);
  padding: 8px 8px;
  border-radius: 8px;
  cursor: pointer;
}
.meal-option-item.selected {
  background: #ececf1;
  font-style: italic;
  color: #1f1ffb;
}
.meal-option-item.pressed {
  background: #ddddf5;
  color: #1f1ffb;
  transform: scale(0.96);
  transition:
    transform 0.1s ease,
    background 0.1s ease;
}

.filter-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 12px;
}

.sensory-group,
.seating-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.filter-label {
  font-family: "Manrope", sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #111;
  white-space: nowrap;
}
.sensory-pill {
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 400;
  color: #111;
  display: flex;
  align-items: center;
  gap: 5px;
  border: 2px solid #dcdce7;
  transition:
    color 0.25s ease-out,
    background 0.25s ease-out,
    border-color 0.25s ease-out;
}
.sensory-label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 5px;
}
.sensory-cross {
  display: none;
  font-size: 20px;
  line-height: 1;
  opacity: 0.8;
}
.sensory-pill.active .sensory-cross {
  display: inline;
}
.sensory-pill.active {
  background: #1f1ffb;
  color: var(--white);
  border-color: transparent;
}

/* ── Seeking: SVG overlay + transition ── */
#seekingBtn {
  position: relative;
  overflow: visible;
  transition:
    color 0.35s ease,
    background 0.35s ease,
    border-color 0.35s ease;
}
.seeking-stroke {
  position: absolute;
  inset: -8px -8px;
  width: calc(100% + 20px);
  height: calc(100% + 16px);
  object-fit: fill;
  opacity: 0;
  transition: opacity 2s ease;
  pointer-events: none;
  z-index: 0;
}
#seekingBtn.active {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: #ffffff;
  /* Bigger padding when active so the pill grows to fit the seeking-stroke
     frame more comfortably. Overrides .sensory-pill's 12px 16px. */
  padding: 8px 24px;
}
#seekingBtn.active .seeking-stroke {
  opacity: 1;
}

@keyframes avoiding-in {
  from {
    opacity: 0.4;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes avoiding-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 1;
  }
}
#avoidingBtn.activating {
  animation: avoiding-in 0.2s ease-in forwards;
}
#avoidingBtn.deactivating {
  animation: avoiding-out 0.25s ease-in forwards;
}

@keyframes seeking-bounce-in {
  0% {
    transform: scale(1);
  }
  20% {
    transform: scale(0.92);
  }
  45% {
    transform: scale(1.1);
  }
  65% {
    transform: scale(0.96);
  }
  80% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes seeking-bounce-out {
  0% {
    transform: scale(1);
  }
  18% {
    transform: scale(1.1);
  }
  42% {
    transform: scale(0.93);
  }
  68% {
    transform: scale(1.04);
  }
  84% {
    transform: scale(0.98);
  }
  100% {
    transform: scale(1);
  }
}
#seekingBtn.activating {
  animation: seeking-bounce-in 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97)
    forwards;
}
#seekingBtn.deactivating {
  animation: seeking-bounce-out 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97)
    forwards;
}

/* Seating toggle */
.toggle-wrap {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  cursor: pointer;
  flex-shrink: 0;
}
.toggle-wrap input {
  opacity: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  cursor: pointer;
  z-index: 2;
  margin: 0;
}
.toggle-track {
  position: absolute;
  inset: 0;
  background: #e0e0e0;
  border-radius: 999px;
  transition: background 0.2s;
}
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  right: 20px;
  height: 20px;
  background: var(--white);
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  /* turning OFF: left edge leads, right edge follows */
  transition:
    left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    right 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}
.toggle-wrap input:checked ~ .toggle-track {
  background: #1f1ffb;
}
.toggle-wrap input:checked ~ .toggle-track .toggle-thumb {
  left: 20px;
  right: 2px;
  /* turning ON: right edge leads, left edge follows */
  transition:
    right 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    left 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (min-width: 480px) {
  /* Centre the app on wider screens */
  .top-overlay,
  .bottom-section,
  .distance-badge {
    max-width: 430px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    width: 430px;
  }
  .distance-badge {
    left: 50%;
  }
}

/* ================================================================
   LOCATION INFO CARD — shown on first load only.
   Map loads in the background; OK button triggers actual geolocation.
   ================================================================ */
.loc-info-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.4);
  opacity: 1;
  transition: opacity 0.3s ease;
}
.loc-info-overlay.hidden,
.loc-info-overlay[hidden] {
  display: none;
}
.loc-info-overlay.fading {
  opacity: 0;
  pointer-events: none;
}
.loc-info-card {
  background: #ffffff;
  border-radius: 22px;
  padding: 28px 24px 22px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.22);
}
.loc-info-icon {
  font-size: 38px;
  line-height: 1;
  margin-bottom: 14px;
}
.loc-info-title {
  font-family: "Libre Baskerville", serif;
  font-weight: 700;
  font-style: italic;
  font-size: 24px;
  color: var(--ink);
  margin-bottom: 12px;
  line-height: 1.2;
}
.loc-info-body {
  font-family: "Manrope", sans-serif;
  font-weight: 400;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 12px;
}
.loc-info-body--small {
  font-size: 12.5px;
  color: var(--ink-muted);
  margin-bottom: 22px;
}
.loc-info-btn {
  width: 100%;
  padding: 13px 16px;
  border-radius: 14px;
  border: none;
  background: #1f1ffb;
  color: #ffffff;
  font-family: "Manrope", sans-serif;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition:
    transform 0.1s ease,
    background 0.15s ease;
}
.loc-info-btn:hover {
  background: #1717d9;
}
.loc-info-btn:active {
  transform: scale(0.98);
}
