html {
  width: 100%;
  height: 100%;
}
body {
  width: 100%;
  background-color: #a0d7eb;
  margin: 0;
  padding: 0px;
  padding-bottom: 20px;
  font-family:
    Arial Cyr,
    Arial,
    Tahoma;
  font-size: 15px;
}
h1,
h2 {
  text-align: center;
  color: #246e89;
}
li {
  list-style-type: none;
  line-height: 23px;
}
nav {
  display: table;
  margin: 0 auto;
}
p {
  text-align: center;
  vertical-align: top;
}
#logo {
  display: block;
  width: 256px;
  height: 160px;
  background: url("../images/logo.png") no-repeat center;
  margin: 0 auto;
  margin-top: 10px;
  margin-bottom: 10px;
}
.pdf:before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  float: left;
  margin: 4px 6px 0 0;
  background: url("../images/pdf.png") no-repeat;
}
.lst:before {
  content: "";
  display: block;
  width: 16px;
  height: 15px;
  float: left;
  margin: 5px 6px 0 0;
  background: url("../images/lst.png") no-repeat;
}
.new:before {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  float: left;
  margin: 5px 6px 0 0;
  background: url("../images/new.png") no-repeat;
}
.new {
  line-height: 30px;
}
.l1 {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 7px;
  background: url("../images/l1.png") no-repeat;
}
.l2 {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 7px;
  background: url("../images/l2.png") no-repeat;
}
hr {
  width: 90%;
}
.man {
  display: inline-table;
  width: 220px;
  height: 240px;
  border: 2px solid #e0e0ef;
  border-radius: 20px;
  padding: 15px;
  background-color: #ffffff;
  margin: 5px;
  text-align: center;
  text-decoration: none;
}
.man img {
  display: inline-block;
}
.man:hover {
  box-shadow: 0px 4px 10px rgba(89, 129, 204, 0.18);
}
.rem {
  font-size: 12px;
  color: #777777;
}
@media (max-width: 1024px) {
  #defenderToggle,
  #christmasToggle,
  #march8Toggle {
    display: none;
  }
}

.footer {
  background-color: #f5f5f5;
  padding: 20px;
  text-align: center;
  font-family: Arial, sans-serif;
  border-top: 1px solid #ddd;
}

.footer p {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 14px;
}

.creation-link {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #666;
  text-decoration: none;
  padding: 4px 12px;
  border: 1px solid #ccc;
  border-radius: 20px;
  transition: all 0.3s ease;
  background-color: white;
  letter-spacing: 0.3px;
}

.creation-link:hover {
  color: #0088cc;
  border-color: #0088cc;
  background-color: #f0f9ff;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.arrow {
  font-size: 14px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.creation-link:hover .arrow {
  transform: translate(2px, -2px);
}

/* Контейнер поиска */
.search-container {
  max-width: 700px;
  margin: 0 auto 30px auto; /* Отступ снизу до сетки */
  text-align: center;
  position: relative;
  z-index: 10;
}

/* Поле ввода */
.search-box {
  position: relative;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50px; /* Полное скругление как у кнопок */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 2px solid rgba(59, 130, 246, 0.15);
  display: flex;
  align-items: center;
  padding: 5px 10px;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.search-box:focus-within {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2);
  transform: translateY(-2px);
}

/* Иконка поиска */
.search-icon {
  color: #3b82f6;
  font-size: 1.2rem;
  padding: 0 15px;
  opacity: 0.7;
}

/* Инпут */
.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: "Roboto", sans-serif;
  font-size: 1rem;
  color: #2c3e50;
  padding: 12px 0;
  outline: none;
  width: 100%;
}

.search-box input::placeholder {
  color: rgba(44, 62, 80, 0.5);
  font-style: italic;
}

/* Кнопка очистки */
.search-clear {
  background: transparent;
  border: none;
  color: #95a5a6;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s;
  display: none; /* Скрыта по умолчанию */
}

.search-clear:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #e74c3c;
}

.search-clear.active {
  display: block;
}

/* Подсказки под поиском */
.search-hint {
  margin-top: 10px;
  font-size: 0.85rem;
  color: rgba(44, 62, 80, 0.6);
  font-family: "Roboto", sans-serif;
}

.hint-item {
  color: #3b82f6;
  cursor: pointer;
  font-weight: 500;
  transition: color 0.2s;
}

