:root{
  --bg:#0f1115;
  --card:#151924;
  --card2:#121621;
  --text:#e9edf5;
  --muted:#aab3c5;
  --stroke:#2a3246;
  --accent:#7c5cff;
  --accent2:#2ee59d;
  --danger:#ff4d6d;
  --shadow: 0 14px 40px rgba(0,0,0,.35);
  --radius:18px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(124,92,255,.35), transparent 60%),
              radial-gradient(900px 500px at 90% 10%, rgba(46,229,157,.15), transparent 55%),
              var(--bg);
  color:var(--text);

  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
}

a{ color:inherit; text-decoration:none; }
.container{
  width:min(1100px, 92vw);
  margin:0 auto;
  padding:18px 0 40px;
}

.topbar{
  position:sticky;
  top:0;
  z-index:10;
  backdrop-filter: blur(10px);
  background: rgba(15,17,21,.65);
  border-bottom: 1px solid rgba(42,50,70,.65);
}

.headerRow{
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  padding:18px 0 10px;
}

.siteTitle{
  text-align:center;
  font-weight:800;
  letter-spacing:.5px;
  line-height:1.1;
  font-size: clamp(20px, 3vw, 30px);
  margin:0;
}

.topRight{
  position:absolute;
  right:0;
  top:50%;
  transform: translateY(-50%);
  display:flex;
  gap:10px;
  align-items:center;
}

.iconPill{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:1px solid rgba(42,50,70,.9);
  border-radius: 14px;
  background: rgba(21,25,36,.75);
  box-shadow: 0 10px 22px rgba(0,0,0,.22);
  cursor:pointer;
  user-select:none;
}
.iconPill img{ width:18px; height:18px; opacity:.95; }
.iconPill span{ font-weight:650; color:var(--muted); }
@media (max-width:760px){ .iconPill span{ display:none; } }

.controls{
  display:flex;
  justify-content:center;
  gap:12px;
  padding:10px 0 10px;
  flex-wrap:wrap;
}

.dropdown{
  position:relative;
  width:min(260px, 44vw);
}

.dropBtn{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border-radius: 14px;
  border:1px solid rgba(42,50,70,.9);
  background: rgba(21,25,36,.75);
  color:var(--text);
  cursor:pointer;
}
.dropBtn .label{ color:var(--muted); font-weight:700; }
.dropBtn .value{ font-weight:750; margin-left:8px; }
.dropBtn .chev{ opacity:.8; font-size:12px; }

.menu{
  position:absolute;
  top: calc(100% + 8px);
  left:0;
  width:100%;
  background: rgba(21,25,36,.98);
  border:1px solid rgba(42,50,70,.9);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow:hidden;
  display:none;
}
.menu.open{ display:block; }
.menu button{
  width:100%;
  text-align:left;
  padding:12px 14px;
  border:0;
  background:transparent;
  color:var(--text);
  cursor:pointer;
}
.menu button:hover{ background: rgba(124,92,255,.18); }
.menu button.active{ background: rgba(46,229,157,.12); }

.searchRow{
  width:min(540px, 92vw);
  margin: 0 auto 14px;
  position:relative;
}
.searchInput{
  width:100%;
  padding:12px 44px 12px 14px;
  border-radius: 14px;
  border:1px solid rgba(42,50,70,.9);
  background: rgba(21,25,36,.75);
  color: var(--text);
  outline:none;
}
.searchInput::placeholder{ color: rgba(170,179,197,.75); }
.searchClear{
  position:absolute;
  right:8px;
  top:50%;
  transform: translateY(-50%);
  width:34px;
  height:34px;
  border-radius: 12px;
  border:1px solid rgba(42,50,70,.85);
  background: rgba(18,22,33,.8);
  color: var(--text);
  cursor:pointer;
}

.grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:16px;
  margin-top:18px;
}
@media (max-width: 760px){
  .grid{
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}
/*@media (max-width: 760px){ .grid{ grid-template-columns: 1fr; } }*/

.card{
  background: linear-gradient(180deg, rgba(21,25,36,.9), rgba(18,22,33,.9));
  border: 1px solid rgba(42,50,70,.75);
  border-radius: var(--radius);
  box-shadow: 0 18px 44px rgba(0,0,0,.25);
  overflow:hidden;
  text-align:center;
  position:relative;
}

.cardImg{
  width:100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  display:block;
  filter:saturate(1.05) contrast(1.05);
}

.favBtn{
  position:absolute;
  top:10px;
  right:10px;
  width:42px;
  height:42px;
  border-radius: 14px;
  border:1px solid rgba(42,50,70,.9);
  background: rgba(15,17,21,.55);
  display:grid;
  place-items:center;
  cursor:pointer;
}
.favBtn img{ width:18px;height:18px; }
.favBtn.active{
  border-color: rgba(46,229,157,.45);
  background: rgba(46,229,157,.14);
}

.cardBody{
  padding:14px 14px 16px;
  display:flex;
  flex-direction:column;
  gap:10px;
  align-items:center;
}

.meta{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  color:var(--muted);
  font-weight:700;
  flex-wrap:wrap;
  font-size:12px;
}
.meta .dot{ width:6px;height:6px;border-radius:99px;background:rgba(170,179,197,.6); }
.iconTiny{ width:18px;height:18px; object-fit:contain; opacity:.95; }

.h2{ margin:0; font-size: 18px; font-weight:850; }

.btn{
  border:0;
  cursor:pointer;
  padding:12px 14px;
  border-radius: 14px;
  font-weight:850;
  color: #0b0d12;
  background: linear-gradient(135deg, var(--accent), #9a86ff);
  box-shadow: 0 14px 30px rgba(124,92,255,.25);
  width: min(240px, 80%);
}
.btn:hover{ filter:brightness(1.03); }

.pillRow{
  display:flex;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
  margin: 6px 0 0;
}
.smallBtn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid rgba(42,50,70,.9);
  background: rgba(21,25,36,.75);
  cursor:pointer;
  color:var(--text);
  font-weight:850;
}
.smallBtn img{ width:16px;height:16px; }
.smallBtn.primary{
  background: linear-gradient(135deg, var(--accent2), #b0ffd8);
  color:#0b0d12;
  border-color: rgba(46,229,157,.25);
}
.smallBtn.danger{
  border-color: rgba(255,77,109,.35);
}
.smallBtn.danger:hover{ background: rgba(255,77,109,.12); }

/* square icon actions (admin) */
.squareBtn{
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  border-radius: 14px;
  border:1px solid rgba(42,50,70,.9);
  background: rgba(21,25,36,.75);
  cursor:pointer;
  position:relative;
  color:var(--text);
}
.squareBtn img{ width:18px;height:18px; }
.squareBtn:hover{ filter:brightness(1.05); }
.squareBtn.danger{ border-color: rgba(255,77,109,.35); }
.squareBtn.danger:hover{ background: rgba(255,77,109,.10); }

.badgeCheck{
  position:absolute;
  right:6px;
  bottom:6px;
  width:16px;
  height:16px;
  border-radius: 8px;
  border:1px solid rgba(46,229,157,.35);
  background: rgba(46,229,157,.16);
  display:grid;
  place-items:center;
}
.badgeCheck img{ width:10px;height:10px; }

/* loading & success states */
.squareBtn[data-loading="1"]{ opacity:.75; pointer-events:none; }
.squareBtn[data-loading="1"]::after{
  content:"";
  position:absolute;
  inset:10px;
  border-radius: 999px;
  border:2px solid rgba(255,255,255,.12);
  border-top-color: rgba(255,255,255,.55);
  animation: spin .9s linear infinite;
}
.squareBtn[data-state="ok"]{
  border-color: rgba(46,229,157,.45);
  box-shadow: 0 0 0 3px rgba(46,229,157,.12);
}
@keyframes spin{ to{ transform: rotate(360deg); } }

.empty{
  text-align:center;
  color:var(--muted);
  border: 1px dashed rgba(42,50,70,.8);
  border-radius: var(--radius);
  padding:22px 16px;
  margin-top:18px;
}

/* dish page */
.backRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:16px 0 10px;
  flex-wrap:wrap;
}
.backBtn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid rgba(42,50,70,.9);
  background: rgba(21,25,36,.75);
  cursor:pointer;
}
.backBtn img{ width:18px;height:18px; }
.backBtn span{ color:var(--text); font-weight:800; }

.detailCard{
  background: linear-gradient(180deg, rgba(21,25,36,.92), rgba(18,22,33,.92));
  border: 1px solid rgba(42,50,70,.75);
  border-radius: var(--radius);
  overflow:hidden;
  box-shadow: var(--shadow);
}
.detailBody{
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:12px;
  align-items:center;
  text-align:center;
}
.desc{
  width:min(820px, 100%);
  text-align:left;
  background: rgba(15,17,21,.35);
  border: 1px solid rgba(42,50,70,.55);
  border-radius: 16px;
  padding:14px;
  color: var(--text);
  white-space: pre-wrap;
  line-height:1.45;
}

