:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f0f4f8;
  --border: rgba(15, 23, 42, 0.10);
  --text: #0f172a;
  --muted: #64748b;
  --accent: #3ba4c7;
  --accent-2: #5fc9e8;
  --shadow: 0 10px 24px rgba(2, 6, 23, 0.08);
  --shadow-soft: 0 6px 14px rgba(2, 6, 23, 0.06);
  --radius: 16px;
  --radius-sm: 12px;
  --container: 1040px;
  --gap: 16px;
  --header-h: 64px;
}

/* Темная тема закомментирована
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --surface: #0f1a2b;
  --surface-2: #121f33;
  --text: #e6eefc;
  --muted: #9bb0cc;
  --border: rgba(230, 238, 252, 0.12);
  --accent: #46b8d8;
  --accent-2: #2da9cc;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}
*/

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Темная тема закомментирована
:root[data-theme="dark"] .header {
  background: #0f172a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
*/

.header__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: auto;
}

.brand__logo {
  width: 120px;
  height: auto;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Логотип отображается всегда */
.brand__logo {
  display: block;
  opacity: 1;
}

/* Эффект при наведении */
.brand:hover .brand__logo {
  transform: scale(1.05);
}

.brand__name {
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 18px;
  color: #0f172a;
}

.brand__sub {
  font-size: 13px;
  font-weight: 500;
  color: rgba(15, 23, 42, 0.72);
  margin-top: 2px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav a {
  font-weight: 600;
  color: rgba(15, 23, 42, 0.9);
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 0.2s;
}

/* Темная тема закомментирована
:root[data-theme="dark"] .nav a {
  color: rgba(230, 238, 252, 0.95);
}
*/

.nav a:hover,
.nav a.active {
  background: rgba(95, 201, 232, 0.2);
  color: #0f172a;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  min-width: 240px;
  flex-wrap: nowrap;
}

.header__actions > * {
  flex-shrink: 0;
}

#profileBtn {
  flex-shrink: 0;
  display: inline-flex;
}

.btn {
  border: 1px solid rgba(15, 23, 42, 0.2);
  background: rgba(15, 23, 42, 0.05);
  color: rgba(15, 23, 42, 0.9);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05) inset;
  transition: all 0.2s;
  font-size: 14px;
}

/* Темная тема закомментирована
:root[data-theme="dark"] .btn {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(230, 238, 252, 0.9);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2) inset;
}
*/

.btn:hover {
  background: rgba(15, 23, 42, 0.1);
  box-shadow: var(--shadow-soft);
}

/* Темная тема закомментирована
:root[data-theme="dark"] .btn:hover {
  background: rgba(255, 255, 255, 0.1);
}
*/

.btn--primary {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #2da9cc, #1c6f86);
  box-shadow: 0 10px 18px rgba(28, 111, 134, 0.25);
}

.btn--ghost {
  background: transparent;
  border: 1px solid rgba(28, 111, 134, 0.3);
  color: #1c6f86;
}

/* Темная тема закомментирована
:root[data-theme="dark"] .btn--ghost {
  color: #2da9cc;
  border-color: rgba(45, 169, 204, 0.3);
}
*/

.btn--icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 14px;
}

.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  background: rgba(15, 23, 42, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s;
  color: rgba(15, 23, 42, 0.9);
}

.theme-toggle:hover {
  background: rgba(15, 23, 42, 0.1);
  box-shadow: var(--shadow-soft);
}

/* Темная тема закомментирована
:root[data-theme="dark"] .theme-toggle {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(230, 238, 252, 0.9);
}

:root[data-theme="dark"] .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}
*/

/* Main */
main {
  padding: 20px 0 88px;
  min-height: calc(100vh - 200px); /* Минимальная высота для footer */
}

.page-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 12px;
}