.hint-item:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* Адаптив для мобильных */
@media (max-width: 768px) {
  .search-container {
    margin: 0 auto 20px auto;
    padding: 0 10px;
  }
  .search-box {
    padding: 3px 8px;
  }
  .search-box input {
    font-size: 0.9rem;
    padding: 10px 0;
  }
  .search-icon {
    padding: 0 10px;
    font-size: 1rem;
  }
}

/*  */

/*  */

/* --- Стили поиска --- */
.search-wrapper {
  max-width: 700px;
  margin: 0 auto 30px auto;
  position: relative;
  z-index: 10;
}

.search-box {
  position: relative;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 2px solid rgba(59, 130, 246, 0.15);
  display: flex;
  align-items: center;
  padding: 5px 15px;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.search-box:focus-within {
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.25);
  transform: translateY(-2px);
}

.search-icon {
  color: #3b82f6;
  font-size: 1.2rem;
  padding-right: 12px;
  opacity: 0.7;
}

.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: "Roboto", sans-serif;
  font-size: 1rem;
  color: #2c3e50;
  padding: 12px 0;
  outline: none;
  width: 100%;
}

.search-box input::placeholder {
  color: rgba(44, 62, 80, 0.5);
  font-style: italic;
}

.search-clear {
  background: transparent;
  border: none;
  color: #95a5a6;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s;
  display: none;
  margin-left: 5px;
}

.search-clear:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #e74c3c;
}

.search-clear.active {
  display: block;
}

.search-stats {
  text-align: center;
  margin-top: 10px;
  font-size: 0.9rem;
  color: rgba(44, 62, 80, 0.6);
  font-family: "Roboto", sans-serif;
  min-height: 20px;
}

/* --- Сетка результатов поиска --- */
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 20px;
  animation: fadeIn 0.4s ease;
}

/* Карточка модели в поиске */
.model-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  padding: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  backdrop-filter: blur(5px);
  position: relative;
  overflow: hidden;
}

.model-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
}

.model-image {
  width: 100%;
  height: 160px;
  object-fit: contain;
  border-radius: 10px;
  margin-bottom: 12px;
  background: rgba(240, 240, 240, 0.5);
  transition: transform 0.3s ease;
}

.model-card:hover .model-image {
  transform: scale(1.05);
}

.model-title {
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 12px;
  line-height: 1.4;
  /* min-height: 2.8em; */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.model-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: auto;
}

.action-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.8rem;
  transition: all 0.3s ease;
  font-family: "Roboto", sans-serif;
}

.btn-video {
  background: linear-gradient(135deg, #ff6b6b, #ee5253);
  color: white;
  box-shadow: 0 3px 8px rgba(255, 107, 107, 0.3);
}

.btn-video:hover {
  background: linear-gradient(135deg, #ee5253, #ff6b6b);
  transform: translateY(-2px);
}

.btn-pdf {
  background: linear-gradient(135deg, #4ecdc4, #45b7d1);
  color: white;
  box-shadow: 0 3px 8px rgba(78, 205, 196, 0.3);
}

.btn-pdf:hover {
  background: linear-gradient(135deg, #45b7d1, #4ecdc4);
  transform: translateY(-2px);
}

/* Пагинация */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.pagination button {
  padding: 10px 16px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  color: #2c3e50;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.pagination button:hover {
  background: #fff;
  transform: translateY(-2px);
}

.pagination button.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.4);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Адаптив */
@media (max-width: 768px) {
  .models-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
  }
  .model-image {
    height: 140px;
  }
  .search-box {
    padding: 5px 10px;
  }
  .search-box input {
    font-size: 0.9rem;
  }
}

/* Метка категории в карточке поиска */
.model-category {
  display: inline-block;
  font-size: 0.75rem;
  color: #7f8c8d;
  background: rgba(0, 0, 0, 0.05);
  padding: 4px 10px;
  border-radius: 12px;
  text-decoration: none;
  margin-bottom: 8px;
  transition: all 0.2s ease;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.model-category:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  transform: translateY(-1px);
}

.model-category i {
  margin-right: 4px;
  font-size: 0.65rem;
  opacity: 0.7;
}

/* СТИЛИ СТРАНИЦЫ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  font-family: "Roboto", sans-serif;
  color: #333;
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 2px solid rgba(0, 0, 0, 0.08);
}

#logo {
  display: block;
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background-image: url("https://wedophoto.github.io/lego/instructions/images/logo.webp");
  background-size: cover;
  background-position: center;
}

h1 {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 2.8rem;
  color: #2c3e50;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.telegram-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: white;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 500;
  padding: 10px 20px;
  background: #0088cc;
  border-radius: 25px;
  transition: all 0.3s ease;
  margin-bottom: 30px;
}

.telegram-link:hover {
  background: #0077b3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.2);
}

.telegram-link i {
  font-size: 1.3rem;
}

.models-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
  margin-bottom: 40px;
}

.model-card {
  background: white;
  border-radius: 20px;
  padding: 25px;
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.model-card:hover {
  transform: translateY(-10px);
  border-color: #4ecdc4;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.model-card:hover::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4ecdc4, #ff6b6b);
}

.model-image {
  width: 100%;
  height: 180px;
  object-fit: contain;
  margin-bottom: 20px;
  border-radius: 12px;
  background: #f8f9fa;
  padding: 10px;
}

.model-title {
  font-family: "Montserrat", sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 15px;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.model-title.two-words {
  font-size: 1.2rem;
}

.model-description {
  font-size: 0.85rem; /* Чуть меньше основного текста */
  color: #666; /* Спокойный серый цвет */
  margin-top: 4px; /* Минимальный отступ сверху (всего 4px) */
  margin-bottom: 10px; /* Отступ до кнопок */
  line-height: 1.3; /* Компактный межстрочный интервал */
  font-weight: 400; /* Обычное начертание (не жирное) */
  min-height: 0.85rem;

  /* Обрезка длинного текста до 2 строк с троеточием */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Адаптив для мобильных: можно показывать больше строк или убрать фиксированную высоту */
@media (max-width: 600px) {
  .model-description {
    font-size: 0.9rem;
    margin-bottom: 12px;
    -webkit-line-clamp: 3; /* Показывать 3 строки на телефоне */
  }
}

.model-details {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
  margin-bottom: 15px;
}

.video-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: #0088cc;
  color: white;
  text-decoration: none;
  border-radius: 25px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.2);
}

