/* Campus Market — main stylesheet. Mobile-first, no framework. */
:root {
  --primary: #0b5d3b;
  --primary-700: #084a2f;
  --primary-50: #e9f4ef;
  --primary-100: #cfe8dc;
  --accent: #f68b1e;
  --accent-700: #d9740c;
  --accent-50: #fff4e8;
  --ink: #15201b;
  --ink-2: #33403a;
  --muted: #64716b;
  --line: #e3e8e5;
  --bg: #f4f6f5;
  --card: #ffffff;
  --success: #15803d;
  --success-50: #eafaf0;
  --danger: #c22a2a;
  --danger-50: #fdeeee;
  --warning: #b45309;
  --warning-50: #fff6e6;
  --info: #1d5fb8;
  --info-50: #ebf3fe;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 32, 24, .06), 0 2px 8px rgba(16, 32, 24, .05);
  --shadow-lg: 0 10px 30px rgba(16, 32, 24, .12);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 15px/1.55 var(--font); color: var(--ink); background: var(--bg); padding-bottom: 72px; }
@media (min-width: 900px) { body { padding-bottom: 0; } }
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
.icon.sm { width: 16px; height: 16px; } .icon.lg { width: 28px; height: 28px; } .icon.fill { fill: currentColor; }
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.text-right { text-align: right; } .center { text-align: center; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: 8px } .mt-2 { margin-top: 16px } .mt-3 { margin-top: 24px } .mb-0 { margin-bottom: 0 } .mb-1 { margin-bottom: 8px } .mb-2 { margin-bottom: 16px } .mb-3 { margin-bottom: 24px }
.flex { display: flex; gap: 10px; align-items: center; } .flex-wrap { flex-wrap: wrap; } .between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 899px) { .hide-mobile { display: none !important; } }
@media (min-width: 900px) { .hide-desktop { display: none !important; } }