/* admin list */
.adminTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-top: 10px;
}
.adminTitle{
  margin:0;
  font-size: 20px;
  font-weight: 900;
}
.adminActions{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}
.adminList{
  margin-top: 14px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px;
  border-radius: 16px;
  background: rgba(21,25,36,.75);
  border:1px solid rgba(42,50,70,.75);
}
.rowLeft{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
.thumb{
  width:64px;
  height:44px;
  border-radius: 12px;
  object-fit:cover;
  border:1px solid rgba(42,50,70,.75);
}
.rowText{
  display:flex;
  flex-direction:column;
  gap:3px;
  min-width:0;
}
.rowMeta{
  color:var(--muted);
  font-weight:800;
  font-size: 13px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.rowName{
  font-weight:950;
  white-space:nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
  max-width: 56vw;
}
.rowRight{ display:flex; align-items:center; gap:8px; }
.iconBtn{
  width:42px; height:42px;
  border-radius: 14px;
  border:1px solid rgba(42,50,70,.9);
  background: rgba(18,22,33,.8);
  cursor:pointer;
  display:grid;
  place-items:center;
}
.iconBtn img{ width:18px;height:18px; }
.iconBtn:hover{ filter:brightness(1.06); }
.iconBtn.delete{ border-color: rgba(255,77,109,.35); }
.iconBtn.delete:hover{ background: rgba(255,77,109,.10); }

/* modal */
.modalWrap{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.55);
  display:none;
  align-items:center;
  justify-content:center;
  padding:16px;
  z-index:99;
}
.modalWrap.open{ display:flex; }
.modal{
  width:min(720px, 96vw);
  border-radius: 18px;
  border:1px solid rgba(42,50,70,.9);
  background: rgba(21,25,36,.97);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modalHead{
  padding:14px 14px 10px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  border-bottom:1px solid rgba(42,50,70,.65);
}
.modalHead h3{ margin:0; font-weight:950; }
.modalBody{ padding:14px; }
.formGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
@media (max-width: 760px){ .formGrid{ grid-template-columns: 1fr; } }
.field{ display:flex; flex-direction:column; gap:6px; }
.field label{ color:var(--muted); font-weight:800; font-size:13px; }
.field input, .field textarea, .field select{
  padding:12px 12px;
  border-radius: 14px;
  border:1px solid rgba(42,50,70,.9);
  outline:none;
  background: rgba(18,22,33,.85);
  color:var(--text);
}
.hintText{ opacity:.7; font-size:12px; line-height:1.35; }

.tokenRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.checkLine{
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--text);
  font-weight:800;
  font-size: 12px;
}
.checkLine input{ transform: translateY(1px); }

.tokenStatus{
  min-height: 18px;
  font-size: 13px;
  opacity:.9;
}
.tokenStatus.ok{ color: rgba(170,255,210,1); }
.tokenStatus.bad{ color: rgba(255,140,156,1); }
.field textarea{ min-height: 140px; resize: vertical; grid-column: 1 / -1; }
.modalFoot{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  padding:12px 14px 14px;
  border-top:1px solid rgba(42,50,70,.65);
}

/* PRINT */
@media print{
  .topbar, .backRow, .pillRow, .iconPill, .favBtn, .btn, .smallBtn, .controls, .searchRow { display:none !important; }
  body{ background:#fff !important; color:#000 !important; }
  .container{ width:auto; margin:0; padding:0; }
  .detailCard, .card{ box-shadow:none !important; border:1px solid #ddd !important; }
  .desc{ background:#fff !important; border:1px solid #ddd !important; color:#000 !important; }
  img{ filter:none !important; }
}

.printBtn{
  display: none !important;
}

#sortDrop {
  display: none !important;
}

/* FIX: dropdown всегда поверх поиска и карточек */
.topbar{
  position: sticky; /* если уже есть — оставь */
  top: 0;
  z-index: 1000;
}

.dropdown{
  position: relative;
}

.dropdown.open{
  z-index: 9999; /* поднимаем активный dropdown */
}

.dropdown .menu{
  position: absolute;
  z-index: 10000; /* меню выше всего */
}

/* ===== Zones page ===== */
.zoneMap{
  width: 100%;
  height: 70vh;
  max-height: 680px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(42,50,70,.75);
  background: rgba(21,25,36,.45);
}

.addrSuggest{
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  background: rgba(21,25,36,.98);
  border: 1px solid rgba(42,50,70,.95);
  border-radius: 16px;
  padding: 6px;
  z-index: 9999;
  box-shadow: 0 14px 40px rgba(0,0,0,.45);
}

.addrItem{
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 900;
  padding: 10px 10px;
  border-radius: 12px;
  cursor: pointer;
}
.addrItem:hover{ background: rgba(78,115,255,.12); }

.zoneInfo{
  margin: 10px auto 0;
  width: min(520px, 92vw);
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(21,25,36,.85);
  border: 1px solid rgba(42,50,70,.85);
  box-shadow: 0 10px 25px rgba(0,0,0,.25);
  font-weight: 900;
  line-height: 1.3;
}
.zoneInfo .muted{ color: rgba(233,237,245,.65); font-weight: 800; }

/* ===== ЗОНЫ ДОСТАВКИ – СТИЛЬ ПОИСКА ===== */

.searchWrap{
  position:relative;
  display:flex;
  align-items:center;
  gap:10px;
}

.searchWrap input{
  width:100%;
  padding:14px 16px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.15);
  background:rgba(255,255,255,.05);
  backdrop-filter:blur(10px);
  color:#fff;
  font-size:15px;
  outline:none;
  transition:.2s;
}

.searchWrap input::placeholder{
  color:rgba(255,255,255,.45);
}

.searchWrap input:focus{
  border-color:rgba(255,255,255,.35);
  background:rgba(255,255,255,.08);
}

.iconBtn{
  width:44px;
  height:44px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.15);
  background:rgba(255,255,255,.06);
  color:#fff;
  font-size:18px;
  cursor:pointer;
}

/* Кнопки зума за интерфейсом */
.leaflet-control-zoom{
  z-index: 50 !important;
}

/* Весь UI страницы выше карты */
.topbar{
  position:relative;
  z-index:200;
}
.zoneInfo{
  position:relative;
  z-index:200;
}

.leaflet-control-attribution{
  display:none !important;
}

/* ===== ZOOM В СТИЛЕ TSC ===== */

.leaflet-control-zoom{
  border:none !important;
}

.leaflet-control-zoom a{
  background:rgba(255,255,255,.08) !important;
  backdrop-filter:blur(10px);
  border:1px solid rgba(255,255,255,.15) !important;
  color:#fff !important;
  border-radius:14px !important;
  margin:6px !important;
  width:44px !important;
  height:44px !important;
  display:flex !important;
  align-items:center;
  justify-content:center;
  font-size:20px !important;
}

.leaflet-control-zoom a:hover{
  background:rgba(255,255,255,.15) !important;
}

/* ===== ZONES FIX: подсказки поверх карты ===== */

.topbar{
  position: sticky;
  top: 0;
  z-index: 6000;
}

.searchWrap{
  position: relative;
  z-index: 6001;
}

.addrSuggest{
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 7000;
}

.zoneMap, #map{
  position: relative;
  z-index: 1;
}