.video-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(0, 136, 204, 0.3);
  background: #0077b3;
}

.video-btn i {
  font-size: 0.9rem;
}

.instruction-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  text-align: center;
  background: #4ecdc4;
  color: white;
  text-decoration: none;
  border-radius: 12px;
  margin-top: auto;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(78, 205, 196, 0.3);
}

.instruction-btn:hover {
  background: #3db9b0;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(78, 205, 196, 0.4);
}

.instruction-btn i {
  font-size: 1rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #4ecdc4;
  text-decoration: none;
  font-size: 1.1rem;
  padding: 12px 25px;
  background: rgba(78, 205, 196, 0.1);
  border-radius: 25px;
  transition: all 0.3s ease;
  border: 1px solid rgba(78, 205, 196, 0.2);
}

.back-link:hover {
  background: rgba(78, 205, 196, 0.2);
  transform: translateX(-5px);
  box-shadow: 0 4px 12px rgba(78, 205, 196, 0.2);
}

.back-link i {
  font-size: 1rem;
}

.footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  color: #666;
  font-size: 0.9rem;
}

@media (max-width: 1200px) {
  .models-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .models-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .models-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 1.8rem;
  }

  body {
    padding: 10px;
  }

  .container {
    padding: 15px;
  }
}
/* Кнопка "На главную" в шапке */
.top-home-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #4ecdc4;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  padding: 10px 20px;
  background: rgba(78, 205, 196, 0.1);
  border-radius: 25px;
  transition: all 0.3s ease;
  border: 1px solid rgba(78, 205, 196, 0.2);
  margin: 15px auto 0; /* отступ сверху и центрирование */
  max-width: fit-content;
}

.top-home-link:hover {
  background: rgba(78, 205, 196, 0.2);
  transform: translateX(-3px);
  box-shadow: 0 4px 12px rgba(78, 205, 196, 0.2);
}

.top-home-link i {
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.top-home-link:hover i {
  transform: translateX(-2px); /* анимация стрелки при наведении */
}

/* Адаптив для мобильных */
@media (max-width: 600px) {
  .top-home-link {
    font-size: 0.95rem;
    padding: 8px 16px;
    margin: 10px auto 0;
  }
}

/* Меню сайта - справа над header */
.site-menu {
  position: relative;
  z-index: 20;
  margin-bottom: 15px;
  display: flex;
  justify-content: flex-end;
}

.menu-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 20px;
}

.menu-item {
  position: relative;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  text-decoration: none;
  color: #2c3e50;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(5px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.menu-link i {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.menu-link:hover {
  color: #0074d9;
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 4px 12px rgba(0, 116, 217, 0.2);
  transform: translateY(-2px);
}

.menu-link:hover i {
  transform: translateY(-2px);
}

