/* Adera Marketplace — design system.
   RTL-safe: uses CSS logical properties (margin-inline, inset-inline, text-align:start)
   so one stylesheet serves both LTR (en/am) and RTL (ar). Prices/phone numbers use
   <bdi> in markup to stay LTR inside Arabic text. */

:root {
  --brand: #0e7c66;         /* deep teal-green — trustworthy, distinct from Noor */
  --brand-dark: #0a5c4b;
  --brand-light: #e7f4f0;
  --accent: #f59e0b;        /* amber — featured/promoted highlight */
  --accent-dark: #b45309;
  --accent-light: #fff5e6;
  --danger: #dc2626;
  --success: #16a34a;
  --whatsapp: #25d366;

  --ink: #1a2b28;
  --muted: #64757040;
  --text: #1f2937;
  --text-soft: #6b7280;
  --line: #e5e7eb;
  --bg: #f7f8f7;
  --card: #ffffff;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-md: 0 4px 14px rgba(16, 24, 40, 0.10);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, 0.18);
  --maxw: 1200px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto,
    "Noto Sans Ethiopic", "Noto Sans Arabic", "Noto Sans", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* Arabic + Amharic scripts are taller — give more breathing room. */
html[lang="ar"] body, html[lang="am"] body { line-height: 1.7; }

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

.container { max-width: var(--maxw); margin-inline: auto; padding-inline: 16px; }
.page { padding-block: 24px 64px; }

/* keep numbers/prices/phones LTR inside RTL text */
bdi, .num { unicode-bidi: isolate; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px;
  padding: 10px 18px; font-weight: 600; font-size: 0.95rem;
  transition: transform .05s ease, background .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-accent { background: var(--accent); color: #3a2a05; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }
.btn-outline { background: #fff; border-color: var(--line); color: var(--text); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-whatsapp { background: var(--whatsapp); color: #04350f; }
.btn-ghost { background: transparent; color: var(--text-soft); padding: 8px 12px; }
.btn-block { width: 100%; }
.btn-lg { padding: 13px 26px; font-size: 1.05rem; }
.btn-sm { padding: 7px 13px; font-size: 0.85rem; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: #fff; border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.header-row { display: flex; align-items: center; gap: 14px; height: 62px; }
.logo { display: inline-flex; flex-direction: column; line-height: 1.02; color: var(--brand); letter-spacing: -.5px; }
.logo .logo-main { font-weight: 800; font-size: 1.4rem; }
.logo .er { color: var(--accent); }
.logo .logo-sub { font-size: .6rem; letter-spacing: .26em; text-transform: uppercase; color: var(--brand); font-weight: 800; margin-top: 2px; }
@media (max-width: 380px) { .logo .logo-sub { letter-spacing: .16em; } }
.header-search { flex: 1; display: flex; max-width: 620px; }
.header-search form { display: flex; width: 100%; box-shadow: var(--shadow-sm); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.header-search select { border: 0; border-inline-end: 1px solid var(--line); padding: 0 12px; background: #fafafa; color: var(--text-soft); max-width: 150px; }
.header-search input { border: 0; flex: 1; padding: 11px 16px; outline: none; }
.header-search button { border: 0; background: var(--brand); color: #fff; padding: 0 20px; }
.header-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }

/* On pages that render a hero (the home page), the hero's big search + the home
   category tiles replace the header's compact search and category strip — so hide
   those in the header to avoid a duplicate search box. Deterministic (no JS). */
body:has(.hero) .header-search,
body:has(.hero) .cat-strip { display: none; }

.lang-switch { position: relative; }
.lang-switch button { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; color: var(--text); font-weight: 600; }
.lang-menu { position: absolute; inset-inline-end: 0; top: 110%; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); overflow: hidden; min-width: 160px; z-index: 60; }
.lang-menu button { display: flex; width: 100%; padding: 11px 14px; border: 0; background: #fff; text-align: start; gap: 8px; }
.lang-menu button:hover { background: var(--brand-light); }
.lang-menu button.active { color: var(--brand); font-weight: 700; }

.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-light); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; overflow: hidden; }

/* category strip under header */
.cat-strip { border-top: 1px solid var(--line); background: #fff; }
.cat-strip .container { display: flex; gap: 6px; overflow-x: auto; padding-block: 8px; scrollbar-width: none; }
.cat-strip .container::-webkit-scrollbar { display: none; }
.cat-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: #f2f4f3; color: var(--text); font-weight: 600; font-size: .9rem; white-space: nowrap; }
.cat-chip:hover { background: var(--brand-light); color: var(--brand); }

/* ---------------- Hero ---------------- */
.hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff; border-radius: 0 0 28px 28px;
  padding-block: 40px 48px;
}
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.6rem); margin: 0 0 8px; font-weight: 800; }
.hero p { font-size: 1.05rem; opacity: .92; margin: 0 0 22px; max-width: 620px; }
.hero .btn-accent { box-shadow: var(--shadow-md); }
.hero-search { margin-top: 22px; background: #fff; border-radius: 16px; padding: 8px; display: flex; gap: 8px; box-shadow: var(--shadow-lg); flex-wrap: wrap; }
.hero-search select, .hero-search input { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; color: var(--text); }
.hero-search input { flex: 1; min-width: 180px; }

/* ---------------- Section ---------------- */
.section { margin-top: 34px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-head h2 { font-size: 1.3rem; margin: 0; display: flex; align-items: center; gap: 8px; }
.section-head a { color: var(--brand); font-weight: 600; font-size: .92rem; }

/* category tiles */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.cat-tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 10px; text-align: center; transition: box-shadow .15s, transform .1s; }
.cat-tile:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.cat-tile .ic { font-size: 1.8rem; }
.cat-tile .nm { font-weight: 600; font-size: .9rem; margin-top: 6px; display: block; }

/* ---------------- Listing grid + card ---------------- */
.listings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }

.lcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s ease, transform .1s ease; position: relative; }
.lcard:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.lcard.featured { border-color: #f4d290; box-shadow: 0 0 0 1px #f4d290, var(--shadow-sm); }
.lcard-media { position: relative; aspect-ratio: 4 / 3; background: #eef1f0; }
.lcard-media img { width: 100%; height: 100%; object-fit: cover; }
.lcard-media .noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #b7c1bd; font-size: 2rem; }
.lcard-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.lcard-price { font-size: 1.15rem; font-weight: 800; color: var(--ink); }
.lcard-price .per { font-size: .8rem; font-weight: 600; color: var(--text-soft); }
.lcard-title { font-size: .92rem; font-weight: 500; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.lcard-specs { display: flex; flex-wrap: wrap; gap: 8px; color: var(--text-soft); font-size: .8rem; }
.lcard-specs span { display: inline-flex; align-items: center; gap: 3px; }
.lcard-foot { display: flex; align-items: center; justify-content: space-between; color: var(--text-soft); font-size: .78rem; margin-top: 2px; }
.lcard-loc { display: inline-flex; align-items: center; gap: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* badges over the photo */
.badges { position: absolute; inset-block-start: 8px; inset-inline-start: 8px; display: flex; gap: 5px; flex-wrap: wrap; }
.badge { font-size: .7rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; letter-spacing: .02em; }
.badge-featured { background: var(--accent); color: #3a2a05; }
.badge-new { background: var(--success); color: #fff; }
.badge-pro { background: #111827; color: #fff; }
.badge-verified { background: #2563eb; color: #fff; }
.badge-broker { background: var(--brand); color: #fff; }
.badge-sold { background: #374151; color: #fff; }
.badge-deadline { background: #fff7ed; color: #b45309; border: 1px solid #fed7aa; }
.photo-count { position: absolute; inset-block-end: 8px; inset-inline-start: 8px; background: rgba(0,0,0,.6); color:#fff; font-size:.72rem; padding: 2px 8px; border-radius: 999px; }
.save-heart { position: absolute; inset-block-start: 8px; inset-inline-end: 8px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.92); border: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; box-shadow: var(--shadow-sm); }
.save-heart.on { color: var(--danger); }

/* SOLD stamp */
.sold-stamp { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; background: rgba(20,20,20,.35); }
.sold-stamp span { border: 3px solid #fff; color:#fff; font-weight: 800; padding: 4px 14px; transform: rotate(-12deg); border-radius: 6px; letter-spacing: .08em; }

/* ---------------- Browse layout (filters + grid) ---------------- */
.browse { display: grid; grid-template-columns: 250px 1fr; gap: 22px; align-items: start; }
.filters { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; position: sticky; top: 78px; }
.filters h3 { margin: 0 0 12px; font-size: 1.05rem; }
.filter-group { margin-bottom: 16px; }
.filter-group > label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; color: var(--text); }
.filter-group select, .filter-group input { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; background: #fff; }
.range-row { display: flex; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-light); color: var(--brand-dark); border-radius: 999px; padding: 5px 11px; font-size: .82rem; font-weight: 600; }
.chip button { border: 0; background: transparent; color: inherit; font-size: 1rem; line-height: 1; }

.browse-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.browse-head .count { color: var(--text-soft); font-size: .9rem; }
.browse-head select { border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; background: #fff; }
.mobile-filter-btn { display: none; }

/* ---------------- Detail ---------------- */
.detail { display: grid; grid-template-columns: 1fr 340px; gap: 26px; align-items: start; }
.gallery-main { position: relative; aspect-ratio: 16/10; background: #eef1f0; border-radius: var(--radius); overflow: hidden; cursor: zoom-in; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 8px; }
.gallery-thumbs button { border: 2px solid transparent; border-radius: 9px; overflow: hidden; aspect-ratio: 1; padding: 0; background: #eef1f0; }
.gallery-thumbs button.active { border-color: var(--brand); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.detail-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.spec-table { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.spec-table .cell { background: #fff; padding: 10px 12px; }
.spec-table .k { color: var(--text-soft); font-size: .8rem; }
.spec-table .v { font-weight: 600; }

.contact-box { position: sticky; top: 78px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.price-lg { font-size: 1.8rem; font-weight: 800; color: var(--ink); }
.seller-row { display: flex; align-items: center; gap: 10px; margin: 14px 0; padding-block: 14px; border-block: 1px solid var(--line); }
.safety { background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 12px 14px; font-size: .85rem; color: #78500a; margin-top: 14px; }
.safety b { display: block; margin-bottom: 6px; color: #92400e; }
.safety ul { margin: 0; padding-inline-start: 18px; }

/* ---------------- Modal / popup ---------------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 100; animation: fade .15s ease; }
.modal { background: #fff; border-radius: 18px; max-width: 440px; width: 100%; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .18s ease; }
.modal.wide { max-width: 560px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 1.15rem; }
.modal-head button { border: 0; background: transparent; font-size: 1.4rem; color: var(--text-soft); line-height: 1; }
.modal-body { padding: 18px; }
.modal-body label { display: block; font-weight: 600; font-size: .85rem; margin: 12px 0 5px; }
.modal-body input, .modal-body select, .modal-body textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }

.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 120; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.lightbox img { max-width: 92vw; max-height: 82vh; object-fit: contain; }
.lightbox .lb-nav { position: absolute; inset-block: 0; display: flex; align-items: center; padding: 0 16px; color: #fff; font-size: 2.4rem; background: transparent; border: 0; }
.lightbox .lb-prev { inset-inline-start: 0; }
.lightbox .lb-next { inset-inline-end: 0; }
.lightbox .lb-close { position: absolute; inset-block-start: 16px; inset-inline-end: 20px; color: #fff; background: transparent; border: 0; font-size: 2rem; }
.lightbox .lb-count { position: absolute; inset-block-end: 20px; color: #fff; opacity: .8; }

@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98) } to { opacity: 1; transform: none } }

/* ---------------- Forms (sell / auth) ---------------- */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; max-width: 720px; margin-inline: auto; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field .hint { color: var(--text-soft); font-size: .8rem; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; background: #fff; }
.field textarea { min-height: 120px; resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.attr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.photo-drop { border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; color: var(--text-soft); background: #fafbfb; }
.photo-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px,1fr)); gap: 8px; margin-top: 10px; }
.photo-previews .pv { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.photo-previews .pv img { width: 100%; height: 100%; object-fit: cover; }
.photo-previews .pv button { position: absolute; inset-block-start: 3px; inset-inline-end: 3px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; border: 0; }
.photo-previews .pv .cover-tag { position: absolute; inset-block-end: 0; inset-inline-start: 0; background: var(--brand); color: #fff; font-size: .65rem; padding: 1px 6px; }

/* ---------------- Tables (admin/dashboard) ---------------- */
.tbl { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tbl th, .tbl td { padding: 11px 13px; text-align: start; border-bottom: 1px solid var(--line); font-size: .9rem; }
.tbl th { background: #fafbfb; font-weight: 600; color: var(--text-soft); }
.tbl tr:last-child td { border-bottom: 0; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.tag-active { background: #dcfce7; color: #166534; }
.tag-sold { background: #e5e7eb; color: #374151; }
.tag-pending { background: #fef3c7; color: #92400e; }
.tag-rejected { background: #fee2e2; color: #991b1b; }
.tag-pro { background: #111827; color: #fff; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 10px 16px; font-weight: 600; color: var(--text-soft); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }

/* Pro plans */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 16px; }
.plan { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.plan.hot { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan .price { font-size: 1.7rem; font-weight: 800; margin: 8px 0; }
.plan ul { list-style: none; padding: 0; margin: 14px 0; }
.plan li { padding: 6px 0; display: flex; gap: 8px; font-size: .9rem; }
.plan li::before { content: "✓"; color: var(--success); font-weight: 800; }

/* ---------------- Footer ---------------- */
.site-footer { margin-top: 60px; background: #10241f; color: #cfe0da; padding-block: 34px 26px; }
.site-footer a { color: #cfe0da; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; }
.footer-grid h4 { color: #fff; margin: 0 0 10px; font-size: .95rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: .88rem; }
.footer-bottom { border-top: 1px solid #23453c; margin-top: 24px; padding-top: 16px; font-size: .82rem; opacity: .8; }

.empty { text-align: center; padding: 60px 20px; color: var(--text-soft); }
.empty .ic { font-size: 3rem; }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .browse { grid-template-columns: 1fr; }
  .filters { display: none; }
  .filters.open { display: block; position: fixed; inset: 0; z-index: 90; border-radius: 0; overflow-y: auto; top: 0; }
  .mobile-filter-btn { display: inline-flex; }
  .detail { grid-template-columns: 1fr; }
  .contact-box { position: static; }
}
@media (max-width: 640px) {
  .header-search { display: none; }
  .grid-2, .attr-grid, .spec-table { grid-template-columns: 1fr; }
  .listings-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 10px; }
  .mobile-contact-bar { position: fixed; inset-inline: 0; inset-block-end: 0; background: #fff; border-top: 1px solid var(--line); display: flex; gap: 8px; padding: 10px 12px; z-index: 70; box-shadow: 0 -4px 14px rgba(0,0,0,.08); }
}
.mobile-contact-bar { display: none; }

/* ---------------- Django additions ---------------- */
.skip-link { position: absolute; inset-inline-start: -999px; top: 0; background: var(--brand); color: #fff; padding: 8px 14px; z-index: 200; }
.skip-link:focus { inset-inline-start: 8px; }
.flashes { margin-bottom: 16px; display: grid; gap: 8px; }
.flash { padding: 11px 14px; border-radius: 10px; background: var(--brand-light); color: var(--brand-dark); border: 1px solid #bfe3d9; }
.flash.error { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.flash.success { background: #dcfce7; color: #166534; border-color: #86efac; }

/* <details>-based dropdown menus (no JS) */
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu[open] > .menu-pop { display: block; }
.menu-pop { display: none; position: absolute; inset-inline-end: 0; top: 112%; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); overflow: hidden; min-width: 180px; z-index: 60; }
.menu-pop a, .menu-pop button { display: flex; width: 100%; padding: 11px 14px; border: 0; background: #fff; text-align: start; gap: 8px; color: var(--text); font-weight: 600; font-size: .92rem; align-items: center; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--brand-light); color: var(--brand); }
.menu-pop a.active { color: var(--brand); }

/* modal via :target or details for report */
.hidden { display: none; }

/* ---------------- PWA / mobile refinements ---------------- */
#ad-install { white-space: nowrap; }
@media (max-width: 480px) {
  .hide-xs { display: none !important; }
  .header-row { gap: 6px; height: 56px; }
  .header-actions { gap: 6px; }
  .btn-sm { padding: 7px 11px; }
  .logo .logo-main { font-size: 1.2rem; }
  .container { padding-inline: 12px; }
  .hero { padding-block: 28px 32px; border-radius: 0 0 20px 20px; }
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
}
/* Respect the iPhone safe area on the fixed bottom contact bar. */
.mobile-contact-bar { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
/* When launched as an installed app, pad for the status bar / notch. */
@media (display-mode: standalone) {
  .site-header { padding-top: env(safe-area-inset-top, 0px); }
  body { overscroll-behavior-y: contain; }
}

/* ---------------- Mobile bottom navigation ---------------- */
.unread-pill{display:inline-flex;align-items:center;justify-content:center;background:var(--danger);color:#fff;
  font-size:.68rem;font-weight:800;min-width:17px;height:17px;border-radius:999px;padding:0 5px;margin-inline-start:4px}
.bottom-nav{display:none}
@media(max-width:860px){
  .bottom-nav{display:flex;position:fixed;inset-inline:0;bottom:0;z-index:70;background:#fff;
    border-top:1px solid var(--line);box-shadow:0 -2px 14px rgba(0,0,0,.07);
    padding-bottom:env(safe-area-inset-bottom,0px)}
  .bottom-nav a{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;padding:7px 0 6px;
    color:var(--text-soft);font-weight:600;position:relative}
  .bottom-nav a:hover{text-decoration:none}
  .bottom-nav a span{font-size:1.2rem;line-height:1}
  .bottom-nav a small{font-size:.6rem}
  .bottom-nav a.on{color:var(--brand)}
  .bottom-nav .bn-post span{background:var(--accent);color:#3a2a05;width:38px;height:38px;border-radius:50%;
    display:flex;align-items:center;justify-content:center;margin-top:-16px;box-shadow:var(--shadow-md);font-size:1.5rem;font-weight:700}
  .bottom-nav .bn-badge i{position:absolute;top:1px;inset-inline-end:24%;background:var(--danger);color:#fff;
    font-size:.58rem;font-weight:800;min-width:15px;height:15px;border-radius:999px;display:flex;align-items:center;justify-content:center;padding:0 3px;font-style:normal}
  body{padding-bottom:60px}
  .mobile-contact-bar{bottom:calc(58px + env(safe-area-inset-bottom,0px))}
}

/* ---------------- Compare ---------------- */
.cmp-btn { position: absolute; inset-block-end: 8px; inset-inline-end: 8px; width: 30px; height: 30px;
  border-radius: 8px; background: rgba(255,255,255,.92); border: 0; font-size: 1rem; box-shadow: var(--shadow-sm);
  color: var(--text-soft); display: flex; align-items: center; justify-content: center; z-index: 2; }
.cmp-btn:hover { color: var(--brand); }
.cmp-btn.on { background: var(--brand); color: #fff; }
.compare-bar { position: fixed; inset-inline: 0; bottom: 0; z-index: 65; background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(0,0,0,.1); display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.compare-bar .cmp-label { font-weight: 700; white-space: nowrap; }
.compare-bar .cmp-items { display: flex; gap: 8px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.compare-bar .cmp-items::-webkit-scrollbar { display: none; }
.compare-bar .cmp-thumb { position: relative; width: 46px; height: 46px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line); flex: 0 0 auto; background: #eef1f0; }
.compare-bar .cmp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.compare-bar .cmp-thumb .rm { position: absolute; inset-block-start: 0; inset-inline-end: 0; background: rgba(0,0,0,.6);
  color: #fff; border: 0; width: 17px; height: 17px; font-size: .72rem; line-height: 1; border-radius: 0 0 0 7px; }
@media (max-width: 860px) { .compare-bar { bottom: calc(58px + env(safe-area-inset-bottom, 0px)); } }