/* ---------- Top bar & header ---------- */
.announce { background: var(--accent); color: #fff; font-size: 13px; text-align: center; padding: 7px 12px; font-weight: 600; }
.header { background: var(--primary); color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.header-row { display: flex; align-items: center; gap: 12px; height: var(--header-h); }
.logo { display: flex; align-items: center; gap: 9px; color: #fff; font-weight: 800; font-size: 19px; letter-spacing: -.02em; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 36px; height: 36px; border-radius: 10px; background: #fff; color: var(--primary); display: grid; place-items: center; font-size: 15px; font-weight: 900; position: relative; }
.logo-mark::after { content: ""; position: absolute; right: -3px; top: -3px; width: 11px; height: 11px; background: var(--accent); border-radius: 50%; border: 2px solid var(--primary); }
.logo-text small { display: block; font-size: 10.5px; font-weight: 500; opacity: .8; letter-spacing: 0; margin-top: -2px; }
.search { flex: 1; display: flex; background: #fff; border-radius: 10px; overflow: hidden; min-width: 0; max-width: 680px; }
.search select { border: 0; background: #f1f4f2; padding: 0 10px; font: inherit; font-size: 13px; color: var(--ink-2); max-width: 150px; border-right: 1px solid var(--line); }
.search input { flex: 1; border: 0; padding: 11px 12px; font: inherit; min-width: 0; color: var(--ink); }
.search input:focus, .search select:focus { outline: none; }
.search button { border: 0; background: var(--accent); color: #fff; padding: 0 16px; cursor: pointer; display: flex; align-items: center; gap: 6px; font-weight: 700; }
.search button:hover { background: var(--accent-700); }
.header-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.hbtn { position: relative; color: #fff; display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 9px; font-weight: 600; font-size: 14px; background: none; border: 0; cursor: pointer; font-family: inherit; }
.hbtn:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.hbtn .count { position: absolute; top: 2px; right: 2px; background: var(--accent); color: #fff; border-radius: 10px; font-size: 10.5px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; font-weight: 700; border: 2px solid var(--primary); }
.btn-sell { background: var(--accent); color: #fff !important; }
.btn-sell:hover { background: var(--accent-700) !important; }
.mobile-search { padding: 0 0 12px; }
.mobile-search .search { max-width: none; }
.nav { background: var(--primary-700); }
.nav a { color: rgba(255,255,255,.88); padding: 10px 14px; display: inline-block; font-size: 14px; font-weight: 600; border-bottom: 3px solid transparent; }
.nav a:hover { color: #fff; text-decoration: none; background: rgba(255,255,255,.06); }
.nav a.active { color: #fff; border-bottom-color: var(--accent); }

/* Dropdown */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; color: var(--ink); min-width: 230px; border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid var(--line); padding: 6px; z-index: 60; }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--ink-2); font-size: 14px; width: 100%; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--bg); text-decoration: none; }
.dropdown-menu .who { padding: 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--primary-50); flex: none; }
.avatar.lg { width: 72px; height: 72px; } .avatar.md { width: 44px; height: 44px; }

/* Bottom nav (mobile) */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); z-index: 50; padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; font-size: 11px; color: var(--muted); font-weight: 600; position: relative; }
.bottom-nav a:hover { text-decoration: none; }
.bottom-nav a.active { color: var(--primary); }
.bottom-nav .sell-fab { margin-top: -22px; }
.bottom-nav .sell-fab span.fab { width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(246,139,30,.45); border: 4px solid #fff; }
.bottom-nav .dot { position: absolute; top: 5px; left: 55%; background: var(--accent); color: #fff; font-size: 10px; border-radius: 9px; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 3px; }
@media (min-width: 900px) { .bottom-nav { display: none; } }

/* ---------- Generic components ---------- */
main { min-height: 60vh; }
.page { padding: 20px 0 40px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-title h2, .card-title h3 { margin: 0; }
.section { margin: 26px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.section-head h2 { margin: 0; font-size: 1.2rem; }
.section-head a { font-weight: 600; font-size: 14px; white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; font: 600 14.5px var(--font); border: 1px solid transparent; cursor: pointer; text-decoration: none !important; background: var(--primary); color: #fff; transition: background .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { background: var(--primary-700); }
.btn:focus-visible { outline: 3px solid var(--primary-100); outline-offset: 1px; }
.btn-accent { background: var(--accent); } .btn-accent:hover { background: var(--accent-700); }
.btn-outline { background: #fff; color: var(--primary); border-color: var(--primary-100); }
.btn-outline:hover { background: var(--primary-50); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: var(--danger); } .btn-danger:hover { background: #a01f1f; }
.btn-danger-outline { background: #fff; color: var(--danger); border-color: #f3c9c9; } .btn-danger-outline:hover { background: var(--danger-50); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.link-btn { background: none; border: 0; color: var(--primary); font: inherit; cursor: pointer; padding: 0; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 20px; white-space: nowrap; }
.badge-success { background: var(--success-50); color: var(--success); }
.badge-danger { background: var(--danger-50); color: var(--danger); }
.badge-warning { background: var(--warning-50); color: var(--warning); }
.badge-info { background: var(--info-50); color: var(--info); }
.badge-muted { background: #eef1ef; color: var(--muted); }
.badge-accent { background: var(--accent); color: #fff; }
.verified { color: var(--info); display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 700; }

.alert { padding: 12px 14px; border-radius: 10px; margin: 0 0 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; border: 1px solid transparent; }
.alert-success { background: var(--success-50); color: #11612f; border-color: #c3ecd2; }
.alert-danger { background: var(--danger-50); color: #8f1c1c; border-color: #f4cccc; }
.alert-warning { background: var(--warning-50); color: #874005; border-color: #f7dcb0; }
.alert-info { background: var(--info-50); color: #164a8f; border-color: #cfe0fa; }
.alerts { padding-top: 16px; }

/* Forms */
.form-group { margin-bottom: 15px; }
label, .label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; color: var(--ink-2); }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 4px; font-weight: 400; }
.input, select.input, textarea.input { width: 100%; padding: 11px 12px; border: 1px solid #cfd8d3; border-radius: 10px; font: inherit; background: #fff; color: var(--ink); transition: border .15s, box-shadow .15s; }
textarea.input { resize: vertical; min-height: 110px; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.input.is-invalid { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 5px; font-weight: 600; }
.check { display: flex; gap: 9px; align-items: flex-start; font-weight: 500; font-size: 14px; cursor: pointer; margin-bottom: 10px; color: var(--ink); }
.check input { margin-top: 3px; accent-color: var(--primary); width: 17px; height: 17px; flex: none; }
.form-row { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-row.cols-2 { grid-template-columns: 1fr 1fr; } .form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; } }
.input-prefix { display: flex; } .input-prefix span { padding: 11px 12px; background: var(--bg); border: 1px solid #cfd8d3; border-right: 0; border-radius: 10px 0 0 10px; font-weight: 700; color: var(--muted); font-size: 14px; }
.input-prefix .input, .input-prefix select { border-radius: 0 10px 10px 0; }
.choice-cards { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .choice-cards { grid-template-columns: 1fr 1fr; } }
.choice { position: relative; display: block; border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 14px 13px 42px; cursor: pointer; background: #fff; font-weight: 500; margin: 0; }
.choice input { position: absolute; left: 14px; top: 16px; accent-color: var(--primary); width: 17px; height: 17px; }
.choice strong { display: block; color: var(--ink); font-size: 14.5px; }
.choice small { color: var(--muted); font-size: 12.5px; display: block; margin-top: 2px; }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
.choice.disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Home ---------- */
.hero { background: linear-gradient(135deg, var(--primary) 0%, #0e7a4e 60%, #12895a 100%); color: #fff; border-radius: 0 0 22px 22px; padding: 26px 0 30px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -80px; top: -60px; width: 300px; height: 300px; border-radius: 50%; background: rgba(255,255,255,.07); }
.hero::before { content: ""; position: absolute; right: 120px; bottom: -90px; width: 200px; height: 200px; border-radius: 50%; background: rgba(246,139,30,.18); }
.hero h1 { color: #fff; font-size: 1.55rem; max-width: 560px; margin-bottom: 6px; position: relative; z-index: 1; }
.hero p { opacity: .9; margin: 0 0 18px; max-width: 520px; position: relative; z-index: 1; }
.hero .search { max-width: 640px; box-shadow: 0 8px 24px rgba(0,0,0,.15); position: relative; z-index: 1; }
.hero .search input { padding: 14px; font-size: 15.5px; }
.hero-stats { display: flex; gap: 22px; margin-top: 18px; position: relative; z-index: 1; flex-wrap: wrap; }
.hero-stats div { font-size: 13px; opacity: .9; } .hero-stats strong { display: block; font-size: 20px; opacity: 1; }
@media (min-width: 900px) { .hero { padding: 40px 0 44px; } .hero h1 { font-size: 2.1rem; } }

.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 1000px) { .cat-grid { grid-template-columns: repeat(12, 1fr); } }
.cat { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 4px; background: #fff; border-radius: 12px; border: 1px solid var(--line); color: var(--ink-2); font-size: 12px; font-weight: 600; text-align: center; line-height: 1.25; transition: transform .15s, box-shadow .15s; }
.cat:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--primary-100); }
.cat .cat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.cat:nth-child(3n+2) .cat-icon { background: var(--accent-50); color: var(--accent-700); }
.cat:nth-child(3n) .cat-icon { background: var(--info-50); color: var(--info); }
.cat .n { color: var(--muted); font-weight: 500; font-size: 11px; }

.promo-row { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .promo-row { grid-template-columns: repeat(3, 1fr); } }
.promo { border-radius: var(--radius); padding: 16px; display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); }
.promo .pi { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--primary-50); color: var(--primary); }
.promo h3 { margin: 0 0 2px; font-size: 14.5px; } .promo p { margin: 0; font-size: 13px; color: var(--muted); }

.deals { background: #fff; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.deals-head { background: var(--accent); color: #fff; padding: 11px 16px; display: flex; justify-content: space-between; align-items: center; }
.deals-head h2 { color: #fff; margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.deals-head a { color: #fff; font-weight: 700; font-size: 14px; }
.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: 46%; gap: 12px; overflow-x: auto; padding: 14px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.hscroll > * { scroll-snap-align: start; }
@media (min-width: 640px) { .hscroll { grid-auto-columns: 30%; } }
@media (min-width: 1000px) { .hscroll { grid-auto-columns: calc((100% - 60px) / 6); } }

/* Product grid & card */
.grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } .grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.pcard { background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); display: flex; flex-direction: column; position: relative; transition: box-shadow .15s, transform .15s; }
.pcard:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.pcard a.cover { display: block; aspect-ratio: 1 / 1; background: #eef1ef; overflow: hidden; }
.pcard a.cover img { width: 100%; height: 100%; object-fit: cover; }
.pcard .body { padding: 10px 11px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.pcard .price { font-weight: 800; color: var(--primary); font-size: 16px; }
.pcard .title { color: var(--ink); font-size: 13.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.pcard .title:hover { color: var(--primary); text-decoration: none; }
.pcard .meta { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 4px; margin-top: auto; padding-top: 4px; }
.pcard .tags { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; flex-wrap: wrap; z-index: 1; }
.pcard .tags .badge { font-size: 10.5px; padding: 3px 7px; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.tag-neg { background: #fff; color: var(--primary); }
.fav-btn { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.95); border: 0; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); box-shadow: 0 1px 4px rgba(0,0,0,.12); z-index: 1; }
.fav-btn:hover { color: var(--danger); }
.fav-btn.on { color: var(--danger); } .fav-btn.on .icon { fill: currentColor; }
.pcard.sold a.cover img { filter: grayscale(.8); opacity: .7; }

/* Browse */
.browse-layout { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .browse-layout { grid-template-columns: 270px 1fr; } }
.filters { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; align-self: start; }
@media (max-width: 899px) {
  .filters { position: fixed; inset: 0; z-index: 80; overflow-y: auto; border-radius: 0; transform: translateX(-100%); transition: transform .2s; padding-bottom: 90px; }
  .filters.open { transform: none; }
}
@media (min-width: 900px) { .filters { position: sticky; top: calc(var(--header-h) + 54px); } .filters-close { display: none; } }
.filters h3 { font-size: 14px; margin: 16px 0 8px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.filters h3:first-of-type { margin-top: 0; }
.cat-list a { display: flex; justify-content: space-between; padding: 6px 8px; border-radius: 7px; color: var(--ink-2); font-size: 14px; }
.cat-list a:hover { background: var(--bg); text-decoration: none; }
.cat-list a.active { background: var(--primary-50); color: var(--primary); font-weight: 700; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar select { width: auto; padding: 8px 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 5px 10px; font-size: 13px; color: var(--ink-2); }
.chip:hover { text-decoration: none; border-color: var(--danger); color: var(--danger); }

.pagination { display: flex; gap: 6px; justify-content: center; margin: 24px 0 0; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; padding: 0 10px; }
.pagination a:hover { text-decoration: none; border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

.empty { text-align: center; padding: 42px 16px; color: var(--muted); }
.empty .icon { width: 46px; height: 46px; color: #b3c2ba; margin: 0 auto 10px; stroke-width: 1.5; }
.empty h3 { color: var(--ink-2); }

/* Product page */
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 12px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.breadcrumb a { color: var(--muted); }
.product-layout { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .product-layout { grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); align-items: start; } .product-side { position: sticky; top: calc(var(--header-h) + 60px); } }
.gallery-main { background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4 / 3; display: grid; place-items: center; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; background: #f7f9f8; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.thumbs button { flex: none; width: 70px; height: 70px; border-radius: 9px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: #eee; }
.thumbs button.active { border-color: var(--primary); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.price-big { font-size: 1.9rem; font-weight: 800; color: var(--primary); letter-spacing: -.02em; line-height: 1.1; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; color: var(--ink-2); }
.desc { white-space: pre-line; color: var(--ink-2); }
.seller-box { display: flex; gap: 12px; align-items: center; }
.rating { color: #e8a317; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.rating .icon { fill: currentColor; stroke: none; width: 15px; height: 15px; }
.action-stack { display: grid; gap: 9px; }
.offer-box { background: var(--accent-50); border: 1px dashed #f5c48f; border-radius: 12px; padding: 14px; }
.safety { background: var(--primary-50); border-radius: 12px; padding: 14px; font-size: 13.5px; color: var(--ink-2); }
.safety ul { margin: 6px 0 0; padding-left: 18px; }
details.collapse { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
details.collapse > summary { cursor: pointer; padding: 11px 14px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.collapse > summary::-webkit-details-marker { display: none; }
details.collapse > summary::after { content: "+"; font-size: 18px; color: var(--muted); }
details.collapse[open] > summary::after { content: "−"; }
details.collapse > div { padding: 0 14px 14px; }

/* Negotiation timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 16px 28px; }
.timeline li::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--primary-100); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--primary-100); }
.timeline li.current .dot { background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.timeline .amt { font-weight: 800; font-size: 16px; }

/* Messages */
.chat-layout { display: grid; grid-template-columns: 1fr; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; height: calc(100vh - 210px); min-height: 460px; }
@media (min-width: 900px) { .chat-layout { grid-template-columns: 330px 1fr; height: calc(100vh - 190px); } }
.chat-list { border-right: 1px solid var(--line); overflow-y: auto; }
.chat-list a { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--ink); align-items: center; }
.chat-list a:hover { background: var(--bg); text-decoration: none; }
.chat-list a.active { background: var(--primary-50); }
.chat-list .thumb { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: #eee; flex: none; }
.chat-list .unread { background: var(--accent); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; font-weight: 700; }
.chat-pane { display: flex; flex-direction: column; min-height: 0; }
.chat-head { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.chat-product { display: flex; gap: 10px; align-items: center; padding: 8px 14px; background: var(--bg); border-bottom: 1px solid var(--line); font-size: 13.5px; }
.chat-product img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px 14px; background: #f7f9f8; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 78%; padding: 9px 12px; border-radius: 14px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; background: #fff; border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.mine { align-self: flex-end; background: var(--primary); color: #fff; border-color: var(--primary); border-bottom-left-radius: 14px; border-bottom-right-radius: 4px; }
.msg .time { display: block; font-size: 10.5px; opacity: .7; margin-top: 3px; text-align: right; }
.msg.offer { background: var(--accent-50); color: var(--ink); border: 1px solid #f5c48f; }
.msg.offer.mine { background: var(--accent); color: #fff; border-color: var(--accent); }
.msg.system { align-self: center; background: transparent; border: 0; color: var(--muted); font-size: 12.5px; text-align: center; max-width: 90%; padding: 2px; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: #fff; }
.chat-form textarea { flex: 1; resize: none; min-height: 44px; max-height: 120px; }
@media (max-width: 899px) { .chat-layout.has-active .chat-list { display: none; } .chat-layout:not(.has-active) .chat-pane { display: none; } }

/* Dashboard */
.dash-layout { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .dash-layout { grid-template-columns: 240px 1fr; } }
.side-nav { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; align-self: start; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 11px; border-radius: 9px; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.side-nav a:hover { background: var(--bg); text-decoration: none; }
.side-nav a.active { background: var(--primary-50); color: var(--primary); }
.side-nav .count { margin-left: auto; background: var(--accent); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; }
@media (max-width: 899px) { .side-nav { display: flex; overflow-x: auto; gap: 4px; padding: 6px; } .side-nav a { white-space: nowrap; padding: 8px 10px; font-size: 13px; } .side-nav a .icon { display: none; } }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: block; color: var(--ink); }
a.stat:hover { text-decoration: none; border-color: var(--primary-100); box-shadow: var(--shadow); }
.stat .v { font-size: 1.6rem; font-weight: 800; line-height: 1.1; color: var(--ink); }
.stat .l { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat .si { float: right; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.stat.warn .si { background: var(--accent-50); color: var(--accent-700); }

.list-item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item img.thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: #eee; flex: none; }
.list-item .title { font-weight: 600; color: var(--ink); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; font-size: 14px; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
.notif { display: flex; gap: 12px; padding: 12px; border-radius: 10px; color: var(--ink); }
.notif:hover { background: var(--bg); text-decoration: none; }
.notif.unread { background: var(--primary-50); }
.notif .ni { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--primary); flex: none; border: 1px solid var(--line); }

/* Tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfa; white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: #fafcfb; }
.table img.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }

/* Order */
.steps { display: flex; gap: 0; margin: 6px 0 4px; }
.steps .step { flex: 1; text-align: center; position: relative; font-size: 11.5px; color: var(--muted); font-weight: 600; padding-top: 30px; }
.steps .step::before { content: ""; position: absolute; top: 8px; left: 50%; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: #dfe5e2; z-index: 1; border: 3px solid #fff; box-shadow: 0 0 0 1px #dfe5e2; }
.steps .step::after { content: ""; position: absolute; top: 16px; left: -50%; width: 100%; height: 3px; background: #dfe5e2; }
.steps .step:first-child::after { display: none; }
.steps .step.done { color: var(--primary); } .steps .step.done::before { background: var(--primary); box-shadow: 0 0 0 1px var(--primary); } .steps .step.done::after { background: var(--primary); }
.summary-line { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14.5px; }
.summary-line.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; font-weight: 800; font-size: 17px; }
.stars { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.stars input { display: none; }
.stars label { font-size: 28px; color: #d6dcd9; cursor: pointer; margin: 0; line-height: 1; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: #e8a317; }

/* Footer */
.footer { background: #0f1f18; color: #c8d3ce; margin-top: 40px; padding: 34px 0 20px; font-size: 14px; }
.footer a { color: #c8d3ce; } .footer a:hover { color: #fff; }
.footer h4 { color: #fff; font-size: 14px; margin-bottom: 10px; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1.2fr; } }
.footer ul { list-style: none; padding: 0; margin: 0; } .footer li { margin-bottom: 7px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 24px; padding-top: 16px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 13px; color: #8fa198; }
.app-badge { display: inline-flex; align-items: center; gap: 8px; background: #000; color: #fff !important; border: 1px solid #3a4a43; border-radius: 9px; padding: 7px 12px; margin: 0 6px 6px 0; font-size: 12px; line-height: 1.2; }
.app-badge strong { display: block; font-size: 14px; }
.app-badge:hover { text-decoration: none; border-color: #fff; }

/* Auth */
.auth-wrap { max-width: 460px; margin: 28px auto; }
.auth-wrap.wide { max-width: 640px; }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 26px 22px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.45rem; margin-bottom: 4px; }

/* Sell form */
.upload-zone { border: 2px dashed #c4d1ca; border-radius: 12px; padding: 22px; text-align: center; background: #fafcfb; cursor: pointer; display: block; color: var(--muted); font-weight: 500; }
.upload-zone:hover { border-color: var(--primary); background: var(--primary-50); }
.upload-zone input { display: none; }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; margin-top: 10px; }
.previews .pv { position: relative; aspect-ratio: 1; border-radius: 9px; overflow: hidden; background: #eee; }
.previews .pv img { width: 100%; height: 100%; object-fit: cover; }
.previews .pv label { position: absolute; inset: auto 0 0 0; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; padding: 3px 5px; margin: 0; display: flex; gap: 4px; align-items: center; cursor: pointer; }
.previews .pv .cover-tag { position: absolute; top: 4px; left: 4px; background: var(--accent); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 6px; font-weight: 700; }

/* Modal (details-based, no JS required) */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 20, 15, .5); z-index: 90; display: none; align-items: flex-end; justify-content: center; padding: 0; }
.modal-backdrop.open { display: flex; }
@media (min-width: 640px) { .modal-backdrop { align-items: center; padding: 20px; } }
.modal { background: #fff; width: 100%; max-width: 480px; border-radius: 16px 16px 0 0; padding: 20px; max-height: 90vh; overflow-y: auto; }
@media (min-width: 640px) { .modal { border-radius: 16px; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-head h3 { margin: 0; }
.x-btn { background: var(--bg); border: 0; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; color: var(--ink-2); }

.install-banner { position: fixed; left: 12px; right: 12px; bottom: 82px; background: var(--ink); color: #fff; border-radius: 14px; padding: 12px 14px; display: none; align-items: center; gap: 12px; z-index: 70; box-shadow: var(--shadow-lg); }
.install-banner.show { display: flex; }
@media (min-width: 900px) { .install-banner { left: auto; right: 20px; bottom: 20px; width: 360px; } }
.install-banner img { width: 42px; height: 42px; border-radius: 10px; }

.prose h3 { margin-top: 1.3em; } .prose ul { padding-left: 20px; } .prose li { margin-bottom: 6px; }
.kbd { font-family: ui-monospace, Menlo, Consolas, monospace; background: #eef1ef; border-radius: 6px; padding: 2px 6px; font-size: 13px; word-break: break-all; }
pre.code { background: #0f1f18; color: #d6e5dd; padding: 14px; border-radius: 10px; overflow-x: auto; font-size: 12.5px; line-height: 1.5; }
