/* =========================================================
   ساحة | Sahat — Classifieds marketplace
   Design tokens
   ========================================================= */
:root {
  color-scheme: light dark;
  --footer: #15264a;
  --footer-light: #233866;
  --footer-lighter: #324a7e;
  --primary: var(--footer);
  --primary-dark: #0f1c38;
  --primary-light: #e8eaf0;
  --accent: #0412ad;
  --text: #182333;
  --muted: #6b7686;
  --muted-2: #94a0b2;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --border: #e6e9f0;
  --border-hover: #d7defb;
  --success: #1a9c5e;
  --danger: #e0453d;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(20, 30, 60, .06);
  --shadow-md: 0 6px 20px rgba(20, 30, 60, .08);
  --shadow-lg: 0 16px 40px rgba(20, 30, 60, .14);
  --header-h: 72px;
}

/* Dark palette — applies automatically when the OS/browser prefers dark
   and the visitor hasn't manually overridden it, or when they've picked
   dark explicitly via the header toggle (data-theme wins either way). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #7c8cf5;
    --primary-dark: #a4b1f8;
    --primary-light: #1c2440;
    --accent: #8b98f7;
    --text: #e8ebf3;
    --muted: #9aa3b8;
    --muted-2: #6f7890;
    --bg: #0e1219;
    --surface: #1a1f2b;
    --border: #2b3244;
    --border-hover: #3a4468;
    --success: #3ecb85;
    --danger: #ef5b52;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, .45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
  }
}

:root[data-theme="dark"] {
  --primary: #7c8cf5;
  --primary-dark: #a4b1f8;
  --primary-light: #1c2440;
  --accent: #8b98f7;
  --text: #e8ebf3;
  --muted: #9aa3b8;
  --muted-2: #6f7890;
  --bg: #0e1219;
  --surface: #1a1f2b;
  --border: #2b3244;
  --border-hover: #3a4468;
  --success: #3ecb85;
  --danger: #ef5b52;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, .45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
}

@font-face {
  font-family: 'AlwiSahafa';
  src: url('../fonts/Elgharib-AlwiSahafa.ttf') format('truetype');
  font-weight: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  max-width: 100vw;
  font-family: 'Cairo', 'Tajawal', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input,
select,
textarea {
  font-family: inherit;
}

:focus-visible {
  outline: 2.5px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  font-weight: 700;
  font-size: 15px;
  transition: .15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: var(--surface);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 14px 26px;
  font-size: 16px;
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-pill);
}

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  gap: 20px;
}

.logo {
  font-family: 'AlwiSahafa', 'Cairo', sans-serif;
  font-size: 60px;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: 1px;
}

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

.hamburger {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  align-items: center;
  justify-content: center;
}

.hamburger span,
.hamburger::before,
.hamburger::after {
  display: none;
}

.hamburger svg {
  width: 26px;
  height: 26px;
  color: var(--text);
}

.hamburger-wrap {
  position: relative;
}

.hamburger-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 190px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 110;
}

.hamburger-dropdown.open {
  display: block;
}

.hamburger-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.theme-toggle-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.theme-toggle-btn svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.header-bell-wrap {
  position: relative;
}

.header-bell-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

.header-bell-btn svg {
  width: 22px;
  height: 22px;
  color: var(--text);
}

.header-bell-badge {
  position: absolute;
  top: 6px;
  left: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 1.5px solid #fff;
}

.header-bell-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 320px;
  max-width: 80vw;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 10px;
  z-index: 110;
}

.header-bell-dropdown.open {
  display: block;
}

.header-bell-dropdown a {
  display: block;
  font-size: 13.5px;
  color: var(--text);
  font-weight: 600;
  line-height: 1.6;
  padding: 10px;
  border-radius: 10px;
}

.header-bell-dropdown a:hover {
  background: var(--bg);
}

.header-bell-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
  padding: 10px;
}

.owner-actions .btn {
  padding: 8px 16px;
  font-size: 13px;
}

.hamburger-dropdown a svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
  flex-shrink: 0;
}

.hamburger-dropdown a:hover {
  background: var(--bg);
}

.hamburger-dropdown a.active {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: visible;
  margin-bottom: 18px;
  position: relative;
}

.search-bar input[type="text"] {
  flex: 1;
  border: none;
  background: transparent;
  padding: 14px 18px;
  font-size: 15px;
  color: var(--text);
  min-width: 0;
}

.search-bar input[type="text"]::placeholder {
  color: var(--muted-2);
}

.search-city {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  height: 52px;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  background: transparent;
  border-inline-end: 1.5px solid var(--border);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  white-space: nowrap;
}

.search-city svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex-shrink: 0;
}

.city-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 50;
  max-height: 360px;
  overflow-y: auto;
}

.city-group {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 4px;
}

.city-group:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.city-group-title {
  padding: 8px 12px 4px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .3px;
}

.city-dropdown.open {
  display: block;
}

.city-dropdown button {
  display: block;
  width: 100%;
  text-align: right;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.city-dropdown button:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.search-submit {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0 26px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
  margin: 6px 8px 6px 10px;
}

.search-submit:hover {
  background: var(--primary-dark);
}

.search-submit svg {
  width: 18px;
  height: 18px;
}

/* ---------- Tabs / categories ---------- */
.tabs {
  display: flex;
  gap: 14px;
  padding-bottom: 22px;
  flex-wrap: wrap;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 80px;
  padding: 10px 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 22px;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text);
  transition: .15s;
}

