/* ===== VEB MARKET — стиль в духе вэб.рф =====
   Палитра: бирюза #2cb5b4, синий #008fd5, сланец #2f444e */

:root {
  --teal: #2cb5b4;
  --teal-hover: #008fd5;
  --blue: #008fd5;
  --sky: #caecff;
  --slate: #2f444e;
  --gray: #718086;
  --bg-light: #f6f6f6;
  --shadow: 0 0 10px 0 #ececec;
  --shadow-hover: 0 8px 24px rgba(47, 68, 78, .14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--slate);
  background: #fff;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--slate);
  margin: 0 0 16px;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: #13b3e9; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--gray); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-block;
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  background: var(--teal);
  border: none;
  border-radius: 30px;
  padding: 12px 28px;
  cursor: pointer;
  transition: background .2s ease;
}
.btn:hover { background: var(--teal-hover); color: #fff; }

/* ---------- Шапка (липкая) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid #e6e6e6;
  transition: box-shadow .2s ease;
}
.site-header.is-scrolled { box-shadow: 0 4px 16px rgba(47, 68, 78, .09); }
.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 14px 20px;
}
.burger-toggle { display: none; }
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
}
.burger span {
  width: 22px; height: 2px;
  background: var(--slate);
  border-radius: 2px;
}
.logo {
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 700;
  font-size: 24px;
  color: var(--slate);
  letter-spacing: .02em;
}
.logo span { color: var(--teal); }
.main-nav { display: flex; gap: 8px; margin-left: auto; }
.main-nav a {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--slate);
  padding: 10px 14px;
}
.main-nav a:hover { color: var(--teal); }

/* ---------- Hero с поиском ---------- */
.hero {
  background: linear-gradient(180deg, #f2fbff 0%, #ffffff 100%);
  padding: 64px 0 72px;
  text-align: center;
}
.hero h1 { font-size: 54px; }
.hero-subtitle { font-size: 18px; color: var(--gray); margin: 0 0 36px; }
.hero-stats {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  color: var(--gray);
  font-size: 14px;
}
.hero-stats b {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 20px;
  color: var(--slate);
  margin-right: 6px;
}

.search-form {
  display: flex;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto;
}
.search-form input,
.search-form select {
  flex: 1;
  font: inherit;
  color: var(--slate);
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 30px;
  padding: 14px 24px;
  box-shadow: var(--shadow);
}
.search-form select { flex: 0 0 240px; }
.search-form input:focus,
.search-form select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(44, 181, 180, .18);
}

/* ---------- Чипсы категорий ---------- */
.listings-section { padding: 40px 20px 64px; }
.category-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.chip {
  font-size: 14px;
  color: var(--slate);
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 30px;
  padding: 8px 18px;
  transition: all .15s ease;
}
.chip:hover { border-color: var(--teal); color: var(--teal); }
.chip-active { background: var(--teal); border-color: var(--teal); color: #fff; }
.chip-active:hover { color: #fff; }

/* ---------- Карточки объявлений ---------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}
.card {
  display: block;
  background: #fff;
  border: none;
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.card-photo { aspect-ratio: 4 / 3; background: var(--bg-light); position: relative; overflow: hidden; }
.card-photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .35s ease;
}
.card:hover .card-photo img { transform: scale(1.05); }
.card-cat-badge {
  position: absolute;
  left: 10px; bottom: 10px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(4px);
  color: var(--slate);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  box-shadow: 0 1px 4px rgba(47, 68, 78, .15);
}
.photo-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #b8c4c9;
  font-size: 14px;
}
.photo-placeholder.big { border-radius: 16px; aspect-ratio: 4 / 3; }
.card-body { padding: 16px; }
.card-price {
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--teal);
  margin-bottom: 6px;
}
.card-title {
  font-weight: 600;
  color: var(--slate);
  font-size: 15px;
  line-height: 1.45;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.9em;
}
.card-meta { font-size: 14px; color: var(--gray); }

/* ---------- Пусто / пагинация ---------- */
.empty-state { text-align: center; padding: 64px 20px; }
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 40px;
}
.pagination a {
  border: 1px solid #e6e6e6;
  border-radius: 30px;
  padding: 10px 22px;
  color: var(--slate);
}
.pagination a:hover { border-color: var(--blue); color: var(--blue); }
.pagination-info { color: var(--gray); font-size: 14px; }

/* ---------- Страница объявления ---------- */
.detail-page { padding: 20px 20px 64px; }
.breadcrumbs { font-size: 13px; color: var(--gray); margin-bottom: 10px; }
.breadcrumbs a { color: var(--gray); }
.breadcrumbs a:hover { color: var(--teal); }
.breadcrumbs span { color: var(--slate); font-weight: 600; }
.back-link { display: inline-block; margin-bottom: 20px; font-size: 14px; }
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 40px;
}
.main-photo {
  width: 100%;
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: block;
}
.thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.thumbs img {
  width: 88px; height: 66px; object-fit: cover;
  border-radius: 10px; cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .15s ease;
}
.thumbs img:hover { border-color: var(--teal); }
.thumbs img.thumb-active { border-color: var(--teal); }
.main-photo { transition: opacity .15s ease; }
.detail-info h1 { font-size: 36px; }
.detail-price {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--teal);
  margin: 8px 0 24px;
}
.detail-meta {
  display: grid; gap: 10px;
  background: var(--bg-light);
  border-radius: 16px;
  padding: 20px 24px;
  margin: 0 0 24px;
}
.detail-meta div { display: flex; gap: 12px; }
.detail-meta dt { color: var(--gray); width: 120px; margin: 0; }
.detail-meta dd { margin: 0; font-weight: 600; }
.detail-desc { white-space: normal; }

