/* ============================================================
   MEGAPOLIS — redesign-2026 (reversible override layer)
   Loaded LAST. Remove the <link> in config/assets.php to revert.
   Design: impeccable (product register) + emil (motion) + taste (anti-slop)
   ============================================================ */

:root {
  /* Neutrals — cool, refined, high-contrast */
  --mp-ink:        #16181d;   /* headings */
  --mp-body:       #33363d;   /* body ~10:1 */
  --mp-muted:      #6b7078;   /* meta text ~4.6:1 on white */
  --mp-line:       #ecedf0;   /* hairline */
  --mp-line-2:     #dfe1e6;
  --mp-bg:         #ffffff;
  --mp-surface:    #f6f7f9;   /* subtle surface */
  --mp-surface-2:  #eff1f4;

  /* Brand — MEGAPOLIS green */
  --mp-brand:      #00c853;   /* vivid fills (paired with dark ink) */
  --mp-brand-600:  #00b84a;   /* hover */
  --mp-brand-700:  #0a7d3a;   /* green text/links on white ~4.6:1 */
  --mp-brand-tint: #e7f8ee;   /* light wash */
  --mp-on-brand:   #06280f;   /* ink text on brand fills ~8:1 */

  /* Elevation — soft, layered */
  --mp-shadow-sm:  0 1px 2px rgba(16,24,40,.05);
  --mp-shadow:     0 2px 4px rgba(16,24,40,.04), 0 10px 24px rgba(16,24,40,.07);
  --mp-shadow-brand: 0 8px 22px rgba(0,176,80,.30);

  /* Radius */
  --mp-r-sm: 10px;
  --mp-r:    12px;
  --mp-r-lg: 16px;

  /* Motion — ease-out quint (emil/impeccable) */
  --mp-ease: cubic-bezier(.22, 1, .36, 1);
  --mp-dur:  170ms;

  /* Legacy token remap (existing CSS reads these) */
  --avito-primary:      #0a7d3a;
  --avito-success:      #00c853;
  --avito-text-primary: #16181d;
  --avito-border:       #ecedf0;
  --avito-bg-gray:      #f6f7f9;
}

