/* =============================================
   ГЛАВНЫЕ ПЕРЕМЕННЫЕ (ЦВЕТА, ТЕНИ, РАДИУСЫ)
   Меняй значения здесь – они применятся везде.
   ============================================= */
:root {
  --bg: #ffffff;                /* ← фон страницы */
  --panel: #ffffff;             /* ← фон панелей */
  --text: #181410;              /* ← цвет текста */
  --muted: #6b7280;             /* ← приглушённый текст (подписи) */
  --line: #7b94c7;              /* ← цвет рамок */
  --blue: #2c15c4;              /* ← основной синий (кнопки) */
  --blue2: #0ea5e9;             /* ← более светлый синий (ховер) */
  --shadow: 0 8px 24px rgba(17, 24, 39, 0.06);  /* ← тень панелей */
  --radius: 20px;               /* ← скругление углов */
}

/* Тёмная тема (автоматически, если в ОС включён тёмный режим) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --panel: #1e2937;
    --text: #f1f5f9;
    --muted: #436da8;
    --line: #334155;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  }
  .topbar { background: rgba(15, 23, 42, 0.95) !important; }
  .dropdown, .mega-menu, .profile-dropdown, .modal { background: #1e2937; border-color: #334155; }
}

/* =============================================
   БАЗОВЫЕ НАСТРОЙКИ
   ============================================= */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body.no-scroll { overflow: hidden; }

.app {
  max-width: 1550px;
  margin: 0 auto;
  padding: 14px 18px 24px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* =============================================
   ШАПКА (ХЕДЕР)
   ============================================= */
.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 12px 14px;
  position: sticky;
  top: 10px;
  z-index: 80;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 22px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  padding: 4px 8px;
  margin: -4px -8px;
  transition: transform 0.2s ease, text-shadow 0.2s ease;
}
.logo:hover {
  transform: scale(1.03);
  text-shadow: 0 0 12px rgba(29, 155, 240, 0.6);
}
.logo::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 40%,
    rgba(255, 255, 255, 0.5) 50%,
    rgba(255, 255, 255, 0.4) 60%,
    transparent 100%
  );
  transition: left 0.6s ease;
  pointer-events: none;
}
.logo:hover::after { left: 100%; }

