/* ==========================================================================
   ЭКСПЕРИМЕНТАЛЬНАЯ ГЛАВНАЯ (new.html)
   Смесь трёх вариантов: знакомая структура index.html, аккуратная
   типографика Srbija Sans, мягкие скругления и фиолетово-серые тона без чёрного.
   Правила ограничены body[data-theme="new"], остальные страницы не меняются.
   ========================================================================== */

@font-face {
  font-family: "Srbija Sans";
  src: url("../fonts/Srbija-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

body[data-theme="new"] {
  --text-main: #3A006B;
  --text-muted: #111111;
  --border-muted: #9B6BFF;
  --bg-panel: #FFFFFF;
  --bg-panel-alt: #FFFFFF;
  --bg-hover: #FFFFFF;

  font-family: "Srbija Sans", "Nunito", "Rubik", sans-serif;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--text-main);
  background-color: #FFFFFF;
  -webkit-font-smoothing: antialiased;
}

body[data-theme="new"] a {
  color: var(--brand);
  text-underline-offset: 2px;
}

body[data-theme="new"] a:hover {
  color: var(--brand-hover);
  background-color: transparent;
}

body[data-theme="new"] a:visited {
  color: var(--brand);
}

body[data-theme="new"] ::selection {
  color: #FFFFFF;
  background-color: var(--brand);
}

body[data-theme="new"] .new-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 0;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0;
  align-items: stretch;
  background-color: #FFFFFF;
}

body[data-theme="new"] .mono,
body[data-theme="new"] .sub-count,
body[data-theme="new"] .main-topbar,
body[data-theme="new"] .topbar-brand-link,
body[data-theme="new"] .topbar-city-link,
body[data-theme="new"] button,
body[data-theme="new"] .btn-link,
body[data-theme="new"] input[type="text"],
body[data-theme="new"] input[type="number"],
body[data-theme="new"] input[type="email"],
body[data-theme="new"] input[type="tel"],
body[data-theme="new"] select,
body[data-theme="new"] textarea {
  font-family: "Srbija Sans", "Nunito", "Rubik", sans-serif;
}

/* ------------------------------ SIDEBAR -------------------------------- */

body[data-theme="new"] .left-sidebar {
  width: auto;
  min-width: 0;
  padding: 12px;
  background-color: #FFFFFF;
  border: 0;
  border-right: 1px solid var(--border-muted);
  border-radius: 0;
}

body[data-theme="new"] .main-area {
  min-width: 0;
  padding: 12px;
  background-color: #FFFFFF;
}

body[data-theme="new"] .sidebar-logo {
  width: 100%;
  margin-bottom: 10px;
  padding: 2px 0 8px;
  border-bottom: 1px solid var(--border-muted);
}

body[data-theme="new"] .sidebar-logo img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  aspect-ratio: 467 / 143;
}

body[data-theme="new"] .sidebar-quick-nav {
  gap: 6px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-muted);
}

body[data-theme="new"] button,
body[data-theme="new"] .btn-link {
  border-radius: 10px;
  font-size: 13px;
}

body[data-theme="new"] .sidebar-quick-nav .btn-link {
  width: 100%;
  padding: 6px 12px;
  text-align: center;
}

body[data-theme="new"] .sidebar-quick-nav .btn-primary {
  background-color: var(--brand);
  border-color: var(--brand);
  color: #FFFFFF !important;
}

body[data-theme="new"] .sidebar-quick-nav .btn-primary:hover {
  background-color: var(--brand-hover);
  border-color: var(--brand-hover);
  color: #FFFFFF !important;
}

body[data-theme="new"] .sidebar-block {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom-color: var(--border-muted);
}

body[data-theme="new"] .sidebar-heading {
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 800;
  text-transform: none;
}

body[data-theme="new"] .sidebar-search-form input[type="text"] {
  width: 100%;
  margin-bottom: 6px;
  border-color: var(--border-muted);
  background-color: #FFFFFF;
  border-radius: 10px;
}