.tab svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.tab:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

/* ---------- Layout: sidebar + feed ---------- */
.page-body {
  padding: 26px 0 60px;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 22px;
  align-items: start;
}

.layout.layout-detail {
  grid-template-columns: 1fr 280px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.panel-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary);
  margin: 0 0 14px;
}

.feed-heading {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 14px;
}

/* Featured sidebar list */
.featured-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.featured-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 10px;
  transition: .15s;
}

.featured-item:hover {
  background: var(--bg);
}

.featured-item img {
  display: block;
  max-width: 64px;
  max-height: 64px;
  width: auto;
  height: auto;
  border-radius: 8px;
  flex-shrink: 0;
}

.featured-item .fi-title {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-item .fi-price {
  font-size: 13px;
  color: var(--accent);
  font-weight: 800;
}

/* Loading skeleton — shown briefly while ads are being fetched, so a slow
   connection reads as "loading" instead of a blank, frozen-looking page. */
@keyframes skelShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skel {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
  background-size: 400% 100%;
  animation: skelShimmer 1.4s ease-in-out infinite;
  border-radius: 8px;
}
.skel-card { pointer-events: none; }
.skel-thumb { width: 220px; height: 150px; max-width: 100%; flex-shrink: 0; }
.skel-fi-thumb { width: 64px; height: 64px; flex-shrink: 0; }
.skel-lines { flex: 1; display: flex; flex-direction: column; gap: 10px; padding-top: 4px; min-width: 0; }
.skel-line { height: 12px; }
.skel-line-title { width: 70%; height: 16px; }
.skel-line-sub { width: 45%; }
.skel-line-price { width: 30%; }

/* ---------- Ad feed ---------- */
.feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ad-card {
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: .15s;
}

.ad-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.ad-thumb {
  max-width: 220px;
  max-height: 150px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.ad-thumb img {
  display: block;
  max-width: 100%;
  max-height: 150px;
  width: auto;
  height: auto;
}

.ad-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ad-title {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--accent);
}

.ad-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 auto;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-line;
}

.ad-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}

.ad-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ad-meta svg {
  width: 15px;
  height: 15px;
  color: var(--muted-2);
}

.ad-price {
  color: var(--accent);
  font-weight: 900;
  font-size: 15px;
  margin-inline-start: auto;
}

.fav-btn {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.fav-btn svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.fav-btn.active svg {
  color: var(--danger);
  fill: var(--danger);
}

.empty-state {
  text-align: center;
  padding: 70px 20px;
  color: var(--muted);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  color: var(--border);
  margin-bottom: 14px;
}

.empty-state h3 {
  margin: 0 0 6px;
  color: var(--text);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--footer);
  color: #c6cddb;
  margin-top: 40px;
}

.footer-top {
  padding: 48px 24px 32px;
}

