/* Nanha Bazaar — Nagpur's pre-loved baby marketplace */

:root {
  --cream:      #FFF9F3;
  --card:       #FFFFFF;
  --blush:      #FFD6E0;
  --blush-deep: #FF8FAB;
  --mint:       #C7F0E4;
  --mint-deep:  #4FC3A1;
  --butter:     #FFE8A3;
  --butter-deep:#FFC24D;
  --lav:        #E4D9FF;
  --lav-deep:   #9B8CFF;
  --sky:        #DDF3FF;
  --orange:     #FF8A3D;
  --ink:        #4A3B47;
  --muted:      #8B7B86;
  --line:       #F1E4EA;
  --radius:     22px;
  --radius-sm:  14px;
  --shadow:     0 10px 30px -12px rgba(122, 92, 107, .30);
  --shadow-lg:  0 22px 50px -18px rgba(122, 92, 107, .42);
  --font-head:  'Baloo 2', 'Trebuchet MS', system-ui, sans-serif;
  --font-body:  'Quicksand', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

/* The UA rule for [hidden] is a bare attribute selector, so any class that sets
   display (.btn, .stat, …) silently beats it. Make the attribute win. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--ink);
  background: var(--cream);
  background-image:
    radial-gradient(circle at 12% 8%,  rgba(255,214,224,.55) 0, transparent 26%),
    radial-gradient(circle at 88% 4%,  rgba(221,243,255,.65) 0, transparent 24%),
    radial-gradient(circle at 50% 100%, rgba(255,232,163,.35) 0, transparent 34%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; margin: 0; letter-spacing: -.2px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,249,243,.88);
  backdrop-filter: blur(14px);
  border-bottom: 2px dashed var(--line);
}
.header-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; }

.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-mark {
  width: 44px; height: 44px; border-radius: 16px;
  background: linear-gradient(140deg, var(--blush-deep), var(--butter-deep));
  display: grid; place-items: center; font-size: 22px;
  box-shadow: var(--shadow); transform: rotate(-6deg);
}
.logo-text { line-height: 1; }
.logo-text b { font-family: var(--font-head); font-size: 21px; display: block; }
.logo-text span { font-size: 11px; color: var(--muted); letter-spacing: .4px; }

.search-shell { flex: 1; position: relative; min-width: 0; }
.search-shell svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); opacity: .45; }
#q, .field {
  width: 100%; border: 2px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 12px 18px; outline: none; transition: .18s;
}
#q { padding-left: 44px; }
#q:focus, .field:focus { border-color: var(--blush-deep); box-shadow: 0 0 0 4px rgba(255,143,171,.18); }

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

.btn {
  border: none; cursor: pointer; border-radius: 999px; font-weight: 700;
  font-family: var(--font-head); font-size: 15px; padding: 11px 20px;
  display: inline-flex; align-items: center; gap: 8px; transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--blush-deep); color: #fff; box-shadow: 0 8px 18px -8px var(--blush-deep); }
.btn-primary:hover { background: #ff7a9c; box-shadow: 0 12px 22px -8px var(--blush-deep); }
.btn-ghost { background: var(--card); border: 2px solid var(--line); }
.btn-ghost:hover { border-color: var(--blush-deep); }
.btn-wa { background: #25D366; color: #fff; box-shadow: 0 8px 18px -8px #25D366; }
.btn-wa:hover { background: #1fbe5b; }
.btn-block { width: 100%; justify-content: center; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); border: 2px solid var(--line); cursor: pointer; position: relative; transition: .15s;
}
.icon-btn:hover { border-color: var(--blush-deep); }
.icon-btn.on { background: var(--blush); border-color: var(--blush-deep); }
.pill-count {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--orange); color: #fff; font-size: 11px;
  display: grid; place-items: center; font-weight: 800;
}
.pill-count:empty { display: none; }

/* ---------- hero ---------- */
.hero { padding: 30px 0 8px; text-align: center; position: relative; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.1; }
.hero h1 em { font-style: normal; color: var(--blush-deep); }
.hero p { color: var(--muted); margin: 10px auto 0; max-width: 560px; font-size: 15px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 7px; background: var(--card);
  border: 2px solid var(--line); border-radius: 999px; padding: 6px 15px;
  font-size: 12.5px; color: var(--muted); margin-bottom: 14px; box-shadow: var(--shadow);
}
.hero-badge b { color: var(--orange); }

/* ---------- categories ---------- */
.cat-strip { display: flex; gap: 10px; overflow-x: auto; padding: 22px 4px 14px; scrollbar-width: none; }
.cat-strip::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; min-width: 92px; cursor: pointer; transition: .16s; text-align: center;
}
.cat-chip:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.cat-chip .emo { font-size: 24px; line-height: 1; }
.cat-chip .nm { font-size: 11.5px; font-weight: 700; line-height: 1.25; }
.cat-chip .ct { font-size: 10.5px; color: var(--muted); }
.cat-chip.active { background: var(--blush); border-color: var(--blush-deep); }