.logo-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot1 { background: #2dd4bf; }
.dot2 { background: #3b82f6; }
.dot3 { background: #22c55e; }
.logo-text b { font-weight: 900; }

.topbar-center {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.category-btn {
  border: 0;
  background: #1d9bf0;
  color: #fff;
  padding: 14px 18px;
  border-radius: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

/* =============================================
   ВЫБОР ГОРОДА
   ============================================= */
.location-wrap {
  position: relative;
  min-width: 180px;
  max-width: 280px;
  flex: 0 0 260px;
}

.geo-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: #e53e3e;
  pointer-events: none;
  z-index: 2;
}

.location-input {
  width: 100%;
  border: 2px solid #1d9bf0;
  border-radius: 18px;
  padding: 14px 40px 14px 34px;
  outline: none;
}

.detect-location-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #1d9bf0;
  background: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 2;
  padding: 0;
}
.detect-location-btn:hover {
  background: #e8f4fd;
  transform: translateY(-50%) scale(1.1);
}
.detect-location-btn.loading {
  animation: spin 1s linear infinite;
  border-color: #ccc;
}
@keyframes spin {
  from { transform: translateY(-50%) rotate(0deg); }
  to { transform: translateY(-50%) rotate(360deg); }
}

.dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: 58px;
  z-index: 300;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.12);
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
}

.dropdown-item {
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
}
.dropdown-item:hover, .dropdown-item.active { background: #f3f4f6; }
.dropdown-item .sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

/* =============================================
   ПОИСК
   ============================================= */
.search-hero { margin-bottom: 20px; }

.search-wrap-hero {
  display: flex;
  background: #fff;
  border: 2px solid #1d9bf0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.search-input-hero {
  flex: 1;
  border: 0;
  outline: none;
  padding: 15px 20px;
  font-size: 16px;
}

.search-btn-hero {
  border-radius: 0;
  box-shadow: none;
  padding: 0 24px;
  background: #1d9bf0;
  color: #fff;
  border: 0;
  font-weight: 700;
  cursor: pointer;
}
.search-btn-hero:hover { background: #0ea5e9; }

/* =============================================
   ПРАВАЯ ЧАСТЬ ШАПКИ (КНОПКИ, ПРОФИЛЬ)
   ============================================= */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mini-link { font-weight: 600; white-space: nowrap; }

.btn {
  border: 0;
  background: var(--blue);
  color: #fff;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}
.btn:hover { background: var(--blue2); transform: translateY(-1px); }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn.wide { width: 100%; margin-top: 16px; padding: 13px 16px; }

.hidden { display: none !important; }

/* =============================================
   ПРОФИЛЬНОЕ МЕНЮ (ВЫПАДАЮЩЕЕ)
   ============================================= */
.profile-dropdown-wrapper { position: relative; display: inline-block; }
.profile-dropdown-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 12px;
  transition: background 0.15s;
}
.profile-dropdown-btn:hover { background: #f3f4f6; }
.profile-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.12);
  z-index: 200;
  min-width: 220px;
  overflow: hidden;
}
.profile-dropdown-item {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 15px;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
}
.profile-dropdown-item:hover { background: #f3f4f6; }
.profile-dropdown-item:last-child { border-bottom: none; }

/* =============================================
   МЕГА-МЕНЮ (КАТЕГОРИИ)
   ============================================= */
.mega-menu {
  position: fixed;
  left: 18px;
  right: 18px;
  top: 80px;
  z-index: 120;
  display: grid;
  grid-template-columns: 320px 1fr 290px;
  gap: 24px;
  background: #fff;
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 16px 50px rgba(0,0,0,0.12);
  border: 1px solid #e5e7eb;
}

.mega-left {
  max-height: 520px;
  overflow: auto;
  padding-right: 8px;
  display: grid;
  gap: 8px;
}

.mega-item {
  border: 0;
  background: transparent;
  padding: 14px 16px;
  border-radius: 14px;
  text-align: left;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s ease;
}
.mega-item:hover { background: #f3f4f6; }
.mega-item.active { background: #f3f4f6; font-weight: 700; }
.mega-item::after { content: "›"; font-size: 24px; color: #111827; }

.mega-right { min-height: 520px; padding: 12px 8px; }

.mega-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 22px;
}

.mega-col h4 {
  margin: 0 0 10px;
  font-size: 22px;
}

.mega-col a {
  display: block;
  color: #111827;
  text-decoration: none;
  margin: 10px 0;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.mega-col a:hover { background: #f3f4f6; }

.mega-side {
  background: #d8ecff;
  border-radius: 24px;
  padding: 20px;
}
.mega-side h3 { margin-top: 0; font-size: 22px; }
.mega-side a {
  display: block;
  margin: 12px 0;
  text-decoration: none;
  color: #111827;
}

/* =============================================
   ОСНОВНОЙ КОНТЕНТ (ГЛАВНАЯ)
   ============================================= */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.content { min-width: 0; }

.categories-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-bottom: 26px;
}

.cat-card {
  background: #f4f4f4;
  border-radius: 18px;
  min-height: 94px;
  padding: 14px 14px 10px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.cat-card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 20px rgba(29,155,240,0.25);
  background: #eef2ff;
}
.cat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.5) 40%, rgba(255,255,255,0.6) 50%, rgba(255,255,255,0.5) 60%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}
.cat-card:hover::after { left: 100%; transition: left 0.5s ease; }

.cat-title {
  font-size: 15px;
  line-height: 1.1;
  font-weight: 600;
  max-width: 150px;
  position: relative;
  z-index: 2;
}

.cat-img {
  position: absolute;
  right: 8px;
  bottom: 6px;
  font-size: 48px;
  opacity: 0.95;
  z-index: 2;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 22px 0 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.grid-products {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.avito-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
  position: relative;
}
.avito-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,0.15); }

.avito-img {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: #f9f9f9;
}
.avito-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.avito-no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #999;
  font-size: 14px;
}

.avito-fav {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: transform 0.2s;
}
.avito-fav:hover { transform: scale(1.1); }
.avito-fav.active { color: #e53e3e; }

.avito-body { padding: 12px 14px 14px; }
.avito-price {
  font-size: 20px;
  font-weight: 700;
  color: #111;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.avito-title {
  font-size: 15px;
  font-weight: 500;
  color: #333;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.avito-meta {
  font-size: 13px;
  color: #8c8c8c;
  margin-bottom: 8px;
}

.avito-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.avito-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  background: #f0f0f0;
  color: #666;
}
.avito-badge.ok { background: #e6f7e6; color: #2e7d32; }
.avito-badge.safe { background: #e3f2fd; color: #1565c0; }
.avito-badge.delivery { background: #fff3e0; color: #e65100; }

/* =============================================
   САЙДБАР (ПРАВАЯ КОЛОНКА)
   ============================================= */
.sidebar {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 100px;
}

.business-card, .side-list {
  padding: 16px;
  border-radius: 24px;
  background: #f6f6f6;
  border: 0;
  box-shadow: var(--shadow);
}

.business-card h3, .side-list h3 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.business-card p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.45;
}

.biz-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; }
.biz-item { text-align: center; font-size: 13px; }
.biz-item span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  margin: 0 auto 8px;
  background: #e9eef5;
  font-size: 28px;
}
.biz-item b { display: block; font-weight: 500; line-height: 1.1; }

.side-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.side-item:first-of-type { border-top: 0; padding-top: 0; }

.thumb {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #e8edf4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.page.hidden { display: none; }

/* =============================================
   ОВЕРЛЕЙ И МОДАЛКА
   ============================================= */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 100;
  padding: 18px;
  overflow-y: auto;
}

.modal {
  max-width: 650px;
  width: 100%;
  margin: 40px auto;
  position: relative;
  padding: 18px;
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 22px;
}

/* =============================================
   ФОРМЫ
   ============================================= */
.form-grid { display: grid; gap: 10px; }

.form-grid input,
.form-grid select,
.form-grid textarea,
.search-field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 15px;
  margin: 12px 0 8px;
  padding: 6px 0;
}
.check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
  cursor: pointer;
  flex-shrink: 0;
}

