/* «Фермеры рядом» — тёплый природный стиль: кремовый фон, глубокий зелёный, медовые акценты */
:root {
  --cream: #FBF6EC;
  --cream-2: #F4EBDA;
  --paper: #FFFDF8;
  --green: #1F4D3A;
  --green-2: #2E6B4F;
  --green-3: #5FA463;
  --honey: #E8A33D;
  --amber: #D9822B;
  --ink: #23302A;
  --muted: #6B7A70;
  --line: rgba(31, 77, 58, .12);
  --shadow-s: 0 2px 8px rgba(40, 50, 30, .08);
  --shadow: 0 10px 30px rgba(40, 50, 30, .14);
  --shadow-l: 0 24px 60px rgba(30, 40, 20, .22);
  --r: 20px;
  --r-s: 14px;
  --panel-w: 440px;
  --topbar-h: 170px;
  --sheet-visible: 300px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.3, 1.6, .5, 1);
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--green-2); }
h2, h3 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.skip { position: absolute; left: -999px; top: 0; z-index: 2000; background: var(--green); color: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--honey); outline-offset: 2px; }

/* ───────── Кнопки ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 16px; border-radius: 999px; border: 0;
  font-weight: 800; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: transform .2s var(--spring), box-shadow .2s, background .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-s); }
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--green); color: #fff; }
.btn--honey { background: var(--honey); color: #3A2600; }
.btn--wa { background: #25A85A; color: #fff; }
.btn--ghost { background: var(--paper); color: var(--green); box-shadow: inset 0 0 0 2px var(--line); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* ───────── Карта ───────── */
.map { position: fixed; inset: 0; z-index: 1; background: #EAE3D2; }
.map .leaflet-tile-pane { filter: saturate(.82) sepia(.14) brightness(1.03); }
.leaflet-container { font-family: var(--font); }
.leaflet-control-attribution { font-size: 11px; background: rgba(251, 246, 236, .86) !important; border-radius: 8px 0 0 0; }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow-s) !important; border-radius: 14px !important; overflow: hidden; }
.leaflet-control-zoom a { background: var(--paper) !important; color: var(--green) !important; width: 38px !important; height: 38px !important; line-height: 38px !important; }
.map-fallback { display: none; }

/* ───────── Маркеры ───────── */
.fr-icon { background: none; border: 0; }
.fr-pin { position: relative; width: 48px; height: 58px; --c: var(--green); }
.fr-pin__drop { position: absolute; inset: 0; animation: pinDrop .9s var(--spring) both; animation-delay: var(--d, 0ms); }
.fr-pin__in { position: absolute; inset: 0; transform-origin: 50% 100%; transition: transform .28s var(--spring); }
.fr-pin__ring {
  position: absolute; left: 4px; top: 2px; width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--c); opacity: 0;
  animation: ring 3.2s ease-out infinite; animation-delay: var(--p, 0s);
}
.fr-pin__head {
  position: absolute; left: 4px; top: 2px; width: 40px; height: 40px;
  background: #fff; border: 3px solid var(--c);
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .22);
  display: grid; place-items: center;
}
.fr-pin__emoji { transform: rotate(45deg); font-size: 20px; line-height: 1; }
.fr-pin__shadow { position: absolute; left: 14px; bottom: 0; width: 20px; height: 6px; border-radius: 50%; background: rgba(0, 0, 0, .22); filter: blur(1px); }
.fr-pin__label {
  position: absolute; top: 50px; left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 999px;
  background: #FFF3D6; color: #7A4B00; box-shadow: var(--shadow-s);
}
.fr-pin--mod .fr-pin__head { border-style: dashed; }
.leaflet-marker-icon:hover .fr-pin__in, .fr-pin.is-hover .fr-pin__in { transform: scale(1.18) translateY(-3px); }
.fr-pin.is-selected .fr-pin__in { transform: scale(1.32) translateY(-4px); }
.fr-pin.is-selected .fr-pin__head { box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 30%, transparent), 0 10px 20px rgba(0, 0, 0, .25); }
.fr-pin.is-selected .fr-pin__ring { animation-duration: 1.6s; }
.fr-pin.is-dim { opacity: .28; filter: grayscale(.6); }
.fr-pin.is-ping .fr-pin__ring { animation: ping 1.4s ease-out 2; }
body.live .fr-pin__ring { animation-duration: 2s; border-width: 4px; }
body.live .fr-pin__head { animation: breathe 2.6s ease-in-out infinite; animation-delay: var(--p, 0s); }

