/* Bazar Odessa — light, dense classifieds layout (OLX-style structure, own implementation).
   Palette: ink #002f34, accent teal #0f766e (AA on white), muted #4a5f63. System fonts only. */
:root { --ink:#002f34; --teal:#0f766e; --teal-d:#0b5c56; --bg:#f2f4f5; --line:#dfe5e7; --muted:#4a5f63; --text:#1f2a2c; --danger:#c62828; --shadow:0 2px 10px rgba(0,47,52,.12); }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--text); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
img { max-width: 100%; }
a { color: var(--teal-d); }
h1, h2, h3 { color: var(--ink); margin: 0; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; width: 100%; }
.main, .container { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 20px 16px 56px; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

/* ---------- buttons ---------- */
.btn-primary, .btn-submit, .inline-btn { display: inline-block; background: var(--teal); color: #fff; border: 0; border-radius: 8px; padding: 12px 20px; font: 600 15px/1.2 inherit; font-family: inherit; text-decoration: none; cursor: pointer; text-align: center; }
.btn-primary:hover, .btn-submit:hover, .inline-btn:hover { background: var(--teal-d); color: #fff; }
.btn-secondary { display: inline-block; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 8px; padding: 9px 16px; font: 600 14px/1.2 inherit; font-family: inherit; cursor: pointer; text-decoration: none; }
.btn-secondary:hover { background: #e6f2f0; }

/* ---------- header ---------- */
.bz-header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--line); }
.bz-top { padding: 10px 0; }
.bz-inner { display: flex; align-items: center; gap: 16px; }
.bz-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: 0 0 auto; }
.bz-mark { display: block; border-radius: 8px; }
.bz-name { font-size: 21px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.header-search { flex: 1 1 auto; display: flex; min-width: 0; }
.header-search-input { flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 14px; border: 2px solid var(--ink); border-right: 0; border-radius: 8px 0 0 8px; font: 16px/1 inherit; font-family: inherit; color: var(--text); background: #fff; }
.header-search-input:focus-visible { outline-offset: 0; }
.header-search-btn { height: 44px; padding: 0 22px; border: 2px solid var(--teal); background: var(--teal); color: #fff; font: 600 15px/1 inherit; font-family: inherit; border-radius: 0 8px 8px 0; cursor: pointer; }
.header-search-btn:hover { background: var(--teal-d); border-color: var(--teal-d); }
.bz-nav { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.bz-link { display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; border-radius: 8px; white-space: nowrap; }
.bz-link:hover { background: #e6f2f0; }
.bz-heart { font-size: 18px; line-height: 1; }
.bz-badge { align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--teal); color: #fff; font-size: 12px; font-weight: 700; }
.bz-add { display: inline-block; margin-left: 6px; padding: 11px 18px; background: var(--teal); color: #fff; font-weight: 700; font-size: 15px; border-radius: 8px; text-decoration: none; white-space: nowrap; }
.bz-add:hover { background: var(--teal-d); }
.bz-burger { display: none; background: none; border: 0; padding: 10px; cursor: pointer; margin-left: auto; }
.bz-burger span { display: block; width: 24px; height: 3px; background: var(--ink); margin: 4px 0; border-radius: 2px; transition: transform .2s, opacity .2s; }
.bz-burger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.bz-burger.active span:nth-child(2) { opacity: 0; }
.bz-burger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.cat-strip { background: #fff; border-top: 1px solid var(--line); }
.cat-strip-inner { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.cat-strip-inner::-webkit-scrollbar { display: none; }
.cat-link { flex: 0 0 auto; padding: 10px 12px 8px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.cat-link:hover { background: #f2f7f6; }
.cat-link.active { color: var(--teal-d); border-bottom-color: var(--teal); }
.cat-n { margin-left: 6px; color: var(--muted); font-weight: 500; font-size: 12px; }

/* ---------- page head / filters ---------- */
.page-head { margin-bottom: 14px; }
.page-head h1, .page-title { font-size: 26px; line-height: 1.2; font-weight: 800; color: var(--ink); }
.page-sub { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.breadcrumbs a { color: var(--teal-d); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; }
.filters-toggle { display: none; }
.filter-group { display: flex; align-items: center; gap: 8px; }
.filter-label { font-size: 14px; color: var(--muted); font-weight: 600; }
.filter-input, .sort-select { height: 38px; padding: 0 10px; border: 1px solid #98aaad; border-radius: 6px; background: #fff; color: var(--text); font: 15px/1 inherit; font-family: inherit; }
.filter-input { width: 96px; }
.filter-dash { color: var(--muted); }
.filter-reset { font-size: 14px; }
.view-toggle { margin-left: auto; display: inline-flex; border: 1px solid #98aaad; border-radius: 8px; overflow: hidden; }
.view-btn { padding: 8px 14px; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; background: #fff; }
.view-btn + .view-btn { border-left: 1px solid #98aaad; }
.view-btn.active { background: var(--ink); color: #fff; }
.result-note { color: var(--muted); font-size: 14px; }

/* ---------- listing cards ---------- */
/* Class names are bz-* on purpose: EasyList hides .ad-card, .ad-grid, .ad-main,
   .ad-side and .ad-title, which made listings invisible with uBlock/AdBlock.
   Do not rename these back to ad-*. */
.bz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.bz-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; transition: box-shadow .15s, border-color .15s; }
.bz-card:hover { border-color: #9db8bb; box-shadow: var(--shadow); }
.bz-card-link { display: block; color: inherit; text-decoration: none; }
.bz-card-media { position: relative; aspect-ratio: 4 / 3; background: #e6ecec; overflow: hidden; }
.bz-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bz-card-noimg { display: flex; height: 100%; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }
.bz-card-badge { position: absolute; left: 8px; top: 8px; background: #b45309; color: #fff; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 4px; }
.bz-card-count { position: absolute; right: 8px; bottom: 8px; background: rgba(0,32,36,.82); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 4px; }
.bz-card-body { padding: 10px 12px 12px; }
.bz-card-title { font-size: 15px; font-weight: 500; line-height: 1.3; color: var(--ink); margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.bz-card-link:hover .bz-card-title { text-decoration: underline; }
.bz-card-price { font-size: 19px; font-weight: 800; color: var(--ink); }
.bz-card-snippet { display: none; margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.bz-card-meta { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.fav-heart { position: absolute; top: 8px; right: 8px; z-index: 3; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.94); color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.fav-heart:hover, .fav-heart.active { color: var(--danger); }
.is-list { grid-template-columns: 1fr; gap: 10px; }
.is-list .bz-card-link { display: grid; grid-template-columns: 240px 1fr; }
.is-list .bz-card-media { aspect-ratio: 4 / 3; align-self: start; }
.is-list .bz-card-body { padding: 14px 18px; display: flex; flex-direction: column; }
.is-list .bz-card-title { -webkit-line-clamp: 1; min-height: 0; font-size: 17px; }
.is-list .bz-card-snippet { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.is-list .bz-card-meta { margin-top: auto; padding-top: 8px; }

.empty-message { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 36px 20px; text-align: center; color: var(--muted); }
.empty-message p { margin: 0 0 12px; }
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 22px 0 8px; }
.page-link { padding: 8px 14px; border: 1px solid #98aaad; border-radius: 8px; background: #fff; text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 600; }
.page-link.current { background: var(--ink); border-color: var(--ink); color: #fff; }

.seo-intro { margin-top: 36px; padding: 20px 22px; background: #fff; border: 1px solid var(--line); border-radius: 10px; max-width: 940px; }
.seo-intro h2 { font-size: 19px; margin-bottom: 8px; }
.seo-intro h3 { font-size: 16px; margin: 16px 0 6px; }
.seo-intro p { color: var(--muted); line-height: 1.6; font-size: 15px; margin: 0 0 8px; }
.seo-intro details { border-top: 1px solid var(--line); padding: 8px 0; }
.seo-intro summary { cursor: pointer; font-weight: 600; color: var(--ink); }

/* ---------- ad page ---------- */
.bz-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.bz-gallery .bz-main { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; justify-content: center; align-items: center; min-height: 240px; }
.bz-main img { display: block; max-width: 100%; height: auto; max-height: 620px; object-fit: contain; }
.bz-thumbs { list-style: none; display: flex; gap: 8px; margin: 10px 0 0; padding: 0; flex-wrap: wrap; }
.bz-thumb { display: block; width: 76px; height: 76px; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: #e6ecec; }
.bz-thumb.active { border-color: var(--teal); }
.bz-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bz-side { position: sticky; top: 130px; display: grid; gap: 14px; }
.bz-info { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px; display: grid; gap: 12px; }
.bz-facts-top { font-size: 13px; color: var(--muted); }
.bz-listing-title { font-size: 21px; line-height: 1.3; font-weight: 700; }
.bz-price-big { font-size: 30px; font-weight: 800; color: var(--ink); }
.bz-listing-phone { display: block; font-size: 17px; padding: 14px 18px; }
.bz-info .fav-heart-lg { position: static; width: 100%; height: auto; border-radius: 8px; box-shadow: none; background: #fff; color: var(--ink); font-size: 15px; padding: 10px 14px; border: 2px solid var(--ink); }
.bz-info .fav-heart-lg.active { color: var(--danger); border-color: var(--danger); }
.bz-facts { margin: 0; display: grid; gap: 6px; font-size: 14px; }
.bz-facts div { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 6px; }
.bz-facts dt { color: var(--muted); }
.bz-facts dd { margin: 0; font-weight: 600; color: var(--ink); text-align: right; }
.bz-desc-block { margin-top: 18px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.bz-desc-block h2, .related h2 { font-size: 19px; margin-bottom: 10px; }
.bz-desc { white-space: pre-wrap; line-height: 1.65; color: var(--text); overflow-wrap: anywhere; }
.related { margin-top: 28px; }

.delivery-box { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.delivery-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.delivery-title { font-weight: 700; font-size: 16px; color: var(--ink); }
.delivery-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.dl-chip { padding: 3px 10px; border-radius: 999px; background: #e6f2f0; border: 1px solid #9fc6c0; color: var(--teal-d); font-size: 13px; font-weight: 600; }
.dl-order-btn { width: 100%; padding: 11px 18px; border: 0; border-radius: 8px; cursor: pointer; background: var(--ink); color: #fff; font: 600 15px/1.2 inherit; font-family: inherit; }
.dl-order-btn:hover { background: #00464d; }
.order-modal { position: fixed; inset: 0; background: rgba(0,32,36,.6); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.order-modal.active { display: flex; }
.order-modal-box { background: #fff; border-radius: 12px; width: 100%; max-width: 460px; max-height: 92vh; overflow: auto; padding: 20px; }
.order-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.order-modal-head b { font-size: 18px; color: var(--ink); }
.order-modal-close { background: none; border: 0; color: var(--muted); font-size: 28px; cursor: pointer; line-height: 1; }
.order-form label { display: block; color: var(--text); font-size: 13px; margin: 10px 0 4px; font-weight: 600; }
.order-form input, .order-form select { width: 100%; padding: 10px 12px; border-radius: 6px; border: 1px solid #98aaad; background: #fff; color: var(--text); font: 15px/1.2 inherit; font-family: inherit; }
.order-form .dlc-go { width: 100%; margin-top: 14px; }
.dlc-est { color: var(--teal-d); font-size: 14px; }
.dl-sent { color: #14693a; font-weight: 700; margin-top: 8px; }
.dlc-note, .hint-note { font-size: 13px; color: var(--muted); }

/* ---------- footer ---------- */
.bz-footer { background: var(--ink); color: #cfe3e5; margin-top: auto; padding: 30px 0 34px; font-size: 14px; }
.bz-footer-inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.bz-fcol { display: flex; flex-direction: column; gap: 2px; }
.bz-fcol strong { color: #fff; font-size: 15px; margin-bottom: 6px; }
.bz-fcol a { color: #a8e6dd; text-decoration: none; padding: 5px 0; }
.bz-fcol a:hover { text-decoration: underline; }
.bz-phone { color: #fff !important; font-weight: 700; font-size: 16px; }

.page-narrow { max-width: 640px; text-align: center; padding-top: 60px; }
.lead { color: var(--muted); margin: 10px 0 20px; }

/* ---------- static pages: add / account / favorites ---------- */
.container:has(.add-form) .page-title { max-width: 560px; margin: 0 auto 14px; }
.fav-card-price { color: var(--ink); }
.fav-card-cat, .card-category { background: #e6f2f0; color: var(--teal-d); }
input[type=file] { font-family: inherit; }
input[type=file]::file-selector-button { background: #e6f2f0; color: var(--ink); border: 1px solid #98aaad; border-radius: 6px; padding: 7px 12px; margin-right: 10px; font: 600 14px inherit; font-family: inherit; cursor: pointer; }
.notice { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 20px; max-width: 520px; margin: 14px auto; text-align: center; box-shadow: none; }
.add-form, .auth-form { background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: none; }
.form-group label { color: var(--ink); font-weight: 600; }
.form-group input, .form-group select, .form-group textarea, .search-input { border: 1px solid #98aaad; border-radius: 6px; font-family: inherit; color: var(--text); background: #fff; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15,118,110,.2); outline: 0; }
.required { color: var(--danger); }
.btn-logout, .btn-delete-group { background: var(--danger); color: #fff; }
.dlc { color: var(--text); background: #fff; border: 1px solid #98aaad; }
.dlc:hover { border-color: var(--teal); }
.error-message { color: var(--danger); }
.success-message { color: #14693a; }
.back-link { color: var(--teal-d); }

@media (max-width: 1100px) {
  .bz-layout { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 860px) {
  .bz-layout { grid-template-columns: 1fr; }
  .bz-side { position: static; }
}
@media (max-width: 760px) {
  .bz-header { position: sticky; }
  .bz-top { padding: 8px 0; }
  .bz-inner { flex-wrap: wrap; gap: 8px 12px; }
  .bz-name { font-size: 19px; }
  .header-search { order: 3; flex: 1 0 100%; }
  .bz-burger { display: block; order: 2; }
  .bz-nav { display: none; order: 4; flex: 1 0 100%; flex-direction: column; align-items: stretch; gap: 2px; padding: 6px 0 4px; border-top: 1px solid var(--line); }
  .bz-nav.active { display: flex; }
  .bz-link { padding: 12px; }
  .bz-add { margin: 4px 0 0; text-align: center; padding: 13px 18px; }
  .main, .container { padding: 14px 12px 48px; }
  .page-head h1, .page-title { font-size: 22px; }
  .bz-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .bz-card-price { font-size: 17px; }
  .bz-card-title { font-size: 14px; }
  .filters { gap: 10px 12px; padding: 10px; }
  .filters-toggle { display: inline-block; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 8px; padding: 9px 14px; font: 600 14px/1.2 inherit; font-family: inherit; cursor: pointer; }
  .filters:not(.open) .filter-group, .filters:not(.open) .btn-secondary, .filters:not(.open) .filter-reset { display: none; }
  .view-toggle { margin-left: auto; }
  .filter-group { flex-wrap: wrap; }
  .bz-grid.is-list { grid-template-columns: 1fr; }
  .is-list .bz-card-link { grid-template-columns: 132px 1fr; }
  .is-list .bz-card-body { padding-right: 44px; }
  .is-list .bz-card-title { font-size: 15px; -webkit-line-clamp: 2; min-height: 0; }
  .is-list .bz-card-body { padding: 10px 12px; }
  .is-list .bz-card-snippet { display: none; }
  .bz-price-big { font-size: 26px; }
  .bz-main img { max-height: 480px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.btn-save-ad, .done-btn { background: var(--teal); color: #fff; }
.btn-save-ad:hover, .done-btn:hover { background: var(--teal-d); }
.container { min-height: 65vh; }