body[data-theme="new"] .sidebar-search-form button {
  width: 100%;
  border-radius: 10px;
  font-size: 13px;
}

body[data-theme="new"] .calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}

body[data-theme="new"] .calendar-nav .sidebar-heading {
  flex: 1;
  margin: 0;
  text-align: center;
}

body[data-theme="new"] .calendar-nav button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--border-muted);
  border-radius: 8px;
  background-color: #FFFFFF;
  color: var(--text-main);
  font-size: 16px;
  line-height: 1;
}

body[data-theme="new"] .calendar-nav button:hover {
  border-color: var(--brand);
  color: var(--brand);
}

body[data-theme="new"] .calendar-table {
  border: 2px solid var(--brand);
  border-radius: 10px;
  background-color: #FFFFFF;
  overflow: hidden;
  font-size: 12px;
}

body[data-theme="new"] .calendar-table th {
  border-bottom: 2px solid var(--brand);
  background-color: #FFFFFF;
  color: var(--text-main);
  font-size: 12px;
  text-transform: none;
}

body[data-theme="new"] .calendar-table td {
  border-color: var(--border-muted);
}

body[data-theme="new"] .calendar-table td.has-posts {
  position: relative;
  z-index: 1;
  background-color: var(--brand);
  color: #FFFFFF;
  font-weight: 800;
}

body[data-theme="new"] .calendar-table td.has-posts a,
body[data-theme="new"] .calendar-table td.has-posts a:visited {
  color: #FFFFFF !important;
}

body[data-theme="new"] .calendar-table td.today {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

body[data-theme="new"] .calendar-table td.is-selected {
  position: relative;
  z-index: 2;
  background-color: #FFFFFF;
  color: var(--brand);
  outline: 2px solid var(--brand);
  outline-offset: -2px;
  font-weight: 800;
}

body[data-theme="new"] .calendar-table td.is-selected a,
body[data-theme="new"] .calendar-table td.is-selected a:visited {
  color: var(--brand) !important;
}

body[data-theme="new"] .sidebar-links {
  font-size: 12.5px;
}

body[data-theme="new"] .notice-bar {
  border-color: var(--border-muted);
  border-radius: 10px;
  background-color: var(--bg-panel);
  color: var(--text-main);
}

/* -------------------------------- TOPBAR ------------------------------- */

body[data-theme="new"] .main-topbar {
  margin-bottom: 14px;
  padding: 7px 12px;
  background-color: var(--bg-panel);
  border: 1px solid var(--border-muted);
  border-radius: 10px;
  color: var(--text-main);
  font-size: 16px;
}

body[data-theme="new"] .topbar-brand-link,
body[data-theme="new"] .topbar-city-link {
  color: var(--text-main) !important;
  font-size: 17px;
  font-weight: 800;
}

body[data-theme="new"] .main-topbar select {
  border-color: var(--border-muted);
  border-radius: 10px;
  background-color: #FFFFFF;
  font-size: 13.5px;
}

body[data-theme="new"] .topbar-sep {
  color: var(--text-muted);
}

/* -------------------------------- INTRO -------------------------------- */

body[data-theme="new"] .new-intro {
  margin-top: 12px;
  margin-bottom: 0;
  justify-content: flex-end;
}

body[data-theme="new"] .new-intro .small {
  font-size: 12.5px;
}

body[data-theme="new"] .welcome-banner {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 12px;
  border: 1px solid var(--border-muted);
  border-radius: 12px;
  background-color: var(--bg-panel);
  overflow: hidden;
}

/* ------------------------------ CATEGORIES ----------------------------- */

body[data-theme="new"] .categories-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

body[data-theme="new"] .category-box {
  border: 1px solid var(--border-muted);
  border-radius: 12px;
  background-color: #FFFFFF;
  overflow: hidden;
}

body[data-theme="new"] .category-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background-color: var(--bg-panel);
  border-bottom: 1px solid var(--border-muted);
  font-size: 14.5px;
  font-weight: 800;
}