.footer-logo {
  font-family: 'AlwiSahafa', 'Cairo', sans-serif;
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 24px;
}

.footer-columns-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
}

.footer-col h4 {
  color: #fff;
  font-size: 15px;
  margin: 0 0 16px;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  font-size: 13.5px;
  color: #94a0b8;
}

.footer-col a:hover {
  color: #fff;
}

.footer-app-promo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.footer-app-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  min-width: 0;
}

.footer-app-text strong {
  font-size: 14px;
  color: #fff;
}

.footer-app-text span {
  font-size: 12px;
  color: #94a0b8;
}

.footer-app-btn {
  width: 100%;
  padding: 9px 12px;
  font-size: 12.5px;
  gap: 6px;
  border-radius: 10px;
  min-width: 0;
  white-space: normal;
  text-align: center;
  line-height: 1.3;
}

.footer-app-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.footer-app-btn span {
  min-width: 0;
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 10px;
}

@media (max-width:420px) {
  .footer-app-btn {
    padding: 8px 12px;
    font-size: 11.5px;
  }

  .social-row a {
    width: 32px;
    height: 32px;
  }
}

.social-row a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--footer-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-row a:hover {
  background: var(--footer-lighter);
}

.social-row svg {
  width: 17px;
  height: 17px;
  color: #fff;
}

.footer-bottom {
  border-top: 2px solid var(--footer-lighter);
  padding: 18px 24px;
  font-size: 13px;
  color: #7c869a;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 0;
}

/* ---------- Mobile bottom nav ---------- */
/* Real SVG-cut notch (not a CSS mask approximation) — the background/border
   is drawn as an actual <path> with a smooth, kink-free dip cut into its
   top edge (tangent is horizontal at every join, see mnavNotchPath() in
   app.js), so the fab sits nested in a genuine round pocket. */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 6px;
  right: 14px;
  left: 14px;
  height: 58px;
  z-index: 200;
  transition: transform .25s ease;
}

.mnav-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 8px 20px rgba(16, 26, 46, .18));
}

.mnav-svg path {
  fill: var(--surface);
  stroke: var(--border);
  stroke-width: 1;
}

.mnav-items {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  justify-items: center;
  padding: 0 22px;
}

.mobile-nav.mnav-hidden {
  transform: translateY(160%);
}

@keyframes mnavPop {
  0% { transform: translateY(160%) scale(1); }
  70% { transform: translateY(0) scale(1.06); }
  100% { transform: translateY(0) scale(1); }
}

.mobile-nav.mnav-pop {
  animation: mnavPop .45s cubic-bezier(.34,1.56,.64,1) forwards;
}

.mobile-nav a,
.mnav-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  position: relative;
  background: none;
  border: none;
  padding: 0;
}

.mobile-nav a.active {
  color: var(--primary);
}

.mnav-badge {
  position: absolute;
  top: -2px;
  left: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 1.5px solid #fff;
}

.mnav-popup {
  display: none;
  position: fixed;
  bottom: 90px;
  left: 14px;
  right: 14px;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 14px;
  z-index: 210;
}

.mnav-popup.open {
  display: block;
}

.mnav-search-submit-icon {
  display: flex;
  width: 18px;
  height: 18px;
}

.mnav-search-submit-icon svg {
  width: 100%;
  height: 100%;
}

.mnav-items svg {
  width: 22px;
  height: 22px;
}

.mobile-nav .fab {
  position: absolute;
  top: 0;
  right: 50%;
  transform: translate(50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  border: 4px solid var(--bg);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(16, 26, 46, .45);
}

.mobile-nav .fab svg {
  width: 26px;
  height: 26px;
}

/* ---------- Listing / detail page ---------- */
.detail-panel {
  padding: 24px;
}

.seller-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.seller-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg);
}

.seller-name {
  font-weight: 800;
  font-size: 15.5px;
}

.seller-meta {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.seller-meta svg {
  width: 13px;
  height: 13px;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 18px;
  background: var(--primary-light);
}

.contact-btn svg {
  width: 17px;
  height: 17px;
}

.detail-title {
  font-size: 22px;
  font-weight: 900;
  margin: 6px 0 8px;
  color: var(--accent);
}

.detail-sub {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
}

.detail-sub svg {
  width: 14px;
  height: 14px;
}

.detail-desc {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text);
  margin-bottom: 20px;
  white-space: pre-line;
}