/* =============================================
   ПРЕВЬЮ ФОТО (ЗАГРУЗКА)
   ============================================= */
.preview-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.preview-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #f8fafc;
  position: relative;
}
.preview-item img {
  width: 100%;
  height: 90px;
  object-fit: contain;
  display: block;
}
.preview-item .remove-photo {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: #fff;
  cursor: pointer;
}
.upload-hint { font-size: 13px; color: var(--muted); line-height: 1.4; }

/* =============================================
   СТРАНИЦА ОБЪЯВЛЕНИЯ – УПРАВЛЕНИЕ ОТСТУПАМИ
   ============================================= */
.product-title {
  width: fit-content;
  margin-left: 40px;
  margin-top: 0;
  margin-bottom: 20px;
}

.product-gallery {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-left: 40px;
}

.main-photo-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 500px;
  margin-left: 0 !important;
}

.product-main-photo {
  width: 100%;
  max-width: 500px;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  background: #f9f9f9;
  border: 1px solid var(--line);
  display: block;
  margin-left: 0 !important;
}

.photo-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.85);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 20px;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.photo-arrow-left  { left: 10px; }
.photo-arrow-right { right: 10px; }

.main-photo-wrapper:hover .photo-arrow {
  opacity: 1;
  pointer-events: auto;
}

.product-thumbnails {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-left: 0;
}

.product-thumb {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  object-fit: contain;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}
.product-thumb:hover,
.product-thumb.active {
  border-color: var(--blue);
}

.product-city {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  width: fit-content;
  margin-left: 40px;
}

.product-description {
  margin-top: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-left: 40px;
}
.product-description h3 { margin-top: 0; }

.product-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  width: fit-content;
  margin-left: 0;
  margin-top: 0;
}

