﻿/* Floating tools: search, up/down, telegram */
.site-tools {
  position: fixed;
  right: 16px;
  bottom: 110px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.site-tools.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.site-tool-btn {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(15,25,45,0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255,255,255,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.site-tool-btn:hover {
  transform: translateY(-1px);
  background: rgba(25,40,70,0.62);
  border-color: rgba(255,255,255,0.38);
}
.site-tool-btn--tg {
  /* Тот же стиль, что и остальные кнопки */
}
.site-tool-icon {
  display: block;
}
.site-tool-icon--search {
  width: 24px;
  height: 24px;
}
.site-tool-icon--tg {
  width: 25px;
  height: 25px;
  border-radius: 7px;
}

.site-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2,6,23,0.55);
  z-index: 1300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.site-overlay.is-open { display: flex; }

.site-modal {
  width: min(760px, 100%);
  max-height: 86vh;
  overflow: auto;
  background: #ffffff;
  border: 1px solid rgba(17,24,39,0.12);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(2,6,23,0.35);
  padding: 18px;
}
.site-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.site-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}
.site-close {
  border: 1px solid rgba(17,24,39,0.15);
  background: #fff;
  color: #0f172a;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
.site-search-input {
  width: 100%;
  border: 1px solid rgba(17,24,39,0.2);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 16px;
  margin-bottom: 12px;
}
.site-search-results {
  display: grid;
  gap: 10px;
}
.site-search-item {
  border: 1px solid rgba(17,24,39,0.14);
  border-radius: 10px;
  padding: 12px;
  display: block;
  text-decoration: none;
  color: #0f172a;
  background: #fff;
}
.site-search-item:hover { background: #fdf6ec; border-color: #c47f2a; }
.site-search-item-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; color: #0f172a; }
.site-search-item-desc { font-size: 14px; color: #475569; line-height: 1.45; }
.site-search-empty { color: #64748b; font-size: 14px; padding: 8px 2px; }

.site-tg-wrap {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  align-items: start;
}
.site-tg-qr {
  width: 220px;
  height: 220px;
  border-radius: 10px;
  border: 1px solid rgba(17,24,39,0.14);
  background: #f8fafc;
}
.site-tg-meta p {
  font-size: 15px;
  color: #334155;
  line-height: 1.6;
  margin-bottom: 12px;
}
.site-tg-link {
  display: inline-block;
  background: #1d4ed8;
  color: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 600;
}
.site-tg-link:hover { background: #1e40af; color: #fff; }

.site-meme-note {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin: 6px 0 10px;
}
.site-meme-img {
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid rgba(17,24,39,0.14);
  background: #f8fafc;
}
.site-meme-hint {
  font-size: 14px;
  color: #64748b;
  margin: 10px 0 0;
}
.site-meme-loader {
  font-size: 15px;
  color: #64748b;
  text-align: center;
  padding: 48px 0;
}
.site-meme-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.site-meme-next {
  border: 1px solid rgba(17,24,39,0.2);
  background: #f1f5f9;
  color: #0f172a;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  transition: background 0.15s;
}
.site-meme-next:hover { background: #e2e8f0; }
.site-meme-next:disabled { opacity: 0.45; cursor: default; }
.site-meme-back {
  border: 1px solid rgba(17,24,39,0.2);
  background: #1d4ed8;
  color: #fff;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
}
.site-meme-back:hover {
  background: #1e40af;
}

@media (max-width: 768px) {
  .site-tools { right: 12px; bottom: 90px; }
  .site-tool-btn { width: 42px; height: 42px; }
  .site-tool-icon--search {
    width: 25px;
    height: 25px;
  }
  .site-tool-icon--tg {
    width: 24px;
    height: 24px;
  }
  .site-modal { padding: 14px; }
  .site-tg-wrap { grid-template-columns: 1fr; }
  .site-tg-qr { width: 180px; height: 180px; }
}

/* ========== Гамбургер-меню ========== */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid rgba(15,31,61,0.15);
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #0f1f3d;
  padding: 0;
  transition: background .15s;
  margin-left: auto;
}
.nav-toggle:hover { background: rgba(15,31,61,0.06); }
.nav-toggle svg { display: block; pointer-events: none; }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-inner {
    flex-wrap: nowrap !important;
    padding: 0 !important;
    height: 64px !important;
    min-height: 64px !important;
  }

  .nav-links {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(15,31,61,0.1);
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);
    flex-direction: column !important;
    padding: 8px 16px 16px !important;
    gap: 0 !important;
    z-index: 200;
    overflow-x: initial !important;
    white-space: normal !important;
    width: 100% !important;
  }

  .nav-links.is-open { display: flex !important; }

  .nav-links li {
    flex-shrink: unset;
    width: 100%;
  }
  .nav-links li a {
    font-size: 16px !important;
    padding: 12px 4px;
    display: block;
    border-bottom: 1px solid rgba(15,31,61,0.07);
    color: #0f1f3d;
  }
  .nav-links li:last-child a { border-bottom: none; }
  .nav-links li .btn.btn-primary {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 24px !important;
    border-radius: 6px !important;
    width: auto;
    text-align: center;
    color: #fff !important;
  }
}
