/* =====================================================================
   Chasidish Marketplace — "The heimish broadsheet" design system
   Warm paper, espresso anchors, one copper accent, Frank Ruhl Libre voice.
   Logical properties throughout: the same sheet serves EN-LTR and YI-RTL.
   ===================================================================== */

:root {
  /* surfaces */
  --bg-page: #F4F6F8;
  --bg-card: #FFFFFF;
  --bg-soft: #EAF0F4;
  --bg-anchor: #16323F;
  --bg-anchor-2: #22414F;
  /* ink */
  --ink: #17262F;
  --ink-body: #3A4750;
  --ink-muted: #6B7883;
  --ink-on-dark: #EAF2F7;
  /* accent — azure/teal (Yad2 look) */
  --accent: #1FA0DB;
  --accent-hover: #1782B4;
  --accent-tint: #E6F4FB;
  /* semantic */
  --green-trust: #1C7C4A;
  --whatsapp: #25D366;
  --amber-tint: #FCF3DC;
  --amber-ink: #8A6A1F;
  --danger: #B3372B;
  /* lines & depth */
  --border: #DEE5EB;
  --shadow-card: 0 1px 2px rgba(20,35,45,.06);
  --shadow-lift: 0 4px 12px rgba(20,35,45,.12);
  --shadow-float: 0 1px 2px rgba(20,35,45,.06), 0 8px 24px rgba(20,35,45,.13);
  /* geometry */
  --r-ctrl: 10px;
  --r-card: 14px;
  --r-lg: 18px;
  --r-pill: 999px;
  /* type */
  --font-display: 'Frank Ruhl Libre', 'Heebo', Georgia, serif;
  --font-ui: 'Heebo', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-ui);
  font-size: 16px;
  background: var(--bg-page);
  color: var(--ink-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
html[dir="rtl"] body { line-height: 1.6; letter-spacing: 0; }

img { display: block; }
a { color: inherit; }
h1, h2, h3 { color: var(--ink); }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 24px; } }

/* bidi isolation for prices / phones / URLs inside RTL text */
.ltr { direction: ltr; unicode-bidi: isolate; text-align: match-parent; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------------------------------------------------------------------
   header
--------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg-card);
  transition: box-shadow .16s ease, border-color .16s ease;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-card); }
/* homepage: header melts into the espresso hero */
.site-header--hero { background: var(--bg-anchor); border-bottom-color: transparent; }
.site-header--hero .brand-name, .site-header--hero .account-link,
.site-header--hero .lang-toggle, .site-header--hero .link-btn { color: var(--ink-on-dark); }
.site-header--hero .lang-toggle { border-color: rgba(248,246,242,.28); }
.site-header--hero .account-link:hover { background: rgba(248,246,242,.10); color: #fff; }
.site-header--hero.is-scrolled { box-shadow: 0 8px 24px rgba(34,30,26,.28); }

.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }

.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-logo { height: 32px; width: auto; display: block; }
.brand-logo--ondark { display: none; }
/* on the dark hero band (top of home, before scroll) use the white-text logo */
.site-header--hero:not(.is-scrolled) .brand-logo--onlight { display: none; }
.site-header--hero:not(.is-scrolled) .brand-logo--ondark { display: block; }
/* legacy text wordmark (unused now that we have an image logo) */
.brand-name {
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  color: var(--ink); line-height: 1.2; white-space: nowrap;
}
.brand-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; align-self: center; }

.header-actions { display: flex; align-items: center; gap: 6px; }

.lang-toggle {
  text-decoration: none; font-size: 14px; font-weight: 500; color: var(--ink-body);
  border: 1px solid var(--border); border-radius: var(--r-pill); padding: 7px 14px;
  transition: border-color .16s ease, color .16s ease; white-space: nowrap;
}
.lang-toggle:hover { border-color: var(--ink-muted); color: var(--ink); }