.page-title h1 {
  font-size: 28px;
  margin: 0;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.page-title .count {
  color: var(--muted);
  font-weight: 600;
  margin-left: 8px;
  font-size: 16px;
}

/* Search block */
.search-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 14px;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.input {
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  transition: all 0.2s;
}

:root[data-theme="dark"] .input {
  background: var(--surface-2);
}

.input:focus {
  border-color: rgba(28, 111, 134, 0.5);
  box-shadow: 0 0 0 4px rgba(28, 111, 134, 0.15);
}

.select {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr;
}

/* Category chips */
.chips {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(28, 111, 134, 0.3) transparent;
  cursor: grab;
}

.chips:active {
  cursor: grabbing;
}

.chips::-webkit-scrollbar {
  height: 6px;
}

.chips::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

.chips::-webkit-scrollbar-thumb {
  background: rgba(28, 111, 134, 0.3);
  border-radius: 3px;
  transition: background 0.2s;
}

.chips::-webkit-scrollbar-thumb:hover {
  background: rgba(28, 111, 134, 0.5);
}

.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff, #f4f8fb);
  box-shadow: 0 6px 14px rgba(2, 6, 23, 0.05);
  font-weight: 600;
  color: #24324a;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
  white-space: nowrap;
}

:root[data-theme="dark"] .chip {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  color: var(--text);
}

.chip:hover {
  border-color: rgba(28, 111, 134, 0.40);
  box-shadow: 0 10px 18px rgba(2, 6, 23, 0.07);
  transform: translateY(-1px);
}

.chip__icon {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: rgba(28, 111, 134, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1c6f86;
  font-size: 12px;
  flex-shrink: 0;
}

.chip__icon i {
  font-size: 14px;
  color: #1c6f86;
}

:root[data-theme="dark"] .chip__icon {
  background: rgba(28, 111, 134, 0.2);
  color: #1c6f86;
}

:root[data-theme="dark"] .chip__icon i {
  color: #1c6f86;
}

/* View toggle */
.view-toggle {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  margin: 0;
  align-self: center;
}

.view-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: all 0.2s;
}

.view-btn.active {
  background: linear-gradient(135deg, #1c6f86, #2da9cc);
  color: #fff;
  border-color: transparent;
}

.icon {
  width: 18px;
  height: 18px;
  position: relative;
  display: inline-block;
}

.icon-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 7px 7px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 0 / 7px 7px no-repeat,
    linear-gradient(currentColor, currentColor) 0 100% / 7px 7px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 100% / 7px 7px no-repeat;
  border-radius: 2px;
}

.icon-list::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 2px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  box-shadow:
    0 6px 0 currentColor,
    0 12px 0 currentColor;
}

/* Cards grid */
.grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.grid.list-view {
  grid-template-columns: 1fr !important;
}

.grid.list-view .card {
  display: flex;
  gap: 14px;
  align-items: stretch;
}

.grid.list-view .card__media {
  width: 160px;
  flex: 0 0 160px;
  aspect-ratio: 4/3;
}