/* Активный пункт меню */
.menu-link.active {
  color: #0074d9;
  background: rgba(0, 116, 217, 0.1);
}

/* Адаптив для мобильных */
@media (max-width: 768px) {
  .site-menu {
    margin-bottom: 10px;
  }

  .menu-list {
    gap: 12px;
  }

  .menu-link span {
    display: none;
  }

  .menu-link i {
    font-size: 1.3rem;
  }

  .menu-link {
    padding: 8px 12px;
  }
}

@media (max-width: 480px) {
  .menu-list {
    gap: 8px;
  }

  .menu-link {
    padding: 6px 10px;
  }

  .menu-link i {
    font-size: 1.1rem;
  }
}

/* ============================================
   БАННЕР "РАЗРАБОТКА САЙТОВ" - Вариант 2
   ============================================ */

.dev-banner {
  position: fixed;
  right: 20px;
  top: 90px;
  z-index: 100;
  max-width: 300px;
  width: calc(100% - 40px);
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 16px;
  padding: 18px;
  border: 1px solid rgba(0, 255, 255, 0.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

/* Стили для кнопки закрытия (крестик) */
.dev-banner-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  font-size: 22px;
  font-weight: bold;
  line-height: 1;
  color: #ffffff;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 20px;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.dev-banner-close:hover {
  background: rgba(255, 80, 80, 0.8);
  transform: scale(1.1);
}

/* Класс для анимации скрытия */
.dev-banner.hide {
  opacity: 0;
  visibility: hidden;
  transform: translateX(50px);
  transition: all 0.3s ease;
}

.dev-banner:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  border-color: rgba(0, 255, 255, 0.4);
}

.dev-banner::before {
  content: "</>";
  position: absolute;
  bottom: -15px;
  right: -15px;
  font-size: 60px;
  opacity: 0.05;
  font-family: monospace;
  pointer-events: none;
}

.dev-banner-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.dev-banner-code-icon {
  background: #0f3460;
  padding: 6px 10px;
  border-radius: 8px;
  font-family: monospace;
  font-weight: 700;
  font-size: 1rem;
  color: #00ffff;
}

.dev-banner-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: white;
}

.dev-banner p {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-bottom: 15px;
  line-height: 1.4;
  color: #e0e0e0;
  text-align: left;
}

.dev-banner-stats {
  display: flex;
  gap: 15px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.dev-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  color: #ccc;
}

.dev-stat i {
  color: #00ffff;
  font-size: 0.7rem;
}

.dev-banner-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #00ffff, #0088ff);
  padding: 8px 16px;
  border-radius: 30px;
  text-decoration: none;
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  width: 100%;
  border: none;
  cursor: pointer;
}

.dev-banner-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 5px 15px rgba(0, 255, 255, 0.3);
}

/* ============================================
   МОБИЛЬНАЯ ВЕРСИЯ (ВНИЗУ, НАД ФУТЕРОМ)
   ============================================ */
@media (max-width: 768px) {
  .dev-banner {
    display: none;
    position: relative;
    right: auto;
    bottom: auto;
    max-width: 100%;
    width: 100%;
    margin: 20px 0 10px 0;
    border-radius: 16px;
  }

  .dev-banner::before {
    display: none;
  }

  .dev-banner-stats {
    gap: 12px;
  }

  .dev-banner-btn {
    padding: 10px 16px;
    font-size: 0.9rem;
  }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
  .dev-banner {
    display: none;
    margin: 15px 0 10px 0;
    padding: 15px;
  }

  .dev-banner-stats {
    gap: 10px;
  }

  .dev-stat {
    font-size: 0.65rem;
  }
}

/* Когда ассистент открыт (не hidden) - скрываем баннер */
.assistant-container:not(.hidden) ~ .dev-banner,
.assistant-container:not(.hidden) + .dev-banner,
body:has(.assistant-container:not(.hidden)) .dev-banner {
  display: none !important;
}

/* И наоборот - когда ассистент скрыт - показываем баннер */
.assistant-container.hidden ~ .dev-banner,
.assistant-container.hidden + .dev-banner,
body:has(.assistant-container.hidden) .dev-banner {
  display: block !important;
}

/* Блок книг с ограниченным доступом */
.restricted-books {
  position: relative;
}

.restricted-books::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(3px);
  border-radius: 16px;
  pointer-events: none;
  z-index: 5;
}

.restricted-books .section-title {
  position: relative;
  z-index: 10;
}

