@import url("../fonts/fonts.css");
/* Optom — site styles. Plain CSS, no framework. Fonts are self-hosted (see /fonts/fonts.css).
   Palette follows the optom.tj (Horizons) design: cream background, deep green, sage, orange accent. */
:root {
  --green: #22593f;
  --green-dark: #1a4631;
  --green-soft: #e6ebdc;
  --orange: #f2870d;
  --orange-dark: #d97409;
  --orange-soft: #fdf0df;
  --red: #c8443f;
  --ink: #18251f;
  --text: #2e3b34;
  --muted: #5f6b64;
  --line: #dcd8cc;
  --bg: #faf8f3;
  --band: #f1eee6;
  --card: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(24, 37, 31, .05), 0 6px 20px rgba(24, 37, 31, .06);
  --shadow-hover: 0 10px 30px rgba(24, 37, 31, .14);
  --wrap: 1240px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "PT Serif", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); }
img { max-width: 100%; display: block; }
a { color: var(--green-dark); text-decoration: none; }
a:hover { color: var(--green); }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; }
h1, h2, .serif { font-family: var(--font-head); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; flex: none; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Top bar & header ---------- */
.lang-switch { display: inline-flex; flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; overflow: hidden; font-size: .8rem; }
.lang-switch a { padding: 5px 10px; color: var(--muted); font-weight: 500; letter-spacing: .02em; }
.lang-switch a:hover { color: var(--green); }
.lang-switch a.is-active { background: var(--orange); color: var(--ink); }

.header { background: rgba(250, 248, 243, .94); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(1.4) blur(8px); }
.header .wrap { display: flex; align-items: center; gap: 18px; min-height: 68px; }
.logo { display: inline-flex; align-items: center; flex: none; }
.logo img, .logo svg { height: 46px; width: auto; }
.nav { display: none; gap: 4px; margin-left: 8px; }
.nav a { color: var(--ink); font-weight: 600; padding: 8px 12px; border-radius: var(--radius-sm); }
.nav a:hover, .nav a.is-active { color: var(--green); background: var(--green-soft); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: var(--ink); background: transparent; border: 0; cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--green-soft); color: var(--green); }
.icon-btn .badge { position: absolute; top: 2px; right: 2px; }
.menu-toggle { display: inline-flex; }
.user-menu { position: relative; }
.user-menu-panel { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-hover); min-width: 220px; padding: 6px; z-index: 60; }
.user-menu-panel a, .user-menu-panel button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--ink); background: none; border: 0; cursor: pointer; text-align: left; }
.user-menu-panel a:hover, .user-menu-panel button:hover { background: var(--bg); }
.user-menu-panel hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

.mobile-nav { border-top: 1px solid var(--line); background: #fff; }
.mobile-nav a { display: block; padding: 12px 16px; color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--line); }

