/* =====================================================
   SherikTop — Modern UI (purple brand)
   Performance-aware, mobile-first, all device sizes.
   - Fluid typography (clamp)
   - backdrop-filter only when supported & user opts in
   - Reduced motion / transparency respected
   - Touch-friendly tap targets
   ===================================================== */

:root {
  /* Brand palette (from logo) */
  --brand-900: #2A1340;
  --brand-800: #3B1E5E;
  --brand-700: #4A2575;
  --brand-600: #5B2E8A;
  --brand-500: #7448B0;
  --brand-400: #8B5FBF;
  --brand-300: #B79BD9;
  --brand-200: #D9C7EC;
  --brand-100: #EDE3F7;
  --brand-50:  #F7F1FC;

  --cream-100: #FBF8F5;
  --cream-200: #F5F1EC;
  --cream-300: #EFE6DC;

  --accent-gold: #E0A933;
  --success: #1FA971;
  --danger:  #DC4D6B;
  --info:    #5B7FE5;

  --bg: var(--cream-200);
  --surface:        rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --surface-soft:   rgba(255, 255, 255, 0.78);

  --text:      #1F1230;
  --text-soft: #4A3B5C;
  --muted:     #7C6E8C;
  --line:        rgba(91, 46, 138, 0.12);
  --line-strong: rgba(91, 46, 138, 0.22);

  --button-text: #ffffff;
  --primary-grad:       linear-gradient(135deg, #5B2E8A 0%, #8B5FBF 100%);
  --primary-grad-hover: linear-gradient(135deg, #4A2575 0%, #7448B0 100%);
  --gold-grad:          linear-gradient(135deg, #E0A933 0%, #F4C66F 100%);

  --shadow-sm: 0 4px 12px rgba(59, 30, 94, 0.08);
  --shadow:    0 12px 30px rgba(59, 30, 94, 0.12);
  --shadow-lg: 0 24px 60px rgba(59, 30, 94, 0.18);

  --radius-sm:   12px;
  --radius:      18px;
  --radius-lg:   24px;
  --radius-pill: 999px;

  /* Fluid sizes — scale smoothly from 320px to 1024px */
  --fs-xs:  clamp(11px, 2.6vw, 12px);
  --fs-sm:  clamp(12px, 3.0vw, 13px);
  --fs-md:  clamp(13px, 3.4vw, 14px);
  --fs-base:clamp(14px, 3.6vw, 15px);
  --fs-lg:  clamp(15px, 4.0vw, 17px);
  --fs-xl:  clamp(18px, 5.0vw, 22px);
  --fs-2xl: clamp(22px, 6.4vw, 28px);

  --pad-content: clamp(12px, 4vw, 22px);
  --gap-md:      clamp(10px, 3vw, 16px);

  --tg-button:      var(--brand-600);
  --tg-button-text: #ffffff;
  --tg-top-inset: 0px;
  --tg-bottom-inset: 0px;
  --app-header-height: 0px;
  --bottom-nav-height: 86px;
  --filter-sheet-bottom-gap: 8px;

  --app-bg-start: #3b0f68;
  --app-bg-end: #1f0638;
  --app-accent-glow: rgba(139, 92, 246, 0.35);
}

/* -------- Reset -------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb  { background: var(--brand-200); border-radius: 999px; }
*::-webkit-scrollbar-track  { background: transparent; }

html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(ellipse at 0% 0%,   rgba(139, 95, 191, 0.18), transparent 55%),
    radial-gradient(ellipse at 100% 0%, rgba(224, 169, 51, 0.08), transparent 50%),
    radial-gradient(ellipse at 50% 100%,rgba(91, 46, 138, 0.10), transparent 60%),
    linear-gradient(180deg, #FBF8F5 0%, #F1E9F7 100%);
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; color: inherit; }
a   { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* =====================================================
   Background image overlay (admin-uploaded bg)
   ===================================================== */
body.has-bg-image {
  background-attachment: scroll; /* iOS Safari fixed-bg flicker fix */
}
body.has-bg-image::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg,
      rgba(42, 19, 64, 0.55) 0%,
      rgba(42, 19, 64, 0.35) 45%,
      rgba(42, 19, 64, 0.65) 100%);
  pointer-events: none;
}

/* =====================================================
   Layout shell
   ===================================================== */
.app-shell {
  width: 100%;
  max-width: 980px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom);
}

/* =====================================================
   Header
   ===================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px var(--pad-content) 10px;
  padding-top: max(11px, env(safe-area-inset-top));
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(59, 30, 94, 0.06);
}
html.is-tg-fullscreen .app-header {
  position: relative;
  top: auto;
  padding-top: calc(var(--tg-top-inset, 92px) + 10px);
  padding-bottom: 14px;
}
html.is-tg-fullscreen body.home-page .app-header {
  padding-top: max(72px, calc(env(safe-area-inset-top) + 42px));
  padding-bottom: 12px;
}
html.is-telegram-webapp body.home-page .app-header {
  padding-top: calc(max(env(safe-area-inset-top), var(--tg-top-inset, 0px)) + 8px);
}
html.is-tg-fullscreen .content {
  padding-top: 12px;
}
html.is-tg-fullscreen body.home-page .content {
  padding-top: 10px;
}
html.is-tg-fullscreen .brand-logo {
  font-size: clamp(23px, 6.2vw, 30px);
}
html.is-tg-fullscreen .app-header p {
  margin-top: 2px;
}
.app-header > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}
.app-header.compact {
  grid-template-columns: 44px 1fr 44px;
}
.app-header h1 {
  margin: 0;
  font-size: var(--fs-xl);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--brand-700);
}
.app-header p {
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.94);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
}
.brand-logo {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  color: var(--brand-700);
  font-size: clamp(24px, 6.8vw, 32px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.header-action {
  display: inline-flex;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  border-radius: 14px;
  background: var(--primary-grad);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.header-action svg { stroke: currentColor; }

/* =====================================================
   Content
   ===================================================== */
