/* ==========================================================================
   سيريابست — stylesheet
   Identity: the SyriaBest mark (Syria silhouette + magnifying glass) in its own lime green,
   on a Damascene ablaq (alternating dark/light stone courses) structure. Brass = premium only.
   ========================================================================== */

:root {
  --basalt: #1c1c19;
  --basalt-deep: #101110;
  --basalt-soft: #3d3d38;
  --muted: #66665c;
  --line: #e5e5df;
  --line-strong: #cfcfc5;
  --bg: #f5f5f0;
  --surface: #ffffff;
  --limestone: #eeeee7;

  /* SyriaBest green — sampled straight from the logo (#7cb82f), scaled down to --green-700
     for AA contrast under white button/link text; --green-500 (#7CB82F) is the brand colour,
     reserved for the mark itself, icon fills and badges. */
  --green-950: #21310b;
  --green-900: #314913;
  --green-800: #426119;
  --green-700: #527a1f;
  --green-600: #699a28;
  --green-500: #7cb82f;
  --green-100: #e9f4dc;
  --green-50: #f6faf2;

  /* The magnifying-glass lens teal from the logo — reserved for the mark itself. */
  --teal: #4d8a1f;
  --teal-light: #a9d66a;

  --brass: #d9a21b;
  --brass-100: #fbf0d0;
  --brass-50: #fdf8e8;
  --brass-ink: #5f4300;

  --star: #c4322b;
  --star-100: #fbe6e4;
  --whatsapp: #1c9c4f;

  --radius-s: 8px;
  --radius: 12px;
  --radius-l: 20px;
  --shadow-pop: 0 12px 32px rgba(28, 28, 25, 0.18);
  --shadow-card: 0 6px 18px rgba(28, 28, 25, 0.09);

  --font-body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, "Noto Sans Arabic", system-ui, sans-serif;
  --font-display: "Reem Kufi", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;

  /* A sparse scatter of small SyriaBest map marks — the tiled backdrop on hero/cta/auth surfaces.
     Native 140×129 (matches the mark's own viewBox — traced from a real governorate map, same
     shape as the header/footer mark, favicon and no-photo placeholder); tile at 140px 129px,
     staggered by half. */
  --map-tile-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='129' viewBox='0 0 140 129'%3E%3Cpath d='M139.2,2.3 105.2,5.8 74,17.5 53.5,11.1 36.3,18.2 19.2,13.1 19.8,28.6 13.5,28.9 9.1,39.2 1.5,38.6 0,45.5 5.1,69.4 12.6,68.9 18.2,80.6 13.2,90.6 4.8,93.4 1.1,117.7 22.9,128.5 109.8,76.2 118.5,44.5 116.6,25.7 130.9,16.3Z' fill='none' stroke='%23ffffff' stroke-opacity='.14' stroke-width='2.4'/%3E%3C/svg%3E");
  --map-tile-green: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='129' viewBox='0 0 140 129'%3E%3Cpath d='M139.2,2.3 105.2,5.8 74,17.5 53.5,11.1 36.3,18.2 19.2,13.1 19.8,28.6 13.5,28.9 9.1,39.2 1.5,38.6 0,45.5 5.1,69.4 12.6,68.9 18.2,80.6 13.2,90.6 4.8,93.4 1.1,117.7 22.9,128.5 109.8,76.2 118.5,44.5 116.6,25.7 130.9,16.3Z' fill='none' stroke='%23527a1f' stroke-opacity='.16' stroke-width='2.4'/%3E%3C/svg%3E");
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--basalt);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.35; margin: 0; letter-spacing: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
:focus-visible { outline: 3px solid var(--green-600); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 16px; }
.muted { color: var(--muted); }
.icon { flex-shrink: 0; vertical-align: -0.2em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--basalt); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 12px; }
.page { padding-block: 20px 56px; }
.page--narrow { max-width: 760px; }
.page--medium { max-width: 920px; }
.page-title { margin-bottom: 20px; }
.page-title h1 { font-size: 1.7rem; }
.page-title--row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.page-title__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.balance-pill .icon { fill: var(--brass); color: var(--brass); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 18px;
  border: 1.5px solid transparent; border-radius: 10px;
  font-weight: 600; line-height: 1.2; white-space: nowrap; text-align: center;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn--primary { background: var(--green-700); color: #fff; }
.btn--primary:hover { background: var(--green-800); }
.btn--ghost { background: #fff; border-color: var(--line-strong); color: var(--basalt); }
.btn--ghost:hover { border-color: var(--green-700); color: var(--green-700); }
.btn--light { background: #fff; color: var(--green-900); }
.btn--light:hover { background: var(--green-100); }
.btn--danger { background: #fff; border-color: var(--line-strong); color: var(--star); }
.btn--danger:hover { background: var(--star-100); border-color: var(--star); }
.btn--whatsapp { background: var(--whatsapp); color: #fff; }
.btn--whatsapp:hover { background: #157d3e; }
.btn--brass { background: var(--brass); color: var(--brass-ink); }
.btn--brass:hover { background: #c4901a; }
.btn--brass .icon { fill: currentColor; }
.btn--lg { min-height: 52px; padding-inline: 24px; font-size: 1.05rem; }
.btn--sm { min-height: 36px; padding: 4px 12px; font-size: .88rem; border-radius: 8px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; background: transparent; border-radius: 50%; }
.icon-btn:hover { background: var(--limestone); }
.link { color: var(--green-700); font-weight: 600; }
.link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Ablaq: alternating dark/light stone courses ---------- */
.ablaq {
  height: 20px;
  background: repeating-linear-gradient(180deg, var(--limestone) 0 5px, var(--basalt) 5px 10px);
}

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: #fff; border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 18px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--green-700); flex-shrink: 0; }
.brand__mark { display: block; color: var(--green-500); }
.brand__word { font-family: var(--font-display); font-size: 1.65rem; font-weight: 700; line-height: 1; letter-spacing: 0; padding-top: 4px; }
.brand__a { color: var(--basalt); }
.brand__b { color: var(--green-700); }

.hsearch {
  flex: 1; max-width: 660px; display: flex; align-items: stretch; overflow: hidden;
  background: #fff; border: 1.5px solid var(--line-strong); border-radius: 999px; min-height: 46px;
  transition: border-color .15s, box-shadow .15s;
}
.hsearch:focus-within { border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(124, 184, 47, .16); }
.hsearch select, .hsearch input { border: 0; background: transparent; outline: 0; padding: 0 14px; min-width: 0; }
.hsearch__cat { max-width: 150px; border-inline-end: 1px solid var(--line) !important; color: var(--basalt-soft); font-size: .92rem; cursor: pointer; }
.hsearch input { flex: 1; }
.hsearch__btn { border: 0; background: var(--green-700); color: #fff; width: 52px; display: grid; place-items: center; }
.hsearch__btn:hover { background: var(--green-800); }

.header-actions { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu__btn { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 999px; cursor: pointer; border: 1.5px solid var(--line-strong); background: #fff; }
.menu__btn:hover { border-color: var(--green-700); }
.menu__name { font-weight: 600; font-size: .92rem; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu[open] .menu__chev { transform: rotate(180deg); }
.menu__panel {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 210px; z-index: 60;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: var(--shadow-pop);
}
.menu__panel a, .menu__panel button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none;
  border-radius: 8px; text-align: start; font-size: .95rem;
}
.menu__panel a:hover, .menu__panel button:hover { background: var(--green-50); color: var(--green-700); }
.menu__badge { margin-inline-start: auto; min-width: 20px; height: 20px; padding-inline: 5px; display: inline-grid; place-items: center; border-radius: 10px; background: var(--brass-100); color: var(--brass-ink); font-size: .75rem; font-weight: 700; }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--green-700); color: #fff; font-family: var(--font-display); font-weight: 700; flex-shrink: 0; }
.avatar--lg { width: 52px; height: 52px; font-size: 1.3rem; }

.catnav { border-top: 1px solid var(--line); background: #fff; }
.catnav__row { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.catnav__row::-webkit-scrollbar { display: none; }
.catnav__item {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px; white-space: nowrap;
  font-size: .9rem; color: var(--basalt-soft); border-bottom: 2.5px solid transparent;
}
.catnav__item:hover { color: var(--green-700); }
.catnav__item.is-active { color: var(--green-700); border-bottom-color: var(--green-700); font-weight: 600; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; inset-inline: 0; top: 76px; z-index: 80; display: grid; justify-items: center; gap: 8px; padding-inline: 16px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; max-width: 560px;
  background: var(--basalt); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-pop);
  border-inline-start: 5px solid var(--green-600); animation: toast-in .3s ease-out;
}
.toast--error { border-inline-start-color: var(--star); }
.toast--warning { border-inline-start-color: var(--brass); }
.toast.is-leaving { opacity: 0; transition: opacity .4s; }
.toast__close { border: 0; background: none; color: #fff; opacity: .7; display: grid; place-items: center; padding: 4px; }
.toast__close:hover { opacity: 1; }
@keyframes toast-in { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  /* Umayyad Mosque, Damascus (CC0, Wikimedia Commons — see static/img/CREDITS.md). Text sits on
     the right (RTL start), so the scrim is darkest there and eases off toward the left. */
  background:
    linear-gradient(90deg, rgba(16, 23, 4, .86) 0%, rgba(16, 23, 4, .6) 40%, rgba(16, 23, 4, .32) 65%, rgba(16, 23, 4, .52) 100%),
    linear-gradient(180deg, rgba(16, 23, 4, .1) 30%, rgba(16, 23, 4, .55) 100%),
    url("../img/hero-damascus.da02baf4323f.jpg") center 38% / cover no-repeat,
    var(--green-900);
}
.hero__inner { position: relative; z-index: 1; padding-block: 56px 48px; }
.hero__title { font-size: clamp(2.1rem, 5.2vw, 3.6rem); line-height: 1.2; max-width: 15em; }
.hero__lead { margin-top: 14px; font-size: 1.12rem; color: rgba(255, 255, 255, .86); max-width: 34em; }
.hero-search {
  margin-top: 28px; max-width: 900px; display: flex; gap: 6px; padding: 8px;
  background: #fff; color: var(--basalt); border-radius: 18px; box-shadow: var(--shadow-pop);
}
.hero-search__field { display: flex; align-items: center; gap: 10px; padding: 0 14px; color: var(--muted); min-width: 0; }
.hero-search__field--grow { flex: 1; }
.hero-search__field + .hero-search__field { border-inline-start: 1px solid var(--line); }
.hero-search input, .hero-search select { border: 0; background: transparent; outline: 0; min-width: 0; width: 100%; color: var(--basalt); min-height: 48px; }
.hero-search select { cursor: pointer; }
.hero-search__btn { min-width: 120px; }
.hero__quick { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; font-size: .92rem; color: rgba(255, 255, 255, .78); }
.hero__quick a { padding: 3px 12px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px; color: #fff; transition: background-color .15s; }
.hero__quick a:hover { background: rgba(255, 255, 255, .14); }

/* ---------- Sections ---------- */
.section { padding-block: 34px 8px; }
.section--premium {
  margin-top: 30px; padding-block: 30px 34px;
  background: linear-gradient(180deg, var(--brass-100), var(--brass-50) 60%, transparent);
  border-top: 3px solid var(--brass);
}
.section__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.section__head h2 { font-size: 1.45rem; display: flex; align-items: center; gap: 10px; }
.title-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brass); color: var(--brass-ink); }
.title-icon .icon { fill: currentColor; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; }
.cat-tile {
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "icon name" "icon count"; align-items: center; column-gap: 12px;
  padding: 14px; height: 100%; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.cat-tile:hover { border-color: var(--green-700); box-shadow: var(--shadow-card); }
.cat-tile__icon { grid-area: icon; display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--green-100); color: var(--green-700); transition: background-color .15s, color .15s; }
.cat-tile:hover .cat-tile__icon { background: var(--green-700); color: #fff; }
.cat-tile__name { grid-area: name; font-weight: 600; line-height: 1.3; align-self: end; }
.cat-tile__count { grid-area: count; font-size: .8rem; color: var(--muted); align-self: start; }

/* ---------- Ad cards ---------- */
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; }
.listing-grid--list { grid-template-columns: repeat(auto-fill, minmax(206px, 1fr)); }
.listing-grid--four { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.listing-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; height: 100%; transition: border-color .15s, box-shadow .15s; }
.listing-card:hover { border-color: var(--green-700); box-shadow: var(--shadow-card); }
.listing-card.is-premium { border: 1.5px solid var(--brass); }
.listing-card__link { display: flex; flex-direction: column; height: 100%; }
.listing-card__media { position: relative; aspect-ratio: 4 / 3; background: var(--green-50); overflow: hidden; }
.listing-card__media img { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; inset-block-start: 10px; inset-inline-start: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; line-height: 1.6; }
.badge--premium { background: var(--brass); color: var(--brass-ink); }
.badge--premium .icon { fill: currentColor; }
.badge--sold { background: var(--basalt); color: #fff; inset-block-start: auto; inset-block-end: 10px; }
.listing-card__body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; flex: 1; }
.listing-card__price { font-weight: 700; font-size: 1.1rem; color: var(--green-700); line-height: 1.4; }
.listing-card__price small { font-weight: 500; font-size: .74rem; color: var(--muted); margin-inline-start: 4px; }
.listing-card__title { font-family: var(--font-body); font-weight: 500; font-size: .98rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 3em; }
.listing-card__specs { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 2px; }
.listing-card__specs li { font-size: .78rem; color: var(--basalt-soft); background: var(--limestone); padding: 0 8px; border-radius: 6px; line-height: 1.7; }
.listing-card__meta { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; font-size: .8rem; color: var(--muted); }
.listing-card__meta span { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Empty state / CTA ---------- */
.empty { text-align: center; padding: 48px 20px; background: #fff; border: 1px dashed var(--line-strong); border-radius: 16px; }
.empty h3 { font-size: 1.2rem; margin-bottom: 6px; }
.empty p { color: var(--muted); margin-bottom: 18px; }
.empty__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.empty--page { border: 0; background: transparent; padding-block: 72px; }
.empty__code { font-family: var(--font-display); font-size: 5rem; line-height: 1; color: var(--green-700); margin-bottom: 8px !important; }
.cta-band {
  margin-block: 44px 8px; padding: 30px 32px; border-radius: var(--radius-l); color: #fff;
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
  background: var(--map-tile-light) 0 0 / 140px 129px, var(--map-tile-light) 70px 65px / 140px 129px, var(--green-900);
}
.cta-band h2 { font-size: 1.6rem; }
.cta-band p { margin-top: 4px; color: rgba(255, 255, 255, .84); max-width: 34em; }

/* ---------- Breadcrumb, chips, list layout ---------- */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: .88rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a:hover { color: var(--green-700); text-decoration: underline; }
.breadcrumb [aria-current] { color: var(--basalt); font-weight: 500; }
.list-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.list-head h1 { font-size: 1.7rem; }
.subcats, .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.subcats { margin: 6px 0 18px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border: 1.5px solid var(--line-strong); border-radius: 999px; background: #fff; font-size: .9rem; transition: border-color .15s, background-color .15s; }
.chip:hover { border-color: var(--green-700); }
.chip.is-active { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.chip--removable { background: var(--green-100); border-color: transparent; color: var(--green-900); }
.chip--removable:hover { background: var(--green-700); color: #fff; }
.chips { margin-bottom: 16px; }

.list-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.filters { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; position: sticky; top: 132px; max-height: calc(100vh - 148px); overflow-y: auto; }
.filters__head { display: none; }
.filters__group { font-size: 1rem; margin: 6px 0 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.filters__actions { display: grid; gap: 8px; margin-top: 8px; }
.filters-backdrop { display: none; }
.side-cats-wrap { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.side-cats-wrap summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; font-weight: 700; padding: 6px 2px; }
.side-cats-wrap summary::-webkit-details-marker { display: none; }
.side-cats-wrap summary:hover { color: var(--green-700); }
.side-cats-wrap[open] .side-cats-wrap__chev { transform: rotate(180deg); }
.side-cats { display: grid; gap: 2px; margin-top: 8px; }
.side-cats a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; font-size: .93rem; }
.side-cats a:hover { background: var(--green-50); }
.side-cats a.is-active { background: var(--green-100); color: var(--green-800); font-weight: 600; }
.side-cats__name { display: inline-flex; align-items: center; gap: 8px; }
.side-cats__n { font-size: .78rem; color: var(--muted); font-weight: 400; }
.side-cats__subs { display: grid; gap: 1px; margin: 2px 0 6px; padding-inline-start: 16px; border-inline-start: 2px solid var(--green-100); margin-inline-start: 14px; }
.side-cats__subs a { font-size: .88rem; padding-block: 4px; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.toolbar__sort { display: inline-flex; align-items: center; gap: 8px; margin-inline-start: auto; color: var(--muted); font-size: .9rem; }
.toolbar__sort select { width: auto; min-height: 40px; padding-block: 6px; }
.filter-toggle { display: none; }
.count-dot { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 10px; background: var(--green-700); color: #fff; font-size: .75rem; padding-inline: 5px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 28px; }
.pager__info { color: var(--muted); font-size: .92rem; }

/* ---------- Range / segmented filters ---------- */
.range__row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.range .unit { color: var(--muted); font-weight: 400; }
.seg { display: inline-flex; margin-top: 8px; border: 1.5px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 5px 18px; font-size: .9rem; }
.seg input:checked + span { background: var(--green-700); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--green-600); outline-offset: -3px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.req { color: var(--star); margin-inline-start: 4px; }
.input {
  width: 100%; min-height: 46px; padding: 9px 14px; background: #fff; color: var(--basalt);
  border: 1.5px solid var(--line-strong); border-radius: 10px; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #93a19a; }
.input:focus { outline: 0; border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(124, 184, 47, .18); }
textarea.input { min-height: 150px; resize: vertical; line-height: 1.7; }
.select {
  appearance: none; cursor: pointer; padding-left: 38px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667770' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat left 12px center;
}
input[type="tel"], input[type="email"], input[dir="ltr"] { text-align: right; }
.hint { color: var(--muted); font-size: .85rem; margin-top: 6px; }
.hint ul { list-style: disc; padding-inline-start: 18px; }
.hint li + li { margin-top: 2px; }
.hint--top { margin: -6px 0 14px; }
.error { color: var(--star); font-size: .88rem; font-weight: 500; margin-top: 6px; }
.has-error .input { border-color: var(--star); }
.checkline { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.check { width: 20px; height: 20px; accent-color: var(--green-700); flex-shrink: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.price-row { display: grid; grid-template-columns: 1fr 150px; gap: 0 16px; }
.subhead { font-size: 1rem; margin: 4px 0 12px; padding-top: 14px; border-top: 1px dashed var(--line-strong); }
.attr-block { margin-top: 4px; }

.step { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; margin-bottom: 18px; }
.step__head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.step__head h2 { font-size: 1.15rem; }
.step--premium { border-color: var(--brass-100); background: var(--brass-50); }
.step--premium .step__n { background: var(--brass); color: var(--brass-ink); }
.step--premium .step__n .icon { fill: currentColor; }
.step__n { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--basalt); color: #fff; font-family: var(--font-display); font-weight: 700; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; position: sticky; bottom: 0; padding-block: 12px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent, var(--bg) 30%); }

.dropzone { position: relative; border: 2px dashed var(--line-strong); border-radius: 14px; background: var(--green-50); transition: border-color .15s, background-color .15s; }
.dropzone.is-drag, .dropzone:hover { border-color: var(--green-600); background: var(--green-100); }
.dropzone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone:focus-within { outline: 3px solid var(--green-600); outline-offset: 2px; }
.dropzone__body { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 28px 16px; color: var(--green-700); text-align: center; pointer-events: none; }
.dropzone__body span { color: var(--muted); font-size: .9rem; }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; margin-top: 12px; }
.previews:empty { display: none; }
.preview { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--limestone); }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview__remove { position: absolute; inset-block-start: 6px; inset-inline-start: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(13, 23, 19, .75); color: #fff; font-size: 1.2rem; line-height: 1; display: grid; place-items: center; }
.preview__remove:hover { background: var(--star); }
.preview__cover, .preview__del { position: absolute; inset-inline: 0; bottom: 0; padding: 3px 8px; font-size: .78rem; font-weight: 600; text-align: center; }
.preview__cover { background: var(--green-700); color: #fff; }
.preview__del { background: rgba(255, 255, 255, .93); display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.preview:has(input:checked) img { opacity: .3; }
.previews--existing { margin-top: 0; margin-bottom: 14px; }

.notice { padding: 12px 16px; border-radius: 12px; background: var(--green-100); color: var(--green-900); margin-bottom: 16px; }
.notice--error { background: var(--star-100); color: #7d1d18; }
.notice--error ul { list-style: none; }
.notice--sold { background: var(--limestone); color: var(--basalt); font-weight: 500; }

/* ---------- Auth ---------- */
.page-auth main { background: var(--map-tile-green) 0 0 / 140px 129px, var(--map-tile-green) 70px 65px / 140px 129px; }
.auth { display: grid; place-items: start center; padding: 44px 16px 64px; }
.auth__card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow-card); }
.auth__card--wide { max-width: 520px; }
.auth__card h1 { font-size: 1.6rem; margin-bottom: 6px; }
.auth__card > .muted { margin-bottom: 22px; font-size: .95rem; }

.profile-balance { display: flex; align-items: center; gap: 6px; margin: -10px 0 22px; padding: 10px 14px; border-radius: 10px; background: var(--brass-50); border: 1px solid var(--brass-100); color: var(--brass-ink); font-size: .9rem; }
.profile-balance .icon { fill: currentColor; }
.profile-balance strong { font-weight: 700; }

.balance-tile { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 24px; padding: 18px 20px; border-radius: 14px; background: var(--map-tile-light) 0 0 / 140px 129px, var(--green-900); color: #fff; }
.balance-tile__num { font-family: var(--font-display); font-size: 2.2rem; line-height: 1; }
.balance-tile__label { display: inline-flex; align-items: center; gap: 6px; color: rgba(255, 255, 255, .84); font-size: .92rem; }
.balance-tile__label .icon { fill: var(--brass); color: var(--brass); }
.balance-form { margin-bottom: 26px; }

.balance-hist__title { font-size: 1.02rem; margin: 8px 0 10px; padding-top: 16px; border-top: 1px dashed var(--line-strong); }
.balance-hist { display: grid; gap: 6px; }
.balance-hist li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--limestone); font-size: .88rem; }
.balance-hist__code { font-family: var(--font-body); font-variant-numeric: tabular-nums; direction: ltr; }
.balance-hist__credits { color: var(--green-700); font-weight: 700; }
.balance-hist__date { margin-inline-start: auto; color: var(--muted); }
.auth__alt { margin-top: 18px; text-align: center; color: var(--muted); font-size: .95rem; }
.auth__alt a { color: var(--green-700); font-weight: 600; }
.auth__alt a:hover { text-decoration: underline; }

/* ---------- Ad detail ---------- */
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.detail-side { position: sticky; top: 132px; }
.gallery__main { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--basalt-deep); border-radius: 16px; overflow: hidden; }
.gallery__main img { width: 100%; height: 100%; object-fit: contain; }
.gallery__main .badge { inset-block-start: 14px; inset-inline-start: 14px; }
.gallery__main .badge--sold { inset-block-start: auto; inset-block-end: 14px; }
.gallery__count { position: absolute; inset-block-end: 12px; inset-inline-end: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; background: rgba(13, 23, 19, .72); color: #fff; font-size: .82rem; }
.gallery__thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.gallery__thumb { flex: 0 0 auto; width: 88px; height: 66px; padding: 0; border: 2.5px solid transparent; border-radius: 10px; overflow: hidden; background: var(--limestone); opacity: .8; }
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb:hover { opacity: 1; }
.gallery__thumb.is-active { border-color: var(--green-700); opacity: 1; }
.gallery__empty { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 16px; object-fit: cover; }

.listing-head { margin-block: 22px 8px; }
.listing-head__price { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.listing-head__price strong { font-family: var(--font-display); font-size: 2.1rem; line-height: 1.3; color: var(--green-700); }
.pill { display: inline-block; padding: 2px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600; background: var(--green-100); color: var(--green-800); }
.listing-head__title { font-family: var(--font-body); font-weight: 600; font-size: 1.5rem; line-height: 1.5; margin-top: 2px; }
.listing-head__meta { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 10px; color: var(--muted); font-size: .92rem; }
.listing-head__meta li { display: inline-flex; align-items: center; gap: 6px; }

.block { margin-top: 26px; }
.block h2 { font-size: 1.2rem; margin-bottom: 12px; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.specs > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; background: #fff; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-weight: 600; text-align: end; }
.prose { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; max-width: 72ch; line-height: 1.9; overflow-wrap: anywhere; }
.prose p + p { margin-top: 10px; }
.safety { display: flex; gap: 12px; align-items: flex-start; margin-top: 24px; padding: 14px 16px; border-radius: 12px; background: var(--brass-50); border: 1px solid var(--brass-100); color: var(--brass-ink); font-size: .93rem; }
.safety .icon { margin-top: 3px; }

.seller { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: grid; gap: 16px; }
.seller__who { display: flex; align-items: center; gap: 12px; }
.seller__name { font-weight: 700; font-size: 1.05rem; line-height: 1.4; }
.seller__since { color: var(--muted); font-size: .85rem; }
.seller__actions { display: grid; gap: 10px; }
.seller__actions .btn { direction: rtl; overflow: hidden; }
.seller__tip { color: var(--muted); font-size: .85rem; text-align: center; margin-top: -4px; }
.contact-bar { display: none; }
.owner-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 18px; background: var(--green-100); border-radius: 14px; }
.owner-bar__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.owner-bar__actions form { display: contents; }

.status { display: inline-flex; align-items: center; gap: 4px; padding: 0 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; line-height: 1.8; background: var(--limestone); color: var(--basalt-soft); }
.status--active { background: var(--green-100); color: var(--green-800); }
.status--premium { background: var(--brass-100); color: var(--brass-ink); }
.status--premium .icon { fill: currentColor; }
.status--hidden { background: var(--star-100); color: #7d1d18; }

/* ---------- My ads ---------- */
.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { padding: 10px 16px; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; color: var(--basalt-soft); font-weight: 500; }
.tab span { display: inline-block; margin-inline-start: 6px; min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--limestone); font-size: .78rem; text-align: center; }
.tab:hover { color: var(--green-700); }
.tab.is-active { color: var(--green-700); border-bottom-color: var(--green-700); font-weight: 700; }
.my-listings { display: grid; gap: 12px; }
.my-listing { display: grid; grid-template-columns: 104px 1fr auto; gap: 16px; align-items: center; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.my-listing__thumb { display: block; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; }
.my-listing__thumb img { width: 100%; height: 100%; object-fit: cover; }
.my-listing__title { font-weight: 600; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.my-listing__title:hover { color: var(--green-700); }
.my-listing__price { font-weight: 700; color: var(--green-700); }
.my-listing__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 2px; font-size: .82rem; color: var(--muted); }
.my-listing__meta span { display: inline-flex; align-items: center; gap: 4px; }
.my-listing__actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; max-width: 360px; }
.my-listing__actions form { display: contents; }

/* ---------- All categories ---------- */
.all-cats { columns: 3 280px; column-gap: 20px; }
.all-cats__group { break-inside: avoid; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin-bottom: 20px; }
.all-cats__group h2 a { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; }
.all-cats__group h2 a:hover { color: var(--green-700); }
.all-cats small { margin-inline-start: auto; color: var(--muted); font-family: var(--font-body); font-weight: 400; font-size: .8rem; }
.all-cats__group ul { margin-top: 10px; display: grid; }
.all-cats__group li a { display: flex; align-items: center; padding: 7px 4px; border-top: 1px solid var(--line); font-size: .95rem; }
.all-cats__group li a:hover { color: var(--green-700); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 56px; background: var(--basalt-deep); color: #c5d0c9; }
.site-footer .ablaq { background: repeating-linear-gradient(180deg, var(--basalt-deep) 0 5px, var(--limestone) 5px 10px); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1.4fr; gap: 32px; padding-block: 36px 20px; }
.brand--footer { color: #fff; margin-bottom: 12px; }
.brand--footer .brand__a { color: #fff; }
.brand--footer .brand__b { color: #a9d66a; }
.footer-about p { max-width: 34ch; font-size: .95rem; }
.footer-title { font-family: var(--font-display); color: #fff; font-size: 1.05rem; margin-bottom: 10px; }
.site-footer li { padding-block: 3px; font-size: .93rem; }
.site-footer a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.tips li::before { content: "•"; color: var(--brass); margin-inline-end: 8px; }
.footer-copy { padding-block: 16px 28px; font-size: .85rem; color: #8b9a92; border-top: 1px solid rgba(255, 255, 255, .08); }
.footer-copy.container { margin-inline: auto; }

/* ---------- Mobile bottom nav ---------- */
.bottomnav { display: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1000px) {
  .detail-layout { grid-template-columns: 1fr; }
  .detail-side { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  body { padding-bottom: 78px; }
  body.has-contact-bar { padding-bottom: 92px; }

  .header-row { flex-wrap: wrap; gap: 8px 12px; padding-block: 10px; }
  .hsearch { order: 3; flex: 1 1 100%; max-width: none; }
  .header-cta { display: none; }
  .menu__name, .menu__chev { display: none; }
  .menu__btn { padding: 3px; }
  .toasts { top: 120px; }

  .list-layout { grid-template-columns: 1fr; }
  .filter-toggle { display: inline-flex; }
  .filters {
    position: fixed; z-index: 90; inset-block: 0; right: 0; width: min(92vw, 380px); max-height: none; border-radius: 0;
    transform: translateX(100%); transition: transform .25s ease-out; padding: 0 18px 24px;
  }
  .filters__head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 1; background: #fff; padding: 12px 0; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
  .filters__head h2 { font-size: 1.15rem; }
  .filters-backdrop { position: fixed; inset: 0; z-index: 85; background: rgba(13, 23, 19, .55); opacity: 0; pointer-events: none; transition: opacity .25s; display: block; }
  body.filters-open { overflow: hidden; }
  body.filters-open .filters { transform: none; }
  body.filters-open .filters-backdrop { opacity: 1; pointer-events: auto; }

  .contact-bar {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: fixed; inset-inline: 0; bottom: 0; z-index: 50;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line);
    box-shadow: 0 -6px 18px rgba(21, 34, 29, .08);
  }
  .contact-bar .btn:only-child { grid-column: 1 / -1; }

  .bottomnav {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; position: fixed; inset-inline: 0; bottom: 0; z-index: 50;
    background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 2px 0; font-size: .72rem; color: var(--muted); }
  .bottomnav a.is-active { color: var(--green-700); font-weight: 600; }
  .bottomnav__add span { display: grid; place-items: center; width: 54px; height: 54px; margin-top: -26px; border-radius: 50%; background: var(--green-700); color: #fff; border: 4px solid #fff; box-shadow: var(--shadow-pop); }
  .site-footer { margin-top: 40px; }
}

@media (max-width: 640px) {
  .page { padding-block: 14px 40px; }
  .hero__inner { padding-block: 34px 34px; }
  .hero {
    background:
      linear-gradient(180deg, rgba(16, 23, 4, .55) 0%, rgba(16, 23, 4, .78) 100%),
      url("../img/hero-damascus.da02baf4323f.jpg") center 38% / cover no-repeat,
      var(--green-900);
  }
  .hero-search { flex-wrap: wrap; padding: 8px; border-radius: 16px; }
  .hero-search__field { flex: 1 1 100%; }
  .hero-search__field + .hero-search__field { border-inline-start: 0; border-top: 1px solid var(--line); }
  .hero-search__btn { flex: 1 1 100%; }

  .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .cat-tile { grid-template-columns: 1fr; grid-template-areas: "icon" "name"; justify-items: center; text-align: center; padding: 12px 6px; row-gap: 8px; }
  .cat-tile__name { font-size: .85rem; align-self: start; }
  .cat-tile__count { display: none; }
  .cat-tile__icon { width: 44px; height: 44px; }

  .listing-grid, .listing-grid--list, .listing-grid--four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .listing-card__body { padding: 10px 10px 12px; }
  .listing-card__price { font-size: 1rem; }
  .listing-card__price small { display: block; margin: 0; line-height: 1.3; }
  .listing-card__title { font-size: .9rem; }
  .listing-card__meta { flex-direction: column; gap: 2px; }
  .badge { inset-block-start: 6px; inset-inline-start: 6px; padding-inline: 8px; font-size: .72rem; }

  .section__head h2, .list-head h1, .page-title h1 { font-size: 1.3rem; }
  .cta-band { padding: 24px 20px; }
  .cta-band .btn { width: 100%; }

  .grid-2, .price-row { grid-template-columns: 1fr; }
  .price-row { grid-template-columns: 1fr 120px; }
  .step { padding: 16px; }
  .specs { grid-template-columns: 1fr; }
  .listing-head__price strong { font-size: 1.8rem; }
  .listing-head__title { font-size: 1.25rem; }

  .my-listing { grid-template-columns: 84px 1fr; }
  .my-listing__actions { grid-column: 1 / -1; justify-content: flex-start; max-width: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .auth { padding-top: 24px; }
  .auth__card { padding: 24px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
