/* ── RecycleMap Module Styles ──────────────────────────────────────────────
   Restored to RecycleMap's own original visual identity. Source of truth:
   the ported React/Tailwind build this module was completed from
   (recyclemap-full-project/recyclemap/client/src, see client/src/index.css
   and its sibling atlas-upgrade.css / brand-system.css / point-profile.css /
   search-feedback.css), whose own top comment names the design contract:
   «Городской атлас повторного использования» ("Urban atlas of reuse") —
   warm porcelain paper, route-mandarin orange, graphite/forest ink, and an
   atlas-grid working-map grammar (dashed routes, diamond map pins, mono
   coordinate labels). Headings in Manrope, body in Onest, labels/eyebrows/
   mono data in IBM Plex Mono.

   An earlier build pass ("2026-08-27 identity unification") deliberately
   stripped all of this out and made the module fall back to bimbly.eu's
   generic site-wide purple (--brand:#7657ff / --brand2:#9a7dff). That is
   reverted here — RecycleMap gets its own palette back.

   How it's scoped: the palette lives in its own --rm-* custom properties
   (below) so nothing here ever redefines bimbly's shared --brand/--text/
   --muted/etc. at :root — that would leak into the shared site-wide
   header/nav/footer. Instead, the shared token *names* are re-pointed to
   RecycleMap's palette only inside <main> (which on every recycle-map page
   contains just this module's own content — the shared header, nav and
   footer all render outside <main>, see _shared/header.php / footer.php).
   That single scoped block is what makes bimbly.css-defined shared classes
   reused here (.eyebrow, .section, ad slot links, breadcrumbs, etc.) and
   the inline `style="color:var(--muted)"` hooks in index.php / point.php /
   search.php / suggest.php automatically pick up RecycleMap's colors
   instead of bimbly purple, without touching those files.

   Class names for this module's own components stay prefixed rm- (the
   original reference naming convention other bimbly.eu modules imitate).
   ─────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Manrope:wght@500;600;700;800&family=Onest:wght@400;500;600&display=swap');

:root {
  --rm-ink:          #232a27;
  --rm-muted:        #6c746e;
  --rm-porcelain:    #f7f5f0;
  --rm-warm:         #fffdfa;
  --rm-card:         #ffffff;
  --rm-mandarin:      #f06434;
  --rm-mandarin-dark: #d65328;
  --rm-mandarin-deep: #d34e24;
  --rm-mandarin-soft: #fff6f1;
  --rm-mandarin-tint: rgba(240,100,52,.12);
  --rm-forest:       #1f7552;
  --rm-forest-deep:  #1f543e;
  --rm-sage:         #eef4ee;
  --rm-sage-soft:    #f4f7f2;
  --rm-line:         #ded9cf;
  --rm-footer-dark:  #1c2821;
  --rm-panel-dark:   #233c30;
  --rm-free:         #1f7552;
  --rm-paid:         #b3762e;
  --rm-unknown:      #8b928b;
  --rm-font-sans:    "Onest", Arial, sans-serif;
  --rm-font-display: "Manrope", Arial, sans-serif;
  --rm-font-mono:    "IBM Plex Mono", monospace;
  --rm-radius:       16px;
  --rm-shadow:       0 16px 34px rgba(56,53,42,.08);
  --rm-easing:       cubic-bezier(0.23, 1, 0.32, 1);
}

/* Re-point the shared bimbly tokens to RecycleMap's own palette, scoped to
   <main> only — the shared site-header/nav/footer live outside <main> on
   every recycle-map page and are completely unaffected by this. */
main {
  --brand: var(--rm-mandarin);
  --brand2: var(--rm-mandarin-dark);
  --text: var(--rm-ink);
  --muted: var(--rm-muted);
  --surface: var(--rm-card);
  --surface2: var(--rm-sage);
  --surface-soft: var(--rm-sage-soft);
  --surface-alt: var(--rm-mandarin-tint);
  --line: var(--rm-line);
  --dark: var(--rm-panel-dark);
  --bg: var(--rm-porcelain);
  --radius: var(--rm-radius);
  --shadow: var(--rm-shadow);
  background: var(--rm-porcelain);
  font-family: var(--rm-font-sans);
  color: var(--rm-ink);
}
main h1, main h2, main h3 { font-family: var(--rm-font-display); letter-spacing: -.03em; }
main .eyebrow, main [class*="eyebrow"] { font-family: var(--rm-font-mono); letter-spacing: .06em; text-transform: uppercase; }

/* ── Account bar ──────────────────────────────────────────────────────────── */