/* ---------- toolbar ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.toolbar select, .toolbar input[type=number] {
  border: 2px solid var(--line); border-radius: 999px; padding: 8px 14px;
  background: var(--cream); outline: none; cursor: pointer; font-size: 14px; transition: .15s;
}
.toolbar select:focus, .toolbar input[type=number]:focus { border-color: var(--lav-deep); }
.toolbar input[type=number] { width: 96px; cursor: text; }
.toolbar .sep { width: 2px; height: 24px; background: var(--line); border-radius: 2px; }
.toolbar .grow { flex: 1; }
.result-count { font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.link-reset { background: none; border: none; cursor: pointer; color: var(--blush-deep); font-weight: 700; font-size: 13.5px; text-decoration: underline; }

/* ---------- grid + cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 20px; padding-bottom: 40px; }

.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden; cursor: pointer;
  border: 2px solid var(--line); display: flex; flex-direction: column;
  transition: transform .18s cubic-bezier(.2,.9,.3,1.2), box-shadow .18s, border-color .18s;
  animation: pop .3s backwards;
}
.card:hover { transform: translateY(-6px) rotate(-.5deg); box-shadow: var(--shadow-lg); border-color: var(--blush); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }

.card-media { position: relative; aspect-ratio: 4/3; background: var(--sky); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-tags { position: absolute; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 66px); }
.tag {
  font-size: 10.5px; font-weight: 800; padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,.94); box-shadow: 0 3px 8px rgba(0,0,0,.08); letter-spacing: .2px;
}
.tag-new   { background: var(--mint-deep); color: #fff; }
.tag-gentle{ background: var(--butter); }
.tag-loved { background: var(--lav); }
.tag-free  { background: var(--orange); color: #fff; }
.tag-mine  { background: var(--blush-deep); color: #fff; }
.tag-demo  { background: rgba(255,255,255,.9); color: var(--muted); }

.heart {
  position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.94); border: none; cursor: pointer; display: grid; place-items: center;
  font-size: 17px; box-shadow: 0 3px 10px rgba(0,0,0,.1); transition: transform .15s; line-height: 1;
}
.heart:hover { transform: scale(1.15); }
.heart.on { background: var(--blush-deep); }

.card-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.price { font-family: var(--font-head); font-size: 21px; font-weight: 800; color: var(--ink); }
.price.free { color: var(--orange); }
.price s { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 6px; }
.card-title { font-size: 14.5px; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { margin-top: auto; padding-top: 8px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.card-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- empty ---------- */
.empty { text-align: center; padding: 70px 20px; grid-column: 1 / -1; }
.empty .emo { font-size: 56px; }
.empty h3 { margin: 14px 0 6px; font-size: 22px; }
.empty p { color: var(--muted); margin: 0 0 18px; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(74,59,71,.55); backdrop-filter: blur(4px);
  z-index: 60; display: grid; place-items: center; padding: 20px; overflow-y: auto;
  animation: fade .2s;
}
@keyframes fade { from { opacity: 0; } }
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--card); border-radius: 26px; width: min(880px, 100%); overflow: hidden;
  box-shadow: var(--shadow-lg); animation: rise .28s cubic-bezier(.2,.9,.3,1.15); margin: auto;
}
@keyframes rise { from { opacity: 0; transform: translateY(26px) scale(.97); } }
.modal-grid { display: grid; grid-template-columns: 1.05fr 1fr; }
.modal-media { position: relative; background: var(--sky); display: grid; }
.modal-media img { width: 100%; height: 100%; object-fit: cover; min-height: 300px; max-height: 82vh; }
/* Category illustrations are artwork, not photos — show them whole instead of cropping. */
.modal-media img.illus { object-fit: contain; padding: 26px; }
.card-media img.illus { object-fit: contain; padding: 10px; }
.modal-close {
  position: absolute; top: 12px; left: 12px; width: 38px; height: 38px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.95); cursor: pointer; font-size: 18px; line-height: 1;
  box-shadow: 0 3px 10px rgba(0,0,0,.14);
}
.modal-side { padding: 24px; display: flex; flex-direction: column; gap: 12px; max-height: 82vh; overflow-y: auto; }
.modal-side h2 { font-size: 22px; line-height: 1.25; }
.modal-price { font-family: var(--font-head); font-size: 32px; font-weight: 800; }
.modal-price s { font-size: 17px; color: var(--muted); font-weight: 600; margin-left: 10px; }
.modal-price.free { color: var(--orange); }
.spec-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.spec {
  background: var(--cream); border-radius: var(--radius-sm); padding: 9px 12px; border: 2px solid var(--line);
}
.spec dt { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.spec dd { margin: 2px 0 0; font-size: 13.5px; font-weight: 700; }
.desc { font-size: 14px; line-height: 1.6; color: #6B5A66; font-weight: 600; white-space: pre-wrap; }
.seller { display: flex; align-items: center; gap: 11px; padding: 12px; background: var(--cream); border-radius: var(--radius-sm); border: 2px solid var(--line); }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; color: #fff; font-size: 17px; flex-shrink: 0; }
.seller b { display: block; font-size: 14.5px; }
.seller small { color: var(--muted); font-size: 12px; }
.safety { font-size: 12px; color: var(--muted); background: var(--butter); border-radius: var(--radius-sm); padding: 10px 13px; line-height: 1.5; }
.modal-actions { display: flex; gap: 9px; }
.modal-actions .btn { flex: 1; justify-content: center; }

/* ---------- post form ---------- */
.form-card {
  background: var(--card); border: 2px solid var(--line); border-radius: 26px;
  padding: 26px; box-shadow: var(--shadow); margin-bottom: 46px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row.full { grid-column: 1 / -1; }
.form-row label { font-size: 13px; font-weight: 800; padding-left: 4px; }
.form-row label .req { color: var(--blush-deep); }
.form-row .hint { font-size: 11.5px; color: var(--muted); padding-left: 4px; }
.field { border-radius: var(--radius-sm); padding: 11px 15px; background: var(--cream); }
textarea.field { resize: vertical; min-height: 110px; font-weight: 600; line-height: 1.55; }
select.field { cursor: pointer; }
.field.bad { border-color: #E4707F; background: #FFF2F4; }
.err { font-size: 11.5px; color: #D8556A; padding-left: 4px; font-weight: 700; }
.form-section-title { font-family: var(--font-head); font-size: 17px; margin: 8px 0 0; grid-column: 1/-1; display: flex; align-items: center; gap: 8px; }
.form-section-title::after { content: ''; flex: 1; height: 2px; background: var(--line); border-radius: 2px; }

.radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-row input { position: absolute; opacity: 0; }
.radio-row label {
  border: 2px solid var(--line); background: var(--cream); border-radius: 999px;
  padding: 9px 16px; cursor: pointer; font-size: 13.5px; transition: .15s; font-weight: 700;
}
.radio-row input:checked + label { background: var(--blush); border-color: var(--blush-deep); }
.radio-row input:focus-visible + label { box-shadow: 0 0 0 4px rgba(255,143,171,.25); }

.drop {
  border: 2.5px dashed var(--blush); border-radius: var(--radius); background: var(--cream);
  padding: 26px; text-align: center; cursor: pointer; transition: .16s;
}
.drop:hover, .drop.over { background: var(--blush); border-color: var(--blush-deep); }
.drop.bad { border-color: #E4707F; background: #FFF2F4; }
.drop .emo { font-size: 34px; }
.drop p { margin: 8px 0 0; font-size: 13.5px; }
.drop small { color: var(--muted); font-size: 11.5px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.thumb { position: relative; width: 92px; height: 92px; border-radius: var(--radius-sm); overflow: hidden; border: 2px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(74,59,71,.82); color: #fff; cursor: pointer; font-size: 12px; line-height: 1; }

/* ---------- my ads ---------- */
.mine-list { display: flex; flex-direction: column; gap: 10px; }
.mine-row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.mine-row img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.mine-row .info { flex: 1; min-width: 0; }
.mine-row .info b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine-row .info small { color: var(--muted); font-size: 12px; }
.btn-del { background: #FFF2F4; color: #D8556A; border: 2px solid #FFD9DF; }
.btn-del:hover { background: #FFE3E8; }

/* ---------- footer / toast ---------- */
.site-footer { border-top: 2px dashed var(--line); padding: 26px 0 40px; text-align: center; color: var(--muted); font-size: 13px; }
.site-footer b { color: var(--ink); }
.site-footer .orange { color: var(--orange); }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 90px);
  background: var(--ink); color: #fff; padding: 13px 22px; border-radius: 999px;
  font-weight: 700; font-size: 14px; z-index: 90; box-shadow: var(--shadow-lg);
  transition: transform .3s cubic-bezier(.2,.9,.3,1.2); max-width: calc(100% - 32px); text-align: center;
}
.toast.show { transform: translate(-50%, 0); }

@media (max-width: 780px) {
  .modal-grid, .form-grid { grid-template-columns: 1fr; }
  .modal-media img { min-height: 210px; max-height: 260px; }
  .header-row { flex-wrap: wrap; }
  .search-shell { order: 3; flex-basis: 100%; }
  .logo { flex: 1; }
  .btn-primary .lbl { display: none; }
  .btn-primary { padding: 11px 15px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 13px; }
  .toolbar { gap: 8px; }
  .toolbar .sep, .toolbar .grow { display: none; }
  .modal-side { padding: 20px; }
}

/* ---------- loading skeletons ---------- */
.card.skel { cursor: default; pointer-events: none; animation: none; }
.card.skel:hover { transform: none; box-shadow: none; border-color: var(--line); }
.card.skel .card-media { background: var(--line); }
.sk-line { height: 12px; border-radius: 6px; background: var(--line); margin: 7px 0; }
.sk-line.w40 { width: 40%; height: 18px; }
.sk-line.w90 { width: 90%; }
.sk-line.w60 { width: 60%; }
.card.skel .card-media, .sk-line { animation: shimmer 1.3s ease-in-out infinite; }
@keyframes shimmer { 50% { opacity: .45; } }

.modal-loading { padding: 70px 30px; text-align: center; }
.modal-loading .emo { font-size: 46px; animation: shimmer 1.2s ease-in-out infinite; }
.modal-loading p { color: var(--muted); margin: 12px 0 18px; }

.load-more-row { display: flex; justify-content: center; padding: 4px 0 46px; }
.load-more-row .btn { padding: 13px 30px; }

/* ---------- extra photos in the modal ---------- */
.thumb-strip {
  position: absolute; bottom: 12px; left: 12px; right: 12px;
  display: flex; gap: 8px; overflow-x: auto; padding: 4px; scrollbar-width: none;
}
.thumb-strip::-webkit-scrollbar { display: none; }
.mini {
  flex: 0 0 auto; width: 54px; height: 54px; border-radius: 12px; overflow: hidden;
  border: 3px solid rgba(255,255,255,.75); background: none; padding: 0; cursor: pointer; transition: .15s;
}
.mini.on { border-color: var(--blush-deep); }
.mini img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- report ---------- */
.report { border-top: 2px dashed var(--line); padding-top: 12px; }
.report summary { cursor: pointer; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.report summary::marker { color: var(--blush-deep); }
.report-row { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 10px; }
.btn-sm { padding: 7px 13px; font-size: 12.5px; }
.report-done { font-size: 13px; color: var(--mint-deep); font-weight: 700; padding-top: 10px; }