@keyframes pinDrop {
  0% { transform: translateY(-80px) scale(.5); opacity: 0; }
  55% { transform: translateY(4px) scale(1.06, .92); opacity: 1; }
  75% { transform: translateY(-8px) scale(.98, 1.03); }
  100% { transform: none; opacity: 1; }
}
@keyframes ring {
  0% { transform: scale(.9); opacity: .55; }
  70% { transform: scale(1.9); opacity: 0; }
  100% { transform: scale(1.9); opacity: 0; }
}
@keyframes ping {
  0% { transform: scale(.9); opacity: .9; border-width: 5px; }
  100% { transform: scale(2.6); opacity: 0; border-width: 1px; }
}
@keyframes breathe {
  0%, 100% { transform: rotate(-45deg) scale(1); }
  50% { transform: rotate(-45deg) scale(1.08); }
}

.fr-me { width: 18px; height: 18px; border-radius: 50%; background: #2F80ED; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(47, 128, 237, .25); }

/* Маршруты доставки (Live) */
.fr-route { stroke-dasharray: 2 12; stroke-linecap: round; animation: dash 1.1s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -28; } }
.fr-truck { background: none; border: 0; }
.fr-truck span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-s); font-size: 15px; }
.fr-kazan { background: none; border: 0; }
.fr-kazan span {
  display: inline-block; white-space: nowrap; padding: 4px 10px; border-radius: 999px;
  background: var(--green); color: #fff; font-weight: 800; font-size: 12px; box-shadow: var(--shadow-s);
  transform: translate(-50%, 22px);
}