.content { padding: var(--pad-content); }
.with-bottom-nav {
  padding-bottom: calc(100px + max(env(safe-area-inset-bottom), var(--tg-bottom-inset, 0px)));
}

.icon, svg {
  width: 19px; height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =====================================================
   Surfaces (cards) — solid by default for performance
   ===================================================== */
.search-card,
.hero-card,
.intro-card,
.state,
.detail-card,
.subscribe-hero,
.plan,
.mini-card,
.card,
.quick-grid a,
.filter-sheet,
.bottom-nav {
  background: var(--surface-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

/* =====================================================
   Search
   ===================================================== */
.search-card {
  position: sticky;
  top: 8px;
  z-index: 25;
  padding: 12px;
  margin-bottom: 14px;
  transition: transform .28s ease, opacity .28s ease;
  will-change: transform;
}
.search-card.is-hidden {
  transform: translateY(-130%);
  opacity: 0;
  pointer-events: none;
}
.search-row {
  display: grid;
  grid-template-columns: 1fr 42px 42px;
  gap: 8px;
  align-items: center;
  min-height: 50px;
  padding: 0 6px 0 14px;
  border: 1.5px solid rgba(31, 18, 48, 0.18);
  border-radius: 16px;
  background: #ffffff;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.search-row:focus-within {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 4px rgba(139, 95, 191, 0.15);
}
body.search-active .search-row,
.search-card:has(.filter-summary:not([hidden])) .search-row {
  border-color: var(--brand-500);
  box-shadow: 0 8px 22px rgba(91, 46, 138, 0.18), 0 0 0 4px rgba(139, 95, 191, 0.14);
}
.search-row input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 500;
}
.search-row input::placeholder { color: #6b5d7a; opacity: 1; }
.search-row button,
.sheet-header button,
.carousel-btn { border: 0; cursor: pointer; }
.search-row button {
  display: inline-flex;
  height: 40px; width: 40px;
  align-items: center; justify-content: center;
  border-radius: 13px;
  background: var(--primary-grad);
  color: var(--button-text);
}
.search-row button svg {
  width: 21px;
  height: 21px;
}
.filter-summary {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 10px 2px 0;
  min-width: 0;
}
.chip-scroll {
  display: flex;
  flex: 1 1 auto;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.chip-scroll::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: 0 0 auto;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand-700);
  border: 1px solid rgba(91, 46, 138, 0.14);
  font-size: 12px;
  font-weight: 800;
}
.chip-clear {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(91, 46, 138, 0.10);
  color: var(--brand-700);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.btn-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.search-row button.is-loading {
  cursor: wait;
  opacity: .92;
}
@keyframes spin { to { transform: rotate(360deg); } }
}

/* =====================================================
   Hero
   ===================================================== */
.hero-card {
  padding: clamp(16px, 4vw, 22px);
  margin-bottom: 14px;
  background: linear-gradient(135deg, #ffffff 0%, var(--brand-50) 100%);
}
.hero-card h2,
.section-heading h2,
.detail-body h2,
.subscribe-hero h2,
.state h2 {
  margin: 0;
  font-size: var(--fs-xl);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--brand-900);
}
.hero-card p,
.section-heading p,
.subscribe-hero p,
.state p {
  margin-top: 6px;
  color: var(--muted);
  font-size: var(--fs-md);
  line-height: 1.5;
}
.hero-actions, .filter-actions, .sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

/* =====================================================
   Buttons
   ===================================================== */
.primary-link, .primary-btn, .secondary-btn,
.ghost-btn, .plain-btn, .call-btn, .secondary-link {
  display: inline-flex;
  min-height: 48px;
  padding: 0 18px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: var(--fs-base);
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, color .2s, box-shadow .2s, transform .15s;
  -webkit-user-select: none;
  user-select: none;
}
.primary-link, .primary-btn, .call-btn {
  background: var(--primary-grad);
  color: var(--button-text);
  box-shadow: var(--shadow-sm);
}
.secondary-btn, .secondary-link {
  background: var(--brand-100);
  color: var(--brand-700);
}
.ghost-btn {
  background: transparent;
  color: var(--brand-600);
  border: 1.5px solid var(--line-strong);
}
.plain-btn {
  background: var(--cream-300);
  color: var(--text-soft);
}
.wide { width: 100%; }

/* =====================================================
   Quick grid
   ===================================================== */
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.quick-grid a {
  display: flex;
  min-height: 78px;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 800;
  font-size: var(--fs-md);
}
.quick-grid span {
  display: inline-flex;
  width: 38px; height: 38px;
  align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--brand-100);
  color: var(--brand-600);
}

/* =====================================================
   Section
   ===================================================== */
.section-heading {
  margin: 18px 4px 14px;
  transition: transform .22s ease, opacity .22s ease;
}
body.search-active .section-heading {
  transform: translateY(-1px);
}
.intro-card {
  margin: 0 4px 14px;
  padding: 14px 16px;
}
.intro-card[hidden] {
  display: none;
}
.intro-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

/* =====================================================
   Popular internal links
   ===================================================== */
.popular-links {
  margin: 0 0 18px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(91, 46, 138, 0.13);
  box-shadow: var(--shadow-sm);
}
.popular-links-head h2 {
  margin: 0;
  color: var(--brand-900);
  font-size: var(--fs-lg);
  font-weight: 900;
}
.popular-links-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.45;
}
.popular-link-groups {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.popular-link-group {
  min-width: 0;
}
.popular-link-group h3 {
  margin: 0 0 8px;
  color: var(--brand-700);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.popular-chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 1px 2px 4px;
  scrollbar-width: none;
}
.popular-chip-row::-webkit-scrollbar { display: none; }
.popular-chip-row a {
  flex: 0 0 auto;
  padding: 9px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(91, 46, 138, 0.10), rgba(139, 95, 191, 0.14));
  color: var(--brand-800);
  border: 1px solid rgba(91, 46, 138, 0.18);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(91, 46, 138, 0.06);
}