@media (max-width: 720px) {
  /* Grid view: 2 карточки на строке */
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  
  /* List view: 1 карточка на строке */
  .grid.list-view {
    grid-template-columns: 1fr !important;
  }
  
  /* Стили для карточек в grid view на мобильных */
  .grid:not(.list-view) .card {
    min-height: auto;
    display: flex;
    flex-direction: column;
  }
  
  .grid:not(.list-view) .card__media,
  .grid:not(.list-view) .card_media {
    min-height: 140px !important;
    max-height: 140px !important;
    height: 140px !important;
  }
  
  .grid:not(.list-view) .card__body {
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  
  .grid:not(.list-view) .card__title {
    font-size: 13px;
    line-height: 1.3;
    margin-bottom: 6px;
    min-height: 2.6em;
    max-height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  
  .grid:not(.list-view) .price {
    font-size: 15px;
    margin-bottom: 6px;
    font-weight: 600;
  }
  
  .grid:not(.list-view) .meta {
    font-size: 10px;
    margin-top: auto;
    padding-top: 6px;
  }
  
  /* Стили для list view на мобильных */
  .grid.list-view .card {
    padding: 12px;
    gap: 12px;
  }
  
  .grid.list-view .card__media {
    width: 120px;
    flex: 0 0 120px;
    min-width: 120px;
    aspect-ratio: 4/3;
    border-radius: var(--radius-sm);
    overflow: hidden;
  }
  
  .grid.list-view .card__body {
    min-height: 120px;
    padding: 0;
  }
  
  .grid.list-view .card__title {
    font-size: 14px;
    line-height: 1.3;
    margin-bottom: 6px;
    min-height: 2.4em;
    max-height: 2.4em;
  }
  
  .grid.list-view .price {
    font-size: 16px;
    margin-bottom: 8px;
  }
  
  .grid.list-view .meta {
    font-size: 11px;
    padding-top: 6px;
  }
}

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

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(2, 6, 23, 0.10);
}

.card__media,
.card_media {
  width: 100% !important;
  min-height: 200px !important;
  max-height: 200px !important;
  height: 200px !important;
  background: #eaf1f7 !important;
  overflow: hidden !important;
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

@media (min-width: 768px) {
  .card__media,
  .card_media {
    min-height: 230px !important;
    max-height: 230px !important;
    height: 230px !important;
  }
}

@media (min-width: 1100px) {
  .card__media,
  .card_media {
    min-height: 260px !important;
    max-height: 260px !important;
    height: 260px !important;
  }
}

:root[data-theme="dark"] .card__media {
  background: var(--surface-2);
}

.card__media img,
.card__media picture,
.card__media picture img,
.card_media img,
.card_media picture,
.card_media picture img {
  width: 100% !important;
  height: auto !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  display: block !important;
  transform: scale(1.001);
  transition: transform .35s ease;
  flex-shrink: 0 !important;
}

.card__media picture,
.card_media picture {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}

.card:hover .card__media img {
  transform: scale(1.04);
}

.card__media--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 600;
  background: linear-gradient(135deg, #f2f4f7, #e6e9ef);
}

:root[data-theme="dark"] .card__media--empty {
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
}

.card__media--empty .hint {
  text-align: center;
  padding: 10px 18px;
  font-weight: 600;
  line-height: 1.2;
}

.card__media--empty .hint small {
  display: block;
  margin-top: 6px;
  font-weight: 500;
  color: #7b8798;
}

:root[data-theme="dark"] .card__media--empty .hint small {
  color: var(--muted);
}

.card__body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  min-height: 160px;
  height: 100%;
}

.card__title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.6em;
  max-height: 2.6em;
}

.price {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: #1c6f86;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}

:root[data-theme="dark"] .price {
  color: #1c6f86;
}

.meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  margin-top: auto;
  padding-top: 8px;
  flex-shrink: 0;
}

.meta .meta-item {
  display: flex;
  align-items: center;
  line-height: 1.4;
}

/* Sticky CTA */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 14px;
  z-index: 60;
  pointer-events: none;
}

.sticky-cta .container {
  pointer-events: auto;
  display: flex;
  justify-content: center;
}

.cta-btn {
  width: min(560px, 100%);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #2da9cc, #1c6f86);
  box-shadow: 0 16px 30px rgba(28, 111, 134, 0.28);
  cursor: pointer;
}

@media (max-width: 720px) {
  .cta-btn {
    width: min(353px, 63%);
    padding: 12px 14px;
    font-size: 14px;
  }
}
  transition: transform 0.1s;
}

.cta-btn:active {
  transform: scale(0.99);
}

/* Footer */
footer {
  background: #0b1220;
  color: rgba(255, 255, 255, 0.86);
  margin-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] footer {
  background: #050810;
}

.footer-top {
  padding: 28px 0 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: center;
  justify-content: space-between;
}

.footer-links nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 10px;
  transition: background 0.2s;
}

.footer-links a:hover {
  background: rgba(95, 201, 232, 0.12);
}

.footer-bottom {
  padding: 14px 0 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mini-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mini-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.mini-logo .mark {
  width: 52px;
  height: 52px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

.mini-logo > div {
  padding-left: 60px;
  position: relative;
}

/* Логотип в футере отображается всегда */
.mini-logo .mark {
  display: block;
  opacity: 1;
}

.years {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 600;
  font-size: 13px;
}

/* Dropdown */
.dropdown {
  position: relative;
}

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(2, 6, 23, 0.14);
  overflow: hidden;
  display: none;
}

.menu.open {
  display: block;
}

.menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px;
  font-weight: 600;
  color: #22314a;
  transition: background 0.2s;
}