/* ── Cards / lists ────────────────────────────────────────────────────────── */
.rm-card {
  background: var(--rm-card); border: 1px solid var(--rm-line);
  border-radius: var(--rm-radius); padding: 20px 22px; margin-bottom: 18px;
  box-shadow: 0 2px 12px rgba(41,58,48,.05);
}
.rm-card-title {
  font-family: var(--rm-font-display); font-weight: 800; font-size: 1.05rem; margin-bottom: 10px;
  color: var(--rm-ink);
}

.rm-point-row {
  display: flex; gap: 14px; align-items: flex-start; padding: 14px 0;
  border-bottom: 1px solid var(--rm-line);
  transition: background .18s var(--rm-easing);
}
.rm-point-row:last-child { border-bottom: none; }
.rm-point-row-body { flex: 1; min-width: 0; }
.rm-point-row-title { font-family: var(--rm-font-display); font-weight: 700; text-decoration: none; color: var(--rm-ink); }
.rm-point-row-title:hover { color: var(--rm-mandarin-deep); }
.rm-point-row-meta { font-size: .8rem; color: var(--rm-muted); margin-top: 4px; }
.rm-point-row-materials { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.rm-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .72rem;
  font-family: var(--rm-font-mono); font-weight: 500; letter-spacing: .02em;
  color: #fff; background: var(--badge-color, var(--rm-unknown));
  white-space: nowrap;
}
.rm-badge-status {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .72rem;
  font-weight: 700; background: var(--rm-sage); color: var(--rm-forest-deep);
}
.rm-chip {
  display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .74rem;
  background: var(--rm-sage-soft); color: var(--rm-forest-deep); border: 1px solid var(--rm-line);
}

/* ── Search / filter form ─────────────────────────────────────────────────── */
.rm-search-form {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; align-items: center;
  background: var(--rm-warm); border: 1px solid var(--rm-line); border-radius: 17px;
  padding: 12px; box-shadow: var(--rm-shadow);
}
.rm-search-input, .rm-select, .rm-input, .rm-textarea {
  border: 1px solid var(--rm-line); border-radius: 10px; padding: 12px 16px;
  font-size: 1rem; font-family: inherit; background: #fff; color: var(--rm-ink);
  box-sizing: border-box; transition: border-color .18s var(--rm-easing), box-shadow .18s var(--rm-easing);
}
.rm-search-input:focus, .rm-select:focus, .rm-input:focus, .rm-textarea:focus {
  outline: none; border-color: var(--rm-mandarin); box-shadow: 0 0 0 3px var(--rm-mandarin-tint);
}
.rm-search-input { flex: 1 1 240px; min-width: 0; }
.rm-select { flex: 1 1 160px; min-width: 0; }
.rm-textarea { width: 100%; resize: vertical; min-height: 100px; font-family: inherit; }

.rm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 10px; padding: 12px 20px; font-weight: 700; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; font-size: .95rem; font-family: var(--rm-font-sans);
  transition: opacity .15s ease, background-color .16s var(--rm-easing), transform .1s var(--rm-easing);
}
.rm-btn-primary { background: var(--rm-mandarin); color: #fff; }
.rm-btn-primary:hover { background: var(--rm-mandarin-dark); opacity: 1; transform: translateY(-1px); }
.rm-btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.rm-btn-ghost { background: transparent; border-color: var(--rm-line); color: var(--rm-ink); }
.rm-btn-ghost:hover { border-color: var(--rm-mandarin); color: var(--rm-mandarin-deep); }
.rm-btn-sm { padding: 8px 14px; font-size: .82rem; }
.rm-btn-full { width: 100%; }
.rm-btn:active { transform: scale(.98); }

/* ── Toggle switch (free/paid filter) — smooth transition, no jarring snap ── */
.rm-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: .85rem; }
.rm-toggle-track {
  position: relative; width: 40px; height: 22px; border-radius: 999px;
  background: var(--rm-line); transition: background-color .2s ease; flex-shrink: 0;
}
.rm-toggle-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25);
  transition: transform .2s ease;
}
.rm-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rm-toggle input:checked + .rm-toggle-track { background: var(--rm-mandarin); }
.rm-toggle input:checked + .rm-toggle-track::after { transform: translateX(18px); }
.rm-toggle input:focus-visible + .rm-toggle-track { outline: 2px solid var(--rm-mandarin); outline-offset: 2px; }