/* ---------- CTA-блок на странице объявления ---------- */
.detail-cta {
  display: grid;
  gap: 12px;
  border: 1px solid #e6e6e6;
  border-radius: 16px;
  padding: 20px;
  margin: 0 0 24px;
  background: linear-gradient(180deg, #f7fdff 0%, #ffffff 100%);
}
.detail-cta-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.btn-block { width: 100%; text-align: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:disabled:hover { background: var(--teal); }
.ico { flex: none; color: var(--teal); }
.empty-state svg { color: #b8c4c9; margin-bottom: 12px; }
.empty-state .btn { margin-top: 12px; }

/* ---------- Страница «Раздел в разработке» ---------- */
.wip-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 110px 20px 130px;
  text-align: center;
}
.wip-page svg { color: var(--teal); margin-bottom: 20px; }
.wip-page h1 { font-size: 36px; margin-bottom: 10px; }
.wip-page p { font-size: 17px; color: var(--slate); margin: 0 0 6px; }

/* ---------- Редактирование ---------- */
.edit-btn { margin: -8px 0 20px; }
.edit-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 14px;
}
.edit-photo {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--bg-light);
}
.edit-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.edit-photo .photo-del {
  position: absolute;
  top: 6px;
  right: 6px;
}
.hidden-form { display: none; }
.photo-del {
  width: 28px; height: 28px;
  border: none; border-radius: 50%;
  background: rgba(185, 74, 72, .92);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.photo-del:hover { background: #a03a38; }
.photo-del-inline { width: auto; height: auto; border-radius: 30px; padding: 6px 16px; font-size: 13px; }
.edit-attachment form { margin-left: auto; }
.edit-attachment {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f2fbff;
  border: 1px solid #d8ecf5;
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 8px;
}
.edit-attachment form { margin-left: auto; }
.edit-attachment .photo-del { width: auto; height: auto; border-radius: 30px; padding: 6px 16px; font-size: 13px; }
.my-action { display: flex; gap: 10px; align-items: center; }

/* ---------- Вложения на странице объявления ---------- */
.attachments { margin-top: 28px; }
.attachments h2 { font-size: 20px; margin-bottom: 14px; }
.attachment {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f2fbff;
  border: 1px solid #d8ecf5;
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 10px;
  color: var(--slate);
  transition: border-color .15s ease, background .15s ease;
}
.attachment:hover { border-color: var(--teal); background: #e9f9f8; color: var(--slate); }
.attachment-ico { font-size: 20px; }
.attachment-name { font-weight: 600; word-break: break-all; }
.attachment-size { color: var(--gray); font-size: 14px; }
.attachment-dl {
  margin-left: auto;
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--teal);
  white-space: nowrap;
}

/* ---------- Пользователь в шапке ---------- */
.user-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 8px;
}
.user-name {
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--slate);
}
.login-link {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--slate);
  padding: 10px 14px;
}
.login-link:hover { color: var(--teal); }
.logout-form { display: inline; }
.btn-ghost {
  background: transparent;
  border: 2px solid var(--sky);
  color: var(--slate);
  padding: 8px 20px;
}
.btn-ghost:hover { background: transparent; border-color: var(--blue); color: var(--blue); }

