/* Chợ Mới · shared visual system. Business behavior stays in app.js. */
:root {
  --green: #123f34;
  --green-dark: #0d3228;
  --ink: #163c31;
  --muted: #576b62;
  --line: #dce5de;
  --surface: #ffffff;
  --white: #ffffff;
  --cream: #f5f8f4;
  --canvas: #f7faf7;
  --mint: #eaf2e9;
  --lime: #d9f279;
  --red: #a6382c;
  --radius: 20px;
  --site-header-height: 80px;
  --announcement-height: 32px;
  --mobile-nav-height: 72px;
  --sc-canvas: var(--canvas);
  --sc-surface: var(--surface);
  --sc-ink: var(--ink);
  --sc-ink-soft: var(--muted);
  --sc-accent: var(--lime);
  --sc-accent-ink: var(--green);
  --sc-font-display: 'Be Vietnam Pro', sans-serif;
  --sc-font-text: 'Be Vietnam Pro', sans-serif;
  --sc-shadow-color: 154 25% 20%;
  --sc-e1: 0 2px 4px hsl(var(--sc-shadow-color) / .04), 0 8px 20px -6px hsl(var(--sc-shadow-color) / .07);
  --sc-e2: 0 4px 10px hsl(var(--sc-shadow-color) / .05), 0 18px 40px -10px hsl(var(--sc-shadow-color) / .12);
  --sc-e3: 0 8px 16px hsl(var(--sc-shadow-color) / .06), 0 28px 64px -16px hsl(var(--sc-shadow-color) / .16);
  --sc-edge: inset 0 1px 0 rgb(255 255 255 / .65);
  font-size: 14px;
  scroll-padding-top: 100px;
}