body[data-theme="new"] .category-box-header a {
  min-width: 0;
  color: var(--brand);
  text-decoration: none;
  overflow-wrap: anywhere;
}

body[data-theme="new"] .category-box-header a:hover {
  background-color: transparent;
  text-decoration: underline;
}

body[data-theme="new"] .category-total {
  flex-shrink: 0;
  min-width: 24px;
  padding: 1px 8px;
  border-radius: 999px;
  background-color: var(--bg-panel-alt);
  color: var(--brand);
  font-size: 11.5px;
  text-align: center;
}

body[data-theme="new"] .subcategory-list {
  padding: 6px 12px;
}

body[data-theme="new"] .subcategory-list li {
  align-items: center;
  padding: 3px 0;
  border-bottom-color: var(--border-muted);
  font-size: 13.5px;
}

body[data-theme="new"] .subcategory-list a {
  min-width: 0;
  overflow-wrap: anywhere;
}

body[data-theme="new"] .sub-count {
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: 999px;
  background-color: var(--bg-panel);
  color: var(--brand);
  font-size: 11.5px;
}

/* -------------------------------- FORMS --------------------------------- */

body[data-theme="new"] .price-inputs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

body[data-theme="new"] .no-photo-img {
  display: block;
  width: 100%;
  max-width: 600px;
  margin-bottom: 14px;
  border: 1px solid var(--border-muted);
  border-radius: 10px;
}

body[data-theme="new"] .auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body[data-theme="new"] .auth-form {
  padding: 12px;
  border: 1px solid var(--border-muted);
  border-radius: 12px;
  background-color: #FFFFFF;
}

/* ------------------------------- MY ADS --------------------------------- */

body[data-theme="new"] .table-wrap {
  border-radius: 10px;
}

body[data-theme="new"] .my-ads-table {
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border-muted);
  border-radius: 10px;
  overflow: hidden;
}

body[data-theme="new"] .my-ads-table th,
body[data-theme="new"] .my-ads-table td {
  border: 0;
  border-right: 1px solid var(--border-muted);
  border-bottom: 1px solid var(--border-muted);
}

body[data-theme="new"] .my-ads-table th:last-child,
body[data-theme="new"] .my-ads-table td:last-child {
  border-right: 0;
}

body[data-theme="new"] .my-ads-table tbody tr:last-child td {
  border-bottom: 0;
}

body[data-theme="new"] .my-ads-table thead tr:first-child th:first-child {
  border-top-left-radius: 10px;
}

body[data-theme="new"] .my-ads-table thead tr:first-child th:last-child {
  border-top-right-radius: 10px;
}

body[data-theme="new"] .my-ads-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 10px;
}

body[data-theme="new"] .my-ads-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 10px;
}

/* ------------------------------- STATES --------------------------------- */

body[data-theme="new"] .notice-bar.notice-error {
  background-color: #FDF2F4;
  border-color: #C91D38;
  color: #7F1024;
}

body[data-theme="new"] .status-active {
  color: var(--brand);
}

body[data-theme="new"] .filter-bar,
body[data-theme="new"] .price-tag,
body[data-theme="new"] .post-badge,
body[data-theme="new"] .photo-empty,
body[data-theme="new"] .notice-bar,
body[data-theme="new"] .thumb-box,
body[data-theme="new"] .gallery-card {
  background-color: #FFFFFF;
  border-color: var(--border-muted);
  color: var(--text-main);
}

body[data-theme="new"] .category-total,
body[data-theme="new"] .sub-count {
  background-color: #FFFFFF;
  border: 1px solid var(--border-muted);
}

/* -------------------------------- ADAPTIVE ----------------------------- */

