/* СБРОС И БАЗА */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #f3ece6;      /* светлый спокойный фон */
  color: #222222;                 /* тёмно-серый текст, не чисто чёрный */
  line-height: 1.5;
}

/* КОНТЕЙНЕР */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 16px 16px 32px;
}

/* ШАПКА */

header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #dddddd;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #d4d4d4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #2563eb;
  font-size: 0.9rem;
}

.brand-text-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #222222;
}

.brand-text-sub {
  font-size: 0.9rem;
  color: #666666;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge {
  font-size: 0.8rem;
  color: #166534;
  background-color: #dcfce7;
  border: 1px solid #86efac;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background-color: #22c55e;
}

.header-contact {
  font-size: 0.85rem;
  color: #555555;
}

.header-contact strong {
  color: #222222;
}

/* БЛОК С ОПИСАНИЕМ */

.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
}

.hero-text {
  max-width: 640px;
}

.hero-title {
  font-size: 1.8rem;
  margin: 0 0 8px;
  font-weight: 700;
  color: #222222;
}

.hero-subtitle {
  font-size: 0.95rem;
  color: #555555;
  max-width: 520px;
}

.hero-subtitle strong {
  color: #222222;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.hero-stat {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e0e0e0;
  background-color: #ffffff;
  font-size: 0.8rem;
  color: #555555;
}

/* БОКОВОЙ БЛОК (можно использовать или убрать) */

.hero-aside {
  min-width: 220px;
  max-width: 320px;
  background-color: #ffffff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 12px 14px;
}

.hero-aside-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hero-aside-status {
  font-size: 0.8rem;
  color: #166534;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hero-aside-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background-color: #22c55e;
}

.hero-aside-desc {
  font-size: 0.85rem;
  color: #555555;
  margin-bottom: 8px;
}

.hero-aside-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  font-size: 0.78rem;
  padding: 3px 8px;
  color: #555555;
  background-color: #f9fafb;
}

/* ПАНЕЛЬ ПОИСКА / ФИЛЬТРОВ */

.toolbar {
  margin: 12px 0 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.search-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 220px;
  max-width: 420px;
  background-color: #ffffff;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  padding: 4px 10px;
}

.search-icon {
  font-size: 0.85rem;
  color: #666666;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.9rem;
  color: #222222;
}

.search-input::placeholder {
  color: #9ca3af;
}

.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chip {
  font-size: 0.8rem;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background-color: #ffffff;
  color: #555555;
}

.chip-primary {
  border-color: #bfdbfe;
  background-color: #dbeafe;
  color: #1d4ed8;
}

/* ОСНОВНОЙ КОНТЕНТ */

main {
  flex: 1;
}

/* СЕТКА ОБЪЯВЛЕНИЙ */

#ads {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: #666666;
  font-size: 0.95rem;
  padding: 40px 10px 20px;
}

/* КАРТОЧКА ОБЪЯВЛЕНИЯ */

.card {
  background-color: #ffffff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.card:hover {
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

.card-image {
  position: relative;
  aspect-ratio: 4 / 3;
  background-color: #e5e7eb;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-pill {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid #e5e7eb;
  font-size: 0.75rem;
  color: #555555;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background-color: #22c55e;
}

.card-body {
  padding: 10px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #222222;
  margin: 0;
}

.card-desc {
  font-size: 0.9rem;
  color: #555555;
  max-height: 3.2em; /* примерно две строки */
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.85rem;
}

.price {
  font-weight: 700;
  color: #166534;
}

.price span {
  font-size: 0.78rem;
  font-weight: 500;
  color: #555555;
  margin-left: 4px;
}

.weight {
  color: #1d4ed8;
}

/* НИЗ КАРТОЧКИ */

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 10px;
  font-size: 0.8rem;
  color: #777777;
}

.card-tag {
  padding: 2px 7px;
  border-radius: 999px;
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #555555;
}

/* КНОПКА "ПОКАЗАТЬ ЕЩЁ" */

.load-wrapper {
  display: flex;
  justify-content: center;
  margin: 20px 0 8px;
}

#loadMore {
  border: 1px solid #d4d4d4;
  outline: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  background-color: #ffffff;
  color: #222222;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

#loadMore:hover {
  background-color: #f3f4f6;
  box-shadow: 0 4px 10px rgba(148, 163, 184, 0.4);
}

#loadMore:active {
  transform: translateY(1px);
  box-shadow: none;
}

#loadMore[disabled] {
  opacity: 0.7;
  cursor: default;
  box-shadow: none;
}

/* ФУТЕР */

footer {
  border-top: 1px solid #e5e7eb;
  padding: 10px 16px 14px;
  font-size: 0.8rem;
  color: #777777;
  background-color: #ffffff;
  margin-top: auto;
}

.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-badge {
  font-size: 0.78rem;
  padding: 3px 8px;
  border-radius: 999px;
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
}

/* АДАПТИВ ДЛЯ ПЛАНШЕТОВ И ТЕЛЕФОНОВ */

@media (max-width: 900px) {
  .container {
    padding-inline: 12px;
  }

  .hero {
    flex-direction: column;
  }

  .hero-aside {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 600px) {
  header {
    padding-bottom: 10px;
  }

  .header-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-chips {
    justify-content: flex-start;
  }

  #ads {
    grid-template-columns: 1fr; /* одна колонка на телефоне */
  }

  .card {
    border-radius: 10px;
  }
}