/* ───────── Верхняя панель (телефон) ───────── */
.topbar {
  position: fixed; left: 0; right: 0; top: 0; z-index: 500;
  padding: max(10px, env(safe-area-inset-top)) 12px 18px;
  background: linear-gradient(180deg, rgba(251, 246, 236, .97) 0%, rgba(251, 246, 236, .9) 72%, rgba(251, 246, 236, 0) 100%);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.controls { display: flex; flex-direction: column; gap: 10px; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand__logo { width: 40px; height: 40px; border-radius: 12px; box-shadow: var(--shadow-s); }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; flex: 1; min-width: 0; }
.brand__name { font-weight: 900; font-size: 20px; color: var(--green); letter-spacing: -.01em; }
.brand__sub { font-size: 12px; color: var(--muted); font-weight: 700; }
.brand__cab {
  text-decoration: none; font-weight: 800; font-size: 13px; color: var(--green);
  background: var(--paper); padding: 8px 12px; border-radius: 999px; box-shadow: inset 0 0 0 2px var(--line);
  transition: transform .2s var(--spring);
}
.brand__cab:hover { transform: translateY(-2px); }

.search {
  display: flex; align-items: center; gap: 8px; background: var(--paper);
  border-radius: 999px; padding: 0 8px 0 14px; height: 48px;
  box-shadow: var(--shadow-s), inset 0 0 0 2px var(--line);
  transition: box-shadow .2s;
}
.search:focus-within { box-shadow: var(--shadow), inset 0 0 0 2px var(--honey); }
.search input { flex: 1; border: 0; background: none; outline: none; font-size: 16px; min-width: 0; }
.search__clear { border: 0; background: var(--cream-2); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.chip-rows { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.chip-rows::-webkit-scrollbar { display: none; }
.chip-rows > .chips { display: contents; }
@media (min-width: 900px) {
  .chip-rows { flex-direction: column; gap: 10px; overflow: visible; }
  .chip-rows > .chips { display: flex; flex-wrap: wrap; overflow: visible; }
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 14px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--paper); font-weight: 800; font-size: 14px; color: var(--ink);
  box-shadow: var(--shadow-s), inset 0 0 0 2px var(--line);
  transition: transform .2s var(--spring), background .2s, color .2s, box-shadow .2s;
}
.chip:hover:not([disabled]) { transform: translateY(-2px); }
.chip.is-on { background: var(--c, var(--green)); color: #fff; box-shadow: 0 6px 14px color-mix(in srgb, var(--c, var(--green)) 40%, transparent); }
.chip--cat[data-cat="honey"] { --c: #E09B16; }
.chip--cat[data-cat="dairy"] { --c: #4F86B8; }
.chip--cat[data-cat="meat"] { --c: #C4533A; }
.chip--cat[data-cat="vegetables"] { --c: #4A9A3A; }
.chip--cat[data-cat="crafts"] { --c: #9463AD; }
.chip--soon { opacity: .55; cursor: not-allowed; background: var(--cream-2); }
.chips--filters .chip { height: 34px; font-size: 13px; }

/* ───────── Инструменты карты ───────── */
.map-tools {
  position: fixed; z-index: 520; left: 12px; right: 12px; top: calc(var(--topbar-h) - 6px);
  display: flex; justify-content: space-between; align-items: center; gap: 8px; pointer-events: none;
}
.map-tools > * { pointer-events: auto; }
.seg { display: inline-flex; background: var(--paper); border-radius: 999px; padding: 4px; box-shadow: var(--shadow); }
.seg__btn { border: 0; background: none; border-radius: 999px; padding: 8px 12px; font-weight: 800; font-size: 13px; cursor: pointer; color: var(--muted); transition: background .25s, color .25s; }
.seg__btn.is-on { background: var(--green); color: #fff; }
.live-btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer;
  background: var(--paper); color: var(--green); font-weight: 900; font-size: 14px;
  padding: 10px 16px; border-radius: 999px; box-shadow: var(--shadow);
  transition: background .25s, color .25s, transform .2s var(--spring);
}
.live-btn:hover { transform: translateY(-2px); }
.live-btn__dot { width: 10px; height: 10px; border-radius: 50%; background: #B9C2BB; transition: background .25s; }
.live-btn[aria-pressed="true"] { background: #C8372D; color: #fff; }
.live-btn[aria-pressed="true"] .live-btn__dot { background: #fff; animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; transform: scale(.7); } }

/* ───────── Live-лента ───────── */
.ticker {
  position: fixed; z-index: 540; left: 12px; right: 12px; bottom: calc(var(--sheet-visible) + 12px);
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  background: rgba(31, 77, 58, .94); color: #fff; border-radius: 16px; padding: 8px 12px;
  box-shadow: var(--shadow-l); backdrop-filter: blur(6px);
  transition: bottom .45s var(--ease), opacity .3s;
  animation: tickerIn .5s var(--spring);
}
.ticker[hidden] { display: none; }
.ticker__tag { grid-row: 1 / span 2; background: #C8372D; font-weight: 900; font-size: 11px; padding: 4px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.ticker__window { overflow: hidden; height: 22px; }
.ticker__msg { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.ticker__msg.is-in { animation: msgIn .55s var(--ease); }
.ticker__note { font-size: 11px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes msgIn { from { transform: translateY(100%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tickerIn { from { transform: translateY(20px); opacity: 0; } }

/* ───────── Офлайн ───────── */
.offline {
  position: fixed; z-index: 900; left: 12px; right: 12px; top: 12px;
  background: #FFF3D6; color: #6A4200; border-radius: 14px; padding: 10px 14px; font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow);
}
.offline[hidden] { display: none; }

/* ───────── Панель / шторка ───────── */
.panel {
  position: fixed; z-index: 600; left: 0; right: 0; bottom: 0;
  height: calc(100dvh - 72px);
  background: var(--cream); border-radius: 26px 26px 0 0; box-shadow: 0 -10px 40px rgba(30, 40, 20, .18);
  transform: translateY(calc(100dvh - 72px - var(--sheet-visible)));
  transition: transform .5s var(--ease);
  display: flex; flex-direction: column; overflow: hidden;
}
.panel.is-dragging { transition: none; }
.panel__leaves { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.panel__scroll { position: relative; z-index: 1; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.sheet-handle { position: relative; z-index: 2; flex: none; height: 30px; border: 0; background: none; cursor: grab; touch-action: none; display: grid; place-items: center; }
.sheet-handle span { width: 46px; height: 5px; border-radius: 99px; background: rgba(31, 77, 58, .25); }

.leaf { position: absolute; top: -40px; opacity: .32; animation: leafFall linear infinite; will-change: transform; }
@keyframes leafFall {
  0% { transform: translate3d(0, -40px, 0) rotate(0deg); }
  25% { transform: translate3d(22px, 25vh, 0) rotate(80deg); }
  50% { transform: translate3d(-12px, 50vh, 0) rotate(160deg); }
  75% { transform: translate3d(18px, 75vh, 0) rotate(240deg); }
  100% { transform: translate3d(-6px, 105vh, 0) rotate(330deg); }
}

/* Партнёрский баннер */
.partner {
  position: relative; display: flex; align-items: center; gap: 12px; margin: 6px 0 18px;
  padding: 14px 16px; border-radius: var(--r); text-decoration: none; color: var(--ink);
  background: linear-gradient(120deg, #FFE7B0 0%, #FBD27A 55%, #F4B85B 100%);
  box-shadow: var(--shadow-s); overflow: hidden;
}
.partner::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
  transform: translateX(-120%); animation: shine 5s ease-in-out infinite 1.5s;
}
@keyframes shine { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.partner__logo { flex: none; animation: spin 24s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.partner__text { display: flex; flex-direction: column; line-height: 1.2; }
.partner__kicker { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #7A4B00; }
.partner__name { font-size: 20px; font-weight: 900; color: #4A2E00; }
.partner__sub { font-size: 13px; color: #5A3C0A; }

/* Подборки */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.section-head h2, .list-head h2 { font-size: 18px; font-weight: 900; color: var(--green); }
.collections { margin-bottom: 18px; }
.collections__row { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 10px; margin: 0 -2px; scrollbar-width: thin; }
.coll {
  flex: none; width: 210px; scroll-snap-align: start; position: relative; text-align: left; cursor: pointer;
  border: 0; border-radius: var(--r); padding: 14px 14px 0; color: #fff; overflow: hidden;
  background: linear-gradient(150deg, var(--c1), var(--c2)); box-shadow: var(--shadow-s);
  display: flex; flex-direction: column; min-height: 168px;
  transition: transform .25s var(--spring), box-shadow .25s;
}
.coll:hover { transform: translateY(-4px) rotate(-.5deg); box-shadow: var(--shadow); }
.coll.is-on { outline: 3px solid var(--green); outline-offset: 2px; }
.coll__emoji { position: absolute; right: 10px; top: 8px; font-size: 44px; animation: bob 3.4s ease-in-out infinite; animation-delay: var(--i, 0s); filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .18)); }
@keyframes bob { 50% { transform: translateY(-7px) rotate(6deg); } }
.coll__kicker { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; opacity: .9; }
.coll__title { font-size: 17px; font-weight: 900; line-height: 1.15; margin: 6px 56px 4px 0; }
.coll__sub { font-size: 12.5px; opacity: .92; flex: 1; }
.coll__partner { margin: 12px -14px 0; padding: 7px 14px; background: rgba(255, 255, 255, .9); color: #6A4200; font-size: 11.5px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.coll__partner img { width: 16px; height: 16px; }

.active-collection {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px 12px; border-radius: var(--r-s);
  background: var(--paper); box-shadow: inset 0 0 0 2px var(--honey); animation: fadeUp .4s var(--ease);
}
.active-collection[hidden] { display: none; }
.active-collection__t { flex: 1; font-size: 14px; }
.active-collection__t b { display: block; font-size: 15px; }
.active-collection__t small { color: #7A4B00; font-weight: 800; }
.active-collection button { border: 0; background: var(--cream-2); border-radius: 999px; padding: 6px 10px; cursor: pointer; font-weight: 800; }

/* Список */
.list-head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 0 10px; gap: 8px; }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; background: var(--green); color: #fff; font-size: 13px; vertical-align: 2px; }
.list { display: flex; flex-direction: column; gap: 10px; outline: none; }
.fcard {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; text-align: left;
  border: 0; width: 100%; padding: 12px; border-radius: var(--r); background: var(--paper); cursor: pointer;
  box-shadow: var(--shadow-s); position: relative; overflow: hidden;
  animation: fadeUp .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms);
  transition: transform .25s var(--spring), box-shadow .25s;
}
.fcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.fcard:hover, .fcard.is-hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.fcard.is-selected { box-shadow: 0 0 0 3px var(--c), var(--shadow); }
.fcard__main { min-width: 0; }
.fcard__name { font-weight: 900; font-size: 16px; color: var(--ink); line-height: 1.2; }
.fcard__where { font-size: 13px; color: var(--muted); margin-top: 2px; }
.fcard__prod { font-size: 13px; margin-top: 4px; color: #3D4C43; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcard__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.tag { font-size: 11.5px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: var(--cream-2); color: var(--green); }
.tag--mod { background: #FFF3D6; color: #7A4B00; }
.tag--dist { background: #E3EEFB; color: #234E77; }
.tag--warn { background: #F3EEE6; color: #6B5B45; }
.tag--farm { background: #E8F1E4; color: #2E5A22; }
.fcard__go { font-size: 22px; color: var(--muted); transition: transform .25s var(--spring); }
.fcard:hover .fcard__go { transform: translateX(4px); color: var(--green); }
.avatar { flex: none; display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 900; letter-spacing: .02em; box-shadow: 0 4px 10px rgba(0, 0, 0, .15); overflow: hidden; }
.avatar--photo img { width: 100%; height: 100%; object-fit: cover; }

.empty { text-align: center; padding: 26px 16px; background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow-s); }
.empty__emoji { font-size: 40px; display: block; animation: bob 3s ease-in-out infinite; }
.note-similar { font-size: 13px; padding: 8px 12px; border-radius: 12px; background: #FFF3D6; color: #6A4200; font-weight: 700; }

.cta-farmer {
  margin: 22px 0 14px; padding: 16px; border-radius: var(--r); display: flex; flex-direction: column; gap: 12px;
  background: linear-gradient(135deg, var(--green), var(--green-2)); color: #fff; box-shadow: var(--shadow);
}
.cta-farmer p { margin: 4px 0 0; font-size: 14px; opacity: .9; }
.signature { text-align: center; font-weight: 800; color: var(--green); padding: 8px 0 18px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.signature img { animation: spin 30s linear infinite; }
.signature p { font-weight: 600; max-width: 380px; margin: 6px 0 0; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ───────── Карточка хозяйства ───────── */
.detail {
  position: fixed; z-index: 800; left: 0; right: 0; bottom: 0; height: 80dvh;
  background: var(--cream); border-radius: 26px 26px 0 0; box-shadow: var(--shadow-l);
  transform: translateY(105%); transition: transform .5s var(--ease); visibility: hidden;
  display: flex; flex-direction: column; overflow: hidden;
}
.detail.is-open { transform: none; visibility: visible; }
.detail__scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.detail__close {
  position: absolute; right: 14px; top: 14px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgba(255, 253, 248, .92); box-shadow: var(--shadow-s); cursor: pointer; font-size: 16px; font-weight: 900;
  transition: transform .25s var(--spring);
}
.detail__close:hover { transform: rotate(90deg); }
.detail__visual { position: relative; height: 210px; background: var(--cream-2); }
.detail__visual .farm-art, .detail__visual .farm-photo { width: 100%; height: 100%; display: block; object-fit: cover; }
.detail__avatar { position: absolute; left: 18px; bottom: -28px; border-radius: 50%; padding: 4px; background: var(--cream); }
.detail__body { padding: 38px 18px 28px; }
.detail__name { font-size: 24px; font-weight: 900; color: var(--green); line-height: 1.15; margin: 8px 0 4px; }
.detail__where { margin: 0 0 10px; color: var(--muted); font-weight: 700; }
.detail__desc { margin: 0 0 14px; line-height: 1.45; }
.detail__body h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 20px 0 8px; }
.detail__line { margin: 6px 0; line-height: 1.4; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--s, var(--cream-2)); color: var(--c, var(--green)); }
.badge--ok { background: #E2F0DE; color: #24581A; }
.badge--warn { background: #F3EEE6; color: #6B5B45; }
.badge--mod { background: #FFF3D6; color: #7A4B00; }
.badge--farm { background: #E8F1E4; color: #2E5A22; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.links { display: flex; flex-wrap: wrap; gap: 12px; font-weight: 800; font-size: 14px; }
.products { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.products li { background: var(--paper); box-shadow: inset 0 0 0 2px var(--line); padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 700; }
.prices { width: 100%; border-collapse: collapse; }
.prices td { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.prices__v { text-align: right; font-weight: 900; color: var(--green); }
.prices__v small { display: block; font-weight: 600; color: var(--muted); font-size: 11px; }
.note { font-size: 13px; color: var(--muted); background: var(--paper); padding: 8px 12px; border-radius: 12px; margin: 10px 0 0; }
.note--mod { background: #FFF3D6; color: #6A4200; }
.sources { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; font-size: 13px; }
.sources a { color: var(--muted); }
.sources a:first-child { color: var(--green-2); font-weight: 800; }
.farm-art .art-emoji { animation: bob 3.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.farm-art .art-sun { animation: sunPulse 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes sunPulse { 50% { transform: scale(1.12); } }

.scrim { position: fixed; inset: 0; z-index: 700; background: rgba(20, 30, 20, .16); opacity: 0; pointer-events: none; transition: opacity .35s; }
.scrim.is-on { opacity: 1; pointer-events: auto; }

.toast {
  position: fixed; z-index: 1500; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 14px; font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow-l); transition: transform .35s var(--spring), opacity .3s; max-width: calc(100% - 32px);
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

.topbar, .map-tools { transition: transform .45s var(--ease), opacity .3s; }
body.detail-open .topbar, body.detail-open .map-tools { transform: translateY(-130%); opacity: 0; pointer-events: none; }
body.detail-open .ticker { opacity: 0; pointer-events: none; }

/* ───────── Без карты (CDN/интернет недоступен) ───────── */
body.no-map .map, body.no-map .map-tools, body.no-map .ticker { display: none !important; }
body.no-map .topbar { position: static; background: none; padding: 0; }
body.no-map .panel { top: 0; height: 100dvh; transform: none !important; border-radius: 0; box-shadow: none; }
body.no-map .sheet-handle { display: none; }
body.no-map .panel__scroll { padding-top: 14px; }
body.no-map .offline { position: static; margin: 0 0 14px; }
body.no-tiles .map { background: repeating-linear-gradient(45deg, #EFE7D6 0 14px, #F4EDDF 14px 28px); }

/* ───────── Десктоп: карта + боковая панель ───────── */
@media (min-width: 900px) {
  .map { left: var(--panel-w); }
  .topbar { display: none; }
  .panel {
    top: 0; right: auto; width: var(--panel-w); height: 100dvh; transform: none !important;
    border-radius: 0; box-shadow: 8px 0 30px rgba(30, 40, 20, .12);
  }
  .sheet-handle { display: none; }
  .panel__scroll { padding: 18px 22px 24px; }
  .panel .controls { margin-bottom: 16px; }
  .map-tools { left: auto; right: 18px; top: 18px; gap: 10px; }
  .ticker { left: calc(var(--panel-w) + 18px); right: 18px; bottom: 34px; max-width: 760px; margin: 0 auto; }
  .detail {
    top: 0; bottom: 0; right: auto; width: var(--panel-w); height: auto; border-radius: 0;
    transform: translateX(-105%); box-shadow: 12px 0 40px rgba(30, 40, 20, .18);
  }
  .detail.is-open { transform: none; }
  .detail__visual { height: 230px; }
  body.detail-open .topbar, body.detail-open .map-tools, body.detail-open .ticker { transform: none; opacity: 1; pointer-events: auto; }
  .scrim { display: none; }
  .offline { left: calc(var(--panel-w) + 18px); }
  body.no-map .panel { width: 100%; }
  body.no-map .panel__scroll { max-width: 920px; margin: 0 auto; width: 100%; padding-top: 22px; }
  body.no-map .list { display: grid; grid-template-columns: 1fr 1fr; }
  body.no-map .offline { left: 18px; }
  .leaflet-control-zoom { margin-top: 74px !important; }
}

@media (min-width: 1400px) { :root { --panel-w: 470px; } }

/* ───────── Уважение к prefers-reduced-motion ───────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .leaf, .partner::after { display: none; }
  .fr-route { animation: none; }
}

@media (max-width: 899px) {
  .fr-kazan span { font-size: 10px; padding: 2px 7px; opacity: .9; }
}