.restricted-books .section-title::after {
  background: linear-gradient(90deg, #ff6b6b, #ffd166, #4ecdc4);
}

.access-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 20;
  background: white;
  padding: 20px 30px;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  border: 2px solid #ff6b6b;
  min-width: 250px;
}

.access-overlay i {
  font-size: 2rem;
  color: #ff6b6b;
  margin-bottom: 10px;
}

.access-overlay h4 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: #2c3e50;
}

.access-overlay p {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 15px;
}

.access-overlay .request-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #0088cc, #005a8e);
  color: white;
  padding: 10px 20px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.access-overlay .request-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 136, 204, 0.3);
}

/* Убираем затемнение при наведении на кнопку */
.restricted-books .access-overlay {
  pointer-events: auto;
}

.restricted-badge {
  background: linear-gradient(135deg, #ff6b6b, #dc3545) !important;
}

.restricted-badge i {
  margin-right: 4px;
}

.restricted-book {
  cursor: pointer;
  transition: all 0.3s ease;
}

.restricted-book:hover {
  transform: translateY(-5px);
  filter: brightness(0.95);
}

/* На мобильных - показываем только первые 2 книги */
@media (max-width: 768px) {
  .restricted-books .featured-books {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  /* Скрываем все книги начиная с 3-й */
  .restricted-books .featured-books .featured-book-card:nth-child(n + 3) {
    display: none;
  }
}

/* ============================================
   МОДАЛЬНОЕ ОКНО - СТИЛЬ МАРКЕТПЛЕЙСА
   ============================================ */

.modal-card {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  z-index: 20000;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.modal-card.active {
  display: flex;
}

.modal-card-content {
  position: relative;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 32px;
  max-width: 700px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  cursor: default;
  animation: modalSlideUp 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Кнопка закрытия */
.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.modal-close-btn:hover {
  background: rgba(255, 71, 87, 0.8);
  transform: rotate(90deg);
}

/* Обёртка изображения */
.modal-card-img-wrapper {
  position: relative;
  width: 100%;
  height: 320px;
  overflow: hidden;
  border-radius: 32px 32px 0 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.modal-card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f0f2f5;
  padding: 20px;
}

/* Бейдж */
.modal-card-badge {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  letter-spacing: 0.5px;
}

/* Тело модального окна */
.modal-card-body {
  padding: 24px 28px 32px;
}

.modal-card-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 12px;
  line-height: 1.3;
  letter-spacing: -0.3px;
}

.modal-card-description {
  font-size: 1rem;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* Статистика / характеристики */
.modal-card-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #64748b;
  background: #f1f5f9;
  padding: 6px 14px;
  border-radius: 30px;
}

.stat-item i {
  font-size: 1rem;
  color: #3b82f6;
}

/* Кнопки действий */
.modal-card-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.modal-card-actions .modal-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 24px;
  border-radius: 60px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border: none;
}

.modal-btn-pdf {
  background: linear-gradient(135deg, #4caf50, #4caf50);
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.modal-btn-video {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

/* Анимация свечения кнопок */
.modal-btn-pdf::before,
.modal-btn-video::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.6s ease;
}

.modal-card.active .modal-btn-pdf::before,
.modal-card.active .modal-btn-video::before {
  left: 100%;
}

.modal-btn-pdf:hover,
.modal-btn-video:hover {
  transform: translateY(-3px);
  filter: brightness(1.05);
}

.modal-btn-pdf:active,
.modal-btn-video:active {
  transform: translateY(0);
}

/* ===== МОБИЛЬНАЯ ВЕРСИЯ ===== */
@media (max-width: 768px) {
  .modal-card-content {
    width: 95%;
    max-height: 90vh;
    border-radius: 24px;
  }

  .modal-card-img-wrapper {
    height: 250px;
  }

  .modal-card-body {
    padding: 20px;
  }

  .modal-card-title {
    font-size: 1.4rem;
  }

  .modal-card-description {
    font-size: 0.9rem;
    margin-bottom: 20px;
  }

  .modal-card-stats {
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
  }

  .stat-item {
    font-size: 0.75rem;
    padding: 4px 12px;
  }

  .modal-card-actions {
    flex-direction: column;
    gap: 12px;
  }

  .modal-card-actions .modal-btn {
    padding: 12px 20px;
    font-size: 0.9rem;
  }

  .modal-close-btn {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  .modal-card-img-wrapper {
    height: 200px;
  }

  .modal-card-body {
    padding: 16px;
  }

  .modal-card-title {
    font-size: 1.2rem;
  }
}