@media (max-width: 860px) {
  body[data-theme="new"] .new-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    gap: 0;
  }

  body[data-theme="new"] .main-area {
    grid-column: 1;
    grid-row: 1;
  }

  body[data-theme="new"] .left-sidebar {
    width: auto;
  }

  body[data-theme="new"] .categories-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  body[data-theme="new"] .left-sidebar {
    padding: 12px;
    border-radius: 10px;
  }

  body[data-theme="new"] .main-topbar {
    font-size: 14px;
    border-radius: 10px;
  }

  body[data-theme="new"] .topbar-brand-link,
  body[data-theme="new"] .topbar-city-link {
    font-size: 15px;
  }

  body[data-theme="new"] .categories-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-theme="new"] .auth-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-theme="new"] .category-box {
    border-radius: 10px;
  }
}


/* -------------------------------- LOGO --------------------------------- */

body[data-theme="new"] .site-logo {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  margin: 0;
  padding: 12px;
  background-color: #FFFFFF;
}

body[data-theme="new"] .site-logo img {
  display: block;
  width: 180px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 467 / 143;
}

body[data-theme="new"] .left-sidebar {
  grid-column: 1;
  grid-row: 2;
}

body[data-theme="new"] .main-area {
  grid-column: 2;
  grid-row: 1 / span 2;
}

body[data-theme="new"] .mobile-bar {
  display: none;
}

@media (max-width: 860px) {
  body[data-theme="new"] .site-logo {
    display: none;
  }

  body[data-theme="new"] .mobile-bar {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-muted);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  body[data-theme="new"] .mobile-bar-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 8px 10px 10px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    align-items: stretch;
  }

  body[data-theme="new"] .mobile-bar-link {
    appearance: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 52px;
    padding: 6px 4px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    text-decoration: none;
    font: inherit;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
  }

  body[data-theme="new"] .mobile-bar-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  body[data-theme="new"] .mobile-bar-link span {
    white-space: nowrap;
  }

  body[data-theme="new"] .mobile-bar-link.is-active {
    color: var(--brand);
    border-color: var(--brand);
    background: #fff;
  }

  body[data-theme="new"] .mobile-bar-link--primary {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
  }

  body[data-theme="new"] .mobile-bar-link--primary svg,
  body[data-theme="new"] .mobile-bar-link--primary span {
    color: #fff;
  }

  body[data-theme="new"] .mobile-bar-menu {
    color: var(--brand);
  }

  body[data-theme="new"] .mobile-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(111, 0, 255, 0.18);
    z-index: 55;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
  }

  body[data-theme="new"] .mobile-sheet-backdrop.is-open {
    opacity: 1;
    visibility: visible;
  }

  body[data-theme="new"] .left-sidebar {
    display: block !important;
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-height: min(72vh, 560px);
    overflow: auto;
    z-index: 60;
    border: 1px solid var(--border-muted);
    border-radius: 12px;
    background: var(--bg-panel);
    visibility: hidden;
    transform: translateY(calc(100% + 24px));
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.34s ease;
    pointer-events: none;
  }

  body[data-theme="new"] .left-sidebar.is-mobile-open {
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  body[data-theme="new"] .left-sidebar .sidebar-quick-nav {
    display: none;
  }

  body[data-theme="new"] .new-layout {
    margin-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  body[data-theme="new"] .main-area {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  body[data-theme="new"].mobile-sheet-open {
    overflow: hidden;
  }
}

@media (max-width: 420px) {
  body[data-theme="new"] .mobile-bar-inner {
    gap: 4px;
    padding: 8px 6px 10px;
  }

  body[data-theme="new"] .mobile-bar-link {
    font-size: 10px;
    min-height: 48px;
  }

  body[data-theme="new"] .left-sidebar {
    left: 6px;
    right: 6px;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 861px) {
  body[data-theme="new"] .site-logo img {
    width: 230px;
  }
}