/* ── Map ──────────────────────────────────────────────────────────────────── */
.rm-map-wrap { position: relative; border-radius: var(--rm-radius); overflow: hidden; border: 1px solid var(--rm-line); margin: 18px 0; box-shadow: var(--rm-shadow); }
.rm-map-canvas { width: 100%; height: 420px; background: #e3e5df; }
.rm-map-preloader {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; background: var(--rm-warm); color: var(--rm-muted); font-size: .85rem;
  transition: opacity .25s ease; z-index: 5;
}
.rm-map-preloader.is-hidden { opacity: 0; pointer-events: none; }
.rm-spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--rm-line); border-top-color: var(--rm-mandarin);
  animation: rm-spin .8s linear infinite;
}
@keyframes rm-spin { to { transform: rotate(360deg); } }
.rm-map-note { font-size: .78rem; color: var(--rm-muted); margin-top: 6px; font-family: var(--rm-font-mono); }
.rm-pop { font-size: .85rem; line-height: 1.5; font-family: var(--rm-font-sans); }
.rm-pop-title { font-family: var(--rm-font-display); font-weight: 700; margin-bottom: 4px; }
.rm-pop-meta { color: #555; margin-bottom: 2px; }
.rm-pop a { color: var(--rm-mandarin-deep); font-weight: 600; text-decoration: none; }

/* ── Detail page ──────────────────────────────────────────────────────────── */
.rm-detail-grid { display: grid; gap: 14px 32px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 18px 0; }
.rm-detail-field dt { font-family: var(--rm-font-mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--rm-muted); margin-bottom: 4px; }
.rm-detail-field dd { margin: 0; font-size: .95rem; line-height: 1.5; }
.rm-disclaimer {
  background: #f8eee5; border-left: 3px solid var(--rm-mandarin); border-top: 1px solid var(--rm-line);
  border-right: 1px solid var(--rm-line); border-bottom: 1px solid var(--rm-line);
  border-radius: 0 var(--rm-radius) var(--rm-radius) 0; padding: 14px 18px; font-size: .85rem;
  color: #6a5c50; margin: 20px 0;
}
.rm-material-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--rm-line); flex-wrap: wrap;
}
.rm-material-row:last-child { border-bottom: none; }
.rm-material-name { font-weight: 600; }
.rm-material-price { font-weight: 700; white-space: nowrap; font-family: var(--rm-font-mono); }
.rm-material-price[data-status="free"] { color: var(--rm-free); }
.rm-material-price[data-status="paid"] { color: var(--rm-paid); }

/* ── Alerts / forms ───────────────────────────────────────────────────────── */
.rm-alert { border-radius: 10px; padding: 12px 16px; font-size: .88rem; margin: 14px 0; }
.rm-alert-danger  { background: #fdf1ef; color: #a8402c; border: 1px solid #f3cabf; }
.rm-alert-success { background: #eef6ef; color: #1f5f43; border: 1px solid #bfdcc9; }
.rm-alert-info    { background: var(--rm-sage-soft); color: var(--rm-forest-deep); border: 1px solid var(--rm-line); }
.rm-form-field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.rm-form-field label { font-weight: 600; font-size: .88rem; color: var(--rm-ink); }
.rm-form-card { max-width: 560px; }
.rm-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── Pagination ───────────────────────────────────────────────────────────── */
.rm-pagination { display: flex; justify-content: space-between; align-items: center; margin: 24px 0; gap: 12px; }

/* ── Mobile responsiveness (375px / 414px verified) ──────────────────────── */
@media (max-width: 480px) {
  .rm-search-form { flex-direction: column; align-items: stretch; }
  .rm-search-input, .rm-select { flex: 1 1 auto; width: 100%; }
  .rm-map-canvas { height: 280px; }
  .rm-detail-grid { grid-template-columns: 1fr; gap: 10px; }
  .rm-point-row { flex-direction: column; gap: 6px; }
  .rm-material-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .rm-pagination { flex-wrap: wrap; }
}

/* ── Pre-footer CTA / trust band ──────────────────────────────────────────── */
.rm-prefooter {
  background: var(--rm-footer-dark);
  color: #fff; padding: 36px 24px; margin-top: 40px;
}
.rm-prefooter-inner {
  max-width: 1000px; margin: 0 auto; display: flex; align-items: center;
  justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.rm-prefooter h2 { margin: 0 0 6px; font-size: 1.3rem; font-family: var(--rm-font-display); }
.rm-prefooter p { margin: 0; color: rgba(255,255,255,.75); font-size: .92rem; }
.rm-prefooter .rm-btn-primary { background: var(--rm-mandarin); color: #fff; }
.rm-prefooter .rm-btn-primary:hover { background: var(--rm-mandarin-dark); }
@media (max-width: 480px) {
  .rm-prefooter-inner { flex-direction: column; text-align: center; }
}

/* RTL */
[dir="rtl"] .rm-detail-field dt { text-align: right; }
[dir="rtl"] .rm-toggle-track::after { left: auto; right: 2px; }
[dir="rtl"] .rm-toggle input:checked + .rm-toggle-track::after { transform: translateX(-18px); }