.gallery-main {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  margin-bottom: 10px;
}

.gallery-main img {
  display: block;
  max-width: 100%;
  max-height: 420px;
  width: auto;
  height: auto;
}

.gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gallery-thumbs img {
  display: block;
  max-width: 120px;
  max-height: 88px;
  width: auto;
  height: auto;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: .85;
}

.gallery-thumbs img.active {
  border-color: var(--primary);
  opacity: 1;
}

/* ---------- Lightbox ---------- */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .92);
  z-index: 500;
  align-items: center;
  justify-content: center;
}

.lightbox-overlay.open {
  display: flex;
}

.lightbox-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: none;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(255, 255, 255, .3);
}

.lightbox-close {
  top: 16px;
  left: 16px;
  width: 40px;
  height: 40px;
}

.lightbox-close svg {
  width: 18px;
  height: 18px;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
}

.lightbox-nav svg {
  width: 22px;
  height: 22px;
}

.lightbox-prev {
  right: 16px;
}

.lightbox-prev svg {
  transform: rotate(90deg);
}

.lightbox-next {
  left: 16px;
}

.lightbox-next svg {
  transform: rotate(-90deg);
}

@media (max-width:720px) {
  .lightbox-nav {
    width: 40px;
    height: 40px;
  }

  .lightbox-prev {
    right: 8px;
  }

  .lightbox-next {
    left: 8px;
  }
}

.price-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--accent);
  font-weight: 900;
  font-size: 20px;
  padding: 10px 20px;
  border-radius: 12px;
  margin-bottom: 6px;
}

.similar-section {
  margin-top: 26px;
}

.similar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.similar-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

.similar-card img {
  display: block;
  max-width: 100%;
  max-height: 110px;
  width: auto;
  height: auto;
  margin: 0 auto;
}

.similar-card .sc-body {
  padding: 10px;
}

.similar-card .sc-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.similar-card .sc-price {
  font-size: 13px;
  color: var(--accent);
  font-weight: 800;
}

.comments-section {
  margin-top: 22px;
}

.comment {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.comment-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}

.comment-bubble {
  flex: 1;
}

.comment-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
}

.comment-name {
  font-weight: 800;
}

.comment-time {
  color: var(--muted-2);
  font-size: 12px;
}

.comment-text {
  font-size: 14px;
  color: var(--text);
  margin: 4px 0 4px;
  line-height: 1.7;
}

.comment-reply {
  font-size: 12.5px;
  color: var(--primary);
  font-weight: 700;
}

.comment-form textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  min-height: 80px;
  resize: vertical;
  margin-bottom: 10px;
  background: var(--bg);
  color: var(--text);
  box-shadow: inset 0 1px 4px rgba(0,0,0,.07);
}

.comment-form label {
  font-weight: 700;
  font-size: 14px;
  display: block;
  margin-bottom: 8px;
}

/* ---------- Forms (add ad) ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  margin-bottom: 16px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
}

.field .req {
  color: var(--danger);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14.5px;
  background: var(--bg);
  color: var(--text);
  box-shadow: inset 0 1px 4px rgba(0,0,0,.07);
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
}

.field input.field-invalid,
.field select.field-invalid,
.field textarea.field-invalid {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
}

.field input[type="number"]::-webkit-inner-spin-button,
.field input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.field input[type="number"] {
  -moz-appearance: textfield;
}

.cat-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cat-chip {
  padding: 12px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cat-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.upload-box {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  background: var(--surface);
}

.upload-box svg {
  width: 34px;
  height: 34px;
  color: var(--muted-2);
  margin-bottom: 10px;
}

.upload-box:hover {
  border-color: var(--primary);
}

.upload-box.upload-box-disabled {
  cursor: default;
  opacity: .55;
}

.upload-box.upload-box-disabled:hover {
  border-color: var(--border);
}

.upload-previews {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.upload-previews .up-thumb {
  position: relative;
  max-width: 84px;
  max-height: 84px;
  border-radius: 10px;
  overflow: hidden;
}

.upload-previews img {
  display: block;
  max-width: 84px;
  max-height: 84px;
  width: auto;
  height: auto;
}

.up-thumb button {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  border: none;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

/* Add-ad page: grid areas so preview sits beside the form on desktop,
   and between the fields and the submit button on mobile */