:root[data-theme="dark"] .menu a {
  color: var(--text);
}

.menu a:hover {
  background: rgba(59, 164, 199, 0.08);
}

.menu .sep {
  height: 1px;
  background: var(--border);
}

/* Listing detail page */
.listing-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 20px;
}

.listing-detail__header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.listing-detail__title {
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.listing-detail__price {
  font-size: 28px;
  font-weight: 700;
  color: #1c6f86;
  margin: 12px 0;
}

:root[data-theme="dark"] .listing-detail__price {
  color: #1c6f86;
}

.listing-detail__gallery {
  position: relative;
  margin-bottom: 20px;
}

.listing-detail__gallery-main {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--surface-2);
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.listing-detail__gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s;
  z-index: 10;
}

:root[data-theme="dark"] .gallery-nav {
  background: rgba(15, 26, 43, 0.9);
  color: var(--text);
}

.gallery-nav:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

:root[data-theme="dark"] .gallery-nav:hover {
  background: rgba(15, 26, 43, 1);
}

.gallery-nav--prev {
  left: 16px;
}

.gallery-nav--next {
  right: 16px;
}

.listing-detail__gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0;
  scrollbar-width: thin;
}

.listing-detail__gallery-thumbs::-webkit-scrollbar {
  height: 6px;
}

.listing-detail__gallery-thumbs::-webkit-scrollbar-track {
  background: var(--surface-2);
  border-radius: 3px;
}

.listing-detail__gallery-thumbs::-webkit-scrollbar-thumb {
  background: var(--muted);
  border-radius: 3px;
}

.gallery-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: all 0.2s;
  flex-shrink: 0;
}

.gallery-thumb:hover {
  opacity: 1;
  border-color: var(--accent);
}

.gallery-thumb.active {
  opacity: 1;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-2);
}

.listing-detail__body {
  padding: 20px;
}