.product-phone {
  font-size: 18px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  width: fit-content;
  margin-left: 0;
  margin-top: 0;
}

.product-message-btn {
  width: 100%;
}

.show-phone-btn {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 18px;
  cursor: pointer;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius);
  transition: background 0.2s;
}
.show-phone-btn:hover {
  background: #f0f0f0;
}

/* =============================================
   СТРАНИЦА СОЗДАНИЯ ОБЪЯВЛЕНИЯ
   ============================================= */
.create-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 10px 0 40px;
}

.create-page-header {
  margin-bottom: 24px;
}

.create-page-header h1 {
  font-size: 28px;
  margin: 0 0 8px;
  font-weight: 700;
}

.create-page-header p {
  color: var(--muted);
  font-size: 15px;
  margin: 0;
}

.create-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
}

.form-section-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section-title .icon {
  font-size: 22px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-row.full {
  grid-template-columns: 1fr;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
  background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(44, 21, 196, 0.08);
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.form-group .help-text {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.form-group .char-counter {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  margin-top: 2px;
}

/* Поле города с подсказками */
.city-input-wrap {
  position: relative;
}

.city-input-wrap input {
  padding-left: 34px !important;
}

.city-input-wrap .geo-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: #e53e3e;
  pointer-events: none;
  z-index: 2;
}

.city-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 300;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  overflow: hidden;
  max-height: 260px;
  overflow-y: auto;
  margin-top: 4px;
}

/* Загрузка фото */
.photo-upload-area {
  border: 2px dashed var(--line);
  border-radius: 16px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafbfc;
}

.photo-upload-area:hover {
  border-color: var(--blue);
  background: #f5f7ff;
}

.photo-upload-area .upload-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 8px;
}

.photo-upload-area .upload-text {
  font-size: 15px;
  color: var(--muted);
}

.photo-upload-area .upload-text b {
  color: var(--blue);
}

.photo-upload-area input {
  display: none;
}

.photos-preview-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.photo-preview-item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
  aspect-ratio: 1;
}

.photo-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-preview-item .remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.photo-preview-item .remove-btn:hover {
  background: #e53e3e;
}

.photo-preview-item .main-photo-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  background: rgba(76, 175, 80, 0.9);
  color: #fff;
  font-size: 11px;
  text-align: center;
  padding: 2px 0;
  border-radius: 6px;
  font-weight: 600;
}

/* Хештеги */
.hashtags-input-wrap {
  position: relative;
}

.hashtags-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.hashtag-tag {
  background: #eef2ff;
  color: var(--blue);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.hashtag-tag .remove-tag {
  cursor: pointer;
  font-size: 14px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.hashtag-tag .remove-tag:hover {
  opacity: 1;
}

/* Чекбоксы */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.checkbox-group input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--blue);
  cursor: pointer;
}

.checkbox-group label {
  font-size: 15px;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
}

/* Нижние кнопки */
.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-top: 8px;
}

.form-actions .btn {
  padding: 14px 28px;
  font-size: 16px;
}

.form-actions .btn.ghost {
  padding: 14px 28px;
}

/* =============================================
   УВЕЛИЧЕННОЕ ФОТО С ПЕРЕЛИСТЫВАНИЕМ
   ============================================= */