.add-ad-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  grid-template-areas: "fields preview" "actions preview";
  gap: 24px;
  align-items: start;
}

.aa-fields {
  grid-area: fields;
}

.aa-actions {
  grid-area: actions;
}

.aa-preview {
  grid-area: preview;
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

/* Live preview card on add-ad page */
.preview-label {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.preview-label svg {
  width: 15px;
  height: 15px;
  color: var(--primary);
}

/* Vertical preview card: image on top, text below */
.ad-card.preview-vertical {
  flex-direction: column;
}

.ad-card.preview-vertical .ad-thumb {
  max-width: 100%;
  max-height: 190px;
}

.ad-card.preview-vertical .ad-thumb img {
  max-height: 190px;
}

.ad-card.preview-vertical .ad-body {
  width: 100%;
}

.section-heading {
  font-size: 16px;
  font-weight: 800;
  margin: 26px 0 12px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #182333;
  color: #fff;
  padding: 14px 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 400;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(20px);
  opacity: 0;
  transition: .25s;
  pointer-events: none;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast svg {
  width: 18px;
  height: 18px;
  color: #3ddc84;
  flex-shrink: 0;
}

.toast.toast-error {
  background: #4a1a1a;
}

.toast.toast-error svg {
  color: #ff6b5e;
}

/* Upload-limit banner — deliberately distinct from .toast: anchored to the
   TOP of the screen (never near the bottom action buttons), pinned white
   glass regardless of the site's theme, and held longer, since this
   specifically needs to be noticed rather than glanced at and forgotten. */
.upload-limit-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  width: min(92vw, 420px);
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #182333;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0,0,0,.2);
  z-index: 600;
  opacity: 0;
  transform: translateX(-50%) translateY(-14px);
  transition: .25s;
  pointer-events: none;
}

.upload-limit-banner.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
  cursor: pointer;
}

/* ---------- Update notice ---------- */
.update-notice {
  position: fixed;
  bottom: 24px;
  left: 24px;
  max-width: 340px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
  z-index: 400;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  transform: translateY(20px);
  opacity: 0;
  transition: .25s;
}

.update-notice.show {
  transform: translateY(0);
  opacity: 1;
}

.update-notice span {
  font-size: 13.5px;
  font-weight: 600;
  flex: 1 1 100%;
}

.update-notice-reload {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-weight: 700;
  font-size: 13px;
}

.update-notice-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  margin-inline-start: auto;
}

.update-notice-close svg {
  width: 14px;
  height: 14px;
}

@media (max-width:720px) {
  .update-notice {
    left: 14px;
    right: 14px;
    max-width: none;
    bottom: 80px;
  }
}