.listing-detail__meta {
  display: grid;
  gap: 6px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.listing-detail__meta .meta-item {
  display: flex;
  align-items: center;
  line-height: 1.5;
}

.listing-detail__description {
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 20px;
  white-space: pre-wrap;
}

.listing-detail__contact {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 20px;
}

/* Contacts page */
.contacts-page {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.contacts-page__title {
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 24px;
  letter-spacing: -0.02em;
}

.contact-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 16px;
}

.contact-card__title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.contact-card__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(28, 111, 134, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1c6f86;
}

.contact-info {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.contact-info a {
  color: var(--accent);
  font-weight: 600;
}

/* About page */
.about-page {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.about-page__title {
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 24px;
  letter-spacing: -0.02em;
}

.about-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.about-section:last-child {
  border-bottom: none;
}

.about-section__title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px;
}

.about-section ol,
.about-section ul {
  margin: 0;
  padding-left: 20px;
}

.about-section li {
  margin-bottom: 8px;
  line-height: 1.6;
}

/* Modal windows for dark theme */
:root[data-theme="dark"] .modal-content {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

:root[data-theme="dark"] .modal-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.modal-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  padding: 1rem !important;
  border-top: 1px solid var(--border) !important;
  background: var(--surface) !important;
  min-height: 60px !important;
}

:root[data-theme="dark"] .modal-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.modal-footer .btn {
  min-width: 120px !important;
  padding: 10px 20px !important;
  font-weight: 600 !important;
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: inherit !important;
}

.modal-footer .btn-newspaper {
  background: linear-gradient(135deg, #87CEEB 0%, #B0E0E6 100%) !important;
  border: none !important;
  color: #2c3e50 !important;
  padding: 10px 20px !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  cursor: pointer !important;
}

.modal-footer .btn-newspaper.btn-outline {
  background: transparent !important;
  color: #2c3e50 !important;
  border: 2px solid #87CEEB !important;
}

.modal-footer .btn-newspaper:hover {
  background: linear-gradient(135deg, #5DADE2 0%, #85C1E2 100%) !important;
  color: #1a252f !important;
}

.modal-footer .btn-newspaper.btn-outline:hover {
  background: #87CEEB !important;
  color: #2c3e50 !important;
}

.modal-footer .btn-link {
  color: #1c6f86 !important;
  text-decoration: none !important;
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.modal-footer .d-flex {
  display: flex !important;
  width: 100% !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.modal-footer .d-flex > div {
  display: flex !important;
  gap: 10px !important;
  align-items: center !important;
}

:root[data-theme="dark"] .modal-title {
  color: var(--text);
}

:root[data-theme="dark"] .form-control {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

:root[data-theme="dark"] .form-control:focus {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--accent);
}

:root[data-theme="dark"] .form-label {
  color: var(--text);
}

:root[data-theme="dark"] .btn-close {
  filter: invert(1);
}

/* Footer fix for pages with little content */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* List view improvements */
.grid.list-view .card {
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: flex-start;
  padding: 16px;
}

.grid.list-view .card__media {
  width: 200px;
  flex: 0 0 200px;
  aspect-ratio: 4/3;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.grid.list-view .card__body {
  flex: 1;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
  height: 100%;
}

.grid.list-view .card__title {
  margin-bottom: 8px;
  min-height: 2.6em;
  max-height: 2.6em;
}

.grid.list-view .price {
  margin: 0 0 12px;
  flex-shrink: 0;
}

.grid.list-view .meta {
  margin-top: auto;
  padding-top: 8px;
  flex-shrink: 0;
}


/* Password toggle button - modern design */
.password-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.password-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 8px;
  z-index: 10;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.password-toggle-btn:hover {
  background: rgba(28, 111, 134, 0.1);
  color: #1c6f86;
}

.password-toggle-btn:focus {
  outline: none;
  background: rgba(28, 111, 134, 0.15);
  color: #1c6f86;
  box-shadow: 0 0 0 3px rgba(28, 111, 134, 0.1);
}

.password-toggle-btn i {
  font-size: 18px;
  transition: all 0.2s ease;
  display: block;
}

.password-toggle-btn:hover i {
  transform: scale(1.15);
  color: #1c6f86;
}

.password-toggle-btn:active i {
  transform: scale(0.95);
}

.password-input-group .form-control {
  padding-right: 50px;
}

.password-input-group .form-control.is-invalid + .password-validation-indicator {
  right: 50px;
}

.password-input-group .form-control.is-invalid + .password-validation-indicator + .password-toggle-btn {
  right: 80px;
}

.password-input-group .form-control.is-invalid {
  padding-right: 120px;
}

/* ПРИНУДИТЕЛЬНОЕ отображение ошибки пароля */
.mb-3 #passwordError {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: #dc3545 !important;
  font-size: 0.875rem !important;
  margin-top: 0.25rem !important;
  position: relative !important;
  width: 100% !important;
  min-height: 20px !important;
  line-height: 1.4 !important;
}

.mb-3 #passwordError[style*="display: block"],
.mb-3 #passwordError[style*="display:block"] {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.password-validation-indicator {
  pointer-events: none;
  transition: opacity 0.2s ease;
}

:root[data-theme="dark"] .password-toggle-btn {
  color: var(--muted);
}

:root[data-theme="dark"] .password-toggle-btn:hover {
  background: rgba(28, 111, 134, 0.15);
  color: #1c6f86;
}

/* Utilities */
.hide {
  display: none !important;
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
}

.mobile-menu-icon {
  font-size: 20px;
  line-height: 1;
}

.mobile-menu {
  position: absolute;
  right: 16px;
  top: calc(100% + 8px);
  width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(2, 6, 23, 0.14);
  overflow: hidden;
  z-index: 100;
  display: none;
}

.mobile-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-weight: 600;
  color: #22314a;
  transition: background 0.2s;
  text-decoration: none;
}

.mobile-menu a:hover {
  background: rgba(95, 201, 232, 0.15);
}

.mobile-menu .sep {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.mobile-menu a span {
  color: var(--muted);
  font-size: 14px;
}

/* Mobile navigation */
.nav-mobile {
  display: none;
}

/* Mobile header layout */
@media (max-width: 880px) {
  .nav {
    display: none;
  }
  
  .nav-mobile {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
  }
  
  .nav-mobile .nav-link {
    font-size: 12px;
    padding: 6px 8px;
    font-weight: 600;
    color: rgba(15, 23, 42, 0.9);
    white-space: nowrap;
  }
  
  .nav-mobile .nav-link:hover,
  .nav-mobile .nav-link.active {
    background: rgba(95, 201, 232, 0.2);
    color: #0f172a;
  }
  
  .brand {
    min-width: auto;
  }
  
  .brand__logo {
    width: 80px;
    height: auto;
  }
  
  .header__actions {
    min-width: auto;
    gap: 6px;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    display: flex;
    align-items: center;
  }
  
  .header__actions > * {
    flex-shrink: 0;
  }
  
  .header__actions .btn {
    font-size: 12px;
    padding: 8px 10px;
    white-space: nowrap;
  }
  
  /* Гостевые кнопки "Вход/Регистрация" всегда в одну строку */
  #guestActions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    white-space: nowrap;
  }
  
  .header__inner {
    position: relative;
    gap: 8px;
    flex-wrap: nowrap;
  }
  
  .mobile-menu-btn {
    display: none;
  }
  
  .mobile-menu {
    display: none;
  }
}

/* Extra-small phones (часто Android 360–412px): ужимаем, но сохраняем 1 строку как на iOS */
@media (max-width: 420px) {
  .brand__logo {
    width: 72px;
  }

  .nav-mobile {
    gap: 6px;
  }

  .nav-mobile .nav-link {
    font-size: 11px;
    padding: 5px 6px;
  }

  .header__actions {
    gap: 6px;
  }

  .header__actions .btn {
    font-size: 11px;
    padding: 7px 8px;
    border-radius: 11px;
  }
}


.btn--sm {
  font-size: 12px;
  padding: 6px 12px;
}

/* ===== Загрузка изображений (создание объявления) ===== */
.image-upload-container {
  border: 2px dashed var(--border, rgba(15,23,42,.1));
  border-radius: var(--radius-sm, 12px);
  padding: 16px;
  background: var(--surface-2, #f0f4f8);
}

.image-upload-area {
  text-align: center;
  padding: 24px 16px;
  border: 2px dashed var(--accent, #3ba4c7);
  border-radius: var(--radius-sm, 12px);
  background: var(--surface, #fff);
  cursor: pointer;
  transition: border-color .2s, background .2s;
}

.image-upload-area:hover {
  border-color: var(--accent-2, #5fc9e8);
  background: var(--surface-2, #f0f4f8);
}

.image-upload-area.dragover {
  border-color: #28a745;
  background: #d4edda;
}

.image-preview-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.image-preview-item {
  position: relative;
  border: 2px solid var(--border, rgba(15,23,42,.1));
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--surface-2, #f0f4f8);
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-item .image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(220, 53, 69, 0.9);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.image-preview-item .image-main-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(40, 167, 69, 0.9);
  color: #fff;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
}

.image-preview-item .image-order {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
}

/* Мобильная адаптация загрузки фото */
@media (max-width: 576px) {
  .image-upload-area {
    padding: 16px 12px;
  }

  .image-upload-area i.fa-2x {
    font-size: 1.4rem !important;
  }

  .image-upload-area p {
    font-size: 13px;
    margin-bottom: 0 !important;
  }

  .image-upload-container {
    padding: 10px;
  }

  .image-preview-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .image-preview-item {
    border-width: 1px;
    border-radius: 6px;
  }

  .image-preview-item .image-remove {
    width: 20px;
    height: 20px;
    font-size: 10px;
    top: 3px;
    right: 3px;
  }

  .image-preview-item .image-main-badge {
    font-size: 8px;
    padding: 1px 4px;
    top: 3px;
    left: 3px;
  }

  .image-preview-item .image-order {
    font-size: 8px;
    padding: 1px 4px;
    bottom: 3px;
    left: 3px;
  }
}

/* Toast уведомления */