@media (min-width: 960px) {
  .nav { display: flex; }
  .menu-toggle { display: none; }
  .mobile-nav { display: none !important; }
}

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 1px solid transparent; font-weight: 500; cursor: pointer; line-height: 1.2; white-space: nowrap; transition: background .15s, box-shadow .15s, color .15s; }
.btn-primary { background: var(--green); color: #fff; }
/* Text on buttons: white on green, dark on orange. Everything inside a button takes the button's colour. */
.btn-accent { background: var(--orange); color: var(--ink); box-shadow: 0 6px 18px rgba(242, 135, 13, .35); }
.btn-accent:hover { background: var(--orange-dark); color: var(--ink); }
.btn > * { color: inherit; }
.btn-primary:hover { background: var(--green-dark); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dark); color: #fff; }
.btn-outline { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--green); color: var(--green); }
.btn-danger { background: #fff; border-color: #f0c7c5; color: var(--red); }
.btn-danger:hover { background: #fdf0ef; color: var(--red); }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-post .btn-post-text { display: none; }
@media (min-width: 640px) { .btn-post .btn-post-text { display: inline; } }

.field { margin-bottom: 16px; }
.field > label, .label { display: block; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.req { color: var(--red); }
.input, .select, .textarea { width: 100%; padding: 11px 13px; border: 1px solid #cfd8d3; border-radius: var(--radius-sm); background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(46, 155, 71, .15); }
.textarea { min-height: 140px; resize: vertical; }
.hint { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.scam-note { display: flex; gap: 8px; align-items: flex-start; background: var(--orange-soft); color: #7a4a0c; border-radius: var(--radius-sm); padding: 10px 12px; }
.scam-note .icon { flex: none; margin-top: 1px; color: var(--orange-dark); }
.error { color: var(--red); font-size: .87rem; margin-top: 4px; }
.is-invalid { border-color: var(--red) !important; }
.row { display: grid; gap: 16px; }
@media (min-width: 640px) { .row-2 { grid-template-columns: 1fr 1fr; } .row-3 { grid-template-columns: repeat(3, 1fr); } }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; margin-bottom: 8px; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--green); flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-input { position: relative; }
.chip-input input { position: absolute; opacity: 0; pointer-events: none; }
.chip-input span { display: inline-block; padding: 8px 14px; border: 1px solid #cfd8d3; border-radius: 999px; cursor: pointer; background: #fff; }
.chip-input input:checked + span { background: var(--green-soft); border-color: var(--green); color: var(--green-dark); font-weight: 600; }
.chip-input input:focus-visible + span { box-shadow: 0 0 0 3px rgba(46, 155, 71, .25); }
.phone-input { display: flex; align-items: stretch; }
.phone-input .prefix { display: flex; align-items: center; padding: 0 12px; border: 1px solid #cfd8d3; border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: var(--bg); font-weight: 700; color: var(--ink); }
.phone-input .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 1.1rem; letter-spacing: .04em; }
.code-input { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-weight: 700; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin: 0 0 16px; border: 1px solid; }
.alert-success { background: var(--green-soft); border-color: #bfe3c9; color: var(--green-dark); }
.alert-error { background: #fdf0ef; border-color: #f0c7c5; color: #a3302d; }
.alert-warn { background: var(--orange-soft); border-color: #f7d6a6; color: #8a5300; }
.flash-area { padding-top: 16px; }

/* ---------- Hero / slider / search ---------- */
.hero { position: relative; background: var(--ink); color: #fff; overflow: hidden; }
.slides { position: absolute; inset: 0; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; background-size: cover; background-position: center; }
.slide.is-active { opacity: 1; }
.slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14, 28, 21, .88) 0%, rgba(14, 28, 21, .62) 45%, rgba(14, 28, 21, .15) 100%); }
.slide-fallback { background: linear-gradient(120deg, var(--green-dark), var(--green) 60%, #6cbf5a); }
.hero-content { position: relative; z-index: 2; min-height: max(340px, var(--hero-h, 340px)); padding: 36px 0 52px; display: flex; flex-direction: column; justify-content: center; }
.hero h1 { color: #fff; font-size: 2.1rem; line-height: 1.08; margin-bottom: 14px; max-width: 760px; }
.hero h1 em { display: block; color: var(--orange); font-style: italic; }
.hero-words { display: flow-root; transition: opacity .3s ease; }
.hero-words.is-changing { opacity: 0; }
.hero-chip { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); color: #fff; border-radius: 999px; padding: 6px 14px; font-size: .85rem; margin-bottom: 16px; }
.hero-note { color: #d7e2da; font-size: .85rem; margin-top: 12px; }
.hero p.lead { color: #e7eee9; margin-bottom: 22px; max-width: 560px; font-size: 1.05rem; }
.slide-dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 3; }
.slide-dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .5); cursor: pointer; padding: 0; }
.slide-dots button.is-active { background: var(--orange); width: 26px; border-radius: 6px; }
@media (min-width: 960px) { .hero-content { min-height: max(520px, var(--hero-h, 520px)); } .hero h1 { font-size: 3.4rem; } }

.search-box { background: #fff; border-radius: var(--radius); box-shadow: 0 14px 40px rgba(0, 0, 0, .28); padding: 10px; display: grid; gap: 8px; color: var(--text); max-width: 860px; }
.search-box .input, .search-box .select { border-color: transparent; background: var(--bg); }
.search-box .btn { border-radius: var(--radius-sm); padding: 12px 22px; }
@media (min-width: 760px) { .search-box { grid-template-columns: 1fr 240px auto; } }
.search-strip { background: #fff; border-bottom: 1px solid var(--line); padding: 14px 0; }
.search-strip .search-box { box-shadow: none; padding: 0; max-width: none; }

/* ---------- Sections ---------- */
.section { padding: 32px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-head h2 { margin: 0; position: relative; padding-bottom: 8px; }
.section-head h2::after { content: none; }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.section-band { background: var(--band); }
.section-head a { white-space: nowrap; }
.section-head a:not(.btn) { font-weight: 600; }

.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .cat-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; } .cat-grid > * { min-height: 230px; } }
.cat-tile { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 170px; padding: 16px 18px; border-radius: var(--radius); overflow: hidden; color: #fff; background: linear-gradient(135deg, var(--green), #4f7d5f); box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.cat-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.cat-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14, 28, 21, 0) 35%, rgba(14, 28, 21, .78) 100%); }
.cat-tile > * { position: relative; z-index: 1; }
.cat-tile:hover img { transform: scale(1.05); }
.cat-tile .cat-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cat-tile .cat-icon-sm { position: absolute; top: 16px; left: 18px; color: rgba(255, 255, 255, .85); }
.cat-tile .cat-icon-sm svg { width: 40px; height: 40px; }
.cat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); color: var(--green-dark); border-color: #cfe9d6; }
.cat-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--green-soft); display: flex; align-items: center; justify-content: center; color: var(--green); }
.cat-icon svg { width: 34px; height: 34px; }
.cat-tile:nth-child(2n) .cat-icon { background: var(--orange-soft); color: var(--orange-dark); }
.cat-tile strong { font-family: var(--font-head); font-size: 1.35rem; line-height: 1.15; }
.cat-tile .count { font-size: .82rem; color: #dfe8e2; }

/* ---------- Listing cards ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 760px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
@media (min-width: 1100px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; position: relative; }
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card-media { position: relative; aspect-ratio: 4 / 3; background: #e9eeeb; display: block; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media .no-photo { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #aab5af; }
.card-media .no-photo svg { width: 48px; height: 48px; }
.badge { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; background: var(--orange); color: #fff; }
.badge-green { background: var(--green); }
.badge-gray { background: #8a948f; }
.badge-red { background: var(--red); }
.card-media .badge { position: absolute; top: 10px; left: 10px; }
.card-cat { position: absolute; bottom: 8px; left: 8px; background: rgba(255, 255, 255, .92); color: var(--ink); font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-title { color: var(--ink); font-weight: 700; font-size: .98rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.card-title:hover { color: var(--green); }
.price { color: var(--green); font-weight: 700; font-size: 1.08rem; }
.price small { color: var(--muted); font-weight: 600; font-size: .8rem; }
.card-meta { display: flex; justify-content: space-between; gap: 6px; color: var(--muted); font-size: .8rem; margin-top: auto; padding-top: 6px; }
.card-meta span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.is-top { box-shadow: 0 0 0 2px var(--orange), var(--shadow); }
@media (max-width: 480px) { .card-body { padding: 10px; } .card-title { font-size: .9rem; } .price { font-size: .98rem; } }

.empty { text-align: center; padding: 48px 16px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); color: var(--muted); }
.empty svg { width: 56px; height: 56px; color: #b8c3bd; margin: 0 auto 10px; }

/* ---------- Catalog page ---------- */
.layout { display: grid; gap: 24px; padding: 24px 0 40px; }
@media (min-width: 960px) { .layout { grid-template-columns: 280px 1fr; } }
.panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.panel + .panel { margin-top: 16px; }
.panel h3 { font-size: 1rem; margin-bottom: 12px; }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list a { display: flex; justify-content: space-between; padding: 7px 0; color: var(--ink); border-bottom: 1px dashed var(--line); }
.cat-list a:hover, .cat-list a.is-active { color: var(--green); }
.cat-list a.is-active { font-weight: 700; }
.cat-list ul { list-style: none; padding-left: 14px; margin: 0; }
.filters-toggle { display: inline-flex; }
@media (min-width: 960px) { .filters-toggle { display: none; } .sidebar[hidden] { display: block !important; } }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.toolbar .select { width: auto; padding: 8px 12px; }
.breadcrumbs { font-size: .87rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--green); }
.breadcrumbs span.sep { color: #b8c3bd; }

.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 24px; }
.pagination a, .pagination span { min-width: 40px; height: 40px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: #fff; border: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.pagination a:hover { border-color: var(--green); color: var(--green); }
.pagination .is-current { background: var(--green); border-color: var(--green); color: #fff; }
.pagination .is-disabled { color: #b8c3bd; }

/* ---------- Ad page ---------- */
.ad-layout { display: grid; gap: 24px; padding: 20px 0 40px; }
@media (min-width: 960px) { .ad-layout { grid-template-columns: 1fr 360px; align-items: start; } .ad-side { position: sticky; top: 88px; } }
.gallery-main { position: relative; aspect-ratio: 4 / 3; background: #e9eeeb; border-radius: var(--radius); overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; background: #1c2420; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .9); color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); }
.gallery-nav.prev { left: 10px; } .gallery-nav.next { right: 10px; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.thumbs button { flex: none; width: 84px; height: 64px; border-radius: var(--radius-sm); overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: none; }
.thumbs button.is-active { border-color: var(--orange); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.ad-title { font-size: 1.5rem; margin: 6px 0 8px; }
.ad-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: .87rem; margin-bottom: 16px; }
.ad-meta span { display: inline-flex; gap: 5px; align-items: center; }
.ad-price { font-size: 1.7rem; font-weight: 800; color: var(--green-dark); }
.ad-price small { font-size: 1rem; color: var(--muted); font-weight: 600; }
.specs { display: grid; grid-template-columns: 1fr; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 16px 0; }
@media (min-width: 640px) { .specs { grid-template-columns: 1fr 1fr; } }
.spec { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #fff; }
.spec .icon { color: var(--green); width: 22px; height: 22px; margin-top: 1px; }
.spec dt { color: var(--muted); font-size: .8rem; }
.spec dd { margin: 0; color: var(--ink); font-weight: 600; }
.description { white-space: pre-line; overflow-wrap: anywhere; }

.seller-card h3 { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 14px; }
.seller-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.3rem; flex: none; }
.seller-head strong { display: block; color: var(--ink); }
.seller-lines { list-style: none; padding: 0; margin: 0 0 14px; color: var(--muted); font-size: .9rem; }
.seller-lines li { display: flex; gap: 8px; align-items: center; padding: 4px 0; }

/* Classima-style phone box: number partly hidden, click to reveal, then click to call. */
.phone-reveal { display: flex; gap: 12px; align-items: center; width: 100%; border: 1px dashed #b9d9c2; background: var(--green-soft); border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; text-align: left; color: var(--ink); }
.phone-reveal:hover { border-color: var(--green); }
.phone-reveal .ph-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.phone-reveal .ph-number { display: block; font-size: 1.15rem; font-weight: 800; letter-spacing: .03em; }
.phone-reveal .ph-hint { display: block; font-size: .8rem; color: var(--muted); }
.phone-reveal.is-revealed { border-style: solid; background: #fff; border-color: var(--green); }
.contact-actions { display: grid; gap: 8px; margin-top: 10px; }
.btn-telegram { background: #229ed9; color: #fff; }
.btn-telegram:hover { background: #1b84b8; color: #fff; }

/* Ad page on phones: price + "Call" fixed at the bottom of the screen (wide screens have the sticky seller card) */
.call-bar { display: none; }
@media (max-width: 959px) {
  .call-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: flex; align-items: center; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(24, 37, 31, .08); transition: transform .2s ease; }
  .call-bar.is-away { transform: translateY(115%); }
  .call-bar-info { flex: 1; min-width: 0; line-height: 1.3; }
  .call-bar-info strong { display: block; font-size: 1.05rem; color: var(--green-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .call-bar-info strong small { font-size: .8rem; font-weight: 600; color: var(--muted); }
  .call-bar-info .ph-number { display: block; font-size: .82rem; color: var(--muted); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .call-bar-btn { flex: none; padding: 12px 20px; }
  .call-bar-tg { flex: none; width: 46px; height: 46px; padding: 0; }
  .call-bar-tg .icon { width: 1.4em; height: 1.4em; }
  /* keep the end of the page (footer) clear of the bar */
  body:has(.call-bar) .footer { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
  .call-bar { gap: 6px; padding-left: 12px; padding-right: 12px; }
  .call-bar-btn { padding: 12px 14px; }
}

.status-banner { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 600; }

/* ---------- Account ---------- */
.auth-wrap { max-width: 440px; margin: 40px auto; }
.auth-card { padding: 28px; }
.auth-card h1 { font-size: 1.4rem; text-align: center; }
.auth-card .lead { text-align: center; color: var(--muted); margin-bottom: 22px; }
.test-code { background: var(--orange-soft); border: 1px dashed var(--orange); padding: 10px 14px; border-radius: var(--radius-sm); text-align: center; margin-bottom: 16px; }
.test-code strong { font-size: 1.4rem; letter-spacing: .2em; color: var(--orange-dark); }

.tabs { display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.is-active { color: var(--green-dark); border-bottom-color: var(--green); }
.tabs .count { background: var(--bg); border-radius: 999px; padding: 1px 8px; font-size: .78rem; margin-left: 4px; }

/* My ads: status tabs + "Post an ad". On phones all four statuses show as a 2×2 grid instead of a hidden scroll. */
.my-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.my-bar .tabs { flex: 1 1 480px; min-width: 0; margin-bottom: 0; }
@media (max-width: 560px) {
  .my-bar .tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border-bottom: 0; overflow: visible; }
  .my-bar .tabs a { display: flex; justify-content: center; align-items: center; gap: 4px; padding: 9px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; white-space: normal; text-align: center; }
  .my-bar .tabs a.is-active { border-color: var(--green); background: var(--green-soft); }
  .my-bar > .btn { width: 100%; justify-content: center; }
}
.my-item { display: grid; grid-template-columns: 96px 1fr; gap: 14px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; margin-bottom: 12px; }
@media (min-width: 760px) { .my-item { grid-template-columns: 140px 1fr auto; align-items: center; } }
.my-item .thumb { aspect-ratio: 4 / 3; border-radius: var(--radius-sm); overflow: hidden; background: #e9eeeb; }
.my-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.my-item h3 { font-size: 1rem; margin-bottom: 4px; }
.my-item .stats { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: .82rem; }
.my-item .actions { display: flex; flex-wrap: wrap; gap: 6px; grid-column: 1 / -1; }
@media (min-width: 760px) { .my-item .actions { grid-column: auto; flex-direction: column; align-items: stretch; } }
.my-item.is-highlight { box-shadow: 0 0 0 2px var(--green), var(--shadow); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.photo-grid .ph { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: #e9eeeb; }
.photo-grid .ph img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid .ph label { position: absolute; inset: auto 4px 4px 4px; background: rgba(255, 255, 255, .92); border-radius: 6px; font-size: .75rem; padding: 2px 6px; display: flex; gap: 4px; align-items: center; cursor: pointer; }
.dropzone { border: 2px dashed #cfd8d3; border-radius: var(--radius); padding: 22px; text-align: center; background: #fbfcfb; cursor: pointer; display: block; }
.dropzone:hover { border-color: var(--green); background: var(--green-soft); }
.dropzone input { display: none; }
.form-section { margin-bottom: 18px; }
.form-section h2 { font-size: 1.1rem; display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.form-section h2 .num { width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; }

/* ---------- Content pages ---------- */
.prose { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; max-width: 880px; }
.prose h2 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }
.page-head { background: var(--band); border-bottom: 1px solid var(--line); padding: 30px 0; }
.page-head h1 { margin: 0; }
.page-head .breadcrumbs, .page-head .breadcrumbs a { color: var(--muted); }

/* ---------- Footer ---------- */
.footer { background: var(--band); color: var(--muted); margin-top: 40px; padding: 44px 0 0; font-size: .92rem; border-top: 1px solid var(--line); }
.footer a { color: var(--ink); }
.footer a:hover { color: var(--green); }
.footer-grid { display: grid; gap: 28px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer h4 { color: var(--ink); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 12px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { padding: 4px 0; display: flex; gap: 8px; align-items: center; }
.footer-logo { display: inline-block; margin-bottom: 12px; }
.footer-logo svg, .footer-logo img { height: 40px; width: auto; }
.footer-bottom { border-top: 1px solid var(--line); margin-top: 30px; padding: 16px 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; font-size: .84rem; }
.digital-note { display: flex; gap: 10px; align-items: flex-start; background: var(--green-soft); color: var(--ink); border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 12px; }
.digital-note .icon { color: var(--orange); margin-top: 2px; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 25, 20, .55); }
.modal-box { background: #fff; border-radius: var(--radius); max-width: 460px; width: 100%; padding: 22px; box-shadow: var(--shadow-hover); max-height: 90vh; overflow: auto; }
.modal-box h3 { display: flex; justify-content: space-between; align-items: center; }
.demo-modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.demo-modal-actions .btn { flex: 1 1 160px; }

/* ---------- Maintenance ---------- */
.maint { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; background: linear-gradient(160deg, var(--green-soft), #fff 60%); }
.maint .logo svg, .maint .logo img { height: 64px; margin: 0 auto 24px; }

/* ---------- optom.tj additions: steps, call to action ---------- */
.steps { display: grid; gap: 16px; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step .step-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.step h3 { font-size: 1.05rem; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: .92rem; margin: 0; }
.cta-band { background: var(--green); color: #e7eee9; border-radius: 22px; padding: 44px 24px; text-align: center; }
.cta-band h2 { color: #fff; font-size: 1.8rem; margin-bottom: 10px; }
.cta-band p { max-width: 560px; margin: 0 auto 22px; }
@media (min-width: 960px) { .cta-band h2 { font-size: 2.3rem; } }
.card { border: 1px solid var(--line); box-shadow: none; }
.card:hover { box-shadow: var(--shadow-hover); }
.card-media .fallback { width: 100%; height: 100%; object-fit: cover; filter: saturate(.85) brightness(.92); }
/* ---------- Category menu (under the header) ---------- */
.catbar { background: #fff; border-bottom: 1px solid var(--line); position: relative; z-index: 40; }
.catbar-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.catbar-list::-webkit-scrollbar { display: none; }
.catbar-item { position: relative; flex: none; }
.catbar-link { display: flex; align-items: center; gap: 8px; padding: 12px 14px; color: var(--ink); font-weight: 600; font-size: .93rem; white-space: nowrap; border-bottom: 3px solid transparent; }
.catbar-link .icon { color: var(--green); width: 20px; height: 20px; }
.catbar-link:hover, .catbar-link.is-active { color: var(--green); border-bottom-color: var(--orange); }
.catbar-drop { display: none; }
@media (min-width: 960px) {
  .catbar-list { overflow: visible; }
  .catbar-drop { position: absolute; top: 100%; left: 0; min-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow-hover); padding: 14px 16px; }
  .catbar-item:hover .catbar-drop, .catbar-item:focus-within .catbar-drop { display: block; }
  .catbar-drop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px 14px; margin-bottom: 10px; }
  .catbar-drop-grid a { color: var(--text); padding: 5px 0; font-size: .92rem; }
  .catbar-drop-grid a:hover, .catbar-drop-grid a.is-active { color: var(--green); }
  .catbar-all { display: inline-block; font-weight: 700; font-size: .9rem; border-top: 1px solid var(--line); padding-top: 8px; width: 100%; }
}

/* Header on small phones: logo, language, account and "post" must fit in 360 px */
@media (max-width: 480px) {
  .header .wrap { gap: 8px; }
  .header-actions { gap: 4px; }
  .hide-sm { display: none; }
  .logo img, .logo svg { height: 40px; }
  .lang-switch a { padding: 5px 8px; }
}
/* City list: a region is a bold option (selects the whole region), its cities are indented below */
.select option.opt-region { font-weight: 700; color: var(--ink); }

/* Header spans the whole window: logo in the left corner, language switch in the right corner */
.header .wrap { max-width: none; padding: 0 24px; }
@media (max-width: 480px) { .header .wrap { padding: 0 12px; } }
/* The smallest phones (320–360 px wide): a tighter header so nothing sticks out to the right */
@media (max-width: 360px) {
  .header .wrap { gap: 4px; padding: 0 8px; }
  .header-actions { gap: 2px; }
  .header .icon-btn { width: 34px; height: 34px; }
  .logo img, .logo svg { height: 32px; }
  .lang-switch a { padding: 5px 6px; }
}

/* Ad form, one step at a time. Fields stop below the fixed header when the page scrolls to them. */
.field, .form-steps { scroll-margin-top: 90px; }
.form-steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 18px; padding: 0; }
.form-steps button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 6px; border: 0; border-bottom: 3px solid var(--line); background: none; color: var(--muted); font: inherit; font-size: .9rem; cursor: pointer; text-align: left; }
.form-steps .num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--line); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 700; }
.form-steps .is-active button { border-color: var(--green); color: var(--ink); font-weight: 700; }
.form-steps .is-done button { border-color: var(--green-soft); }
.form-steps .is-active .num, .form-steps .is-done .num { background: var(--green); color: #fff; }
.form-steps-name { display: none; }
@media (min-width: 640px) { .form-steps-name { display: inline; } }
.step-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }
.step-count { color: var(--muted); font-size: .85rem; margin-left: auto; }
.summary { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* iPhone Safari zooms into any field with text under 16px when it is tapped, and the page stays zoomed */
@media (max-width: 960px) { input, select, textarea { font-size: max(16px, 1em); } }