.enlarged-photo-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: pointer;
}
.enlarged-photo-container img {
  max-width: 800px;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
}
.enlarged-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.8);
  border: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.enlarged-nav:hover { background: #fff; }
.enlarged-nav-left { left: 20px; }
.enlarged-nav-right { right: 20px; }

/* =============================================
   ВКЛАДКИ ПРОФИЛЯ
   ============================================= */
.profile-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.profile-tab {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.profile-tab.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* =============================================
   СКРЫТИЕ ЭЛЕМЕНТОВ ДЛЯ ВНУТРЕННИХ СТРАНИЦ
   ============================================= */
body.inner-page #homeContent { display: none; }
body.inner-page #pageContent { display: block; }
body.inner-page #sidebarBusiness,
body.inner-page #sidebarSellerRating { display: none; }
body.inner-page .sidebar { align-content: start; }
body.inner-page #sidebarMessages { order: -1; }

/* =============================================
   ЛАЙТБОКС ДЛЯ ФОТО
   ============================================= */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox-content img {
  max-width: 450px;
  max-height: 450px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  background: #fff;
}
.lightbox-close {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  z-index: 2;
}
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(0,0,0,0.9); }
.lightbox-prev { left: -20px; }
.lightbox-next { right: -20px; }
.lightbox-actions { margin-top: 15px; }
.set-avatar-btn { padding: 8px 16px; font-size: 14px; }
.lightbox-counter { margin-top: 8px; color: #fff; font-size: 14px; }

/* =============================================
   DRAG-AND-DROP ДЛЯ ФОТО
   ============================================= */
.sortable-photo {
  cursor: grab;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.sortable-photo:active {
  cursor: grabbing;
}

.sortable-photo.drag-over {
  transform: scale(1.05);
  border-color: var(--blue) !important;
  box-shadow: 0 0 0 3px rgba(44, 21, 196, 0.2);
}

/* =============================================
   ГЕОЛОКАЦИЯ
   ============================================= */
.geo-permission-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.geo-permission-dialog {
  background: #fff;
  border-radius: 20px;
  padding: 30px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.geo-permission-dialog h3 {
  margin: 0 0 10px;
  font-size: 22px;
}
.geo-permission-dialog p {
  color: #666;
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 20px;
}
.geo-permission-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.geo-permission-buttons .btn {
  padding: 12px 24px;
  font-size: 15px;
}

/* =============================================
   МИГАНИЕ ДЛЯ ЗАБЛОКИРОВАННЫХ ОБЪЯВЛЕНИЙ И ПОЛЬЗОВАТЕЛЕЙ
   ============================================= */
@keyframes blink {
  0%, 100% { background: #ffebee; }
  50% { background: #ffcdd2; }
}

.blocked-row {
  animation: blink 1s infinite;
}

.banned-row {
  animation: blink 0.8s infinite;
}

/* =============================================
   АДАПТИВНОСТЬ (МОБИЛЬНЫЕ)
   ============================================= */
/* Планшеты и небольшие ноутбуки: 4 карточки */
@media (max-width: 1400px) {
  .grid-products {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .categories-row { grid-template-columns: repeat(5, 1fr); }
  .mega-menu { grid-template-columns: 280px 1fr 260px; }
  .preview-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Мобильные устройства: 2 карточки */
@media (max-width: 768px) {
  .grid-products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .product-main { grid-template-columns: 1fr; }
  .product-right {
    order: -1;
    position: static;
  }
  .product-title,
  .product-main-photo,
  .product-thumbnails,
  .product-city,
  .product-description {
    margin-left: 10px;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .photos-preview-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .create-page {
    padding: 0 10px 30px;
  }
}

@media (max-width: 1100px) {
  .topbar { grid-template-columns: 1fr; justify-items: stretch; }
  .topbar-center { width: 100%; flex-wrap: wrap; }
  .topbar-right { justify-content: flex-start; }
  .location-wrap { flex: 1; max-width: none; }
  .categories-row { grid-template-columns: repeat(3, 1fr); }
  .mega-menu { left: 12px; right: 12px; top: 100px; grid-template-columns: 1fr; }
  .mega-side { display: none; }
  .preview-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Очень узкие экраны: 1 карточка */
@media (max-width: 640px) {
  .grid-products {
    grid-template-columns: 1fr;
  }
  .app { padding: 10px; }
  .categories-row { grid-template-columns: repeat(2, 1fr); }
  .category-btn { display: none; }
  .preview-grid { grid-template-columns: repeat(2, 1fr); }
  .photos-preview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
/* =============================================
   СТАТИЧЕСКИЕ СТРАНИЦЫ
   ============================================= */
.page-content {
  max-width: 800px;
  margin: 0 auto;
}

.page-content p {
  margin-bottom: 16px;
  line-height: 1.7;
}

.page-content h1, .page-content h2, .page-content h3 {
  margin-top: 24px;
  margin-bottom: 12px;
}
