@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #100f12;
  --panel: rgba(34, 25, 29, 0.91);
  --panel-strong: rgba(18, 17, 20, 0.97);
  --line: rgba(255, 255, 255, 0.12);
  --muted: rgba(255, 255, 255, 0.66);
  --accent: #e32630;
  --accent-2: #ff4851;
  --green: #21c777;
  --yellow: #ffd36a;
  --radius: 26px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 4%, rgba(227, 38, 48, 0.25), transparent 28rem),
    radial-gradient(circle at 94% 26%, rgba(121, 29, 43, 0.26), transparent 30rem),
    linear-gradient(145deg, #291217 0%, #151216 46%, #0d0d10 100%);
  color: #fff;
  font-family: "Manrope", sans-serif;
}

button, input, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.nearby-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.28;
  background-image: url("../img/03.png");
  background-size: cover;
  background-position: center;
  mix-blend-mode: soft-light;
}

.shell { width: min(1380px, calc(100% - 32px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.nearby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(49, 27, 32, 0.83);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(20px);
}

.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; }
.brand img { width: 58px; height: 58px; flex: none; border: 2px solid #fff; border-radius: 17px; object-fit: cover; }
.brand span { display: grid; gap: 2px; }
.brand small { color: rgba(255, 255, 255, 0.63); font-size: 11px; font-weight: 800; letter-spacing: 0.15em; }
.brand strong { font-size: 18px; letter-spacing: 0.04em; }

.desktop-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.desktop-nav a {
  padding: 13px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: 180ms ease;
}
.desktop-nav a:hover, .desktop-nav a.is-active { border-color: rgba(227, 38, 48, 0.55); background: var(--accent); transform: translateY(-1px); }

.nearby-main { margin-top: 22px; }
.nearby-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(115deg, rgba(72, 29, 37, 0.91), rgba(15, 15, 18, 0.88));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}
.eyebrow { display: inline-block; margin-bottom: 9px; color: #ff9ca1; font-size: 11px; font-weight: 800; letter-spacing: 0.2em; }
.nearby-intro h1 { margin: 0; font-size: clamp(34px, 4.6vw, 66px); line-height: 0.98; letter-spacing: -0.045em; }
.nearby-intro p { max-width: 760px; margin: 16px 0 0; color: var(--muted); font-size: 16px; line-height: 1.7; }
.nearby-intro__status { min-width: 210px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 17px; background: rgba(0, 0, 0, 0.28); }
.nearby-intro__status strong, .nearby-intro__status span { display: block; }
.nearby-intro__status strong { font-size: 18px; }
.nearby-intro__status span { margin-top: 5px; color: var(--muted); font-size: 12px; }

.nearby-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(170px, 0.8fr) minmax(170px, 0.8fr) auto auto;
  gap: 10px;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(24, 20, 23, 0.93);
  backdrop-filter: blur(18px);
}
.nearby-toolbar label, .nearby-toolbar button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}
.nearby-toolbar select, .nearby-toolbar input { width: 100%; height: 100%; border: 0; outline: 0; background: transparent; color: #fff; }
.nearby-toolbar select { padding: 0 38px 0 14px; cursor: pointer; }
.nearby-toolbar select option { background: #171519; color: #fff; }
.nearby-search { display: flex; align-items: center; gap: 10px; padding: 0 14px; }
.nearby-search svg, .nearby-toolbar button svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nearby-search input::placeholder { color: rgba(255, 255, 255, 0.44); }
.nearby-toolbar button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; cursor: pointer; font-size: 13px; font-weight: 800; transition: 180ms ease; }
.nearby-toolbar button:hover { border-color: rgba(227, 38, 48, 0.5); background: rgba(227, 38, 48, 0.15); }
.nearby-toolbar button.is-active { border-color: var(--accent); background: var(--accent); }
.open-filter__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(33, 199, 119, 0.14); }
.location-message { min-height: 20px; margin: 10px 5px; color: rgba(255, 255, 255, 0.72); font-size: 13px; }