html { scrollbar-color: #a2b2a5 transparent; }
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: -.015em;
  overflow-x: clip;
}
body[data-page='home'] { background: #fcfdf9; }
::selection { background: var(--lime); color: var(--green); }
:root { accent-color: var(--green); caret-color: var(--green); }
:focus-visible { outline: 3px solid #266b50; outline-offset: 4px; }
h1, h2, h3 { color: var(--ink); text-wrap: balance; }
p { text-wrap: pretty; }
a, button { -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font-family: inherit; }
img, svg { max-width: 100%; }
.wrap { width: calc(100% - 64px); max-width: 1280px; margin-inline: auto; }
.skip-link { z-index: 200; font-size: 14px; padding: 12px 20px; border-radius: 0 0 12px 12px; }
.heading-dot { color: #608c4d; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .11em; }

/* A working marketplace header, with a visible publishing action. */
.announcement {
  height: var(--announcement-height);
  min-height: var(--announcement-height);
  padding: 0 32px;
  background: var(--green);
  color: #eaf2e4;
  font-size: 11px;
  letter-spacing: .01em;
}
.announcement-dot { width: 5px; height: 5px; background: var(--lime); }
.announcement-location { color: #d0e1d3; font-size: 11px; }
.announcement-location svg { width: 13px; height: 13px; }
.site-header {
  height: var(--site-header-height);
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgb(255 255 255 / .97);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.header-inner { gap: 24px; }
.brand { font-size: 32px; font-weight: 700; letter-spacing: -1.8px; gap: 7px; }
.brand-mark { width: 34px; height: 36px; }
.brand-mark svg { width: 100%; height: 100%; stroke-width: 1.65; }
.brand-light { font-weight: 600; }
.brand i { width: 6px; height: 6px; margin-left: 3px; background: #90b76d; }
.desktop-nav { gap: 26px; margin: 0 auto; padding-left: 36px; font-size: 13px; font-weight: 500; }
.desktop-nav a { color: var(--muted); }
.desktop-nav a.active, .desktop-nav a:hover { color: var(--green); }
.desktop-nav a.active::after { height: 3px; bottom: 17px; background: #7d9f5c; border-radius: 5px; }
.header-actions { gap: 12px; flex-shrink: 0; }
.header-actions > .icon-button { width: 38px; height: 40px; padding: 8px; border-radius: 12px; }
.header-actions > .icon-button:hover { background: var(--mint); }
.header-actions > .icon-button svg { width: 22px; height: 22px; }
.login-link { color: var(--green); font-size: 13px; font-weight: 600; white-space: nowrap; }
.button {
  min-height: 46px;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  gap: 9px;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
.button svg { width: 19px; height: 19px; }
.button-primary { color: #fff; background: var(--green); border: 1px solid var(--green); }
.button-primary:hover { background: #205b45; border-color: #205b45; box-shadow: 0 4px 12px rgb(18 63 52 / .1); }
.button-secondary { background: #fff; color: var(--green); border: 1px solid #cbd9ce; }
.button-secondary:hover { background: #f1f6ed; border-color: #8ba98f; }
.button-danger { color: #a6382c; border-color: #e4c9c4; background: #fff6f2; }
.post-button, .post-button:hover { background: var(--lime); color: var(--green); border-color: var(--lime); }
.post-button { min-height: 44px; padding: 10px 17px; }
.avatar { width: 40px; height: 40px; border: 1px solid #d8e4d5; background: #edf3e7; color: var(--green); font-size: 12px; }
.account-dropdown { top: calc(100% + 18px); width: 232px; max-height: calc(100dvh - 180px); overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 16px; padding: 10px; box-shadow: var(--sc-e3); }
.account-dropdown strong { font-size: 13px; padding: 10px 12px; color: var(--green); }
.account-dropdown a, .account-dropdown button { font-size: 13px; padding: 11px 12px; border-radius: 9px; }
.account-dropdown a:hover, .account-dropdown button:hover { background: var(--mint); }

/* Product cards are the content, rather than a grid of marketing claims. */
.listing-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px 22px; }
.listing-card { border: 1px solid #e1e8df; background: #fff; border-radius: 18px; overflow: hidden; transition: box-shadow 220ms ease, transform 220ms ease; }
.listing-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px -12px rgb(22 60 49 / .22); }
.listing-photo { aspect-ratio: 1.2; border-radius: 0; background: #edf1ea; }
.listing-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 420ms cubic-bezier(.23, 1, .32, 1); }
.listing-card:hover .listing-photo img { transform: scale(1.025); }
.listing-photo-digital img { object-fit: cover; }
.condition-badge { top: 12px; left: 12px; border: 1px solid rgb(255 255 255 / .6); background: rgb(255 255 255 / .94); color: #3a5644; padding: 4px 8px; border-radius: 6px; font-size: 10px; font-weight: 500; max-width: calc(100% - 68px); }
.favorite-button { top: 10px; right: 10px; width: 36px; height: 36px; background: rgb(255 255 255 / .96); border: 1px solid #e4eae0; box-shadow: 0 2px 5px rgb(18 63 52 / .04); }
.favorite-button svg { width: 18px; height: 18px; }
.favorite-button.is-saved { background: var(--green); color: #fff; border-color: var(--green); }
.listing-content { padding: 15px 16px 17px; }
.listing-category { color: #5d715f; font-size: 10px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; }
.listing-content h3 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; min-height: 44px; margin-top: 5px; font-size: 14px; line-height: 1.6; font-weight: 500; letter-spacing: -.025em; }
.listing-content h3 a:hover { color: #327a4d; }
.listing-price { color: var(--green); font-size: 20px; font-weight: 700; margin-top: 7px; letter-spacing: -.04em; }
.listing-meta { color: var(--muted); font-size: 11px; margin-top: 13px; gap: 7px; flex-wrap: wrap; align-items: center; }
.listing-meta > span:first-child { min-width: 0; gap: 4px; }
.listing-meta svg { width: 13px; height: 13px; }
.listing-meta > span:last-child { white-space: nowrap; }
.empty-state { padding-block: 64px; }
.empty-state h3 { font-size: 22px; }
.empty-state p { color: var(--muted); font-size: 14px; line-height: 1.7; }
.empty-icon { width: 64px; height: 64px; background: #eaf3e6; color: var(--green); }
.pagination { gap: 8px; margin-top: 40px; font-size: 13px; }
.pagination a, .pagination > span { min-width: 42px; min-height: 42px; border-radius: 12px; }
.pagination a { border-color: #d7e2d7; background: #fff; }
.pagination-current { background: var(--green); color: #fff; }
.pagination-count { color: var(--muted); font-size: 11px; }
.pagination .button { font-size: 12px; min-height: 42px; }

/* The search page keeps the same controls as the home feed. */
.search-title { padding-top: 44px; padding-bottom: 10px; }
.search-title h1 { font-size: clamp(30px, 3.2vw, 46px); letter-spacing: -.06em; margin-top: 6px; }
.search-title p { color: var(--muted); font-size: 14px; margin-top: 12px; }
.search-bar { background: #fff; border: 1px solid #cadbcd; border-radius: 16px; min-height: 76px; padding: 10px; box-shadow: 0 8px 24px -16px rgb(18 63 52 / .2); }
.search-input-wrap { padding-inline: 16px; gap: 12px; }
.search-input-wrap input { font-size: 14px; color: var(--ink); padding-block: 13px; }
.search-input-wrap input::placeholder { color: #647767; }
.search-input-wrap > svg, .search-area svg { color: var(--green); }
.search-area { border-left-color: var(--line); padding-inline: 18px; }
.search-area select { font-size: 12px; max-width: 200px; }
.search-bar > .button { min-height: 52px; padding-inline: 24px; }
.search-digital { color: var(--muted); font-size: 13px; }
.filter-bar { margin-block: 22px 26px; gap: 12px; }
.filter-categories { gap: 7px; padding-bottom: 6px; scrollbar-width: thin; }
.filter-pill { min-height: 39px; border: 1px solid #dce5da; background: #fff; color: #4e6657; padding: 8px 13px; border-radius: 9px; font-size: 11px; font-weight: 500; }
.filter-pill svg { width: 15px; height: 15px; }
.filter-pill.selected { color: #fff; background: var(--green); border-color: var(--green); }
.filter-pill:hover { border-color: #8da88f; }
.filter-tools { color: var(--muted); gap: 12px; }
.sort-label { color: var(--muted); font-size: 11px; }
.sort-label select { padding-block: 9px; font-size: 12px; }
.filter-popover { width: 310px; padding: 22px; border-radius: 16px; border-color: var(--line); box-shadow: var(--sc-e3); z-index: 40; }
.search-active { color: var(--muted); font-size: 12px; gap: 9px; }
.search-active > span { background: #eaf2e5; border: 1px solid #d9e6d4; padding: 6px 10px; border-radius: 8px; }
.grid-ending { color: var(--muted); font-size: 11px; margin-block: 42px; }
.grid-ending p { color: var(--muted); font-size: 11px; }

/* A quiet close with real destinations. */
.site-footer { margin-top: 64px; padding: 48px 0 0; border-top: 1px solid #dbe5d7; background: #edf3e9; }
.footer-main { display: grid; grid-template-columns: 1.2fr 1.2fr .7fr; gap: 48px; align-items: start; padding-bottom: 42px; }
.footer-brand { font-size: 40px; letter-spacing: -2.4px; }
.footer-main > div:first-child > p { color: #4c6654; font-size: 13px; margin-top: 15px; line-height: 1.8; max-width: 32ch; }
.footer-links { gap: 12px 24px; display: flex; flex-wrap: wrap; align-content: start; padding-top: 6px; font-size: 12px; line-height: 1.7; }
.footer-links a { color: #45604e; }
.footer-links a:hover { color: var(--green); text-decoration: underline; text-underline-offset: 4px; }
.footer-place { color: #4c6654; font-size: 13px; line-height: 1.85; text-align: right; }
.footer-bottom { color: #556f5b; font-size: 10px; gap: 20px; border-top-color: #d7e2d2; padding-top: 22px; padding-bottom: 24px; line-height: 1.75; }
.demo-note { max-width: 70ch; text-align: right; }
.toast { z-index: 150; background: var(--green); color: #fff; font-size: 13px; padding: 13px 20px; border-radius: 12px; box-shadow: var(--sc-e2); }
.notice { font-size: 13px; border-radius: 12px; line-height: 1.7; }
.noscript-notice { margin: 16px 0; padding: 16px; border: 1px solid #d7e2d2; background: #edf3e9; color: var(--green); border-radius: 12px; font-size: 14px; }

@media (min-width: 1500px) {
  .wrap { max-width: 1320px; }
}
@media (max-width: 1120px) {
  .desktop-nav { gap: 20px; padding-left: 0; margin-right: 0; }
  .header-inner { gap: 18px; }
  .header-actions { gap: 8px; }
  .header-actions > .header-saved { display: none; }
}
@media (max-width: 1000px) {
  .desktop-nav { display: none; }
  .header-actions { margin-left: auto; gap: 14px; }
  .header-actions > .header-saved { display: flex; }
  .listing-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 18px; }
  .footer-main { grid-template-columns: 1fr 1.2fr; gap: 30px; }
  .footer-place { display: none; }
}
@media (max-width: 760px) {
  :root { --site-header-height: 72px; }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .wrap { width: calc(100% - 40px); }
  .announcement { padding-inline: 20px; font-size: 10px; }
  .announcement-location { display: none; }
  .header-inner { gap: 12px; }
  .brand { font-size: 28px; gap: 5px; letter-spacing: -1.5px; }
  .brand-mark { width: 31px; height: 34px; }
  .header-actions { gap: 10px; }
  .post-button { font-size: 12px; padding: 10px 13px; min-height: 42px; }
  .post-button span { display: inline; }
  .post-button svg { width: 17px; height: 17px; }
  .avatar { width: 36px; height: 36px; font-size: 11px; }
  .account-dropdown { top: calc(100% + 17px); right: -98px; }
  .mobile-nav { display: flex; height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom)); padding: 0 4px env(safe-area-inset-bottom); background: rgb(255 255 255 / .97); border-top: 1px solid #dce7d8; backdrop-filter: blur(16px); box-shadow: 0 -6px 24px rgb(18 63 52 / .03); z-index: 90; }
  .mobile-nav > a { width: 20%; padding: 10px 1px; min-height: 60px; gap: 4px; color: #5b705d; font-size: 10px; font-weight: 500; }
  .mobile-nav > a > svg { width: 22px; height: 22px; stroke-width: 1.7; }
  .mobile-nav > a.active { color: var(--green); font-weight: 700; }
  .mobile-nav > a.active > svg { stroke-width: 2; }
  .mobile-nav .mobile-post { transform: none; margin-top: 0; padding-top: 0; color: var(--green); }
  .mobile-post > span:first-child { display: flex; width: 43px; height: 43px; border-radius: 13px; background: var(--green); color: #fff; margin-top: -10px; margin-bottom: 0; box-shadow: 0 3px 0 #deebd5; }
  .mobile-post > span:first-child svg { width: 23px; height: 23px; }
  .listing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
  .listing-card { border-radius: 14px; }
  .listing-content { padding: 12px; }
  .listing-content h3 { font-size: 13px; min-height: 41px; line-height: 1.55; }
  .listing-price { font-size: 18px; margin-top: 6px; }
  .listing-category { font-size: 9px; }
  .listing-meta { font-size: 10px; row-gap: 4px; margin-top: 10px; }
  .condition-badge { top: 10px; left: 10px; padding: 3px 6px; font-size: 9px; max-width: calc(100% - 57px); }
  .favorite-button { width: 34px; height: 34px; top: 8px; right: 8px; }
  .search-title { padding-top: 28px; }
  .search-title h1 { font-size: 32px; }
  .search-title p { font-size: 13px; }
  .search-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; min-height: 64px; padding: 8px; gap: 0; }
  .search-input-wrap { padding-inline: 9px; gap: 8px; }
  .search-input-wrap input { min-width: 0; font-size: 16px; padding-block: 10px; }
  .search-input-wrap > svg { width: 20px; height: 20px; }
  .search-area, .search-digital { display: none; }
  .search-bar > .button { padding: 11px 14px; min-height: 46px; }
  .search-bar > .button span { display: none; }
  .search-bar > .button svg { width: 20px; height: 20px; }
  .filter-bar { flex-direction: column; align-items: stretch; gap: 12px; margin-block: 18px 24px; }
  .filter-categories { width: 100%; gap: 7px; }
  .filter-tools { justify-content: space-between; }
  .filter-pill { padding: 8px 11px; min-height: 39px; }
  .filter-popover { max-width: calc(100vw - 40px); }
  .sort-label select { max-width: 164px; }
  .site-footer { margin-top: 44px; padding-top: 36px; padding-bottom: 0; }
  .footer-main { grid-template-columns: 1fr; gap: 26px; padding-bottom: 32px; }
  .footer-brand { font-size: 36px; }
  .footer-main > div:first-child > p { font-size: 12px; margin-top: 12px; }
  .footer-links { font-size: 11px; gap: 10px 22px; max-width: 42ch; }
  .footer-bottom { display: flex; flex-direction: column; align-items: start; gap: 8px; font-size: 11px; }
  .demo-note { text-align: left; }
  .toast { max-width: calc(100vw - 32px); bottom: calc(90px + env(safe-area-inset-bottom)); font-size: 12px; text-align: center; }
}
@media (max-width: 620px) {
  .header-actions > .header-chat, .header-actions > .header-saved, .header-actions .login-link { display: none; }
}
@media (max-width: 359px) {
  .wrap { width: calc(100% - 32px); }
  .brand { font-size: 25px; }
  .brand-mark { width: 28px; height: 30px; }
  .header-actions { gap: 7px; }
  .post-button { padding-inline: 10px; font-size: 11px; gap: 5px; }
  .avatar { width: 32px; height: 32px; }
  .listing-grid { gap: 18px 10px; }
  .listing-content { padding: 10px; }
  .listing-content h3 { font-size: 12px; min-height: 38px; }
  .listing-price { font-size: 16px; }
  .listing-category { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .listing-card, .listing-photo img { transition: none; }
  .listing-card:hover, .listing-card:hover .listing-photo img { transform: none; }
}

/* Shared entry points for seller tools, subscriptions and paid placement. */
.search-subscriptions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin: 28px 0 8px; }
.sponsored-section { margin: 28px 0 40px; padding: 22px; background: #edf3e8; border: 1px solid #d8e4d2; border-radius: 22px; }
.sponsored-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.sponsored-label { background: #d9edaf; color: #173f33; font-weight: 700; }
.sponsored-section .section-heading { gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.auth-recovery { margin: 18px 0; }
[data-notification-unread] { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; padding: 2px 6px; border-radius: 999px; background: #d9edaf; color: #173f33; font-size: 11px; }
[data-order-extras] { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
[data-seller-reviews] { margin: 24px 0; }
@media (max-width: 720px) {
  .sponsored-section { padding: 14px; }
  .sponsored-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  [data-order-extras] { padding: 20px; }
}
@media (max-width: 420px) {
  .sponsored-grid { grid-template-columns: minmax(0,1fr); }
}
