/* ===== TricityBazaar – mobile-first stylesheet (no external fonts, no frameworks) ===== */
:root {
  --brand: #0b3a75; --brand-2: #0f4c97; --brand-50: #eef4fc;
  --accent: #c2410c; --accent-d: #9a3412;
  --text: #0f172a; --muted: #475569; --border: #dbe3ee; --bg: #f6f8fb; --card: #fff;
  --ok: #166534; --ok-bg: #dcfce7; --danger: #b91c1c; --warn-bg: #fff7e6; --warn: #8a4b00;
  --radius: 12px; --shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 16px rgba(15,23,42,.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 var(--font); color: var(--text); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; outline: none; padding-bottom: 32px; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-2); }
a:hover { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; color: var(--text); }
h1 { font-size: clamp(1.6rem, 4.5vw, 2.4rem); letter-spacing: -.01em; }
h2 { font-size: 1.35rem; }
h3, .h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.visually-hidden-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.visually-hidden-input:focus-visible + *, .photo-add:focus-within { outline: 3px solid #f59e0b; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 8px; color: #fff; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.center { text-align: center; margin-top: 20px; }
.center-text { text-align: center; padding-top: 48px; }
.muted { color: var(--muted); }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 62ch; }
.icon { width: 20px; height: 20px; flex: none; }
.icon-lg { width: 36px; height: 36px; }
[hidden] { display: none !important; }