/* ---------- Mobile ---------- */
@media (max-width:920px) {

  .layout,
  .layout.layout-detail {
    grid-template-columns: 1fr;
  }

  .sidebar-panel {
    order: 3;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .add-ad-grid {
    grid-template-columns: 1fr;
    grid-template-areas: "fields" "preview" "actions";
  }

  .aa-preview {
    position: static;
    margin: 24px 0;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }

  .similar-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width:720px) {
  .container {
    padding: 0 18px;
  }

  .hamburger {
    display: flex;
  }

  .header-top {
    gap: 8px;
    flex-wrap: nowrap;
    position: relative;
    padding-top: 15px;
    padding-bottom: 3px;
  }

  .header-actions {
    gap: 6px;
  }

  .header-actions .btn {
    padding: 8px 10px;
    font-size: 12px;
  }

  .header-actions .cta-auth {
    display: none;
  }

  .header-bell-wrap {
    display: none;
  }

  .header-actions .cta-add {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
  }

  .header-actions .cta-add:hover {
    background: var(--primary-dark);
  }

  .logo {
    font-size: 30px;
  }

  .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 14px;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    min-width: 65px;
    min-height: 56px;
    padding: 9px 8px;
    font-size: 11px;
  }

  .tab svg {
    width: 20px;
    height: 20px;
  }

  .search-bar {
    height: 56px;
  }

  .search-city,
  .search-submit {
    height: 100%;
  }

  .search-bar input[type="text"] {
    height: 100%;
  }

  .ad-card {
    flex-direction: row-reverse;
    padding: 10px;
    gap: 10px;
  }

  .ad-thumb {
    max-width: 110px;
    max-height: 100px;
  }

  .skel-thumb {
    width: 110px;
    height: 100px;
  }

  .ad-thumb img {
    max-height: 100px;
  }

  .ad-title {
    font-size: 15px;
    margin-bottom: 4px;
  }

  .ad-desc {
    -webkit-line-clamp: 1;
    font-size: 13px;
  }

  .ad-meta {
    margin-top: 8px;
    font-size: 11.5px;
    gap: 10px;
  }

  .ad-price {
    font-size: 14px;
  }

  .mobile-nav {
    display: block;
  }

  .gallery-main img {
    max-height: 230px;
  }

  .similar-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-top {
    padding: 24px 24px 16px;
  }

  .footer-columns-row {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .footer-categories-col {
    display: none;
  }

  /* On mobile the widget+social pair reads better above the support+links
     pair, but the desktop 5-column order (support, links, categories,
     widget, social) must stay untouched — so reorder visually here only,
     leaving the underlying DOM order alone. */
  .footer-app-promo,
  .social-row {
    order: 1;
  }

  .footer-col {
    order: 2;
  }

  /* extra empty room below the real footer content so the floating nav
     pill only ever overlaps this padding — never the footer's links,
     social icons, or copyright line — once you scroll to the very bottom.
     Compound selector so it always wins over the later `.container`
     padding reset, regardless of source order. */
  .container.footer-bottom {
    padding-bottom: 110px;
  }

  .detail-panel {
    padding: 16px;
  }

  .search-city {
    padding: 0 10px;
    font-size: 12.5px;
    gap: 5px;
    height: 44px;
  }

  .search-submit {
    padding: 0 16px;
    font-size: 13.5px;
    height: 44px;
  }

  .search-bar input[type="text"] {
    padding: 12px 10px;
    font-size: 13.5px;
  }

  .city-dropdown {
    min-width: 150px;
  }
}

@media (max-width:480px) {
  .container {
    padding: 0 14px;
  }

  .header-top {
    gap: 6px;
  }

  .logo {
    font-size: 25px;
  }

  .header-actions .btn {
    padding: 7px 8px;
    font-size: 10.5px;
  }

  .hamburger {
    width: 34px;
    height: 34px;
  }

  .hamburger svg {
    width: 22px;
    height: 22px;
  }

  .tab {
    min-width: 59px;
    min-height: 50px;
    padding: 8px 6px;
    font-size: 10px;
    gap: 5px;
  }

  .tab svg {
    width: 18px;
    height: 18px;
  }

  .search-bar {
    height: 50px;
  }

  .search-bar input[type="text"] {
    padding: 0 8px;
    font-size: 12.5px;
  }

  .search-city {
    padding: 0 8px;
    font-size: 11.5px;
  }

  .search-submit {
    padding: 0 12px;
    font-size: 12.5px;
  }

  .search-submit span {
    display: none;
  }

  .ad-thumb {
    max-width: 88px;
    max-height: 88px;
  }

  .ad-thumb img {
    max-height: 88px;
  }

  .ad-title {
    font-size: 13.5px;
  }

  .ad-price {
    font-size: 12.5px;
  }

  .ad-meta {
    gap: 8px;
    font-size: 10.5px;
  }

  .ad-meta span {
    gap: 3px;
  }

  .panel {
    padding: 14px;
  }

  .detail-title {
    font-size: 18px;
  }

  .price-tag {
    font-size: 16px;
    padding: 8px 14px;
  }

  .gallery-main img {
    max-height: 190px;
  }

  .gallery-thumbs {
    gap: 6px;
  }

  .gallery-thumbs img {
    max-height: 60px;
  }

  .similar-grid {
    gap: 10px;
  }

  .similar-card img {
    max-height: 88px;
  }

  .featured-item img {
    max-width: 52px;
    max-height: 52px;
  }

  .featured-item .fi-title {
    font-size: 12.5px;
  }

  .footer-logo {
    font-size: 22px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .cat-chip {
    padding: 10px 14px;
    font-size: 12.5px;
  }

  .cat-chip svg {
    display: none;
  }

  .upload-box {
    padding: 20px;
  }

}


/* ---------- Login page ---------- */
.auth-wrap {
  max-width: 420px;
  margin: 60px auto;
  padding: 0 20px;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  background: var(--bg);
  border-radius: var(--radius-pill);
  padding: 4px;
  margin-bottom: 22px;
}

.auth-tabs button {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  border-radius: var(--radius-pill);
  font-weight: 700;
  color: var(--muted);
}

.auth-tabs button.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ---------- Admin dashboard ---------- */
.admin-shell {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}

.admin-sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--footer);
  color: #c6cddb;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.admin-logo {
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 22px;
  padding: 0 8px;
}

