/* ==========================================================================
   PetBikroy — stylesheet
   A classifieds marketplace for pets, inspired by bikroy.com
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --green:        #23a455;
  --green-dark:   #1a8043;
  --green-light:  #e8f6ee;
  --orange:       #ff8f1f;
  --orange-dark:  #e57a10;
  --red:          #e5484d;
  --blue:         #1568c4;

  --ink:          #1f2328;
  --ink-2:        #43494f;
  --muted:        #737b83;
  --faint:        #9aa2aa;

  --bg:           #f4f5f6;
  --surface:      #ffffff;
  --line:         #e3e6e8;
  --line-strong:  #d2d6da;

  --radius-s:     6px;
  --radius:       10px;
  --radius-l:     16px;

  --shadow-s:     0 1px 2px rgba(16, 24, 32, .06);
  --shadow:       0 2px 10px rgba(16, 24, 32, .08);
  --shadow-l:     0 10px 34px rgba(16, 24, 32, .14);

  --header-h:     64px;
  --maxw:         1200px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans Bengali", sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { margin: 0 0 .5em; line-height: 1.25; font-weight: 700; }
h1 { font-size: 28px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p  { margin: 0 0 1em; }

a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }

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

/* ---------- Layout helpers ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
}
.row { display: flex; align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.push { margin-left: auto; }
.stack > * + * { margin-top: 16px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.page { padding: 20px 0 56px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-s);
}
.card-pad { padding: 18px; }

.section { margin-top: 30px; }
.section-head {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.section-head h2 { margin: 0; }
.section-head .see-all { font-size: 14px; font-weight: 600; margin-left: auto; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny  { font-size: 12px; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  font-size: 14px; font-weight: 600;
  line-height: 1.1;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-accent { background: var(--orange); color: #fff; }
.btn-accent:hover { background: var(--orange-dark); }
.btn-outline {
  background: var(--surface); color: var(--ink);
  border-color: var(--line-strong);
}
.btn-outline:hover { border-color: var(--green); color: var(--green-dark); background: var(--green-light); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: #eef0f1; }
.btn-danger { background: #fff; color: var(--red); border-color: #f2c5c6; }
.btn-danger:hover { background: #fdf2f2; border-color: var(--red); }
.btn-lg { padding: 13px 26px; font-size: 15px; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field > label,
.label {
  display: block; margin-bottom: 6px;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.req::after { content: " *"; color: var(--red); }

.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit; font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 130px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(35, 164, 85, .15);
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23737b83' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
.field-error .input,
.field-error .select,
.field-error .textarea { border-color: var(--red); }
.err-msg { display: none; margin-top: 5px; font-size: 12px; color: var(--red); font-weight: 600; }
.field-error .err-msg, .err-msg.show { display: block; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.check {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 14px; cursor: pointer; user-select: none;
}
.check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--green); flex: none; }

.radio-cards { display: grid; gap: 10px; }
.radio-card {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  cursor: pointer; background: var(--surface);
  transition: border-color .15s, background-color .15s;
}
.radio-card:hover { border-color: var(--green); background: var(--green-light); }
.radio-card input { accent-color: var(--green); width: 17px; height: 17px; flex: none; }
.radio-card.is-active { border-color: var(--green); background: var(--green-light); }
.radio-card .rc-icon { font-size: 20px; }
.radio-card .rc-body { min-width: 0; }
.radio-card .rc-title { font-weight: 600; font-size: 14px; }
.radio-card .rc-sub { font-size: 12px; color: var(--muted); }

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 60;
}
.header-top {
  display: flex; align-items: center; gap: 16px;
  min-height: var(--header-h);
  padding-top: 10px; padding-bottom: 10px;
}

.logo { display: flex; align-items: center; gap: 9px; flex: none; }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(140deg, var(--green) 0%, var(--green-dark) 100%);
  display: grid; place-items: center;
  font-size: 21px; line-height: 1;
  box-shadow: 0 3px 8px rgba(26, 128, 67, .3);
}
.logo-text { font-size: 21px; font-weight: 800; letter-spacing: -.4px; color: var(--green-dark); }
.logo-text span { color: var(--orange); }

.loc-pick {
  display: flex; align-items: center; gap: 7px;
  flex: none;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--surface);
  font-size: 13px; color: var(--ink-2);
  max-width: 190px;
}
.loc-pick svg { flex: none; color: var(--green); }
.loc-pick select {
  border: 0; background: transparent; font: inherit; font-size: 13px;
  color: inherit; width: 100%; padding: 0; cursor: pointer;
}
.loc-pick select:focus { outline: none; }

.search-bar {
  display: flex; align-items: stretch; flex: 1 1 auto; min-width: 0;
  border: 2px solid var(--green);
  border-radius: var(--radius-s);
  background: var(--surface);
  overflow: hidden;
}
.search-bar select {
  border: 0; border-right: 1px solid var(--line);
  background: #fbfbfc;
  padding: 0 30px 0 12px; font: inherit; font-size: 13px; color: var(--ink-2);
  max-width: 168px;
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23737b83' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.search-bar select:focus { outline: none; }
.search-bar input {
  flex: 1 1 auto; min-width: 0;
  border: 0; padding: 11px 12px; font: inherit; font-size: 14px;
}
.search-bar input:focus { outline: none; }
.search-bar button {
  border: 0; background: var(--green); color: #fff;
  padding: 0 20px; display: grid; place-items: center;
  transition: background-color .15s;
}
.search-bar button:hover { background: var(--green-dark); }

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

.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--surface); color: var(--ink-2);
  transition: border-color .15s, color .15s, background-color .15s;
}
.icon-btn:hover { border-color: var(--green); color: var(--green-dark); background: var(--green-light); }
.icon-btn .badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--orange); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}

.header-user {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--surface);
  font-size: 13px; color: var(--ink-2);
}
.header-user:hover { text-decoration: none; border-color: var(--green); color: var(--green-dark); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--green-light); color: var(--green-dark);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; flex: none;
}

.hamburger { display: none; }

/* Category nav */
.cat-nav {
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.cat-nav-inner {
  display: flex; align-items: center; gap: 4px;
  overflow-x: auto; scrollbar-width: none;
  -ms-overflow-style: none;
}
.cat-nav-inner::-webkit-scrollbar { display: none; }
.cat-nav a {
  flex: none;
  padding: 11px 13px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.cat-nav a:hover { color: var(--green-dark); background: var(--green-light); text-decoration: none; }
.cat-nav a.is-active { color: var(--green-dark); border-bottom-color: var(--green); }
.cat-nav .all-cats {
  display: flex; align-items: center; gap: 7px;
  color: var(--ink); font-weight: 700;
  border-right: 1px solid var(--line);
  padding-right: 14px; margin-right: 4px;
}

/* Mobile drawer */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(16, 24, 32, .45);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 91;
  width: 290px; max-width: 84vw;
  background: var(--surface);
  transform: translateX(-100%);
  transition: transform .24s ease;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-l);
}
.drawer.is-open { transform: none; }
.drawer-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.drawer-body { padding: 10px 8px 30px; overflow-y: auto; }
.drawer-body h4 {
  margin: 14px 10px 6px; font-size: 12px; letter-spacing: .6px;
  text-transform: uppercase; color: var(--faint);
}
.drawer-body a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-s);
  font-size: 14px; color: var(--ink-2); font-weight: 500;
}
.drawer-body a:hover { background: var(--green-light); color: var(--green-dark); text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1100px 320px at 12% -30%, #2fbb68 0%, transparent 62%),
    radial-gradient(900px 300px at 88% -10%, #f7a044 0%, transparent 58%),
    linear-gradient(160deg, #1a8043 0%, #23a455 55%, #2bb264 100%);
  color: #fff;
  padding: 40px 0 34px;
}
.hero h1 { font-size: 33px; color: #fff; margin-bottom: 8px; letter-spacing: -.5px; }
.hero p.lead { font-size: 15.5px; color: rgba(255, 255, 255, .92); max-width: 620px; margin-bottom: 22px; }
.hero .search-bar { border-color: #fff; box-shadow: 0 6px 22px rgba(0, 0, 0, .16); }
.hero-stats { display: flex; gap: 26px; margin-top: 20px; flex-wrap: wrap; }
.hero-stats div { font-size: 13px; color: rgba(255, 255, 255, .88); }
.hero-stats b { display: block; font-size: 22px; color: #fff; line-height: 1.2; }

/* ---------- Category grid ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
  gap: 12px;
}
.cat-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 12px;
  text-align: center;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.cat-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--green);
  text-decoration: none;
}
.cat-tile .emoji { font-size: 30px; line-height: 1; display: block; margin-bottom: 10px; }
.cat-tile .name { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.cat-tile .count { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- Listing cards ---------- */
.grid-listings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 16px;
}
.grid-listings.list-view { grid-template-columns: 1fr; }

.ad-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.ad-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #cfe6d9; }
.ad-card:hover .ad-title { color: var(--green-dark); }

.ad-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #eef0f1;
  overflow: hidden;
}
.ad-media img { width: 100%; height: 100%; object-fit: cover; }
.ad-card .ad-body { padding: 12px 13px 14px; display: flex; flex-direction: column; flex: 1; }
.ad-price {
  font-size: 18px; font-weight: 800; color: var(--ink);
  letter-spacing: -.3px;
}
.ad-price .cur { font-size: 15px; font-weight: 700; }
.ad-price.is-free { color: var(--green-dark); }
.ad-title {
  margin: 6px 0 8px;
  font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .15s;
}
.ad-meta {
  margin-top: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12px; color: var(--muted);
}
.ad-meta .loc { display: flex; align-items: center; gap: 4px; min-width: 0; }
.ad-meta .loc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ad-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.tag {
  font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: 4px;
  background: #eef0f1; color: var(--ink-2);
}
.tag-green { background: var(--green-light); color: var(--green-dark); }
.tag-orange { background: #fff2e2; color: #b2650a; }

.ribbon {
  position: absolute; top: 10px; left: 10px;
  padding: 4px 9px; border-radius: 4px;
  font-size: 11px; font-weight: 700; letter-spacing: .4px;
  background: var(--orange); color: #fff;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}
.ribbon-sold { background: var(--red); }

.fav-btn {
  position: absolute; top: 8px; right: 8px;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .92);
  border: 0; color: var(--ink-2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
  transition: color .15s, background-color .15s, transform .15s;
}
.fav-btn:hover { background: #fff; color: var(--red); transform: scale(1.08); }
.fav-btn.is-active { color: var(--red); }
.fav-btn.is-active svg { fill: currentColor; }

/* List view variant */
.grid-listings.list-view .ad-card { flex-direction: row; }
.grid-listings.list-view .ad-media {
  width: 250px; flex: none; aspect-ratio: auto;
}
.grid-listings.list-view .ad-body { padding: 16px 18px; }
.grid-listings.list-view .ad-title { font-size: 16px; font-weight: 700; }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, #eef0f1 25%, #f6f7f8 50%, #eef0f1 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
  border-radius: var(--radius-s);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Empty state ---------- */
.empty {
  text-align: center; padding: 60px 20px;
  background: var(--surface); border: 1px dashed var(--line-strong);
  border-radius: var(--radius-l);
}
.empty .emoji { font-size: 46px; margin-bottom: 12px; }
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 420px; margin: 0 auto 18px; }

/* ---------- Breadcrumbs ---------- */
.crumbs { font-size: 13px; color: var(--muted); padding: 14px 0 4px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--green-dark); }
.crumbs .sep { margin: 0 6px; color: var(--faint); }

/* ---------- Listings page layout ---------- */
.split { display: grid; grid-template-columns: 268px 1fr; gap: 20px; align-items: start; }

.filters { position: sticky; top: calc(var(--header-h) + 12px); }
.filter-block { padding: 16px; border-bottom: 1px solid var(--line); }
.filter-block:last-child { border-bottom: 0; }
.filter-block h4 {
  margin: 0 0 11px; font-size: 13px; font-weight: 700;
  letter-spacing: .3px; text-transform: uppercase; color: var(--ink-2);
}
.filter-list { max-height: 232px; overflow-y: auto; }
.filter-list li { margin-bottom: 2px; }
.filter-list label {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px; border-radius: var(--radius-s);
  font-size: 13.5px; color: var(--ink-2); cursor: pointer;
}
.filter-list label:hover { background: #f3f5f6; }
.filter-list input { accent-color: var(--green); width: 16px; height: 16px; flex: none; }
.filter-list .n { margin-left: auto; font-size: 12px; color: var(--faint); }

.price-range { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.price-range .dash { color: var(--faint); }

.results-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-s);
}
.results-bar h1 { font-size: 18px; margin: 0; }
.view-toggle { display: flex; gap: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-s); overflow: hidden; }
.view-toggle button {
  padding: 7px 10px; border: 0; background: var(--surface); color: var(--muted);
  display: grid; place-items: center;
}
.view-toggle button + button { border-left: 1px solid var(--line-strong); }
.view-toggle button.is-active { background: var(--green-light); color: var(--green-dark); }

.active-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 10px; border-radius: 20px;
  background: var(--green-light); color: var(--green-dark);
  font-size: 12.5px; font-weight: 600;
  border: 1px solid #cfe9da;
}
.chip button {
  border: 0; background: transparent; color: inherit;
  font-size: 15px; line-height: 1; padding: 0; display: grid; place-items: center;
}
.chip button:hover { color: var(--red); }

.pager { display: flex; justify-content: center; gap: 6px; margin-top: 26px; flex-wrap: wrap; }
.pager button {
  min-width: 38px; height: 38px; padding: 0 11px;
  border: 1px solid var(--line-strong); background: var(--surface);
  border-radius: var(--radius-s); color: var(--ink-2); font-weight: 600; font-size: 14px;
}
.pager button:hover:not([disabled]) { border-color: var(--green); color: var(--green-dark); }
.pager button.is-active { background: var(--green); border-color: var(--green); color: #fff; }
.pager button[disabled] { opacity: .45; cursor: default; }

.mobile-filter-bar { display: none; }

/* ---------- Ad detail ---------- */
.detail { display: grid; grid-template-columns: 1fr 330px; gap: 22px; align-items: start; }
.gallery { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gallery-main {
  position: relative; aspect-ratio: 16 / 11; background: #eef0f1;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-main .nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, .93);
  display: grid; place-items: center; color: var(--ink);
  box-shadow: var(--shadow);
}
.gallery-main .nav:hover { background: #fff; color: var(--green-dark); }
.gallery-main .nav.prev { left: 12px; }
.gallery-main .nav.next { right: 12px; }
.gallery-count {
  position: absolute; bottom: 12px; right: 12px;
  padding: 4px 10px; border-radius: 14px;
  background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; font-weight: 600;
}
.gallery-thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; }
.gallery-thumbs button {
  width: 76px; height: 60px; flex: none; padding: 0;
  border: 2px solid transparent; border-radius: var(--radius-s);
  overflow: hidden; background: #eef0f1;
}
.gallery-thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs button.is-active { border-color: var(--green); }

.detail-head { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.detail-head h1 { font-size: 22px; margin-bottom: 10px; }
.detail-price { font-size: 30px; font-weight: 800; color: var(--green-dark); letter-spacing: -.8px; }
.detail-price .cur { font-size: 22px; }
.detail-sub { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 8px; }

.spec-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px;
}
.spec { font-size: 13px; }
.spec .k { color: var(--muted); font-size: 12px; }
.spec .v { font-weight: 600; }

.desc { white-space: pre-wrap; line-height: 1.75; color: var(--ink-2); font-size: 14.5px; }

.sidebar { position: sticky; top: calc(var(--header-h) + 12px); display: flex; flex-direction: column; gap: 16px; }
.seller-head { display: flex; align-items: center; gap: 12px; }
.seller-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(140deg, var(--green) 0%, var(--green-dark) 100%);
  color: #fff; display: grid; place-items: center;
  font-size: 18px; font-weight: 700; flex: none;
}
.seller-name { font-weight: 700; font-size: 15px; }
.verify-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; color: var(--green-dark);
  background: var(--green-light); padding: 2px 7px; border-radius: 4px;
}

.contact-actions { display: grid; gap: 10px; margin-top: 16px; }
.phone-reveal {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-s); background: #fbfbfc;
  font-weight: 700; font-size: 15px; letter-spacing: .5px;
}
.phone-reveal.blurred { filter: blur(4.5px); user-select: none; }

.safety { background: #fff8ec; border: 1px solid #f6dfb8; border-radius: var(--radius); padding: 15px; }
.safety h4 { color: #a5670a; font-size: 14px; margin-bottom: 8px; }
.safety li {
  position: relative; padding-left: 18px; margin-bottom: 7px;
  font-size: 13px; color: #7c5a14; line-height: 1.5;
}
.safety li::before {
  content: "•"; position: absolute; left: 5px; top: -1px;
  color: var(--orange); font-weight: 700;
}

/* ---------- Post ad wizard ---------- */
.wizard { max-width: 780px; margin: 0 auto; }
.steps {
  display: flex; align-items: center; gap: 6px;
  padding: 18px; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow-x: auto;
}
.step { display: flex; align-items: center; gap: 9px; flex: none; }
.step .dot {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: #eef0f1; color: var(--muted);
  font-size: 13px; font-weight: 700; flex: none;
}
.step .lbl { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.step.is-active .dot { background: var(--green); color: #fff; }
.step.is-active .lbl { color: var(--ink); }
.step.is-done .dot { background: var(--green-light); color: var(--green-dark); }
.step-line { width: 26px; height: 2px; background: var(--line-strong); flex: none; }

.wizard-panel { display: none; }
.wizard-panel.is-active { display: block; }
.wizard-actions {
  display: flex; gap: 10px; margin-top: 20px; padding-top: 18px;
  border-top: 1px solid var(--line);
}

.dropzone {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 34px 20px; text-align: center;
  background: #fbfbfc; cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--green); background: var(--green-light); }
.dropzone .emoji { font-size: 34px; margin-bottom: 8px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; margin-top: 14px; }
.photo-item { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius-s); overflow: hidden; border: 1px solid var(--line); }
.photo-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-item .rm {
  position: absolute; top: 5px; right: 5px;
  width: 24px; height: 24px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, .62); color: #fff;
  display: grid; place-items: center; font-size: 15px; line-height: 1;
}
.photo-item .rm:hover { background: var(--red); }
.photo-item .primary-flag {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(35, 164, 85, .92); color: #fff;
  font-size: 10.5px; font-weight: 700; text-align: center;
  padding: 2px 0; letter-spacing: .4px; text-transform: uppercase;
}

.review-list { display: grid; gap: 0; }
.review-list .row-item {
  display: grid; grid-template-columns: 160px 1fr; gap: 14px;
  padding: 11px 0; border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.review-list .row-item:last-child { border-bottom: 0; }
.review-list .k { color: var(--muted); font-size: 13px; }

/* ---------- Tables (my ads) ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
  text-align: left; padding: 12px 14px;
  background: #fafbfb; border-bottom: 1px solid var(--line);
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; color: var(--muted); white-space: nowrap;
}
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #fbfcfc; }
.tbl-ad { display: flex; align-items: center; gap: 12px; min-width: 260px; }
.tbl-ad img { width: 60px; height: 46px; object-fit: cover; border-radius: var(--radius-s); flex: none; }
.tbl-ad .t { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

.status-pill {
  display: inline-block; padding: 3px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
}
.status-active { background: var(--green-light); color: var(--green-dark); }
.status-sold   { background: #fdecec; color: var(--red); }
.status-pending  { background: #fdf5e4; color: #9a6708; }
.status-rejected { background: #fdeaea; color: var(--red); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button {
  padding: 11px 15px; border: 0; background: transparent;
  font-size: 14px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button:hover { color: var(--ink); }
.tabs button.is-active { color: var(--green-dark); border-bottom-color: var(--green); }

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none; width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: var(--radius);
  background: #23292e; color: #fff; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-l);
  animation: toast-in .22s ease;
}
.toast.ok { background: var(--green-dark); }
.toast.err { background: #b3373b; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 48px;
  background: #1f262c; color: #b7c0c8;
  padding: 40px 0 26px; font-size: 13.5px;
}
.footer-grid {
  display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 30px;
}
.site-footer h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .7px; margin-bottom: 12px; }
.site-footer a { color: #b7c0c8; display: block; padding: 4px 0; }
.site-footer a:hover { color: #fff; text-decoration: none; }
.footer-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.footer-brand .logo-mark { box-shadow: none; }
.footer-brand .logo-text { color: #fff; }
.footer-bottom {
  margin-top: 30px; padding-top: 18px; border-top: 1px solid #333d45;
  display: flex; gap: 14px; flex-wrap: wrap; justify-content: space-between;
  font-size: 12.5px; color: #8b959d;
}

/* ---------- Utilities ---------- */
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.hide { display: none !important; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .split { grid-template-columns: 236px 1fr; }
  .detail { grid-template-columns: 1fr 300px; }
}

@media (max-width: 940px) {
  .header-top { flex-wrap: wrap; }
  .search-bar { order: 3; flex-basis: 100%; }
  .loc-pick { display: none; }
  .hamburger { display: grid; }
  .logo-text { font-size: 19px; }
  .split { grid-template-columns: 1fr; }
  .filters {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 91;
    width: 320px; max-width: 88vw;
    background: var(--surface); border: 0; border-radius: 0;
    overflow-y: auto; transform: translateX(-100%);
    transition: transform .24s ease; box-shadow: var(--shadow-l);
  }
  .filters.is-open { transform: none; }
  .filters-head { display: flex !important; }
  .mobile-filter-bar { display: flex; }
  .detail { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .grid-listings.list-view .ad-media { width: 160px; }
}

@media (max-width: 620px) {
  body { font-size: 14.5px; }
  .hero { padding: 28px 0 24px; }
  .hero h1 { font-size: 25px; }
  .hero-stats { gap: 18px; }
  .hero-stats b { font-size: 18px; }
  .grid-listings { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .ad-price { font-size: 16px; }
  .ad-card .ad-body { padding: 10px; }
  .detail-price { font-size: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 22px; }
  .field-row { grid-template-columns: 1fr; }
  .steps { padding: 13px; }
  .step .lbl { display: none; }
  .step.is-active .lbl { display: block; }
  .search-bar select { display: none; }
  .header-actions .btn-accent { padding: 10px 12px; font-size: 13px; }
  .header-user span.un { display: none; }
  .review-list .row-item { grid-template-columns: 1fr; gap: 2px; }
  .grid-listings.list-view .ad-card { flex-direction: column; }
  .grid-listings.list-view .ad-media { width: 100%; aspect-ratio: 4 / 3; }
}

@media print {
  .site-header, .site-footer, .sidebar, .crumbs, .toast-wrap { display: none; }
  body { background: #fff; }
}