.leaflet-top, .leaflet-bottom{
  z-index: 1000;
}

/* ===== MODALS: always above everything ===== */
.modalWrap{
  position: fixed;
  inset: 0;
  z-index: 9999; /* выше любых шапок/карт/меню */
}

.modalWrap .modal{
  max-height: calc(100vh - 40px);
  overflow: auto;
}

/* ===== Scroll To Top (TSC style) ===== */
.toTopBtn{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 5500;

  width: 46px;
  height: 46px;
  border-radius: 14px;

  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.07);
  color: #fff;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.45);

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, background .2s ease;
}

.toTopBtn:hover{
  background: rgba(255,255,255,0.12);
}

.toTopBtn.show{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}


/* Utility */
.is-hidden{display:none !important;}

/* Убрать встроенный крестик у input type="search" */
input[type="search"]::-webkit-search-cancel-button{
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
input[type="search"]::-webkit-search-decoration{
  -webkit-appearance: none;
}

/* Yandex Suggest: всегда поверх карты */
.ymaps-2-1-79-suggest,
.ymaps-2-1-79-suggest-view,
.ymaps-2-1-79-suggest-item,
.ymaps-2-1-79-suggest-popup {
  z-index: 999999;
}

/* Back + Lock row */
.backRowZones{
  display:flex;
  align-items:center;
  justify-content:space-between;
}

/* Lock button */
.lockBtn{
  width:44px;
  height:44px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:14px;
  border:1px solid rgba(42,50,70,.9);
  background:rgba(21,25,36,.75);
  color:rgba(255,255,255,.92);
  cursor:pointer;
  transition:all .18s ease;
}

.lockBtn:hover{
  background:rgba(255,255,255,.12);
}

.lockBtn:active{
  transform: translateY(1px);
}

.lockBtn svg{
  width:22px;
  height:22px;
}

/* ===== Custom tooltip (tsc) ===== */
.tscTip{
  position: fixed;
  z-index: 999999;
  max-width: min(320px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(10,10,18,.72);
  backdrop-filter: blur(14px);
  box-shadow: none; /*0 18px 60px rgba(0,0,0,.55);*/
  color: rgba(255,255,255,.92);
  font-size: 12px;
  line-height: 1.25;
  pointer-events: none;
  transform: translateY(6px);
  opacity: 0;
  transition: opacity .12s ease, transform .12s ease;
}

.tscTip[data-show="1"]{
  opacity: 1;
  transform: translateY(0);
}

.tscTip .tt{ font-weight: 800; letter-spacing:.02em; }
.tscTip .ts{ margin-top: 4px; color: rgba(255,255,255,.65); }