.admin-logo span {
  color: var(--primary);
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 14.5px;
  color: #c6cddb;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: right;
  width: 100%;
}

.admin-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.admin-nav-item:hover {
  background: var(--footer-light);
  color: #fff;
}

.admin-nav-item.active {
  background: var(--footer-lighter);
  color: #fff;
}

.admin-nav-spacer {
  flex: 1;
}

.admin-main {
  flex: 1;
  padding: 28px 32px;
  min-width: 0;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-title {
  font-size: 22px;
  font-weight: 900;
}

.admin-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--muted);
}

.admin-user-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 26px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.stat-card .stat-num {
  font-size: 28px;
  font-weight: 900;
  color: var(--primary);
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  margin-top: 4px;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.admin-search {
  flex: 1;
  min-width: 220px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.admin-table th {
  background: var(--bg);
  text-align: right;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 800;
  padding: 12px 14px;
}

.admin-table td {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  vertical-align: middle;
}

.admin-table img {
  display: block;
  max-width: 48px;
  max-height: 48px;
  width: auto;
  height: auto;
  border-radius: 8px;
}

.admin-table .cell-title {
  font-weight: 700;
  max-width: 260px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.admin-table .row-actions {
  display: flex;
  gap: 8px;
}

.admin-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.admin-icon-btn svg {
  width: 15px;
  height: 15px;
}

.admin-icon-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.admin-icon-btn.danger:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.admin-badge {
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary-dark);
}

.admin-empty {
  padding: 50px 20px;
  text-align: center;
  color: var(--muted);
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 26, 46, .55);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: var(--surface);
  border-radius: 16px;
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.settings-card {
  max-width: 480px;
}

@media (max-width:920px) {
  .admin-sidebar {
    position: fixed;
    right: -260px;
    top: 0;
    z-index: 250;
    transition: .25s;
    box-shadow: var(--shadow-lg);
  }

  .admin-sidebar.open {
    right: 0;
  }

  .admin-main {
    padding: 20px 16px;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .admin-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

@media (max-width:480px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-card .stat-num {
    font-size: 22px;
  }
}

/* ---------- Toggle switch (optional price / contact method) ---------- */
.field-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  margin-bottom: 8px;
}

.field-head label {
  margin: 0;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: .2s;
}

.switch-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: var(--surface);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: .2s;
}

.switch input:checked+.switch-slider {
  background: var(--primary);
}

.switch input:checked+.switch-slider::before {
  transform: translateX(18px);
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.switch-row span {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--muted);
}

.field-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
  margin: 8px 0 0;
  background: var(--primary-light);
  padding: 8px 12px;
  border-radius: 10px;
}

.field-hint svg {
  width: 14px;
  height: 14px;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ---------- WhatsApp contact + share row (listing page) ---------- */
.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  background: #25d366;
  border: 1.5px solid #25d366;
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-weight: 700;
  font-size: 14px;
}

.whatsapp-btn:hover {
  background: #1eb958;
  border-color: #1eb958;
}

.whatsapp-btn svg {
  width: 17px;
  height: 17px;
}

.share-section {
  margin-top: 8px;
}

.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.share-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.share-btn svg {
  width: 17px;
  height: 17px;
}

.share-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}