/* ===== GENPLAN KP — Leaflet v2.3 ===== */
.genplan-wrap { position:relative; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Inter',sans-serif; border-radius:12px; overflow:hidden; box-shadow:0 4px 24px rgba(0,0,0,.10); display:flex; flex-direction:column; background:#f5f5f0; }

/* Toolbar */
.gp-toolbar { background:#fff; border-bottom:1px solid #ebebeb; padding:10px 16px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; flex-shrink:0; }
.gp-toolbar-label { font-size:12px; color:#4a4a4a; font-weight:600; }
.gp-fbtn { padding:6px 14px; border-radius:20px; border:1.5px solid #d0d0d0; background:#fff; font-size:13px; font-weight:600; cursor:pointer; color:#333; transition:all .15s; display:flex; align-items:center; gap:6px; }
.gp-fbtn .gp-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.gp-fbtn:hover { border-color:#999; color:#111; }

/* Кнопка Акция */
.gp-fbtn-promo { border-color:#e6500a; color:#c04000; }
.gp-fbtn-promo-active { background:linear-gradient(135deg,#e6500a,#ff8c00) !important; color:#fff !important; border-color:#c04000 !important; box-shadow:0 2px 10px rgba(230,80,10,.35); }
.gp-fbtn-promo-active .gp-dot { background:#fff !important; }
.gp-fbtn-promo-inactive { background:#fff3ee; color:#c04000; border-color:#f0a070; }
.gp-fbtn-promo:hover { border-color:#c04000; color:#8a2500; }

.gp-stats { margin-left:auto; display:flex; gap:16px; flex-wrap:wrap; }
.gp-stat { font-size:12px; color:#444; white-space:nowrap; font-weight:500; }
.gp-stat b { font-weight:700; color:#111; }
.gp-map-container { flex:1; min-height:0; position:relative; }
.gp-leaflet-map { width:100%; height:100%; }

/* Пульсация акционных полигонов */
@keyframes gpPromoStroke {
  0%, 100% { stroke-width:2.5px; stroke-opacity:1; }
  50%       { stroke-width:5px;   stroke-opacity:0.7; }
}
.gp-poly-promo { animation: gpPromoStroke 1.8s ease-in-out infinite; }

/* Leaflet overrides */
.leaflet-control-zoom { border:none!important; box-shadow:0 2px 12px rgba(0,0,0,.15)!important; }
.leaflet-control-zoom a { background:#fff!important; color:#333!important; font-size:18px!important; font-weight:300!important; border:none!important; border-bottom:1px solid #eee!important; width:34px!important; height:34px!important; line-height:34px!important; }
.leaflet-control-zoom a:hover { background:#f5f5f5!important; }
.leaflet-control-zoom-in { border-radius:8px 8px 0 0!important; }
.leaflet-control-zoom-out { border-radius:0 0 8px 8px!important; border-bottom:none!important; }

/* Layer toggle */
.gp-layer-btn { position:absolute; top:12px; right:12px; z-index:500; background:#fff; border:none; border-radius:8px; padding:8px 13px; font-size:12px; font-weight:600; cursor:pointer; box-shadow:0 2px 10px rgba(0,0,0,.15); color:#222; display:flex; align-items:center; gap:6px; transition:all .15s; }
.gp-layer-btn:hover { background:#f0f0f0; }
.gp-layer-btn.sat { background:#1a1a2e; color:#fff; }

/* Popup */
.gp-popup .leaflet-popup-content-wrapper { border-radius:14px!important; box-shadow:0 8px 32px rgba(0,0,0,.18)!important; padding:0!important; overflow:hidden; min-width:260px; border:none!important; background:#fff!important; }
.gp-popup .leaflet-popup-content { margin:0!important; width:auto!important; }
.gp-popup .leaflet-popup-tip-container { display:none; }
.gp-popup .leaflet-popup-close-button { top:10px!important; right:12px!important; font-size:20px!important; color:#555!important; font-weight:400!important; z-index:10; }
.gp-popup .leaflet-popup-close-button:hover { color:#111!important; }
.gp-card-head { padding:16px 40px 12px 16px; border-bottom:1px solid #eee; background:#fff; }
.gp-card-status { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.1em; margin-bottom:4px; display:flex; align-items:center; gap:5px; }
.gp-card-status::before { content:''; display:inline-block; width:7px; height:7px; border-radius:50%; background:currentColor; }
.gp-card-status.free { color:#1a5c28; }
.gp-card-status.reserved { color:#7a4e00; }
.gp-card-status.sold { color:#8a1515; }
.gp-card-status.coming { color:#666; }
.gp-card-status.tu { color:#0d3b7a; }
.gp-card-title { font-size:18px; font-weight:700; color:#111; line-height:1.2; }
.gp-card-body { padding:12px 16px 16px; background:#fff; }
.gp-card-row { display:flex; justify-content:space-between; align-items:center; font-size:13px; margin-bottom:6px; gap:8px; }
.gp-card-row .lbl { color:#555; font-weight:500; }
.gp-card-row .val { color:#111; font-weight:600; text-align:right; }
.gp-card-price { font-size:22px; font-weight:800; color:#111; margin:12px 0 14px; letter-spacing:-.5px; }
.gp-card-actions { display:flex; gap:6px; flex-wrap:wrap; }
.gp-btn { flex:1; min-width:70px; border:none; border-radius:10px; padding:10px 8px; font-size:12px; font-weight:700; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:5px; text-decoration:none; transition:filter .15s; }
.gp-btn:hover { filter:brightness(.9); }
.gp-btn-wa  { background:#128C4A; color:#fff!important; }
.gp-btn-tg  { background:#006DAE; color:#fff!important; }
.gp-btn-max { background:#6633cc; color:#fff!important; }
.gp-btn-route { background:#FC3F1D; color:#fff!important; font-size:13px; }
.gp-card-sold-msg { background:#fde8e8; color:#8a1515; border-radius:8px; padding:11px; font-size:13px; font-weight:700; text-align:center; margin-top:4px; }
.gp-card-coming-msg { background:#fff3cd; color:#7a5300; border-radius:8px; padding:10px; font-size:12px; font-weight:600; text-align:center; margin-bottom:8px; }

/* Акция — карточка в тултипе */
.gp-promo-card { margin:0; padding:12px 16px 10px; background:linear-gradient(135deg,#fff7ed,#fff3e0); border-bottom:1px solid #f0c070; }
.gp-promo-title { font-size:13px; font-weight:800; color:#c05e00; margin-bottom:6px; }

/* Бронирование */
.gp-booking-block { background:#fffbf0; border:1px solid #f0d080; border-radius:8px; padding:8px 10px; margin:10px 0; }

/* Legend */
.gp-legend { position:absolute; bottom:20px; left:12px; z-index:500; background:rgba(255,255,255,.97); border-radius:10px; padding:10px 14px; box-shadow:0 2px 12px rgba(0,0,0,.12); }
.gp-legend-item { display:flex; align-items:center; gap:8px; font-size:12px; color:#222; font-weight:500; margin-bottom:5px; }
.gp-legend-item:last-child { margin-bottom:0; }
.gp-legend-dot { width:12px; height:12px; border-radius:3px; flex-shrink:0; }
.gp-legend-dot-promo { animation: gpPromoDot 1.8s ease-in-out infinite; }
@keyframes gpPromoDot { 0%,100%{opacity:1} 50%{opacity:0.45} }

/* Loading / placeholder */
.gp-loading { position:absolute; inset:0; background:rgba(245,243,238,.92); display:flex; align-items:center; justify-content:center; z-index:600; font-size:14px; color:#333; font-weight:500; gap:10px; }
.gp-spinner { width:20px; height:20px; border:2px solid #ccc; border-top-color:#4a8a5a; border-radius:50%; animation:gpSpin .8s linear infinite; }
@keyframes gpSpin { to { transform:rotate(360deg); } }


/* ===== MOBILE ADAPTATIONS ===== */

/* По умолчанию: десктоп-режим */
.gp-filter-mobile  { display: none; }
.gp-filter-desktop { display: contents; }

/* Стиль мобильного select */
.gp-mobile-select {
    padding: 7px 34px 7px 14px;
    border-radius: 20px;
    border: 1.5px solid #d0d0d0;
    background-color: #fff;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    outline: none;
    transition: border-color .15s;
}
.gp-mobile-select:focus { border-color: #999; }

@media (max-width: 640px) {
    /* Показываем дропдаун, скрываем кнопки */
    .gp-filter-mobile  { display: flex; align-items: center; }
    .gp-filter-desktop { display: none !important; }

    /* Скрываем статистику */
    .gp-stats-desktop  { display: none !important; }

    /* Скрываем легенду */
    .gp-legend-desktop { display: none !important; }

    /* Тулбар компактнее */
    .gp-toolbar { padding: 8px 12px; gap: 6px; }

    /* На мобильном bottom-sheet виден, leaflet popup скрываем */
    .gp-bottom-sheet { display: flex; }
    .gp-popup { display: none !important; }
}

.gp-extra-wrap { font-size:12px; }
.gp-extra-section { border:1px solid #e0e0e0; border-radius:6px; padding:8px; background:#fafafa; }
.gp-ei { width:100%; box-sizing:border-box; padding:3px 6px; border:1px solid #ddd; border-radius:4px; font-size:12px; }
textarea.gp-ei { font-family:inherit; }

/* ── Мобильный bottom-sheet ── */
.gp-bottom-sheet {
  display: none;
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 1000;
  background: #fff;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -4px 32px rgba(0,0,0,.18);
  transform: translateY(100%);
  transition: transform .32s cubic-bezier(.32,1,.46,1);
  max-height: 82%;
  overflow: hidden;
  flex-direction: column;
}
.gp-bottom-sheet.gp-bs-open    { transform: translateY(0); display: flex; }
.gp-bottom-sheet.gp-bs-closing { transform: translateY(100%); display: flex; pointer-events:none; }
.gp-bs-handle {
  width: 40px; height: 5px;
  background: #ddd;
  border-radius: 3px;
  margin: 10px auto 6px;
  flex-shrink: 0;
  cursor: grab;
  touch-action: none;
}
.gp-bs-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
  padding-bottom: 16px;
}
.gp-bs-close {
  position: absolute;
  top: 8px; right: 14px;
  background: none; border: none;
  font-size: 24px; color: #888;
  cursor: pointer; line-height: 1;
  padding: 0; z-index: 10;
}
.gp-bs-close:hover { color: #111; }

/* ── Акционная цена — пульсация ── */
@keyframes gpPriceGlow {
  0%, 100% { color: #c05000; text-shadow: 0 0 0px rgba(230,80,10,0); }
  50%       { color: #e6500a; text-shadow: 0 0 10px rgba(230,80,10,0.45); }
}
.gp-promo-price-pulse > span:first-child {
  animation: gpPriceGlow 1.8s ease-in-out infinite;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -.5px;
}

/* Перечёркнутая старая цена */
.gp-old-price {
  font-size: 15px;
  font-weight: 500;
  color: #999;
  text-decoration: line-through;
  text-decoration-color: #c0392b;
  text-decoration-thickness: 2px;
  white-space: nowrap;
}