/* ----- buttons ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; font: 600 1rem/1.2 var(--font); text-decoration: none; cursor: pointer; transition: background .15s, box-shadow .15s; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: #082c59; color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-d); color: #fff; }
.btn-ghost { background: #fff; color: var(--brand); border-color: var(--border); }
.btn-ghost:hover { background: var(--brand-50); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-wa { background: #157a3c; color: #fff; }
.btn-wa:hover { background: #0f5f2e; color: #fff; }
.btn-lg { min-height: 50px; padding: 12px 22px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 6px 12px; font-size: .9rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; background: transparent; color: inherit; border-radius: 10px; cursor: pointer; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-2); text-decoration: underline; cursor: pointer; min-height: 44px; }

/* ----- header ----- */
.site-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 10px; min-height: 64px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.2rem; color: var(--brand); text-decoration: none; letter-spacing: -.01em; margin-right: auto; }
.logo-light { color: #fff; }
.header-search { order: 5; flex-basis: 100%; display: flex; margin-bottom: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.header-search input { flex: 1; border: 0; background: transparent; padding: 10px 12px; font: inherit; min-width: 0; }
.header-search input:focus { outline: none; }
.header-search:focus-within { outline: 3px solid #f59e0b; }
.main-nav { display: none; order: 6; flex-basis: 100%; flex-direction: column; padding-bottom: 12px; }
.main-nav.open { display: flex; }
.main-nav a, .main-nav .linklike { padding: 10px 4px; color: var(--text); text-decoration: none; font-weight: 500; text-align: left; display: flex; align-items: center; }
.main-nav a:hover { color: var(--brand-2); }
.sell-btn { min-height: 40px; padding: 8px 14px; }
@media (min-width: 900px) {
  .header-inner { flex-wrap: nowrap; gap: 20px; }
  .logo { margin-right: 0; }
  .header-search { order: 0; flex: 1; flex-basis: auto; margin: 0; max-width: 460px; }
  .main-nav { display: flex; flex-direction: row; flex-basis: auto; order: 0; padding: 0; gap: 18px; margin-left: auto; }
  .menu-toggle { display: none; }
}

/* ----- hero ----- */
.hero { background: linear-gradient(135deg, #0b3a75 0%, #0f4c97 60%, #1663b8 100%); color: #fff; padding: 36px 0 32px; }
.hero h1 { color: #fff; max-width: 22ch; }
.hero .lead { color: #dbe7f7; }
.hero-search { display: grid; gap: 10px; background: #fff; padding: 12px; border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.18); margin-top: 18px; max-width: 860px; }
.hero-search label { color: var(--muted); font-size: .85rem; font-weight: 600; }
.trust { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px 22px; color: #e6eefa; font-size: .95rem; }
.trust li { display: inline-flex; gap: 6px; align-items: center; }
@media (min-width: 720px) { .hero { padding: 56px 0 48px; } .hero-search { grid-template-columns: 1fr 200px auto; align-items: end; } }

/* ----- forms ----- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field.grow { flex: 1; }
label, legend { font-weight: 600; font-size: .95rem; }
legend { padding: 0; margin-bottom: 6px; }
input, select, textarea { font: inherit; color: var(--text); background: #fff; border: 1px solid #94a3b8; border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid #f59e0b; outline-offset: 0; border-color: var(--brand); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.hint { color: var(--muted); font-size: .85rem; }
.form-error { color: var(--danger); font-weight: 600; margin: 0; }
.form-error:empty { display: none; }
.form-ok { color: var(--ok); font-weight: 600; }
.row2 { display: grid; gap: 14px; }
@media (min-width: 600px) { .row2 { grid-template-columns: 1fr 1fr; } }
.stack > * + * { margin-top: 16px; }
.card-form { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 22px; height: 22px; min-height: 0; margin-top: 2px; flex: none; }
.prefix-input { display: flex; align-items: stretch; }
.prefix-input span { display: flex; align-items: center; padding: 0 10px; background: var(--bg); border: 1px solid #94a3b8; border-right: 0; border-radius: 10px 0 0 10px; font-weight: 600; }
.prefix-input input { border-radius: 0 10px 10px 0; }
.row-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ----- sections ----- */
.section { margin-top: 36px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h1, .section-head h2 { margin: 0; }
main > .container > h1:first-child, .breadcrumbs + h1 { margin-top: 8px; }
.link-more { font-weight: 600; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 16px 0 8px; display: flex; flex-wrap: wrap; gap: 6px; font-size: .9rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "›"; margin-right: 6px; }
.prose { max-width: 75ch; }
.prose h2 { margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
main > .container.prose, main > .container.narrow { padding-top: 4px; }

/* categories */
.cat-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.cat { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 14px 6px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none; font-weight: 600; font-size: .9rem; height: 100%; transition: border-color .15s, transform .15s; }
.cat:hover { border-color: var(--brand-2); color: var(--brand); transform: translateY(-1px); }
.cat-ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--brand-50); color: var(--brand); }
.cat-ic .icon { width: 24px; height: 24px; }
@media (min-width: 900px) { .cat-grid { grid-template-columns: repeat(11, 1fr); } }

/* listing cards */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; color: var(--text); text-decoration: none; box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; }
a.card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(15,23,42,.12); color: var(--text); }
.card-img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; background: #e8eef6; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.price { font-weight: 800; font-size: 1.15rem; color: var(--text); }
.card-title { font-size: .95rem; font-weight: 500; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; line-height: 1.45; }
.card-meta { display: flex; justify-content: space-between; gap: 6px; color: var(--muted); font-size: .8rem; margin-top: 4px; }
.card-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.badge-sample { position: absolute; top: 8px; left: 8px; background: #fde68a; color: #713f12; border: 1px solid #b45309; }
.badge-sold { background: #e2e8f0; color: #334155; }
.badge-active { background: var(--ok-bg); color: var(--ok); }
.badge-review { background: var(--warn-bg); color: var(--warn); }
.skeleton, .sk-img { background: linear-gradient(90deg, #eef2f7 25%, #e3e9f1 50%, #eef2f7 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; box-shadow: none; }
.skeleton { box-shadow: none; }
.skeleton .sk-img { aspect-ratio: 4 / 3; }
.card-body { min-height: 126px; }
.grid.listings { align-content: start; }
.cta-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 20px 12px; border: 1px dashed var(--border); background: #f8fafc; color: inherit; text-decoration: none; }
.cta-card:hover, .cta-card:focus-visible { border-color: var(--brand, #0b3a75); }
.cta-ic { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; background: #e8eef7; color: #0b3a75; }
.cta-t { font-weight: 600; }
/* FAQ accordion */
.faq details { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 0 16px; margin-bottom: 10px; max-width: 80ch; }
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; }
.faq details p { margin: 0 0 14px; }
.sk-crumb { height: 21px; margin: 16px 0 8px; }
.sk-gallery { aspect-ratio: 4 / 3; border-radius: var(--radius); }
.sk-panel { min-height: 320px; }
.sk-side { min-height: 360px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.empty { grid-column: 1 / -1; text-align: center; padding: 40px 16px; background: #fff; border: 1px dashed var(--border); border-radius: var(--radius); }
.result-count { color: var(--muted); margin: 0 0 12px; min-height: 1.5em; }

/* chips */
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; min-height: 40px; background: #fff; border: 1px solid var(--border); border-radius: 999px; color: var(--text); text-decoration: none; font-size: .92rem; }
.chip .icon { width: 16px; height: 16px; color: var(--accent); }
.chip:hover { border-color: var(--brand-2); color: var(--brand); }

/* steps + callout */
.steps { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; text-align: center; }
.steps-list { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 18px; }
@media (min-width: 720px) { .steps-list { grid-template-columns: repeat(3, 1fr); } }
.step-n { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; margin-bottom: 8px; }
.steps p { color: var(--muted); margin: 0; }
.callout { display: flex; gap: 16px; align-items: flex-start; margin-top: 36px; padding: 20px; background: var(--warn-bg); border: 1px solid #f3d29b; border-radius: var(--radius); color: var(--text); }
.callout .icon { color: var(--warn); }
.callout p { margin: 0 0 .5em; }
.notice { padding: 14px 16px; border-radius: var(--radius); border: 1px solid #f3d29b; background: var(--warn-bg); margin: 16px 0; }
.notice-info { border-color: #bcd3f2; background: var(--brand-50); }
.notice-ok { border-color: #86efac; background: var(--ok-bg); }
.notice > :last-child { margin-bottom: 0; }

/* browse layout */
.browse { display: grid; gap: 20px; margin-top: 12px; }
.filters { display: grid; gap: 12px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; align-self: start; }
.filter-actions { display: flex; gap: 8px; }
.filter-actions .btn { flex: 1; }
@media (min-width: 600px) and (max-width: 959px) { .filters { grid-template-columns: 1fr 1fr; } .filter-actions { grid-column: 1 / -1; } }
@media (min-width: 960px) { .browse { grid-template-columns: 280px 1fr; } .filters { position: sticky; top: 84px; } }
.price-range .row2 { grid-template-columns: 1fr 1fr; gap: 8px; }

/* detail */
.detail { display: grid; gap: 20px; margin-top: 12px; }
@media (min-width: 960px) { .detail { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); grid-template-areas: "g s" "d s"; align-items: start; } .d-gallery { grid-area: g; } .detail-side { grid-area: s; position: sticky; top: 84px; } .d-details { grid-area: d; } }
.desc-h { margin-top: 18px; }
.gallery { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.gallery-main { position: relative; background: #0f172a; aspect-ratio: 4 / 3; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.92); border: 0; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--text); box-shadow: var(--shadow); }
.gallery-prev { left: 10px; } .gallery-next { right: 10px; }
.gallery-count { position: absolute; bottom: 10px; right: 10px; background: rgba(15,23,42,.8); color: #fff; padding: 2px 10px; border-radius: 999px; font-size: .85rem; }
.thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; list-style: none; margin: 0; }
.thumbs button { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: none; flex: none; width: 76px; }
.thumbs button[aria-current="true"] { border-color: var(--accent); }
.thumbs img { width: 72px; height: 54px; object-fit: cover; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 14px; }
.detail-price { font-size: 2rem; font-weight: 800; margin: 0; }
.detail-title { font-size: 1.3rem; font-weight: 600; margin: 4px 0 10px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.contact-actions { display: grid; gap: 10px; margin-top: 14px; }
.description { white-space: pre-line; overflow-wrap: anywhere; }
.seller { display: flex; align-items: center; gap: 12px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; font-weight: 800; flex: none; }

/* post form photos */
.photo-grid { list-style: none; padding: 0; margin: 4px 0 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.photo-grid li { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); aspect-ratio: 1; background: #eef2f7; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid .remove { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(15,23,42,.85); color: #fff; display: grid; place-items: center; cursor: pointer; }
.photo-grid .remove .icon { width: 16px; height: 16px; }
.photo-grid .cover { position: absolute; left: 4px; bottom: 4px; background: var(--brand); color: #fff; font-size: .7rem; padding: 1px 6px; border-radius: 6px; }
.photo-add { align-self: flex-start; cursor: pointer; }

/* my ads */
.my-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.my-item { display: grid; grid-template-columns: 96px 1fr; gap: 12px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.my-item img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; background: #eef2f7; }
.my-item h2 { font-size: 1rem; margin: 0 0 4px; }
.my-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
@media (min-width: 720px) { .my-item { grid-template-columns: 120px 1fr auto; align-items: center; } .my-item img { width: 120px; height: 90px; } .my-actions { grid-column: auto; } }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin: 16px 0; }
.tabs [role="tab"] { flex: 1; background: none; border: 0; padding: 12px 8px; font: 600 1rem var(--font); color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; min-height: 44px; }
.tabs [aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }

/* dialog */
dialog { border: 0; border-radius: var(--radius); padding: 22px; width: min(480px, calc(100% - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.3); color: var(--text); }
dialog::backdrop { background: rgba(15,23,42,.55); }

/* contact list */
.contact-list { list-style: none; padding: 0 !important; }
.contact-list li { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.contact-list .icon { color: var(--brand); }

/* footer */
.site-footer { background: #0b1f3a; color: #cbd5e1; margin-top: 48px; padding-top: 36px; }
.site-footer a { color: #e2e8f0; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: 1fr 1fr; }
.footer-grid > div:first-child { grid-column: 1 / -1; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; } .footer-grid > div:first-child { grid-column: auto; } }
.footer-grid p { margin-top: 12px; font-size: .95rem; }
.footer-h { color: #fff; font-size: .95rem; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .06em; }
.footer-h:not(:first-child) { margin-top: 18px; }
.footer-links { list-style: none; padding: 0; margin: 0; font-size: .95rem; }
.footer-links li { margin-bottom: 6px; overflow-wrap: anywhere; }
.footer-links a { display: inline-block; padding: 3px 0; }
.footer-bottom { border-top: 1px solid #1e3a5f; margin-top: 28px; padding: 16px; font-size: .85rem; }
.footer-bottom p { margin: 0; }

/* demo bar + toast */
.demo-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fde68a; color: #422006; border-top: 1px solid #b45309; padding: 8px 16px; text-align: center; font-size: .92rem; }
body.has-demo { padding-bottom: 64px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #0f172a; color: #fff; padding: 12px 18px; border-radius: 10px; max-width: calc(100% - 32px); z-index: 70; opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.show { opacity: 1; }

/* spacing fixes */
main > .container > h1:first-child, main > .container > .section-head:first-child { margin-top: 24px; }
.notice + .gallery { margin-top: 14px; }
.detail .panel + .panel { margin-top: 14px; }
@media (min-width: 900px) { .hero .container { background: url("/assets/img/hero-art.svg") no-repeat right center / 340px auto; } .hero-search { max-width: 760px; } }
body.has-demo .toast { bottom: 76px; }
/* reserve room for the demo / login notice on the post page so the form does not jump (CLS) */
#post-gate:empty { min-height: 104px; }
#post-gate.settled:empty { min-height: 0; }
@media (min-width: 640px) { #post-gate:empty { min-height: 84px; } }