/* =====================================================
   Card grid (listings)
   ===================================================== */
.cards {
  display: grid;
  gap: var(--gap-md);
  grid-auto-rows: 1fr;
  transition: opacity .18s ease, transform .18s ease;
}
.cards.is-refreshing {
  opacity: .45;
  transform: translateY(6px);
}
.cards.is-updated .card {
  animation: card-in .46s ease both;
}
.cards.is-updated .card:nth-child(2) { animation-delay: .04s; }
.cards.is-updated .card:nth-child(3) { animation-delay: .08s; }
@keyframes card-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}

.image-wrap {
  position: relative;
  height: clamp(170px, 50vw, 220px);
  overflow: hidden;
  background: linear-gradient(135deg, var(--brand-100), var(--cream-200));
}
.detail-image { height: clamp(220px, 60vw, 320px); }

.slide {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .25s ease;
}
.slide.is-active { opacity: 1; }

.carousel-btn {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 36px; height: 44px;
  transform: translateY(-50%);
  border-radius: var(--radius-pill);
  background: rgba(42, 19, 64, 0.55);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  transition: background .2s;
}
.carousel-btn:hover { background: rgba(42, 19, 64, 0.78); }
.carousel-btn.left  { left: 10px; }
.carousel-btn.right { right: 10px; }