/* ---------- Typography: one family, many weights (CONTENT ONLY, header untouched) ---------- */
body,
.home-widget-sections, .home-widget-sections input, .home-widget-sections button,
.container-item-grid, .home-categories {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.home-widget-sections { color: var(--mp-body); }
/* NOTE: do NOT force font-family on .header-wow * — it breaks the tabler icon
   font (ti-search / ti-category show as tofu boxes). Header keeps its own fonts. */

/* Bigger logo (user request) */
.h-logo svg { height: 50px !important; width: auto !important; }
h1, h2, h3, .bold-title-and-link, .widget-title {
  color: var(--mp-ink) !important;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h1, h2 { font-weight: 800 !important; }
h3, .bold-title-and-link { font-weight: 700 !important; }

/* ---------- Header / search / header-buttons: kept as original theme.
   Only fix: force "Каталог" back to the light-gray look (user prefers photo 1) ---------- */
.header-button-menu-catalog.button-color-scheme1,
.header-button-menu-catalog {
  background: #2563eb !important;
  color: #ffffff !important;
  border: 0 !important;
  box-shadow: none !important;
  transition: background .18s ease !important;
}
.header-button-menu-catalog i { color: #ffffff !important; }
.header-button-menu-catalog:hover,
.header-button-menu-catalog.button-color-scheme1:hover { background: #1d4ed8 !important; }

/* ---------- Category tiles ---------- */
.home-categories { gap: 16px !important; }
.home-categories a.home-widget-categories-item {
  background: var(--mp-surface) !important;
  border: 1px solid transparent !important;
  border-radius: var(--mp-r-lg) !important;
  transition: transform var(--mp-dur) var(--mp-ease),
              box-shadow var(--mp-dur) var(--mp-ease),
              background var(--mp-dur) var(--mp-ease),
              border-color var(--mp-dur) var(--mp-ease) !important;
}
.home-categories a.home-widget-categories-item:hover {
  background: var(--mp-bg) !important;
  border-color: var(--mp-line) !important;
  box-shadow: var(--mp-shadow) !important;
  transform: translateY(-3px);
}
.home-categories a.home-widget-categories-item div {
  color: var(--mp-ink) !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em;
}
.home-categories a.home-widget-categories-item img {
  transition: transform var(--mp-dur) var(--mp-ease) !important;
}
.home-categories a.home-widget-categories-item:hover img { transform: scale(1.06); }

/* ---------- Listing cards ----------
   NOTE: no transform/scale on card or img — the theme has a native hover
   image-carousel (avito-ux) that uses absolutely-positioned thumbnails;
   any transform on the card creates a containing block and throws the
   preview into the corner. Keep it to border + soft shadow only. */
.container-item-grid {
  border: 1px solid var(--mp-line) !important;
  border-radius: var(--mp-r-lg) !important;
  background: var(--mp-bg) !important;
  transition: box-shadow var(--mp-dur) var(--mp-ease),
              border-color var(--mp-dur) var(--mp-ease) !important;
}
.container-item-grid:hover {
  box-shadow: var(--mp-shadow) !important;
  border-color: var(--mp-line) !important;
}

.container-item-grid-content { padding: 12px !important; gap: 6px !important; }
.container-item-grid-content-prices,
.container-item-grid-content-price {
  color: var(--mp-ink) !important;
  font-weight: 800 !important;
  font-size: 17px !important;
  letter-spacing: -0.02em;
}
.container-item-grid-content-title {
  color: var(--mp-body) !important;
  font-weight: 500 !important;
}
.container-item-grid-content-additionally,
.container-item-grid-content-user { color: var(--mp-muted) !important; font-size: 12.5px !important; }

/* ---------- Links & accents ---------- */
a.link, .bold-title-and-link a, .text-link { color: var(--mp-brand-700) !important; }
.badge-vip, .label-vip { background: var(--mp-brand) !important; color: var(--mp-on-brand) !important; }

/* ---------- Focus visibility (a11y) ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--mp-brand) !important;
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Section rhythm ---------- */
.home-widget-sections > section { margin-bottom: 40px; }
.bold-title-and-link { margin-bottom: 16px !important; }

/* ============================================================
   HERO (redesign-2026) — functional marketplace hero
   ============================================================ */
.mp-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 50% -20%, var(--mp-brand-tint) 0%, rgba(231,248,238,0) 55%),
    linear-gradient(180deg, #ffffff 0%, var(--mp-surface) 100%);
  border-bottom: 1px solid var(--mp-line);
  padding: clamp(40px, 7vw, 84px) 0 clamp(32px, 5vw, 56px);
}
.mp-hero__glow {
  position: absolute; inset: -40% 0 auto 0; height: 420px;
  background: radial-gradient(50% 60% at 50% 0%, rgba(0,200,83,.16) 0%, rgba(0,200,83,0) 70%);
  pointer-events: none;
}
.mp-hero__inner {
  position: relative; max-width: 780px; margin: 0 auto; text-align: center;
}
.mp-hero__title {
  font-family: 'Manrope', sans-serif !important;
  font-weight: 800 !important;
  font-size: clamp(2rem, 1.2rem + 3.4vw, 3.4rem) !important;
  line-height: 1.06 !important;
  letter-spacing: -0.035em;
  color: var(--mp-ink) !important;
  margin: 0 0 14px;
  text-wrap: balance;
  animation: mpFadeUp .6s var(--mp-ease) both;
}
.mp-hero__sub {
  font-size: clamp(1rem, .95rem + .3vw, 1.15rem) !important;
  line-height: 1.55; color: var(--mp-muted) !important;
  max-width: 58ch; margin: 0 auto 28px; text-wrap: pretty;
  animation: mpFadeUp .6s var(--mp-ease) .06s both;
}
.mp-hero__search {
  display: flex; align-items: center; gap: 8px;
  background: var(--mp-bg);
  border: 1.5px solid var(--mp-line-2);
  border-radius: 999px;
  padding: 7px 7px 7px 18px;
  max-width: 660px; margin: 0 auto;
  box-shadow: var(--mp-shadow);
  transition: border-color var(--mp-dur) var(--mp-ease), box-shadow var(--mp-dur) var(--mp-ease);
  animation: mpFadeUp .6s var(--mp-ease) .12s both;
}
.mp-hero__search:focus-within {
  border-color: var(--mp-brand);
  box-shadow: 0 0 0 4px var(--mp-brand-tint), var(--mp-shadow);
}
.mp-hero__search-icon { display: flex; color: var(--mp-muted); flex: none; }
.mp-hero__search input {
  flex: 1; min-width: 0; border: 0 !important; outline: 0 !important; background: transparent !important;
  font-size: 16px !important; color: var(--mp-ink) !important; height: 46px;
  font-family: 'Manrope', sans-serif !important;
}
.mp-hero__search input::placeholder { color: var(--mp-muted) !important; }
.mp-hero__search button {
  flex: none; border: 0; cursor: pointer;
  background: var(--mp-brand); color: var(--mp-on-brand);
  font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 15px;
  padding: 0 26px; height: 46px; border-radius: 999px;
  box-shadow: var(--mp-shadow-brand);
  transition: background var(--mp-dur) var(--mp-ease), transform var(--mp-dur) var(--mp-ease);
}
.mp-hero__search button:hover { background: var(--mp-brand-600); }
.mp-hero__search button:active { transform: scale(.96); }
.mp-hero__chips {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px; margin-top: 20px;
  animation: mpFadeUp .6s var(--mp-ease) .18s both;
}
.mp-hero__chips-label { color: var(--mp-muted); font-size: 14px; font-weight: 600; margin-right: 2px; }
.mp-hero__chips a {
  text-decoration: none;
  background: var(--mp-bg); border: 1px solid var(--mp-line-2);
  color: var(--mp-body); font-size: 14px; font-weight: 600;
  padding: 8px 15px; border-radius: 999px;
  transition: background var(--mp-dur) var(--mp-ease), border-color var(--mp-dur) var(--mp-ease),
              color var(--mp-dur) var(--mp-ease), transform var(--mp-dur) var(--mp-ease);
}
.mp-hero__chips a:hover {
  background: var(--mp-brand-tint); border-color: transparent;
  color: var(--mp-brand-700); transform: translateY(-1px);
}
@media (max-width: 560px) {
  .mp-hero__title br { display: none; }
  .mp-hero__search { border-radius: 16px; }
  .mp-hero__search button { padding: 0 18px; }
}

@keyframes mpFadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Section titles — a touch more presence */
.bold-title-and-link > span { font-size: clamp(1.15rem, 1rem + .5vw, 1.4rem) !important; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  .container-item-grid:hover,
  .home-categories a.home-widget-categories-item:hover,
  .header-wow-sticky-add:hover { transform: none !important; }
}

/* ============================================================
   DARK THEME — toggled via <html data-theme="dark"> (2026-07-07)
   Reversible: delete from this marker down + remove header toggle.
   ============================================================ */
html[data-theme="dark"]{
  --mp-ink:#eef0f5; --mp-body:#c4c9d3; --mp-muted:#868d9b;
  --mp-line:#262a33; --mp-line-2:#333947;
  --mp-bg:#14161b; --mp-surface:#1b1e25; --mp-surface-2:#232732;
  --mp-brand-700:#3ad47f; --mp-brand-tint:#123020;
  --mp-shadow-sm:0 1px 2px rgba(0,0,0,.5);
  --mp-shadow:0 2px 6px rgba(0,0,0,.45),0 12px 28px rgba(0,0,0,.55);
  --avito-primary:#3ad47f; --avito-success:#00c853;
  --avito-text-primary:#eef0f5; --avito-border:#262a33; --avito-bg-gray:#1b1e25;
  color-scheme:dark;
}
html[data-theme="dark"]{ background:#14161b; }
html[data-theme="dark"] body{ background:var(--mp-bg) !important; color:var(--mp-body); }

/* surfaces / cards */
html[data-theme="dark"] .container-item-grid,
html[data-theme="dark"] .container-item-grid-content,
html[data-theme="dark"] .container-item-list,
html[data-theme="dark"] .container-item-list-highlight,
html[data-theme="dark"] .container-item-images,
html[data-theme="dark"] .container-item-images-skeleton,
html[data-theme="dark"] .container-item-grid-skeleton,
html[data-theme="dark"] .container-item-list-skeleton,
html[data-theme="dark"] .container-item-favorite,
html[data-theme="dark"] .ad-card-content-item,
html[data-theme="dark"] .ad-card-sidebar,
html[data-theme="dark"] .ad-card-content-geo-map,
html[data-theme="dark"] .ad-create-options-container-item,
html[data-theme="dark"] .home-widget-sections,
html[data-theme="dark"] .catalog-sidebar,
html[data-theme="dark"] .params-buttons-sticky,
html[data-theme="dark"] .params-form,
html[data-theme="dark"] .top-banner-item,
html[data-theme="dark"] .top-toolbar,
html[data-theme="dark"] .toolbar-dropdown-box,
html[data-theme="dark"] .big-catalog-menu-content,
html[data-theme="dark"] .big-catalog-menu-banners-item,
html[data-theme="dark"] .uni-dropdown-content,
html[data-theme="dark"] .uni-select-content,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .modal-geo-search-results,
html[data-theme="dark"] .auth-block-tab-container,
html[data-theme="dark"] .live-search-container,
html[data-theme="dark"] .live-search-results{
  background:var(--mp-surface) !important; color:var(--mp-body);
  border-color:var(--mp-line) !important;
}

/* header + footer */
html[data-theme="dark"] .header-wow,
html[data-theme="dark"] .header-wow-top,
html[data-theme="dark"] .header-wow-sticky,
html[data-theme="dark"] .header-wow-sticky-mobile,
html[data-theme="dark"] footer,
html[data-theme="dark"] .footer{
  background:#0f1116 !important; color:var(--mp-body);
  border-color:var(--mp-line) !important;
}

/* inputs / selects */
html[data-theme="dark"] .live-search-form-input,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-control-textarea,
html[data-theme="dark"] .uni-select-name,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] textarea,
html[data-theme="dark"] select{
  background:var(--mp-surface-2) !important; color:var(--mp-ink) !important;
  border-color:var(--mp-line-2) !important;
}
html[data-theme="dark"] ::placeholder{ color:var(--mp-muted) !important; opacity:1; }

/* headings / prices / names -> light */
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3,
html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6,
html[data-theme="dark"] .font-bold,
html[data-theme="dark"] .card-item-price-now,
html[data-theme="dark"] .profile-user-sidebar-full-name,
html[data-theme="dark"] .profile-container-item-list,
html[data-theme="dark"] .user-item-container,
html[data-theme="dark"] .ad-card-subtitle,
html[data-theme="dark"] .ad-create-page-title,
html[data-theme="dark"] .ad-create-section-title,
html[data-theme="dark"] .ad-create-step-label,
html[data-theme="dark"] .ad-create-options-container-item-title,
html[data-theme="dark"] .ad-create-categories-item,
html[data-theme="dark"] .widget-shops-item-link,
html[data-theme="dark"] .container-item-list-map,
html[data-theme="dark"] .quantity{ color:var(--mp-ink) !important; }

/* menu / dropdown / link items -> readable */
html[data-theme="dark"] .toolbar-link,
html[data-theme="dark"] .toolbar-link a,
html[data-theme="dark"] .uni-dropdown-content-item,
html[data-theme="dark"] .uni-select-content-item,
html[data-theme="dark"] .live-search-results-item,
html[data-theme="dark"] .big-catalog-menu-category-item,
html[data-theme="dark"] .catalog-container-links-inline-item,
html[data-theme="dark"] .live-search-container-geo-name,
html[data-theme="dark"] .mp-description-toggle,
html[data-theme="dark"] .switch-label,
html[data-theme="dark"] .breadcrumb,
html[data-theme="dark"] .breadcrumb-item span{ color:var(--mp-body) !important; }
html[data-theme="dark"] .uni-dropdown-content-item:hover,
html[data-theme="dark"] .uni-select-content-item:hover,
html[data-theme="dark"] .live-search-results-item:hover,
html[data-theme="dark"] .big-catalog-menu-category-item:hover{ background:var(--mp-surface-2) !important; }

/* login pill (white -> dark) */
html[data-theme="dark"] .button-color-scheme2{
  background:var(--mp-surface-2) !important; color:var(--mp-ink) !important;
  border-color:var(--mp-line-2) !important;
}

/* dividers */
html[data-theme="dark"] hr,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer{ border-color:var(--mp-line) !important; }

/* logo: MEGA (#111827) invisible on dark -> light; POLIS stays green */
html[data-theme="dark"] .h-logo text tspan:first-child,
html[data-theme="dark"] .h-logo svg tspan[fill="#111827"]{ fill:#f2f4f8 !important; }

/* slider nav arrows stay visible */
html[data-theme="dark"] .ad-card-media-slider-nav-left,
html[data-theme="dark"] .ad-card-media-slider-nav-right,
html[data-theme="dark"] .uni-media-slider-modal-container-nav-left,
html[data-theme="dark"] .uni-media-slider-modal-container-nav-right{ color:#fff !important; }

/* ---------- Theme toggle button ---------- */
.mp-theme-toggle{
  display:inline-flex; align-items:center; justify-content:center;
  width:40px; height:40px; padding:0; border-radius:11px;
  border:1px solid var(--mp-line-2, #dfe1e6); background:transparent;
  color:inherit; cursor:pointer; font-size:19px; line-height:1;
  transition:background .17s ease, border-color .17s ease;
}
.mp-theme-toggle:hover{ background:rgba(15,20,30,.06); }
html[data-theme="dark"] .mp-theme-toggle:hover{ background:rgba(255,255,255,.08); }
.mp-theme-toggle .mp-ic-sun{ display:none; }
.mp-theme-toggle .mp-ic-moon{ display:inline-flex; }
html[data-theme="dark"] .mp-theme-toggle .mp-ic-moon{ display:none; }
html[data-theme="dark"] .mp-theme-toggle .mp-ic-sun{ display:inline-flex; }

/* dark: category tiles (top grid) -> surface, not white */
html[data-theme="dark"] .home-widget-categories-item,
html[data-theme="dark"] .category-item,
html[data-theme="dark"] .widget-categories-container,
html[data-theme="dark"] .widget-ads-categories-container{
  background:var(--mp-surface) !important;
  border-color:var(--mp-line) !important; color:var(--mp-body) !important;
}
html[data-theme="dark"] .home-widget-categories-item:hover,
html[data-theme="dark"] .category-item:hover{ background:var(--mp-surface-2) !important; }
html[data-theme="dark"] .category-item-name,
html[data-theme="dark"] .home-widget-categories-item span{ color:var(--mp-ink) !important; }

/* dark: top category grid tiles (.avito-category-card) */
html[data-theme="dark"] .avito-category-card{
  background:var(--mp-surface) !important; border-color:var(--mp-line) !important;
  color:var(--mp-body) !important;
}
html[data-theme="dark"] .avito-category-card:hover{ background:var(--mp-surface-2) !important; }
html[data-theme="dark"] .avito-category-card *:not(img){ color:var(--mp-ink) !important; }

/* dark: subcategory chips on category pages */
html[data-theme="dark"] .widget-categories-or-subcategories a{ background-color:var(--mp-surface) !important; }
html[data-theme="dark"] .widget-categories-or-subcategories a div{ color:var(--mp-body) !important; }
html[data-theme="dark"] .widget-categories-or-subcategories a.active,
html[data-theme="dark"] .widget-categories-or-subcategories a:hover{ background-color:#186aff !important; }
html[data-theme="dark"] .widget-categories-or-subcategories a.active > div,
html[data-theme="dark"] .widget-categories-or-subcategories a:hover > div{ color:#fff !important; }

/* dark: ad detail remaining white surfaces (gallery, reviews, prices, seller) */
html[data-theme="dark"] .ad-card-media-slider-container,
html[data-theme="dark"] .ad-card-reviews-content,
html[data-theme="dark"] .ad-card-prices,
html[data-theme="dark"] .ad-card-user,
html[data-theme="dark"] .ad-card-content > .ad-card-content-item{
  background:var(--mp-surface) !important; border-color:var(--mp-line) !important; color:var(--mp-body);
}
html[data-theme="dark"] .ad-card-reviews-content *:not(a):not(button){ color:var(--mp-body) !important; }

/* ============================================================
   DARK — GLOSS UPGRADE (premium glassy) 2026-07-07
   Overrides the flat dark layer above. Loaded last -> wins.
   ============================================================ */
html[data-theme="dark"]{
  --mp-bg:#0e1016; --mp-surface:#191d26; --mp-surface-2:#222732;
  --mp-ink:#f3f5fa; --mp-body:#cbd1dc; --mp-muted:#8c93a3;
  --mp-line:#2b313d; --mp-line-2:#39414f; --mp-brand-700:#41d885;
}
/* deep ambient gradient page */
html[data-theme="dark"] body{
  background:
    radial-gradient(1300px 620px at 15% -10%, rgba(0,200,83,.09), transparent 62%),
    radial-gradient(1200px 680px at 92% -12%, rgba(56,120,255,.07), transparent 60%),
    linear-gradient(180deg,#0e1016 0%,#0b0d12 100%) !important;
}
/* let section wrappers be transparent so cards float on the gradient */
html[data-theme="dark"] .home-widget-sections{
  background:transparent !important; border:none !important; box-shadow:none !important;
}

/* GLOSSY CARDS: sheen gradient + edge-light + depth */
html[data-theme="dark"] .container-item-grid,
html[data-theme="dark"] .container-item-list,
html[data-theme="dark"] .ad-card-content-item,
html[data-theme="dark"] .ad-card-sidebar,
html[data-theme="dark"] .ad-card-media-slider-container,
html[data-theme="dark"] .ad-card-reviews-content,
html[data-theme="dark"] .ad-card-prices,
html[data-theme="dark"] .ad-card-user,
html[data-theme="dark"] .avito-category-card,
html[data-theme="dark"] .catalog-sidebar,
html[data-theme="dark"] .params-buttons-sticky,
html[data-theme="dark"] .widget-categories-or-subcategories a{
  background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,0) 44%), var(--mp-surface) !important;
  border:1px solid rgba(255,255,255,.075) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07) !important;
}
html[data-theme="dark"] .avito-category-card:hover,
html[data-theme="dark"] .container-item-grid:hover,
html[data-theme="dark"] .container-item-list:hover,
html[data-theme="dark"] .widget-categories-or-subcategories a:hover{
  border-color: rgba(65,216,133,.5) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 10px 30px rgba(0,200,83,.10), 0 0 0 1px rgba(65,216,133,.45) !important;
  background:linear-gradient(180deg, rgba(65,216,133,.06), rgba(255,255,255,0) 50%), var(--mp-surface) !important;
}

/* FROSTED-GLASS OVERLAYS: header, mega-menu, dropdowns, modals */
html[data-theme="dark"] .header-wow,
html[data-theme="dark"] .header-wow-top,
html[data-theme="dark"] .header-wow-sticky,
html[data-theme="dark"] .header-wow-sticky-mobile{
  background:linear-gradient(180deg, rgba(20,23,31,.82), rgba(13,15,20,.70)) !important;
  -webkit-backdrop-filter:blur(20px) saturate(160%); backdrop-filter:blur(20px) saturate(160%);
  border-bottom:1px solid rgba(255,255,255,.07) !important;
}
html[data-theme="dark"] .big-catalog-menu-content,
html[data-theme="dark"] .big-catalog-menu-container,
html[data-theme="dark"] .uni-dropdown-content,
html[data-theme="dark"] .uni-select-content,
html[data-theme="dark"] .toolbar-dropdown-box,
html[data-theme="dark"] .live-search-results,
html[data-theme="dark"] .modal-content{
  background:linear-gradient(180deg, rgba(28,32,42,.94), rgba(19,22,29,.94)) !important;
  -webkit-backdrop-filter:blur(22px) saturate(160%); backdrop-filter:blur(22px) saturate(160%);
  border:1px solid rgba(255,255,255,.08) !important;
  box-shadow:0 24px 60px rgba(0,0,0,.6) !important;
}

/* FIX: mega-menu category + subcategory names were invisible (dark on dark) */
html[data-theme="dark"] .big-catalog-menu-content-categories a,
html[data-theme="dark"] .big-catalog-menu-category-item,
html[data-theme="dark"] .big-catalog-menu-content-subcategories a,
html[data-theme="dark"] .big-catalog-menu-content-subcategories h4,
html[data-theme="dark"] .big-catalog-menu-content-subcategories strong{ color:var(--mp-ink) !important; }
html[data-theme="dark"] .big-catalog-menu-content-subcategories a:hover{ color:var(--mp-brand-700) !important; }
html[data-theme="dark"] .big-catalog-menu-category-item:hover,
html[data-theme="dark"] .big-catalog-menu-category-item.active{
  background:rgba(65,216,133,.12) !important; color:#eafff3 !important;
  border-radius:10px;
}

/* GLOSSY INPUTS */
html[data-theme="dark"] .live-search-form-input,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-control-textarea,
html[data-theme="dark"] .uni-select-name,
html[data-theme="dark"] input[type="text"], html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="email"], html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] input[type="number"], html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] textarea, html[data-theme="dark"] select{
  background:rgba(255,255,255,.045) !important;
  border:1px solid rgba(255,255,255,.10) !important;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.35) !important; color:var(--mp-ink) !important;
}
html[data-theme="dark"] .live-search-form-input:focus,
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] textarea:focus, html[data-theme="dark"] select:focus{
  border-color:rgba(65,216,133,.55) !important;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.35), 0 0 0 3px rgba(65,216,133,.15) !important;
}