.map-workspace {
  position: relative;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  height: min(720px, calc(100vh - 250px));
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: #161519;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
}
.place-panel { position: relative; z-index: 3; display: flex; min-height: 0; flex-direction: column; border-right: 1px solid var(--line); background: rgba(18, 17, 20, 0.98); }
.place-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; border-bottom: 1px solid var(--line); }
.place-panel__head div { display: grid; gap: 4px; }
.place-panel__head strong { font-size: 17px; }
.place-panel__head span { color: var(--muted); font-size: 12px; }
.place-panel__head button { display: none; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: rgba(255, 255, 255, 0.06); color: #fff; font-size: 24px; cursor: pointer; }
.place-list { min-height: 0; overflow-y: auto; padding: 10px; scrollbar-color: rgba(227, 38, 48, 0.65) transparent; scrollbar-width: thin; }
.place-list::-webkit-scrollbar { width: 6px; }
.place-list::-webkit-scrollbar-thumb { border-radius: 99px; background: rgba(227, 38, 48, 0.65); }

.map-place-card {
  display: grid;
  width: 100%;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 9px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: 160ms ease;
}
.map-place-card:hover, .map-place-card.is-active { border-color: rgba(227, 38, 48, 0.62); background: rgba(227, 38, 48, 0.12); transform: translateY(-1px); }
.map-place-card img { width: 92px; height: 98px; border-radius: 13px; object-fit: cover; background: #272329; }
.map-place-card__body { min-width: 0; }
.map-place-card small { display: block; overflow: hidden; color: rgba(255, 255, 255, 0.53); font-size: 9px; font-weight: 800; letter-spacing: 0.09em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.map-place-card h2 { display: -webkit-box; margin: 5px 0 0; overflow: hidden; font-size: 14px; line-height: 1.3; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.map-place-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.map-place-card__rating, .map-place-card__distance, .map-place-card__status { padding: 5px 7px; border: 1px solid var(--line); border-radius: 999px; font-size: 10px; font-weight: 800; }
.map-place-card__rating { color: var(--yellow); }
.map-place-card__distance { color: #fff; }
.map-place-card__status.is-open { border-color: rgba(33, 199, 119, 0.35); background: rgba(33, 199, 119, 0.13); color: #7bf0ad; }
.map-place-card__status.is-closed { color: rgba(255, 255, 255, 0.54); }
.map-place-card__address { margin-top: 7px; color: rgba(255, 255, 255, 0.57); font-size: 10px; line-height: 1.4; }
.map-empty { display: grid; place-items: center; min-height: 240px; padding: 30px; color: var(--muted); text-align: center; }

.map-stage { position: relative; min-width: 0; min-height: 0; }
.nearby-map { width: 100%; height: 100%; background: #242226; }
.map-loading { position: absolute; inset: 0; z-index: 7; display: grid; place-content: center; gap: 12px; background: rgba(15, 14, 17, 0.84); text-align: center; transition: opacity 220ms ease, visibility 220ms ease; }
.map-loading.is-hidden { visibility: hidden; opacity: 0; }
.map-loading span { width: 36px; height: 36px; margin: auto; border: 3px solid rgba(255, 255, 255, 0.16); border-top-color: var(--accent); border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.user-location-marker { width: 19px; height: 19px; border: 4px solid #fff; border-radius: 50%; background: #2188ff; box-shadow: 0 0 0 8px rgba(33, 136, 255, 0.22), 0 6px 18px rgba(0, 0, 0, 0.38); }
.mobile-list-toggle { display: none; }

.maplibregl-ctrl-group { overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.2) !important; border-radius: 14px !important; background: rgba(18, 17, 20, 0.93) !important; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28) !important; }
.maplibregl-ctrl-group button { filter: invert(1); }
.maplibregl-popup-content { width: 250px; padding: 0 !important; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 20px !important; background: #171519 !important; color: #fff; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45) !important; }
.maplibregl-popup-tip { border-top-color: #171519 !important; }
.map-popup img { width: 100%; height: 130px; object-fit: cover; }
.map-popup__body { padding: 13px; }
.map-popup small { color: rgba(255, 255, 255, 0.55); font-size: 9px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.map-popup h3 { margin: 5px 0 0; font-size: 16px; }
.map-popup p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.map-popup__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 11px; }
.map-popup__row span { color: var(--yellow); font-size: 12px; font-weight: 800; }
.map-popup__row a { padding: 8px 10px; border-radius: 10px; background: var(--accent); font-size: 11px; font-weight: 800; text-decoration: none; }

.nearby-footer { display: grid; grid-template-columns: minmax(240px, 1fr) auto; gap: 24px; margin-block: 28px 36px; padding: 24px 28px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(115deg, rgba(75, 27, 37, 0.82), rgba(16, 15, 18, 0.94)); }
.nearby-footer > div:first-child { max-width: 470px; }
.nearby-footer small, .nearby-footer strong { display: block; }
.nearby-footer small { color: var(--muted); font-size: 11px; }
.nearby-footer strong { margin-top: 7px; font-size: 18px; }
.nearby-footer p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.nearby-footer nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.nearby-footer nav a { align-self: center; padding: 12px 15px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255, 255, 255, 0.04); font-size: 12px; font-weight: 800; text-decoration: none; }
.nearby-footer nav a.primary { border-color: var(--accent); background: var(--accent); }
.footer-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 18px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.footer-meta a { font-weight: 800; text-decoration: none; }

@media (max-width: 1080px) {
  .nearby-toolbar { grid-template-columns: minmax(220px, 1.5fr) repeat(2, minmax(150px, 0.8fr)); }
  .nearby-toolbar button { min-height: 44px; }
  .map-workspace { grid-template-columns: 320px minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .shell { width: min(100% - 20px, 720px); }
  .nearby-header { margin-top: 10px; padding: 12px; }
  .brand img { width: 54px; height: 54px; }
  .brand strong { font-size: 16px; }
  .desktop-nav { display: none; }
  .nearby-main { margin-top: 12px; }
  .nearby-intro { align-items: start; flex-direction: column; padding: 22px; }
  .nearby-intro p { margin-top: 12px; font-size: 14px; }
  .nearby-intro__status { width: 100%; min-width: 0; }
  .nearby-toolbar { grid-template-columns: 1fr 1fr; padding: 10px; }
  .nearby-search { grid-column: 1 / -1; }
  .nearby-toolbar .locate-button, .nearby-toolbar .open-filter { min-height: 48px; padding-inline: 10px; }
  .map-workspace { display: block; height: calc(100svh - 290px); min-height: 520px; overflow: visible; border-radius: 24px; }
  .map-stage { width: 100%; height: 100%; overflow: hidden; border-radius: 24px; }
  .place-panel { position: fixed; z-index: 2147483010; top: max(12px, env(safe-area-inset-top, 0px)); right: 10px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); left: 10px; display: flex; max-height: none; border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.62); opacity: 0; transform: translateY(110%); transition: transform 240ms ease, opacity 200ms ease; pointer-events: none; }
  .place-panel.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .place-panel__head button { display: inline-grid; place-items: center; }
  .mobile-list-toggle { position: absolute; z-index: 8; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 7px; min-height: 46px; padding: 0 14px; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 15px; background: rgba(18, 17, 20, 0.94); color: #fff; box-shadow: 0 14px 32px rgba(0, 0, 0, 0.36); font-size: 12px; font-weight: 800; }
  .mobile-list-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
  .mobile-list-toggle b { display: inline-grid; min-width: 22px; height: 22px; place-items: center; border-radius: 999px; background: var(--accent); font-size: 10px; }
  .nearby-footer { grid-template-columns: 1fr; margin-bottom: 20px; padding: 22px; }
  .nearby-footer nav { justify-content: flex-start; }
  .footer-meta { grid-column: auto; }
}

@media (max-width: 520px) {
  .nearby-toolbar { grid-template-columns: 1fr; }
  .nearby-toolbar > * { grid-column: 1; }
  .nearby-intro h1 { font-size: 42px; }
  .map-workspace { height: 58svh; min-height: 480px; }
  .map-place-card { grid-template-columns: 84px minmax(0, 1fr); }
  .map-place-card img { width: 84px; height: 94px; }
  .nearby-footer nav a { flex: 1 1 130px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