.tag {
  position: absolute;
  top: 12px;
  z-index: 4;
  min-width: 0;
  max-width: 58%;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.tag.audience { background: linear-gradient(135deg, #5B2E8A, #8B5FBF); }
.tag.audience.audience-all   { background: linear-gradient(135deg, #5B2E8A, #8B5FBF); }
.tag.audience.audience-girls { background: linear-gradient(135deg, #A04AC8, #C77DDB); }
.tag.audience.audience-boys  { background: linear-gradient(135deg, #3D1A6B, #6B3FA0); }
.tag.property { background: linear-gradient(135deg, #1FA971, #2BC489); }
.tag.listing-badge {
  right: 12px;
  max-width: calc(100% - 24px);
}

.dots {
  position: absolute;
  left: 0; right: 0; bottom: 12px;
  display: flex;
  justify-content: center;
  gap: 5px;
}
.dot {
  width: 7px; height: 7px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.55);
  transition: width .2s, background .2s;
}
.dot.is-active { width: 22px; background: #fff; }

.card-body, .detail-body { padding: clamp(14px, 3.5vw, 18px); }
.card .card-body { display: flex; flex-direction: column; flex: 1 1 auto; }
.card .card-body .meta-row { margin-top: auto; }
.card .info-grid { min-height: 76px; align-content: start; }
.card .description { min-height: 44px; }

.detail-body h2 {
  margin: 0 0 4px;
  color: var(--brand-900);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.card-body h3 {
  margin: 0 0 10px;
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--brand-900);
  letter-spacing: -0.01em;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.info-grid span,
.district {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
  font-size: var(--fs-sm);
  font-weight: 700;
}
.info-grid span svg,
.district svg { color: var(--brand-500); }

.description {
  display: -webkit-box;
  min-height: 44px;
  margin: 12px 0;
  overflow: hidden;
  color: var(--text-soft);
  font-size: var(--fs-md);
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.date {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 700;
}

/* =====================================================
   States
   ===================================================== */
.state {
  padding: clamp(20px, 5vw, 32px);
  color: var(--muted);
  text-align: center;
}
.state .primary-btn {
  margin-top: 14px;
  min-height: 42px;
}

.related-searches {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(91, 46, 138, 0.12);
}
.related-searches h3 {
  margin: 0 0 10px;
  color: var(--brand-900);
  font-size: var(--fs-md);
  font-weight: 900;
}
.related-chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-width: none;
}
.related-chip-row::-webkit-scrollbar { display: none; }
.related-chip-row a {
  flex: 0 0 auto;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(91, 46, 138, 0.09);
  color: var(--brand-800);
  border: 1px solid rgba(91, 46, 138, 0.17);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.load-more {
  width: 100%;
  margin: 18px 0 30px;
  background: var(--surface-strong);
  color: var(--brand-700);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}

/* =====================================================
   Filter sheet
   ===================================================== */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(20, 8, 38, 0.72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .2s ease;
}
.filter-sheet {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-nav-height, 86px) + var(--filter-sheet-bottom-gap, 8px));
  z-index: 70;
  width: min(100%, 720px);
  max-height: calc(100vh - var(--bottom-nav-height, 86px) - var(--filter-sheet-bottom-gap, 8px) - 16px);
  max-height: calc(100dvh - var(--bottom-nav-height, 86px) - var(--filter-sheet-bottom-gap, 8px) - 16px);
  overflow-y: auto;
  padding: 18px;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -20px 60px rgba(20, 8, 38, 0.3);
  transform: translate(-50%, 105%);
  transition: transform .25s cubic-bezier(.2, .7, .3, 1);
  -webkit-overflow-scrolling: touch;
}
.sheet-open .sheet-backdrop { opacity: 1; }
.sheet-open .filter-sheet { transform: translate(-50%, 0); }

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.sheet-header strong {
  display: block;
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--brand-900);
}
.sheet-header span {
  color: var(--muted);
  font-size: var(--fs-sm);
}
.sheet-header button {
  display: inline-flex;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  border-radius: 14px;
  background: var(--brand-50);
  color: var(--brand-700);
}

.filter-sheet form { display: grid; gap: 12px; }
.filter-sheet label {
  display: grid;
  gap: 6px;
  color: var(--text-soft);
  font-size: var(--fs-sm);
  font-weight: 700;
}
.filter-sheet input,
.filter-sheet select {
  width: 100%;
  height: 46px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  background: #ffffff;
  color: var(--text);
  font-size: var(--fs-md);
  font-weight: 600;
  transition: border-color .2s, box-shadow .2s;
}
.filter-sheet input::placeholder { color: #8a7a9c; opacity: 1; }
.filter-sheet input:focus,
.filter-sheet select:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 4px rgba(139, 95, 191, 0.15);
}
.check-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px !important;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--brand-50);
}
.check-row input { width: 18px; height: 18px; accent-color: var(--brand-600); }
.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* =====================================================
   Detail page
   ===================================================== */
.detail-content {
  max-width: 760px;
  margin: 0 auto;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.detail-grid div {
  padding: 14px;
  border-radius: 16px;
  background: var(--brand-50);
  border: 1px solid var(--line);
}
.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.detail-grid strong {
  display: block;
  margin-top: 4px;
  font-size: var(--fs-md);
  font-weight: 800;
  color: var(--brand-900);
}
.amenities, .locked-phone, .subscribe-hero {
  margin-top: 16px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--brand-50);
  border: 1px solid var(--line);
}
.amenities h3,
.locked-phone strong {
  display: block;
  margin: 0 0 8px;
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--brand-900);
}
.amenities p,
.locked-phone p {
  margin: 0 0 12px;
  color: var(--text-soft);
  font-size: var(--fs-md);
  line-height: 1.5;
}
.locked-phone .call-btn { width: 100%; }

/* =====================================================
   Plans (subscribe)
   ===================================================== */
.plans { display: grid; gap: 14px; }
.plan {
  position: relative;
  padding: clamp(16px, 4vw, 22px);
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}
.plan.featured {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--surface-strong), var(--surface-strong)) padding-box,
    var(--primary-grad) border-box;
}
.plan h3 {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--brand-900);
}
.plan strong {
  display: block;
  margin-top: 10px;
  font-size: var(--fs-2xl);
  font-weight: 900;
  color: var(--brand-700);
  letter-spacing: -0.02em;
}
.badge {
  position: absolute;
  top: 14px; right: 14px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--gold-grad);
  color: #2A1340;
  font-size: var(--fs-xs);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 4px 14px rgba(224, 169, 51, 0.35);
}

/* =====================================================
   Mini card (my listings)
   ===================================================== */
.mini-card {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  padding: 12px;
}
.mini-card img {
  width: 92px; height: 82px;
  object-fit: cover;
  border-radius: 14px;
}
.mini-card span {
  display: block;
  margin: 5px 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.mini-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.mini-actions a,
.mini-actions button {
  padding: 7px 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--brand-100);
  color: var(--brand-700);
  font-size: var(--fs-xs);
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
}

.profile-card {
  padding: 0;
  overflow: hidden;
  text-align: left;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.profile-hero {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid rgba(222, 82, 139, 0.22);
  box-shadow: 0 8px 24px rgba(42, 19, 64, 0.10);
}
.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(42, 19, 64, 0.14);
}
.profile-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #5B2E8A, #A04AC8);
  color: #fff;
  font-size: 22px;
  font-weight: 950;
}
.profile-identity-text {
  min-width: 0;
}
.profile-eyebrow {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: var(--brand-100);
  color: var(--brand-700);
  font-size: 11px;
  font-weight: 900;
}
.profile-hero h2 {
  margin: 0;
  overflow: hidden;
  color: #9b124d;
  font-size: 22px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-hero p {
  margin: 6px 0 0;
  overflow: hidden;
  color: #7f6f82;
  font-size: 14px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-action-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.profile-action {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 18px;
  background: #fff;
  color: var(--brand-900);
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(42, 19, 64, 0.08);
}
.profile-action .icon {
  width: 22px;
  height: 22px;
  justify-self: center;
  color: var(--brand-600);
}
.profile-action span {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-action strong {
  padding: 5px 8px;
  border-radius: var(--radius-pill);
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: 12px;
  font-weight: 900;
}
.profile-saved {
  margin-top: 12px;
  padding: 14px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(42, 19, 64, 0.10);
}
.profile-saved h3 {
  margin: 0 0 10px;
  color: var(--brand-900);
  font-size: 16px;
  font-weight: 900;
}
.profile-saved-list {
  color: var(--text-soft);
  font-size: 13px;
}
.profile-saved-card {
  margin-top: 10px;
  border: 1px solid rgba(91, 46, 138, 0.10);
  box-shadow: none;
}
.profile-saved-card:first-child {
  margin-top: 0;
}

.saved-only-hidden {
  display: none !important;
}

body.saved-profile-page .content {
  padding-top: calc(14px + max(env(safe-area-inset-top, 0px), var(--tg-top-inset, 0px)));
}

html.is-tg-fullscreen body.saved-profile-page .content,
html.is-telegram-webapp body.saved-profile-page .content {
  padding-top: calc(14px + max(env(safe-area-inset-top, 0px), var(--tg-top-inset, 0px)));
  padding-bottom: calc(124px + max(env(safe-area-inset-bottom, 0px), var(--tg-bottom-inset, 0px)));
}

body.saved-profile-page .profile-card {
  padding-top: 0;
}

body.saved-profile-page .profile-saved {
  margin-top: 0;
}

/* =====================================================
   Bottom nav
   ===================================================== */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 50;
  display: grid;
  width: min(100%, 980px);
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid var(--line);
  border-radius: 0;
  transform: translateX(-50%);
}
.bottom-nav a,
.bottom-nav button {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 6px 4px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-decoration: none;
  transition: color .2s, background .2s;
}
.bottom-nav .is-active {
  color: var(--brand-700);
  background: var(--brand-100);
}
.bottom-nav .is-active span { color: var(--brand-600); }

/* =====================================================
   Utility
   ===================================================== */
.price-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--primary-grad);
  color: #fff;
  font-size: var(--fs-md);
  font-weight: 800;
}

/* =====================================================
   Responsive
   ===================================================== */
/* Very small phones (<360px) — extra compact */
@media (max-width: 359px) {
  .hero-actions, .filter-actions, .sheet-actions { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .two-cols { grid-template-columns: 1fr; }
  .bottom-nav { padding: 8px 4px calc(8px + env(safe-area-inset-bottom)); }
  .bottom-nav a, .bottom-nav button { padding: 4px 2px; font-size: 10px; }
}

/* Tablet & up */
@media (min-width: 720px) {
  .image-wrap { height: 240px; }
  .cards      { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-sheet form { grid-template-columns: repeat(2, 1fr); }
  .sheet-header,
  .sheet-actions,
  .check-row { grid-column: 1 / -1; }
}

/* Large desktop */
@media (min-width: 1024px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* =====================================================
   PROGRESSIVE ENHANCEMENT — capable devices only
   ===================================================== */

/* Hover effects only for true mouse pointers (skip touch) */
@media (hover: hover) and (pointer: fine) {
  .header-action:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
  .primary-link:hover, .primary-btn:hover, .call-btn:hover {
    background: var(--primary-grad-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
  }
  .secondary-btn:hover, .secondary-link:hover { background: var(--brand-200); }
  .ghost-btn:hover { background: var(--brand-50); }
  .plain-btn:hover { background: var(--cream-200); }
  .quick-grid a:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
  .card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
  .plan:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
  .popular-chip-row a:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
  .load-more:hover { background: var(--brand-50); }
  .mini-actions a:hover { background: var(--brand-200); }
  .bottom-nav a:hover, .bottom-nav button:hover { color: var(--brand-600); background: var(--brand-50); }
}

/* Backdrop-filter only when supported AND user OK with transparency */
@media (prefers-reduced-transparency: no-preference) {
  @supports ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
    .bottom-nav {
      background: rgba(255, 255, 255, 0.85);
      -webkit-backdrop-filter: blur(16px) saturate(140%);
      backdrop-filter: blur(16px) saturate(140%);
    }
    body.has-bg-image .search-card,
    body.has-bg-image .hero-card,
    body.has-bg-image .intro-card,
    body.has-bg-image .state,
    body.has-bg-image .detail-card,
    body.has-bg-image .subscribe-hero,
    body.has-bg-image .plan,
    body.has-bg-image .mini-card,
    body.has-bg-image .card,
    body.has-bg-image .quick-grid a,
    body.has-bg-image .filter-sheet,
    body.has-bg-image .bottom-nav {
      background: rgba(255, 255, 255, 0.96);
      -webkit-backdrop-filter: blur(20px) saturate(160%);
      backdrop-filter: blur(20px) saturate(160%);
      border-color: rgba(255, 255, 255, 0.7);
    }
  }
}

/* When backdrop-filter NOT supported and bg-image is active → use solid white surfaces for max readability */
@supports not ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
  body.has-bg-image .search-card,
  body.has-bg-image .hero-card,
  body.has-bg-image .intro-card,
  body.has-bg-image .state,
  body.has-bg-image .detail-card,
  body.has-bg-image .subscribe-hero,
  body.has-bg-image .plan,
  body.has-bg-image .mini-card,
  body.has-bg-image .card,
  body.has-bg-image .quick-grid a,
  body.has-bg-image .filter-sheet,
  body.has-bg-image .bottom-nav {
    background: #ffffff;
    border-color: var(--line);
  }
  body.has-bg-image .app-header {
    background: rgba(42, 19, 64, 0.92);
    border-bottom-color: rgba(255, 255, 255, 0.18);
  }
}

/* Header on bg-image: solid purple gradient (no glass — was unreadable) */
body.has-bg-image .app-header {
  background: linear-gradient(135deg, #2A1340 0%, #5B2E8A 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
body.has-bg-image .app-header h1 {
  color: #ffffff;
  text-shadow: none;
}
body.has-bg-image .brand-logo { color: #ffffff; }
body.has-bg-image .app-header p { color: rgba(255, 255, 255, 0.85); }
body.has-bg-image .header-action { background: rgba(255, 255, 255, 0.18); color: #fff; }

/* Section headings ("Yangi e'lonlar" etc) sit directly on bg-image — give them a readable pill */
body.has-bg-image .section-heading {
  padding: 14px 18px;
  border-radius: var(--radius);
  background: rgba(42, 19, 64, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
body.has-bg-image .section-heading h2 {
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
body.has-bg-image .section-heading p {
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}
@media (prefers-reduced-transparency: no-preference) {
  @supports ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
    body.has-bg-image .section-heading {
      background: rgba(42, 19, 64, 0.38);
      -webkit-backdrop-filter: blur(14px) saturate(140%);
      backdrop-filter: blur(14px) saturate(140%);
    }
  }
}

/* Make all card surfaces more opaque on bg-image so text stays readable */
body.has-bg-image .hero-card,
body.has-bg-image .search-card,
body.has-bg-image .intro-card,
body.has-bg-image .state,
body.has-bg-image .detail-card,
body.has-bg-image .subscribe-hero,
body.has-bg-image .plan,
body.has-bg-image .mini-card,
body.has-bg-image .card,
body.has-bg-image .quick-grid a,
body.has-bg-image .popular-links,
body.has-bg-image .filter-sheet {
  background: rgba(255, 255, 255, 0.95) !important;
}
body.has-bg-image .bottom-nav { background: rgba(255, 255, 255, 0.92) !important; }
body.has-bg-image .hero-card h2,
body.has-bg-image .hero-card p { color: var(--brand-900); }
body.has-bg-image .hero-card p { color: var(--text-soft); }

/* Reduced motion — respect user preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  body.has-bg-image { background-attachment: scroll; }
}

/* Reduced data — drop heavy effects */
@media (prefers-reduced-data: reduce) {
  body { background: var(--cream-200); }
  body.has-bg-image::before { background: rgba(42, 19, 64, 0.6); }
  .app-header, .bottom-nav { backdrop-filter: none; -webkit-backdrop-filter: none; background: #fff; }
}

/* High contrast — boost contrast on Windows high-contrast / forced-colors */
@media (forced-colors: active) {
  .primary-link, .primary-btn, .call-btn { background: ButtonText; color: ButtonFace; }
  .card, .hero-card, .panel { border: 1px solid CanvasText; }
}

/* ===== Phone reveal card ===== */
.locked-phone {
  display: flex; flex-direction: column; gap: 12px;
  background: linear-gradient(140deg, rgba(139,95,191,0.10), rgba(91,46,138,0.06));
  border: 1px solid rgba(139,95,191,0.28);
  border-radius: 16px; padding: 18px;
}
.locked-phone strong { font-size: 1.05rem; color: var(--brand-900, #2A1340); }
.locked-phone p { margin: 0; color: #4a3a60; font-size: 0.92rem; line-height: 1.45; }
.locked-phone .call-btn { width: 100%; justify-content: center; }
.phone-result { width: 100%; }
.phone-msg {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: 14px;
  animation: phoneFadeIn .25s ease-out;
}
@keyframes phoneFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.phone-msg-icon { font-size: 1.5rem; line-height: 1; flex-shrink: 0; }
.phone-msg-body { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.phone-msg-body strong { font-size: 1rem; color: var(--brand-900, #2A1340); }
.phone-msg-body p { margin: 0; font-size: 0.9rem; color: #4a3a60; line-height: 1.45; }
.phone-msg-body .primary-btn { align-self: flex-start; margin-top: 4px; }
.phone-msg-warn {
  background: linear-gradient(140deg, #fff4e6, #ffe6d1);
  border: 1px solid rgba(217,119,6,0.35);
}
.phone-msg-warn strong { color: #7a3e0a; }
.phone-msg-locked {
  background: linear-gradient(140deg, rgba(139,95,191,0.16), rgba(91,46,138,0.10));
  border: 1px solid rgba(139,95,191,0.4);
}
.phone-msg-ok {
  background: linear-gradient(140deg, #e8f8ee, #d6f0e0);
  border: 1px solid rgba(34,139,75,0.35);
  flex-direction: column; gap: 10px; align-items: stretch;
}
.phone-reveal-row {
  display: flex; gap: 10px; align-items: center; justify-content: space-between;
  flex-wrap: wrap;
}
.phone-num {
  font-size: 1.45rem; font-weight: 700; letter-spacing: 0.5px;
  color: #1d6b3a; text-decoration: none;
  font-feature-settings: "tnum";
  word-break: break-all;
}
.phone-num:hover { text-decoration: underline; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 10px; cursor: pointer;
  background: #fff; color: #1d6b3a;
  border: 1px solid rgba(34,139,75,0.4);
  font-size: 0.88rem; font-weight: 600;
  transition: all .18s ease;
}
.copy-btn:hover { background: #1d6b3a; color: #fff; transform: translateY(-1px); }
.copy-btn .icon { width: 16px; height: 16px; }
.phone-hint { margin: 0 !important; font-size: 0.82rem !important; color: #3d6b50 !important; }
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.7s linear infinite;
  vertical-align: middle; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Suggest chips — input focus bo'lganda chiqadigan dropdown */
.filter-sheet label.has-suggest { position: relative; }
.suggest-chips {
  margin: 0;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid rgba(139, 95, 191, 0.25);
  border-top: none;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 8px 18px rgba(42, 19, 64, 0.12);
}
.filter-sheet label.has-suggest .suggest-chips {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 50;
  margin-top: -2px;
}
.suggest-chips[hidden] { display: none !important; }
.suggest-head {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted, #8a7aa8);
  margin-bottom: 6px;
  font-weight: 600;
}
.suggest-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 4px 4px 4px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 95, 191, 0.45) transparent;
}
.suggest-row::-webkit-scrollbar { width: 6px; }
.suggest-row::-webkit-scrollbar-thumb {
  background: rgba(139, 95, 191, 0.45);
  border-radius: 999px;
}
.suggest-row::-webkit-scrollbar-track { background: transparent; }
@media (max-width: 600px) {
  .suggest-row { max-height: 200px; }
}
.suggest-row .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(139, 95, 191, 0.08);
  color: var(--brand-700, #5B2E8A);
  border: 1px solid rgba(139, 95, 191, 0.25);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-family: inherit;
}
.suggest-row .chip:hover {
  background: rgba(139, 95, 191, 0.16);
  border-color: rgba(139, 95, 191, 0.45);
}
.suggest-row .chip.chip-active {
  background: var(--brand-500, #8B5FBF);
  color: #fff;
  border-color: var(--brand-500, #8B5FBF);
}
.suggest-row .chip-count {
  font-size: 11px;
  background: rgba(255,255,255,0.4);
  color: inherit;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 600;
  opacity: 0.85;
}
.suggest-row .chip.chip-active .chip-count {
  background: rgba(255,255,255,0.25);
}

/* ===== Bottom navigation ===== */
.with-bottom-nav {
  padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px));
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 90;
  width: min(100%, 980px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 12px max(8px, env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(91, 46, 138, 0.10);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -12px 30px rgba(42, 19, 64, 0.12);
}

.bottom-nav .bottom-nav-item {
  min-width: 0;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 18px;
  color: #63708a;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.1;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.bottom-nav .bottom-nav-item:active {
  transform: translateY(1px);
}

.bottom-nav .bottom-nav-item.is-active {
  background: #eafbf3;
  color: #00a878;
}

.bottom-nav .bottom-nav-item.is-active span {
  color: inherit;
}

.bottom-nav .bottom-nav-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav .bottom-nav-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (prefers-reduced-transparency: no-preference) {
  @supports ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
    .bottom-nav {
      -webkit-backdrop-filter: blur(16px) saturate(140%);
      backdrop-filter: blur(16px) saturate(140%);
    }
  }
}

@media (max-width: 420px) {
  .bottom-nav {
    gap: 4px;
    padding-left: 8px;
    padding-right: 8px;
  }
  .bottom-nav .bottom-nav-item {
    min-height: 68px;
    border-radius: 16px;
    font-size: 12px;
  }
}

/* ===== Conversion-focused mobile WebApp refresh ===== */
body.home-page {
  background:
    radial-gradient(circle at top right, var(--app-accent-glow), transparent 35%),
    linear-gradient(180deg, var(--app-bg-start) 0%, var(--app-bg-end) 100%);
  background-repeat: no-repeat;
}

body.home-page .app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  justify-content: center;
  min-height: 50px;
  padding: 6px 16px 5px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: linear-gradient(135deg, #4a2575 0%, #7448b0 100%);
  border-bottom: 0;
  box-shadow: 0 8px 24px rgba(42, 19, 64, 0.16);
}

html.is-tg-fullscreen body.home-page .app-header {
  position: sticky;
  top: 0;
  padding-top: max(44px, calc(var(--tg-top-inset, 84px) - 24px));
  padding-bottom: 5px;
}

html.is-telegram-webapp body.home-page .app-header {
  padding-top: max(44px, calc(max(env(safe-area-inset-top), var(--tg-top-inset, 84px)) - 24px));
}

body.home-page .app-header > div {
  width: 100%;
  align-items: center;
  text-align: center;
}

body.home-page .brand-logo {
  justify-content: center;
  width: 100%;
  color: #fff;
  font-size: 21px;
  font-weight: 950;
  transform: none;
}

body.home-page .brand-logo-img {
  display: block;
  width: min(34vw, 136px);
  height: auto;
  max-height: 67px;
  object-fit: contain;
}

body.home-page .app-header p {
  display: none;
}

body.home-page .content {
  padding: 12px 12px 0;
}

body.home-page .search-card {
  top: 8px;
  z-index: 35;
  padding: 8px;
  margin-bottom: 10px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 22px rgba(42, 19, 64, 0.10);
}

html.is-telegram-webapp body.home-page .search-card {
  top: calc(max(env(safe-area-inset-top), var(--tg-top-inset, 0px)) + 8px);
}

body.home-page .search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px 42px;
  gap: 6px;
  min-height: 48px;
  padding: 0 4px 0 12px;
  border: 1px solid rgba(91, 46, 138, 0.14);
  border-radius: 18px;
  background: #fff;
}

.search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-600);
}

.search-icon svg {
  width: 20px;
  height: 20px;
}

body.home-page .search-row input {
  font-size: 14px;
  font-weight: 600;
}

body.home-page .search-row input::placeholder {
  color: #81728f;
}

body.home-page .search-row button {
  width: 38px;
  height: 38px;
  border-radius: 14px;
}

body.home-page .search-submit-inline {
  display: inline-flex;
  background: rgba(91, 46, 138, 0.09);
  color: var(--brand-700);
  box-shadow: none;
}

.popular-searches-panel {
  margin: 8px 2px 0;
  padding: 10px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(91, 46, 138, 0.10);
  box-shadow: 0 8px 20px rgba(42, 19, 64, 0.10);
}

.popular-searches-panel[hidden] {
  display: none !important;
}

.popular-search-title {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.popular-search-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.popular-search-row::-webkit-scrollbar {
  display: none;
}

.popular-search-chip {
  flex: 0 0 auto;
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: #f4edfb;
  color: var(--brand-700);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.popular-search-chip small {
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(91, 46, 138, 0.12);
  color: var(--brand-600);
  font-size: 11px;
}

body.home-page #filter-open {
  background: var(--primary-grad);
  color: #fff;
}

body.home-page .filter-summary {
  margin-top: 8px;
}

body.home-page .cards {
  gap: 12px;
  grid-auto-rows: auto;
  scroll-behavior: smooth;
}

body.home-page .card {
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(42, 19, 64, 0.10);
}

body.home-page .image-wrap {
  height: clamp(156px, 42vw, 180px);
  border-radius: 22px 22px 0 0;
}

body.home-page .carousel-btn {
  width: 30px;
  height: 34px;
  font-size: 18px;
  background: rgba(42, 19, 64, 0.46);
}

body.home-page .carousel-btn.left { left: 8px; }
body.home-page .carousel-btn.right { right: 8px; }

body.home-page .tag {
  max-width: 46%;
  padding: 6px 10px;
  font-size: 11px;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.16);
}

body.home-page .tag.listing-badge {
  top: 10px;
  right: 10px;
  max-width: calc(100% - 20px);
}

body.home-page .tag.audience.audience-family { background: linear-gradient(135deg, #7a4cc2, #2bbf88); }

body.home-page .dots {
  bottom: 9px;
  gap: 4px;
}

body.home-page .dot {
  width: 5px;
  height: 5px;
}

body.home-page .dot.is-active {
  width: 16px;
}

body.home-page .card-body {
  padding: 10px 12px 12px;
}

body.home-page .card-body h3 {
  margin-bottom: 7px;
  overflow: hidden;
  color: var(--brand-900);
  font-size: 16px;
  line-height: 1.22;
  white-space: nowrap;
  text-overflow: ellipsis;
}

body.home-page .info-grid {
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
}

body.home-page .info-grid span {
  min-height: 20px;
  overflow: hidden;
  gap: 5px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
}

body.home-page .info-grid span svg {
  width: 16px;
  height: 16px;
  color: var(--brand-500);
}

body.home-page .description {
  min-height: 34px;
  margin: 7px 0 8px;
  font-size: 12.5px;
  line-height: 1.36;
  -webkit-line-clamp: 2;
}

.cta-row {
  display: grid;
  grid-template-columns: minmax(94px, .72fr) minmax(0, 1.28fr);
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(91, 46, 138, 0.10);
}

.save-btn,
.card-cta {
  min-height: 42px;
  border-radius: 15px;
  font-size: 13px;
  font-weight: 850;
}

.save-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(91, 46, 138, 0.16);
  background: #fff;
  color: var(--brand-700);
  cursor: pointer;
}

.save-btn svg {
  width: 17px;
  height: 17px;
}

.save-btn.is-saved {
  background: #f4edfb;
  color: var(--brand-800);
}

.save-btn.is-saved svg {
  fill: currentColor;
}

.card-cta {
  width: 100%;
  padding: 0 12px;
  box-shadow: 0 8px 18px rgba(91, 46, 138, 0.18);
}

.skeleton-card {
  pointer-events: none;
}

.skeleton-block,
.skeleton-line,
.skeleton-grid span,
.skeleton-actions span {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, #eee7f4 0%, #f8f5fb 45%, #eee7f4 100%);
  background-size: 220% 100%;
  animation: skeleton-pulse 1.1s ease-in-out infinite;
}

.skeleton-line {
  width: 62%;
  height: 18px;
  border-radius: 999px;
}

.skeleton-line.wide {
  width: 78%;
  margin-bottom: 12px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.skeleton-grid span {
  height: 18px;
  border-radius: 999px;
}

.skeleton-actions {
  display: grid;
  grid-template-columns: .72fr 1.28fr;
  gap: 8px;
  margin-top: 12px;
}

.skeleton-actions span {
  height: 44px;
  border-radius: 15px;
}

@keyframes skeleton-pulse {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

body.home-page .state {
  padding: 24px 18px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(42, 19, 64, 0.08);
}

.filter-sheet {
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -16px 36px rgba(42, 19, 64, 0.18);
}

.filter-sheet label {
  font-size: 13px;
  font-weight: 800;
  color: var(--brand-900);
}

.filter-sheet input,
.filter-sheet select {
  min-height: 46px;
  border-radius: 15px;
}

.bottom-nav {
  gap: 6px;
  padding: 7px 10px max(7px, env(safe-area-inset-bottom, 0px), var(--tg-bottom-inset, 0px));
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 -10px 24px rgba(42, 19, 64, 0.10);
}

html.is-telegram-webapp .with-bottom-nav {
  padding-bottom: calc(124px + max(env(safe-area-inset-bottom), var(--tg-bottom-inset, 0px)));
}

html.is-telegram-webapp body.home-page .search-card {
  top: calc(var(--app-header-height, 0px) + 8px);
}

html.is-telegram-webapp body.home-page .search-card.is-hidden {
  transform: translateY(calc(-100% - var(--app-header-height, 0px) - 16px));
}

.bottom-nav .bottom-nav-item {
  min-height: 62px;
  gap: 4px;
  border-radius: 17px;
  font-size: 12px;
}

.bottom-nav .bottom-nav-icon,
.bottom-nav .bottom-nav-icon svg {
  width: 22px;
  height: 22px;
}

.bottom-nav .bottom-nav-item.is-active {
  background: #f0e9fa;
  color: var(--brand-700);
}

@media (max-width: 380px) {
  body.home-page .image-wrap {
    height: 176px;
  }
  .cta-row {
    grid-template-columns: 1fr;
  }
  .save-btn,
  .card-cta {
    width: 100%;
  }
}