/* GLOSSY GREEN primary buttons (add-ad) with sheen + glow */
html[data-theme="dark"] .button-color-scheme5,
html[data-theme="dark"] .header-wow-sticky-add{
  background:linear-gradient(180deg,#14e065,#00b84a) !important;
  box-shadow:0 6px 18px rgba(0,200,83,.35), inset 0 1px 0 rgba(255,255,255,.35) !important;
  color:#05230f !important; border:none !important;
}
/* premium scrollbar */
html[data-theme="dark"] ::-webkit-scrollbar{ width:12px; height:12px; }
html[data-theme="dark"] ::-webkit-scrollbar-track{ background:#0b0d12; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb{
  background:linear-gradient(#333a48,#232733); border-radius:9px; border:3px solid #0b0d12;
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover{ background:linear-gradient(#3d465a,#2b313d); }

/* dark: FAVORITE heart button (was black circle, heart invisible) */
html[data-theme="dark"] .container-item-favorite{
  background:rgba(8,10,14,.5) !important;
  -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
  border:1px solid rgba(255,255,255,.22) !important;
  box-shadow:0 2px 10px rgba(0,0,0,.45) !important;
}
html[data-theme="dark"] .container-item-favorite i{ color:#fff !important; }
html[data-theme="dark"] .container-item-favorite i.ti-heart-filled{ color:#ff4d5e !important; }
html[data-theme="dark"] .container-item-favorite:hover{
  background:rgba(0,0,0,.72) !important; border-color:rgba(255,255,255,.4) !important;
}

/* smooth theme switch (premium feel) — safe: no transition on initial load (data-theme set pre-paint) */
body, .header-wow, .header-wow-top, .header-wow-sticky,
.container-item-grid, .container-item-list, .ad-card-content-item, .ad-card-sidebar,
.avito-category-card, .widget-categories-or-subcategories a,
.form-control, .live-search-form-input, input, textarea, select{
  transition: background-color .32s ease, color .32s ease, border-color .32s ease, box-shadow .2s ease;
}

/* ============================================================
   NEON / GLOW accents (dark) 2026-07-07 — user picked "неон/свечение"
   ============================================================ */
/* glowing green PRICES */
html[data-theme="dark"] .card-item-price-now,
html[data-theme="dark"] .ad-card-prices .card-item-price-now{
  color:#43f58f !important;
  text-shadow:0 0 14px rgba(67,245,143,.45), 0 0 2px rgba(67,245,143,.55);
}
html[data-theme="dark"] .card-item-price-old{ color:var(--mp-muted) !important; text-shadow:none !important; }

/* NEON primary button (add-ad) */
html[data-theme="dark"] .button-color-scheme5,
html[data-theme="dark"] .header-wow-sticky-add{
  box-shadow:0 0 0 1px rgba(20,224,101,.55), 0 6px 22px rgba(0,200,83,.5), inset 0 1px 0 rgba(255,255,255,.4) !important;
}
html[data-theme="dark"] .button-color-scheme5:hover,
html[data-theme="dark"] .header-wow-sticky-add:hover{
  box-shadow:0 0 0 1px rgba(20,224,101,.9), 0 8px 30px rgba(0,200,83,.78), inset 0 1px 0 rgba(255,255,255,.45) !important;
  filter:brightness(1.05);
}

/* NEON card hover: glowing green ring */
html[data-theme="dark"] .container-item-grid:hover,
html[data-theme="dark"] .container-item-list:hover,
html[data-theme="dark"] .avito-category-card:hover,
html[data-theme="dark"] .widget-categories-or-subcategories a:hover{
  border-color:rgba(67,245,143,.85) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.10), 0 0 0 1px rgba(67,245,143,.55), 0 0 26px rgba(67,245,143,.28) !important;
}

/* FAVORITE: red neon when filled, green glow on hover */
html[data-theme="dark"] .container-item-favorite i.ti-heart-filled{
  color:#ff4d5e !important; text-shadow:0 0 12px rgba(255,77,94,.75);
}
html[data-theme="dark"] .container-item-favorite:hover i{
  color:#43f58f !important; text-shadow:0 0 10px rgba(67,245,143,.7);
}

/* stronger green focus glow on inputs */
html[data-theme="dark"] .live-search-form-input:focus,
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] textarea:focus, html[data-theme="dark"] select:focus{
  border-color:rgba(67,245,143,.8) !important;
  box-shadow:inset 0 1px 3px rgba(0,0,0,.35), 0 0 0 3px rgba(67,245,143,.16), 0 0 18px rgba(67,245,143,.22) !important;
}
/* green links glow subtly */
html[data-theme="dark"] .catalog-container-links-inline-item:hover,
html[data-theme="dark"] a.text-success{ color:#43f58f !important; text-shadow:0 0 10px rgba(67,245,143,.4); }

/* FLAT single-color background (user: "одним цветом чтоб заднего не было видно") */
html[data-theme="dark"]{ background:#0e1016 !important; }
html[data-theme="dark"] body{
  background:#0e1016 !important;
}
/* section wrappers stay transparent -> uniform bg */
html[data-theme="dark"] .home-widget-sections,
html[data-theme="dark"] .widget-categories-container,
html[data-theme="dark"] .widget-ads-categories-container,
html[data-theme="dark"] .widget-ads-container,
html[data-theme="dark"] .widget-ads-vip-container,
html[data-theme="dark"] .avito-categories-grid,
html[data-theme="dark"] .home-widget-sections .row{
  background:transparent !important; box-shadow:none !important; border:none !important;
}
/* section titles were dark-on-dark -> light */
html[data-theme="dark"] .bold-title-and-link span,
html[data-theme="dark"] .bold-title-and-link{ color:var(--mp-ink) !important; }

/* dark: AD-CREATE page (was mostly white) */
html[data-theme="dark"] .ad-create-content-container,
html[data-theme="dark"] .ad-create-categories-container,
html[data-theme="dark"] .ad-create-step-indicator,
html[data-theme="dark"] .form-ad-create,
html[data-theme="dark"] .form-ad-create .ad-create-options-container-item,
html[data-theme="dark"] .ad-create-options-container-item,
html[data-theme="dark"] .ad-create-categories-container-items .ad-create-categories-item,
html[data-theme="dark"] .ad-create-categories-item{
  background:var(--mp-surface) !important;
  border:1px solid rgba(255,255,255,.08) !important;
  color:var(--mp-body) !important;
}
html[data-theme="dark"] .form-ad-create textarea,
html[data-theme="dark"] .form-ad-create textarea:focus{
  background:rgba(255,255,255,.045) !important; color:var(--mp-ink) !important;
  border:1px solid rgba(255,255,255,.10) !important;
}
html[data-theme="dark"] .ad-create-step-number{ background:var(--mp-surface-2) !important; color:var(--mp-body) !important; }
html[data-theme="dark"] .ad-create-categories-item,
html[data-theme="dark"] .ad-create-categories-item *:not(img),
html[data-theme="dark"] .ad-create-step-label,
html[data-theme="dark"] .ad-create-section-title{ color:var(--mp-ink) !important; }
html[data-theme="dark"] .ad-create-categories-item:hover{
  border-color:rgba(67,245,143,.7) !important;
  box-shadow:0 0 0 1px rgba(67,245,143,.5), 0 0 22px rgba(67,245,143,.25) !important;
}

/* dark: FOOTER (was gray rgb(75 75 75) panel) */
html[data-theme="dark"] .footer-bg{ background:#0e1016 !important; border-top:1px solid rgba(255,255,255,.06) !important; }
html[data-theme="dark"] .footer-bg-box-link-inline{
  background:var(--mp-surface) !important; border:1px solid rgba(255,255,255,.07) !important;
}
html[data-theme="dark"] .footer-bg-box-link-inline-item{ color:var(--mp-body) !important; }
html[data-theme="dark"] .footer-bg-box-link-inline-item:hover{ color:#43f58f !important; }
html[data-theme="dark"] footer a{ color:var(--mp-muted) !important; }
html[data-theme="dark"] footer a:hover{ color:#43f58f !important; }

/* dark: "Срочно" switch filter (was white #f9fafb box) */
html[data-theme="dark"] .params-form-item-switch{
  background:var(--mp-surface-2) !important; border:1px solid rgba(255,255,255,.08) !important;
}
html[data-theme="dark"] .switch-label{ color:var(--mp-ink) !important; }
html[data-theme="dark"] .switch .switch-toggle-slider{ background:rgba(255,255,255,.16) !important; }
html[data-theme="dark"] .switch .switch-input:checked ~ .switch-toggle-slider{ background:#00c853 !important; }

/* dark: remaining audit gaps (mobile menus, modal close, avatar) */
html[data-theme="dark"] .big-catalog-menu-mobile-container,
html[data-theme="dark"] .header-menu-filters-mobile-container,
html[data-theme="dark"] .main-floating-menu,
html[data-theme="dark"] .mobile-grid-menu-category-item{
  background:var(--mp-surface) !important; border-color:rgba(255,255,255,.08) !important; color:var(--mp-body) !important;
}
html[data-theme="dark"] .mobile-menu-list-link-item,
html[data-theme="dark"] .header-flex-box-icon{ color:var(--mp-body) !important; }
html[data-theme="dark"] .box-user-face-card-avatar{ background:var(--mp-surface-2) !important; }
html[data-theme="dark"] .btn-close{ filter:invert(1) grayscale(1) brightness(1.6) !important; }

/* dark: image placeholder area (avoid white flash before lazy-load / no-photo) */
html[data-theme="dark"] .container-item-images,
html[data-theme="dark"] .container-item-grid-content-images,
html[data-theme="dark"] .container-item-list-images,
html[data-theme="dark"] .container-item-images img,
html[data-theme="dark"] .container-item-images-skeleton{
  background-color:var(--mp-surface-2) !important;
}

/* ROOT FIX: redefine marketplace theme vars for dark (--m-card=#fff etc. → dark).
   Fixes .catalog-container-options toolbar + all --m-*-based surfaces at once. */
html[data-theme="dark"]{
  --m-card:#191d26;
  --m-bg:#0e1016;
  --m-text:#eef0f5;
  --m-border:rgba(255,255,255,.09);
  --m-border-h:rgba(255,255,255,.18);
  --m-blue-soft:#15233c;
}
/* sort toolbar text readable (keep blue active view icon) */
html[data-theme="dark"] .catalog-container-links-inline-item,
html[data-theme="dark"] .catalog-container-options-links-inline-sorting,
html[data-theme="dark"] .catalog-container-options-links-inline-sorting a,
html[data-theme="dark"] .catalog-container-options-view-item span{ color:var(--mp-body) !important; }
html[data-theme="dark"] .catalog-container-options-view-item span.active{ color:#4c7dff !important; }

/* dark: safety — no white behind lazy/absent listing images */
html[data-theme="dark"] [class*="container-item"] img,
html[data-theme="dark"] .container-item-grid > a,
html[data-theme="dark"] .container-item-list-image,
html[data-theme="dark"] img.lazy, html[data-theme="dark"] img[data-src]{
  background-color:var(--mp-surface-2) !important;
}

/* ============ dark: AD DETAIL description + seller (косяки со скринов) ============ */
/* description text was dark-on-dark */
html[data-theme="dark"] .ad-card-description,
html[data-theme="dark"] .ad-description-readable,
html[data-theme="dark"] .ad-card-description p,
html[data-theme="dark"] .ad-card-description span,
html[data-theme="dark"] .ad-card-description div,
html[data-theme="dark"] .ad-card-description li,
html[data-theme="dark"] .mp-desc-rows,
html[data-theme="dark"] .mp-desc-value{ color:var(--mp-body) !important; }
html[data-theme="dark"] .mp-desc-label{ color:var(--mp-muted) !important; }
/* white read-more fade mask -> fade to dark surface */
html[data-theme="dark"] .ad-card-description.is-collapsed::after,
html[data-theme="dark"] .ad-description-collapsed::after{
  background:linear-gradient(transparent, var(--mp-surface)) !important;
}
/* light badge / phone pill -> dark */
html[data-theme="dark"] .mp-badge{ background:rgba(56,120,255,.16) !important; color:#8fbaff !important; }
html[data-theme="dark"] .mp-phone-pill,
html[data-theme="dark"] .ad-card-description a.avito-phone-link,
html[data-theme="dark"] .ad-description-readable a.avito-phone-link{
  background:var(--mp-surface-2) !important; color:var(--mp-ink) !important;
}
/* seller name (list view card + detail) was dark-on-dark */
html[data-theme="dark"] .box-user-face-card-content,
html[data-theme="dark"] .box-user-face-card-content *,
html[data-theme="dark"] .mp-seller-name,
html[data-theme="dark"] .widget-shops-item-name{ color:var(--mp-ink) !important; }

/* dark: PHOTO GALLERY (was white .mp-gallery) + contacts button */
html[data-theme="dark"] .mp-gallery,
html[data-theme="dark"] .ad-card-media-slider-container{ background:var(--mp-surface) !important; }
html[data-theme="dark"] .mp-gallery-empty,
html[data-theme="dark"] .mp-gallery-thumb{ background:var(--mp-surface-2) !important; }
html[data-theme="dark"] .uni-media-slider-modal-container{ background:rgba(6,8,12,.97) !important; }
html[data-theme="dark"] .ad-card-media-slider-nav-left,
html[data-theme="dark"] .ad-card-media-slider-nav-right{
  background:rgba(8,10,14,.55) !important; color:#fff !important;
  border:1px solid rgba(255,255,255,.18) !important;
}
/* "Показать контакты" (button-color-scheme2) forced dark secondary */
html[data-theme="dark"] .button-color-scheme2,
html[data-theme="dark"] .btn-custom.button-color-scheme2,
html[data-theme="dark"] .actionAdShowContacts{
  background:var(--mp-surface-2) !important; color:var(--mp-ink) !important;
  border:1px solid rgba(255,255,255,.14) !important;
}

/* dark: PRICE is not a boxed element — just text on the sidebar (remove box) */
html[data-theme="dark"] .ad-card-prices{
  background:transparent !important; border:none !important; box-shadow:none !important;
  padding-left:0 !important; padding-right:0 !important;
}

/* dark: share/menu-line action button (was white square) */
html[data-theme="dark"] .ad-card-menu-line-item{
  background:rgba(255,255,255,.06) !important;
  border:1px solid rgba(255,255,255,.12) !important;
  color:var(--mp-body) !important;
}
html[data-theme="dark"] .ad-card-menu-line-item:hover{
  background:rgba(255,255,255,.12) !important; color:var(--mp-ink) !important;
}

/* dark: button-color-scheme2 HOVER was going white/light (color:black + bg:#d8edff) */
html[data-theme="dark"] .button-color-scheme2:hover,
html[data-theme="dark"] .button-color-scheme2:active,
html[data-theme="dark"] .btn-custom.button-color-scheme2:hover,
html[data-theme="dark"] .ad-card-action-buttons .btn-custom.button-color-scheme2:hover,
html[data-theme="dark"] .ad-card-action-buttons .btn-custom.button-color-scheme3:hover,
html[data-theme="dark"] .actionAdShowContacts:hover,
html[data-theme="dark"] .actionAdShowContacts:active{
  background:rgba(255,255,255,.12) !important;
  color:var(--mp-ink) !important;
  border-color:rgba(255,255,255,.28) !important;
}

/* FIX: catalog mega-menu had translucent bg -> page bled through. Make it SOLID. */
html[data-theme="dark"] .big-catalog-menu-content{
  background:#14171e !important;
  -webkit-backdrop-filter:none !important; backdrop-filter:none !important;
  box-shadow:0 24px 60px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.08) !important;
}
html[data-theme="dark"] .big-catalog-menu-container{ background:transparent !important; -webkit-backdrop-filter:none !important; backdrop-filter:none !important; box-shadow:none !important; border:none !important; }
html[data-theme="dark"] .big-catalog-menu-content-categories,
html[data-theme="dark"] .big-catalog-menu-content-subcategories{ background:transparent !important; }

/* FIX (both themes): filter sidebar taller than viewport was unreachable
   (.catalog-sidebar is position:sticky top:80 with no max-height) -> internal scroll */
@media (min-width: 992px){
  .catalog-sidebar{
    max-height: calc(100vh - 96px) !important;
    overflow-y: auto !important;
    overflow-x: hidden;
    scrollbar-width: thin;
  }
}
