/* ===================================================
   PRODVK DESIGN SYSTEM & ULTRA-RESPONSIVE ENGINE
   =================================================== */

:root {
  --bg-main: #060913;
  --bg-card: rgba(13, 22, 44, 0.7);
  --border-light: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(56, 189, 248, 0.3);

  --accent-blue: #2563eb;
  --accent-cyan: #38bdf8;
  --accent-gradient: linear-gradient(135deg, #1d4ed8 0%, #06b6d4 100%);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  --radius-lg: 16px;
  --radius-md: 10px;
  --header-height: 70px;
}

/* Базовый сброс и защита от горизонтального вылета */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

body.lock-scroll {
  overflow: hidden;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===================================================
   ШАПКА (АККУРАТНАЯ, СТАБИЛЬНАЯ, БЕЗ СМЕЩЕНИЙ)
   =================================================== */
.header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: rgba(6, 9, 19, 0.9);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--border-light);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.45rem;
  font-weight: 800;
  text-decoration: none;
  color: #fff;
  letter-spacing: -0.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.logo-dot {
  width: 10px;
  height: 10px;
  background: #38bdf8;
  border-radius: 50%;
  box-shadow: 0 0 10px #38bdf8;
}
.logo span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Навигация для десктопа */
.nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav a:hover {
  color: #fff;
}
.nav-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-light);
  padding: 8px 18px;
  border-radius: var(--radius-md);
  color: #fff !important;
}

/* Кнопка бургера (по умолчанию скрыта) */
.burger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 19px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}
.burger span {
  width: 100%;
  height: 2px;
  background-color: #fff;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.burger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ===================================================
   HERO СЕКЦИЯ
   =================================================== */
.hero {
  padding: 70px 0 40px;
  text-align: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 30px;
  color: var(--accent-cyan);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 18px;
}
.hero h1 span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  color: var(--text-muted);
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  max-width: 650px;
  margin: 0 auto 30px;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 35px;
  padding-top: 25px;
  border-top: 1px solid var(--border-light);
}
.hero-stat-item { text-align: center; }
.hero-stat-num { font-size: 2rem; font-weight: 800; color: #fff; }
.hero-stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; }

/* ===================================================
   ТУЛБАР КАТАЛОГА (ФИЛЬТРЫ, ПОИСК, СОРТИРОВКА)
   =================================================== */
.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 35px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 14px;
  border-radius: var(--radius-lg);
  backdrop-filter: blur(15px);
}
.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}
.tab-btn {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
}
.tab-btn.active, .tab-btn:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
}
.search-input, .sort-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  outline: none;
  font-size: 0.9rem;
}
.search-input { min-width: 240px; }

/* ===================================================
   СЕТКА КАРТОЧЕК
   =================================================== */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 25px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card-img-wrap {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #000;
}
.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.card:hover .card-img-wrap img { transform: scale(1.04); }
.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.card-tag { font-size: 0.75rem; color: var(--accent-cyan); text-transform: uppercase; font-weight: 700; }
.card-title { font-size: 1.25rem; margin: 6px 0 10px; color: #fff; }
.card-desc { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 20px; flex-grow: 1; }
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  padding-top: 15px;
}
.price { font-size: 1.3rem; font-weight: 800; color: #fff; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-light);
  color: #fff;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: var(--radius-md);
}

/* ===================================================
   ПРЕИМУЩЕСТВА И FAQ
   =================================================== */
.features-section, .faq-section { padding: 60px 0; }
.section-head { text-align: center; margin-bottom: 40px; }
.section-head h2 { font-size: 2.2rem; margin-bottom: 10px; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 26px;
  border-radius: var(--radius-lg);
}
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  margin-bottom: 18px;
}
.faq-list { max-width: 800px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}
.faq-question {
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 20px;
  color: var(--text-muted);
}
.faq-item.active .faq-answer { padding-bottom: 18px; }

.cta-banner {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25) 0%, rgba(6, 182, 212, 0.12) 100%);
  border: 1px solid var(--border-glow);
  padding: 50px 20px;
  border-radius: var(--radius-lg);
  text-align: center;
  margin: 30px 0 60px;
}

/* ===================================================
   МОБИЛЬНАЯ ВЕРСИЯ (ДО 768px)
   =================================================== */
@media (max-width: 768px) {
  .burger { display: flex; }

  /* Выпадающее мобильное меню-шторка на весь экран */
  .nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: #060913;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 25px;
    display: none;
    z-index: 999;
  }
  .nav.open {
    display: flex;
  }
  .nav a {
    font-size: 1.3rem;
    color: #fff;
  }
  .nav-btn {
    width: 200px;
    text-align: center;
  }

  /* Сжатие блоков под пальцы */
  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .hero-stat-num { font-size: 1.4rem; }
  .hero-stat-label { font-size: 0.65rem; }

  .catalog-toolbar {
    flex-direction: column;
    gap: 12px;
  }
  .category-tabs {
    width: 100%;
    padding-bottom: 4px;
  }
  .search-input, .sort-select {
    width: 100%;
    min-width: 100%;
  }

  .templates-grid {
    grid-template-columns: 1fr;
  }
}