/* ===== СТИЛИ ГЛАВНОЙ СТРАНИЦЫ — FPV-ЦЕНТР, ТЁМНАЯ ТЕМА NERV =====
   ВСЕ ГЛАВНЫЕ БЛОКИ С ПРЯМЫМИ (НЕ СКРУГЛЁННЫМИ) УГЛАМИ */

/* ===== ШАПКА ===== */
.header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 20px;
  margin-bottom: 14px;
  align-items: flex-start;
  background: var(--bg-card);
  border-radius: 0; /* ровные углы */
  padding: 22px 26px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.header-top-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.header-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.header-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 620px;
  line-height: 1.55;
}

.header-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.header-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(255, 122, 0, 0.3);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 260px;
}

/* ===== ПОИСК ===== */
.search-input {
  position: relative;
  flex: 1 1 374px;   /* 220px × 1.7 — поиск длиннее в 1.7 раза */
  min-width: 272px;  /* 160px × 1.7 */
}
.search-input input {
  width: 100%;
  padding: 10px 12px 10px 34px;
  border-radius: 0; /* ровные углы */
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-input input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.15);
}
.search-input input::placeholder {
  color: var(--text-dim);
}
.search-input svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  opacity: 0.45;
  color: var(--text-muted);
}

/* ===== БАНЕР (HERO) — фон через hero-background.css ===== */
.hero {
  display: flex;
  align-items: center;
  gap: 24px;
  border: 1px solid var(--border);
  border-radius: 0; /* ровные углы */
  padding: 26px 30px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
}
.hero-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hero-text h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
}
.hero-text p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 420px;
  line-height: 1.55;
}
.hero-image {
  width: 40%;
  max-width: 420px;
  flex-shrink: 0;
}
.hero-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
}

/* ===== ЛЕЙАУТ ===== */
.layout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

/* ===== САЙДБАР (категории) — ровные углы ===== */
.side-filters {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0; /* ровные углы */
  box-shadow: var(--shadow-card);
  padding: 14px 12px 16px;
}

.side-filters-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.side-filters-title .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* Подсказка «Фильтр за типом софту» — УДАЛЕНА (скрыта) */
.side-filters-hint {
  display: none !important;
}

.side-filters-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 2px;
}

/* ===== КНОПКИ КАТЕГОРИЙ ===== */
/* Каждая кнопка (включая выбранную) всегда занимает всю ширину блока.
   Плюс гарантийные свойства на случай перекрытия другими правилами. */
.side-filter-btn,
.side-filter-btn.active {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex: 1 1 auto !important;
}

.side-filter-btn {
  text-align: left;
  border-radius: 0; /* ровные углы */
  padding: 8px 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.side-filter-btn-main {
  display: flex;
  align-items: center;
  gap: 7px;
}
.side-filter-btn small {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  flex-shrink: 0;
}
.side-filter-btn:hover {
  border-color: var(--border);
  background: var(--bg-hover);
  color: var(--text);
}
.side-filter-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

/* ===== СЕТКА (список блоков) — ровные углы ===== */
.models-grid-wrapper {
  flex: 1;
  background: var(--bg-card);
  border-radius: 0; /* ровные углы */
  padding: 14px 16px 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.models-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 10px;
  flex-wrap: wrap;
}

.models-header-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 7px;
}
.models-header-title .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.models-header-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.models-header-meta .divider {
  width: 1px;
  height: 14px;
  background: var(--border);
}

/* Сетка: 3 блока в ширину */
.models-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

/* ===== КАРТОЧКА ПРОГРАМЫ ===== */
.model-card {
  position: relative;
  border-radius: 0; /* квадратные углы — в стиле NERV */
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  outline: none;
}

.model-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.25);
}

/* NERV-УГОЛОК: маленькая L-скобка в левом верхнем углу */
.model-card::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 8px;
  width: 14px;
  height: 14px;
  z-index: 3;
  pointer-events: none;
  border-top: 3px solid var(--accent);
  border-left: 3px solid var(--accent);
}

.model-image {
  position: relative;
  height: 285px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-light);
}
.model-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}
.model-image .img-fallback {
  display: none;
  width: 44px;
  height: 44px;
  color: var(--text-dim);
  opacity: 0.5;
  position: absolute;
}

.model-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.model-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  line-height: 1.3;
}
.model-title .badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--bg-hover);
  white-space: nowrap;
  font-weight: 600;
}

/* ===== ОПИСАНИЕ ПРОГРАММЫ В КАРТОЧКЕ ===== */
.model-desc {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
  flex: 1;
  min-height: 0;
  overflow: hidden;
  max-height: 65px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.model-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.model-meta-os {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.model-meta-os .os-pill {
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  background: var(--bg-hover);
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 600;
}

.model-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}
.model-card:hover img {
  transform: scale(1.04);
}

/* ===== ПУСТОЕ СОСТОЯНИЕ ===== */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 44px 20px;
  text-align: center;
  gap: 10px;
  color: var(--text-muted);
}
.empty-state svg {
  width: 40px;
  height: 40px;
  opacity: 0.3;
}
.empty-state h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.empty-state p {
  font-size: 13px;
  max-width: 340px;
  line-height: 1.5;
  color: var(--text-dim);
}

/* ===== КНОПКА «ПОКАЗАТИ ЩЕ» ===== */
.load-more-wrapper {
  display: flex;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 14px;
}

.load-more-btn {
  font-size: 13px;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 0; /* ровные углы */
  padding: 9px 20px;
  cursor: pointer;
  font-weight: 600;
  transition: background var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.load-more-btn:hover {
  background: #E06E00;
  box-shadow: 0 4px 14px rgba(255, 122, 0, 0.35);
}
.load-more-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.3);
  outline: none;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 1024px) {
  .models-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-image { width: 46%; }
}

@media (max-width: 860px) {
  .page-shell { padding: 0 14px; }
  .header { flex-direction: column; padding: 18px; }
  .header-right { align-items: stretch; min-width: 0; width: 100%; }
  .search-input { flex: 1 1 100%; }
  .hero { flex-direction: column; padding: 22px; }
  .hero-image { width: 100%; max-width: 100%; }
  .layout { flex-direction: column; }
  .side-filters { width: 100%; }
  .models-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .model-image { height: 130px; }
  .model-desc { max-height: 38px; }
  .model-body { padding: 10px 12px 12px; gap: 6px; }
  .model-title { font-size: 12px; }
  .model-meta { font-size: 10px; }
}

@media (max-width: 480px) {
  .models-grid { grid-template-columns: 1fr; }
  .models-grid-wrapper { padding: 10px 10px 14px; }
  .hero-text h2 { font-size: 22px; }
  .model-image { height: 170px; }
  .model-desc { max-height: 44px; }
  .load-more-wrapper {
    justify-content: stretch;
  }
  .load-more-btn {
    width: 100%;
  }
}

/* ===== ШИРОКИЕ ЭКРАНЫ ===== */
@media (min-width: 1500px) {
  .models-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1900px) {
  .models-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