/* ---------- Мои объявления ---------- */
.my-page { padding: 32px 20px 64px; }
.my-page h1 { display: inline-block; margin-right: 20px; }
.my-list { display: grid; gap: 16px; margin-top: 28px; }
.my-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 20px;
  align-items: center;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
}
.my-photo { width: 110px; height: 82px; border-radius: 10px; overflow: hidden; background: var(--bg-light); }
.my-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.my-photo .photo-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #a0a5ab; font-size: 12px; }
.my-info { display: grid; gap: 6px; }
.my-title { font-weight: 600; color: var(--slate); font-size: 17px; }
.my-title:hover { color: var(--blue); }
.badge {
  justify-self: start;
  font-size: 12px;
  font-weight: 600;
  border-radius: 30px;
  padding: 4px 14px;
}
.badge-active { background: #e9f9f8; color: #1d7a79; }
.badge-inactive { background: #f1f1f1; color: #a0a5ab; }

/* ---------- Подача объявления ---------- */
.form-page { max-width: 720px; padding: 32px 20px 64px; }
.form-page h1 { font-size: 36px; }
.form-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 32px;
  display: grid;
  gap: 20px;
  margin-top: 24px;
}
.form-field { display: grid; gap: 6px; }
.form-field label {
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 600;
  font-size: 14px;
}
.form-control {
  font: inherit;
  color: var(--slate);
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  padding: 12px 16px;
}
.form-control:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(44, 181, 180, .15);
}
textarea.form-control { resize: vertical; }
.file-input { padding: 10px 16px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.hint { font-size: 13px; color: var(--gray); }
.field-error { font-size: 13px; color: #b94a48; }
.form-errors {
  background: #fdf0f0;
  border-radius: 12px;
  padding: 14px 18px;
  color: #b94a48;
}
.btn-lg { padding: 16px 36px; font-size: 16px; justify-self: start; }

/* ---------- Flash-сообщения ---------- */
.flash {
  max-width: 1240px;
  margin: 20px auto 0;
  padding: 0 20px;
}
.flash div {
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 10px;
  font-weight: 600;
  animation: flash-in .35s ease;
}
.flash div.flash-hide {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .4s ease, transform .4s ease;
}
@keyframes flash-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
.flash-success { background: #e9f9f8; color: #1d7a79; }
.flash-warning { background: #fff7e6; color: #946200; }

/* ---------- Подвал ---------- */
.site-footer {
  background: var(--slate);
  color: #cfd8dc;
  padding: 40px 0;
  margin-top: 64px;
}
.site-footer p { margin: 0; }
.site-footer a { color: #8fd3d2; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* ---------- Адаптив ---------- */
@media (max-width: 800px) {
  .hero h1 { font-size: 34px; }
  .search-form { flex-direction: column; }
  .search-form select { flex: auto; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-info h1 { font-size: 26px; }
  .header-inner { gap: 14px; flex-wrap: wrap; }

  /* Бургер-меню */
  .burger { display: flex; order: 2; }
  .main-nav {
    display: none;
    order: 10;
    flex-basis: 100%;
    flex-direction: column;
    gap: 4px;
    padding: 10px 0 16px;
    border-top: 1px solid #eef2f4;
  }
  .burger-toggle:checked ~ .main-nav { display: flex; }
}