.account-link {
  display: flex; align-items: center; gap: 7px; text-decoration: none;
  font-size: 15px; font-weight: 500; color: var(--ink-body);
  padding: 8px 12px; border-radius: var(--r-ctrl);
  transition: background .16s ease;
}
.account-link:hover { background: var(--bg-soft); color: var(--ink); }
.account-link span { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.logout-form { display: inline; }
.link-btn {
  background: none; border: none; cursor: pointer; font: inherit; font-size: 14px;
  color: var(--ink-muted); padding: 6px;
}
.link-btn:hover { color: var(--ink); text-decoration: underline; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 20px; height: 40px; border-radius: var(--r-ctrl); text-decoration: none;
  font-family: var(--font-ui); font-weight: 600; font-size: 15px; border: none; cursor: pointer;
  transition: background .16s ease, transform .16s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn-post { background: var(--accent); color: #fff; }
.btn-post:hover { background: var(--accent-hover); color: #fff; }

/* ---------------------------------------------------------------------
   hero band + floating search card (homepage)
--------------------------------------------------------------------- */
.hero {
  background: radial-gradient(120% 100% at 50% 0%, var(--bg-anchor-2) 0%, var(--bg-anchor) 60%);
  padding: 48px 0 88px;
  position: relative;
}
.hero-inner { max-width: 760px; margin: 0 auto; text-align: center; }
.hero-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(30px, 4.5vw, 42px); line-height: 1.25;
  color: var(--ink-on-dark); margin-bottom: 10px;
}
.hero-sub { font-size: 16px; color: rgba(248,246,242,.75); }

.searchbar {
  display: flex; align-items: stretch;
  background: var(--bg-card); border-radius: var(--r-lg); box-shadow: var(--shadow-float);
  max-width: 880px; margin: 32px auto -44px; position: relative; z-index: 2;
  overflow: hidden; border: none; padding: 6px;
}
.sc-cell { flex: 1 1 0; display: flex; flex-direction: column; justify-content: center; padding: 8px 16px; min-width: 0; }
.sc-cell--q { flex: 2 1 0; }
.sc-cell + .sc-cell { border-inline-start: 1px solid var(--border); }
.sc-label { font-size: 12px; font-weight: 600; color: var(--ink-muted); margin-bottom: 2px; }
.searchbar input[type="text"], .searchbar select {
  border: none; outline: none; background: transparent; width: 100%;
  font: inherit; font-size: 16px; color: var(--ink); height: 28px; padding: 0;
}
.searchbar select { cursor: pointer; appearance: none; }
.btn-search {
  flex: none; align-self: center; height: 48px; padding: 0 26px;
  background: var(--accent); color: #fff; border: none; border-radius: var(--r-ctrl);
  font: inherit; font-weight: 600; font-size: 16px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background .16s ease; margin-inline-start: 8px;
}
.btn-search:hover { background: var(--accent-hover); }
.search-ic { color: var(--ink-muted); display: none; }

@media (max-width: 720px) {
  .hero { padding: 36px 0 72px; }
  .searchbar { flex-direction: column; padding: 10px; gap: 0; }
  .sc-cell + .sc-cell { border-inline-start: none; border-top: 1px solid var(--border); }
  .btn-search { width: 100%; margin: 8px 0 0; }
}

/* trust strip under the hero overlap */
.trust-strip {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 64px 16px 0; color: var(--ink-muted); font-size: 13px; text-align: center;
}
.trust-strip svg { color: var(--green-trust); flex: none; }

/* ---------------------------------------------------------------------
   category tiles
--------------------------------------------------------------------- */
.cats { padding: 28px 0 8px; }
.cats-row {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 16px;
}
.cat-tile {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 20px 10px 16px; text-decoration: none; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: transform .16s ease, box-shadow .16s ease;
  position: relative;
}
.cat-tile:hover, .cat-tile:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.cat-tile.active { border-color: var(--accent); box-shadow: var(--shadow-card); }
.cat-ic {
  width: 64px; height: 64px; border-radius: 50%; background: var(--accent-tint);
  display: flex; align-items: center; justify-content: center; color: var(--accent);
  overflow: hidden;
  transition: transform .16s ease;
}
.cat-ic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-ic svg { width: 30px; height: 30px; }   /* fallback (e.g. the "More" toggle) */
.cat-tile:hover .cat-ic { transform: scale(1.05); }
.cat-name { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.cat-count { font-size: 13px; color: var(--ink-muted); }

.cat-tile--more { justify-content: center; background: transparent; border-style: dashed; cursor: pointer; font: inherit; }
.cat-tile--more .cat-name { color: var(--ink-body); }
.cats-hidden { display: none; }
.cats-row.cats-expanded .cats-hidden { display: flex; }

@media (max-width: 480px) {
  .cats-row { grid-auto-flow: column; grid-template-columns: none; grid-template-rows: 1fr; grid-auto-columns: 128px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 8px; }
  .cat-tile { scroll-snap-align: start; }
  .cats-hidden { display: flex; }         /* on mobile strip, show all */
  .cat-tile--more { display: none; }
}

/* ---------------------------------------------------------------------
   filters (quiet row)
--------------------------------------------------------------------- */
.filters { padding: 8px 0 0; }
.filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter-row input, .filter-row select {
  height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--r-pill);
  font: inherit; font-size: 14px; background: var(--bg-card); color: var(--ink);
}
.filter-row select { cursor: pointer; }
.f-price { width: 104px; }
.f-go {
  height: 40px; padding: 0 20px; border: none; border-radius: var(--r-pill);
  background: var(--ink); color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.f-go:hover { background: #000; }
.f-clear { color: var(--ink-muted); font-size: 14px; text-decoration: none; }
.f-clear:hover { color: var(--ink); text-decoration: underline; }

/* ---------------------------------------------------------------------
   listings grid + cards
--------------------------------------------------------------------- */
.listings-main { padding: 8px 16px 64px; }
@media (min-width: 768px) { .listings-main { padding: 8px 24px 64px; } }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 40px 0 20px; flex-wrap: wrap; }
.section-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(22px, 3vw, 26px); line-height: 1.3; }
.section-count { color: var(--ink-muted); font-size: 13px; }

/* results toolbar: "X found" + sort tabs (Yad2 style) */
.listing-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin: 32px 0 18px; padding-bottom: 12px; border-bottom: 2px solid var(--border);
}
.lt-left { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.lt-count { color: var(--ink-muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.lt-sort { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; font-size: 13px; }
.lt-sort-label { color: var(--ink-muted); margin-inline-end: 4px; }
.lt-opt { text-decoration: none; color: var(--ink-body); padding: 5px 10px; border-radius: 6px; font-weight: 600; }
.lt-opt:hover { background: var(--accent-tint); color: var(--accent-hover); }
.lt-opt.is-active { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 560px) { .lt-sort { width: 100%; } }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(264px, 1fr)); gap: 20px; }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; gap: 14px; } .grid-4 { grid-template-columns: 1fr 1fr; gap: 12px; } }

.card {
  display: flex; flex-direction: column; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  text-decoration: none; box-shadow: var(--shadow-card);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: #BFDAEA; }

.card-photo { position: relative; aspect-ratio: 4 / 3; background: var(--bg-soft); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.card-photo::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(20,35,45,.05); pointer-events: none; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .22s ease; }
.card:hover .card-photo img { transform: scale(1.03); }
.ph-empty { color: #AEBDC8; }
.ph-empty svg { width: 42px; height: 42px; }
.ph-empty.big svg { width: 72px; height: 72px; }

/* corner badge (Yad2 "FOR SALE" style) */
.card-badge {
  position: absolute; top: 10px; inset-inline-end: 10px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; padding: 4px 10px; border-radius: 3px;
  box-shadow: 0 1px 3px rgba(20,35,45,.25);
}
.card-badge.is-free { background: var(--green-trust); }

/* pills still used by related-item cards on the listing page */
.fresh-pill {
  position: absolute; top: 8px; inset-inline-start: 8px;
  background: var(--amber-tint); color: var(--amber-ink);
  font-size: 12px; font-weight: 600; border-radius: var(--r-pill); padding: 3px 10px;
}
.free-pill {
  position: absolute; top: 8px; inset-inline-start: 8px;
  background: var(--green-trust); color: #fff;
  font-size: 12px; font-weight: 600; border-radius: var(--r-pill); padding: 3px 10px;
}

.card-body { display: flex; flex-direction: column; flex: 1; padding: 14px 16px 16px; background: #F7F9FB; }
.card-title {
  font-size: 16px; font-weight: 700; color: var(--accent); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: calc(2 * 1.35em);
}
.card:hover .card-title { color: var(--accent-hover); text-decoration: underline; }
.card-loc { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-muted); font-style: italic; margin-top: 6px; }
.card-loc svg { flex: none; color: var(--accent); }
.card-price { font-size: 20px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; margin-top: 8px; }
.card-price.is-free { color: var(--green-trust); }

.card-specs { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; display: grid; gap: 4px; }
.card-specs .spec { display: flex; gap: 6px; font-size: 13px; line-height: 1.4; }
.card-specs dt { color: var(--ink); font-weight: 700; }
.card-specs dt::after { content: ':'; }
.card-specs dd { color: var(--ink-body); }

.card-details {
  align-self: flex-start; margin-top: 14px;
  border: 1px solid var(--accent); color: var(--accent);
  font-size: 13px; font-weight: 600; border-radius: 6px; padding: 6px 15px;
  transition: background .16s ease, color .16s ease;
}
.card:hover .card-details { background: var(--accent); color: #fff; }
.card-details .chev { display: inline-block; }
html[dir="rtl"] .card-details .chev { transform: scaleX(-1); }

/* legacy simple meta (related-item cards) */
.card-meta { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-muted); margin-top: 6px; flex-wrap: wrap; }
.card-meta .dot { color: var(--border); }

.empty { padding: 32px 0 64px; color: var(--ink-muted); }
.empty a { color: var(--accent-hover); }

/* legacy overlay price (kept harmless if referenced) */
.card-price-overlay { display: none; }

/* ---------------------------------------------------------------------
   forms (post / edit / contact)
--------------------------------------------------------------------- */
.form-page { max-width: 640px; margin: 0 auto; padding: 40px 16px 64px; }
.form-title { font-family: var(--font-display); font-weight: 700; font-size: 28px; margin-bottom: 6px; }
.form-sub { color: var(--ink-muted); font-size: 15px; margin-bottom: 24px; }

.form-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 28px 24px; box-shadow: var(--shadow-card);
}
@media (min-width: 560px) { .form-card { padding: 32px; } }

.field { margin-bottom: 20px; }
.field label { display: block; font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field .req { color: var(--danger); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 11px 14px;
  border: 1px solid var(--border); border-radius: var(--r-ctrl);
  font: inherit; font-size: 16px; background: var(--bg-card); color: var(--ink);
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(196,85,27,.18);
}
.field .hint { font-size: 13px; color: var(--ink-muted); margin-top: 6px; font-weight: 400; }
.field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.field-row .field { flex: 1 1 200px; }
.btn-submit { width: 100%; height: 48px; font-size: 16px; margin-top: 4px; }

.form-error {
  background: #FBEAE7; border: 1px solid #EFC7BF; color: var(--danger);
  border-radius: var(--r-ctrl); padding: 12px 14px; font-size: 14px; margin-bottom: 16px;
}

.checkbox-row { display: flex; gap: 10px; flex-wrap: wrap; }
.checkbox-row .check {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--r-ctrl); padding: 10px 16px;
  font-size: 15px; font-weight: 500; color: var(--ink); background: var(--bg-card);
  margin: 0 0 6px; user-select: none; transition: border-color .16s ease, background .16s ease;
}
.checkbox-row .check input { width: auto; min-height: 0; accent-color: var(--accent); margin: 0; }
.checkbox-row .check:hover { border-color: var(--accent); background: var(--accent-tint); }

.notice-banner {
  display: flex; align-items: center; gap: 10px;
  background: var(--accent-tint); border: 1px solid #C6E6F7; color: var(--accent-hover);
  border-radius: var(--r-card); padding: 14px 16px; margin-bottom: 20px; font-weight: 500; font-size: 15px;
}
.notice-banner svg { flex: none; }

/* ---------------------------------------------------------------------
   auth
--------------------------------------------------------------------- */
.auth-page { display: flex; justify-content: center; padding: 48px 16px 72px; }
.auth-card {
  width: 100%; max-width: 440px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 32px 28px; box-shadow: var(--shadow-card);
}
.auth-card .form-title { font-size: 26px; }
.auth-swap { margin-top: 18px; font-size: 14px; color: var(--ink-muted); text-align: center; }
.auth-swap a { color: var(--accent-hover); font-weight: 600; }

/* ---------------------------------------------------------------------
   account
--------------------------------------------------------------------- */
.account-page { max-width: 900px; margin: 0 auto; padding: 40px 16px 64px; }
.empty-box {
  background: var(--bg-card); border: 1px dashed var(--border); border-radius: var(--r-lg);
  padding: 48px 20px; text-align: center; color: var(--ink-muted);
}
.empty-box .btn { margin-top: 16px; }

.account-list { display: flex; flex-direction: column; gap: 12px; }
.acct-row {
  display: flex; align-items: center; gap: 14px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--r-card); padding: 12px 14px;
  box-shadow: var(--shadow-card);
}
.acct-row.is-removed { opacity: .6; }
.acct-photo {
  flex: none; width: 84px; height: 63px; border-radius: var(--r-ctrl); overflow: hidden;
  background: var(--bg-soft); display: flex; align-items: center; justify-content: center;
}
.acct-photo img { width: 100%; height: 100%; object-fit: cover; }
.acct-info { flex: 1; min-width: 0; }
.acct-title { font-weight: 600; text-decoration: none; color: var(--ink); display: block; font-size: 15px; }
.acct-title:hover { color: var(--accent-hover); }
.acct-actions { display: flex; gap: 8px; align-items: center; flex: none; }

.status-badge {
  display: inline-block; font-size: 12px; font-weight: 600;
  border-radius: var(--r-pill); padding: 2px 10px; margin-top: 5px;
}
.st-live { background: #E4F2EA; color: var(--green-trust); }
.st-removed { background: #FBEAE7; color: var(--danger); }
.st-new { background: var(--amber-tint); color: var(--amber-ink); }

.btn-mini {
  display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; text-decoration: none;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--ink);
  border-radius: var(--r-ctrl); padding: 7px 14px; cursor: pointer; font-family: inherit;
  transition: border-color .16s ease, background .16s ease;
}
.btn-mini:hover { border-color: var(--ink-muted); }
.btn-mini-del { color: var(--danger); border-color: #EFC7BF; }
.btn-mini-del:hover { background: #FBEAE7; border-color: var(--danger); }
.btn-mini-ok { color: #fff; background: var(--green-trust); border-color: var(--green-trust); }
.btn-mini-ok:hover { background: #16643C; border-color: #16643C; }
.btn-mini-warn { color: var(--accent-hover); border-color: #C6E6F7; }
.btn-mini-warn:hover { background: var(--accent-tint); border-color: var(--accent); }

/* ---------------------------------------------------------------------
   listing detail
--------------------------------------------------------------------- */
.detail-page { max-width: 1200px; margin: 0 auto; padding: 32px 16px 96px; }
@media (min-width: 768px) { .detail-page { padding: 40px 24px 72px; } }
.detail-grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
@media (min-width: 960px) { .detail-grid { grid-template-columns: 1fr 380px; gap: 32px; } }

.detail-photo {
  aspect-ratio: 16 / 10; background: var(--bg-soft); border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  border: 1px solid var(--border); position: relative;
}
.detail-photo::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(34,30,26,.05); pointer-events: none; border-radius: var(--r-lg); }
.detail-photo img { width: 100%; height: 100%; object-fit: cover; }

.detail-main .detail-title { font-family: var(--font-display); font-weight: 600; font-size: 26px; line-height: 1.3; margin: 18px 0 8px; }
.detail-metaline { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-muted); flex-wrap: wrap; }
.detail-metaline .dot { color: var(--border); }
.detail-desc {
  border-top: 1px solid var(--border); margin-top: 18px; padding-top: 18px;
  font-size: 16px; line-height: 1.6; color: var(--ink-body); white-space: pre-wrap;
}
.detail-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.chip {
  font-size: 13px; font-weight: 500; color: var(--ink-body); text-decoration: none;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 6px 14px;
  transition: border-color .16s ease;
}
.chip:hover { border-color: var(--ink-muted); }

/* sticky contact card */
.contact-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-card);
  box-shadow: var(--shadow-float); padding: 24px;
}
@media (min-width: 960px) { .contact-card { position: sticky; top: 88px; } }
.cc-price-label { font-size: 13px; color: var(--ink-muted); }
.cc-price { font-size: 28px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.cc-price.is-free { color: var(--green-trust); }
.cc-fresh { margin-top: 8px; display: inline-block; position: static; }

.seller-row { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--border); margin-top: 16px; padding-top: 16px; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; background: var(--accent-tint);
  color: var(--accent-hover); font-weight: 700; font-size: 17px;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.seller-name { font-size: 15px; font-weight: 600; color: var(--ink); }
.seller-meta { font-size: 13px; color: var(--ink-muted); }

.contact-buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.contact-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  height: 48px; border-radius: var(--r-ctrl); text-decoration: none;
  font-size: 15px; font-weight: 600; border: none; cursor: pointer; font-family: inherit;
  transition: filter .16s ease, transform .16s ease;
}
.contact-btn:hover { filter: brightness(.94); }
.contact-btn:active { transform: scale(.98); }
.cb-call { background: var(--accent); color: #fff; }
.cb-text { background: var(--bg-card); color: var(--ink); border: 1.5px solid var(--ink); }
.cb-wa { background: var(--whatsapp); color: #fff; }
.cc-safety { font-size: 12px; color: var(--ink-muted); margin-top: 14px; line-height: 1.5; }
.contact-value { font-size: 15px; font-weight: 600; color: var(--ink); margin-top: 10px; }
.muted { color: var(--ink-muted); }

.owner-actions { margin-top: 14px; }

/* mobile fixed contact bar */
.mobile-cta {
  display: none;
}
@media (max-width: 959px) {
  .mobile-cta {
    display: flex; position: fixed; inset-inline: 0; bottom: 0; z-index: 60;
    background: var(--bg-card); border-top: 1px solid var(--border);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    align-items: center; gap: 10px;
    box-shadow: 0 -4px 16px rgba(34,30,26,.08);
  }
  .mobile-cta .mc-price { font-size: 17px; font-weight: 700; color: var(--ink); flex: 1; }
  .mobile-cta .contact-btn { height: 44px; padding: 0 18px; flex: none; }
}

.related-head { margin-top: 48px; }

.message-page { max-width: 560px; margin: 0 auto; padding: 48px 16px 72px; }

/* ---------------------------------------------------------------------
   legacy manage link notice
--------------------------------------------------------------------- */
.link-notice {
  background: var(--amber-tint); border: 1px solid #EFDFB4; border-radius: var(--r-card);
  padding: 14px 16px; margin-bottom: 20px; font-size: 14px; color: var(--amber-ink);
}
.link-notice strong { display: block; margin-bottom: 8px; font-weight: 600; }
.link-notice input { width: 100%; padding: 8px 10px; border: 1px solid #EFDFB4; border-radius: var(--r-ctrl); font-size: 13px; background: #fff; color: var(--ink); }
.current-photo img { max-width: 150px; border-radius: var(--r-ctrl); margin-bottom: 8px; }
.manage-delete { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
.btn-del { background: var(--danger); color: #fff; border: none; border-radius: var(--r-ctrl); padding: 10px 18px; cursor: pointer; font-weight: 600; font-family: inherit; }
.btn-del:hover { filter: brightness(.92); }

/* ---------------------------------------------------------------------
   admin
--------------------------------------------------------------------- */
.admin-page { max-width: 1200px; margin: 0 auto; padding: 36px 16px 64px; }
.admin-page .hint { color: var(--ink-muted); margin-bottom: 18px; max-width: 640px; font-size: 14px; }
.admin-page .form-title { font-size: 26px; }

.admin-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.tab {
  text-decoration: none; font-size: 14px; font-weight: 600; color: var(--ink-body);
  border: 1px solid var(--border); background: var(--bg-card); border-radius: var(--r-pill); padding: 8px 18px;
  transition: border-color .16s ease;
}
.tab:hover { border-color: var(--ink-muted); }
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.tab-badge { background: var(--accent); color: #fff; border-radius: var(--r-pill); padding: 1px 8px; font-size: 12px; }

.admin-table { width: 100%; border-collapse: collapse; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow-card); }
.admin-table th, .admin-table td { text-align: start; padding: 11px 12px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.admin-table th { background: var(--bg-soft); color: var(--ink-muted); font-weight: 600; font-size: 13px; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: #F2F7FA; }
.admin-table a { color: var(--ink); font-weight: 600; text-decoration: none; }
.admin-table a:hover { color: var(--accent-hover); }
.row-removed { opacity: .55; }
.thumb-cell { width: 60px; }
.admin-thumb { width: 54px; height: 40px; object-fit: cover; border-radius: 6px; }
.actions-cell { white-space: nowrap; }
.actions-cell form { display: inline-block; margin-inline-end: 4px; margin-bottom: 4px; }

/* admin messages */
.msg-list { display: flex; flex-direction: column; gap: 12px; }
.msg-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-card); padding: 16px 18px; box-shadow: var(--shadow-card); }
.msg-card.is-unread { border-inline-start: 4px solid var(--accent); }
.msg-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.msg-name { font-weight: 600; color: var(--ink); }
.msg-contact { color: var(--accent-hover); font-weight: 600; font-size: 14px; }
.msg-date { color: var(--ink-muted); font-size: 13px; margin-inline-start: auto; }
.msg-body { white-space: pre-wrap; color: var(--ink-body); margin-bottom: 12px; font-size: 15px; }
.msg-actions { display: flex; gap: 8px; }

/* ---------------------------------------------------------------------
   footer
--------------------------------------------------------------------- */
.pre-footer {
  text-align: center; padding: 40px 16px 48px; color: var(--ink-body); font-size: 15px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
}
.pre-footer svg { color: var(--green-trust); flex: none; }

.site-footer { background: var(--bg-anchor); color: var(--ink-on-dark); }
.footer-grid {
  display: grid; grid-template-columns: 1fr; gap: 28px; padding: 56px 0 32px;
}
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; } }
.foot-brand { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--ink-on-dark); }
.foot-mission { font-size: 14px; color: rgba(248,246,242,.65); margin-top: 8px; max-width: 30em; line-height: 1.6; }
.foot-col h5 { font-size: 13px; font-weight: 600; color: var(--ink-on-dark); margin-bottom: 14px; }
.foot-col ul { list-style: none; }
.foot-col li { margin-bottom: 9px; }
.foot-col a { color: rgba(248,246,242,.72); text-decoration: none; font-size: 14px; }
.foot-col a:hover { color: var(--ink-on-dark); text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid rgba(248,246,242,.14); padding: 20px 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font-size: 13px; color: rgba(248,246,242,.5);
}

/* ---------------------------------------------------------------------
   RTL icon mirroring (directional glyphs only)
--------------------------------------------------------------------- */
[dir="rtl"] .icon-directional { transform: scaleX(-1); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
