/* ============================================================
   AFFARACCI — Design system
   Verde smeraldo + giallo caldo su fondo crema, etichette mono.
   ============================================================ */
:root {
  --green: #009147;
  --green-deep: #00773b;
  --green-ink: #0d2b1a;
  --yellow: #f6dd38;
  --yellow-deep: #e8cb14;
  --bg: #f6f4ec;
  --surface: #ffffff;
  --surface-2: #eeece1;
  --ink: #101c14;
  --muted: #66705f;
  --line: #ddd9c8;
  --danger: #c2402a;
  --radius: 14px;
  --font-main: 'Archivo', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--green-deep); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.icon { width: 22px; height: 22px; flex: none; }

/* ---------- Tipografia utility ---------- */
.mono-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--green-deep);
}
.mono-small {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
h1, h2, h3 { line-height: 1.15; }
.page-title { font-size: clamp(26px, 4vw, 38px); font-weight: 900; margin: 34px 0 6px; }
.page-sub { color: var(--muted); margin-bottom: 26px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--green);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 0 rgba(13,43,26,.25);
}
.header-row { display: flex; align-items: center; gap: 18px; padding: 12px 20px; }
.logo {
  font-weight: 900; font-style: italic; font-size: 27px;
  color: #fff; text-decoration: none; letter-spacing: -.02em;
}
.logo-dot { color: var(--yellow); }
.logo-light { color: #fff; }
.header-search {
  flex: 1; display: flex; max-width: 560px;
  background: #fff; border-radius: 999px; overflow: hidden;
}
.header-search input {
  flex: 1; border: 0; padding: 11px 20px; font-size: 15px;
  font-family: var(--font-main); background: transparent; color: var(--ink);
  min-width: 0;
}
.header-search input:focus { outline: none; }
.header-search button {
  border: 0; background: var(--yellow); color: var(--ink);
  padding: 0 20px; cursor: pointer; display: flex; align-items: center;
  transition: background .2s ease;
}
.header-search button:hover { background: var(--yellow-deep); }
.header-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-link {
  position: relative; color: #fff; text-decoration: none;
  display: flex; align-items: center; gap: 7px;
  padding: 9px 10px; border-radius: 10px; font-weight: 600; font-size: 14px;
  transition: background .2s ease;
}
.nav-link:hover { background: rgba(255,255,255,.14); }
.badge {
  position: absolute; top: 2px; right: 0;
  background: var(--yellow); color: var(--ink);
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  min-width: 17px; height: 17px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; border: 0; cursor: pointer;
  font-family: var(--font-main); font-weight: 700; font-size: 15px;
  padding: 12px 24px; text-decoration: none;
  transition: background .2s ease, transform .15s ease, box-shadow .2s ease;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 3px solid var(--green-deep); outline-offset: 2px; }
.btn-accent { background: var(--yellow); color: var(--ink); }
.btn-accent:hover { background: var(--yellow-deep); }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-deep); }
.btn-ghost { background: transparent; color: var(--green-deep); box-shadow: inset 0 0 0 2px var(--green); }
.btn-ghost:hover { background: rgba(0,145,71,.08); }
.btn-danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 2px var(--danger); }
.btn-danger:hover { background: rgba(194,64,42,.08); }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 30px; font-size: 17px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-pub span { display: inline; }

/* ---------- Flash ---------- */
.flash {
  margin-top: 14px; padding: 13px 20px; border-radius: var(--radius);
  font-weight: 600; font-size: 15px;
}
.flash-info { background: #fff3c4; color: #6d5b00; }
.flash-ok { background: #d9f2e2; color: var(--green-deep); }
.flash-err { background: #fadcd4; color: var(--danger); }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1100px 480px at 85% -10%, rgba(0,145,71,.10), transparent 60%),
    var(--bg);
  padding: 64px 0 46px;
}
.hero-kicker { margin-bottom: 14px; }
.hero h1 {
  font-size: clamp(34px, 6.2vw, 68px);
  font-weight: 900; letter-spacing: -.03em; line-height: 1.02;
  max-width: 13ch;
}
.rot-wrap {
  display: inline-block; position: relative; white-space: nowrap;
}
.rot-word {
  display: inline-block; color: var(--ink);
  background: linear-gradient(transparent 55%, var(--yellow) 55%);
  transition: opacity .25s ease, transform .25s ease;
}
.rot-word.rot-out { opacity: 0; transform: translateY(-10px); }
.hero-sub { margin-top: 16px; font-size: 18px; color: var(--muted); max-width: 52ch; }

.big-search {
  margin-top: 30px; display: flex; gap: 0; max-width: 760px;
  background: var(--surface); border-radius: 18px;
  box-shadow: 0 10px 30px rgba(13,43,26,.12);
  overflow: hidden;
}
.big-search input {
  flex: 1.4; border: 0; padding: 18px 22px; font-size: 16px;
  font-family: var(--font-main); color: var(--ink); background: transparent; min-width: 0;
}
.big-search input + input { flex: 1; border-left: 2px solid var(--surface-2); }
.big-search input:focus { outline: none; }
.big-search button {
  border: 0; background: var(--green); color: #fff;
  font-family: var(--font-main); font-weight: 700; font-size: 16px;
  padding: 0 30px; cursor: pointer; display: flex; align-items: center; gap: 9px;
  transition: background .2s ease;
}
.big-search button:hover { background: var(--green-deep); }

.hero-pills { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 9px; }
.pill {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  color: var(--ink); text-decoration: none;
  background: var(--surface); border-radius: 999px; padding: 8px 15px;
  border: 1px solid var(--line);
  transition: background .2s ease, border-color .2s ease;
}
.pill:hover { background: var(--yellow); border-color: var(--yellow); }

/* ---------- Sezioni ---------- */
.section { padding: 44px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-head h2 { font-size: clamp(21px, 3vw, 28px); font-weight: 900; letter-spacing: -.01em; }
.section-head a { font-family: var(--font-mono); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- Categorie ---------- */
.cats-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.cat-tile {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 16px;
  text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; gap: 12px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.cat-tile:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(13,43,26,.10); border-color: var(--green); }
.cat-tile .icon { width: 28px; height: 28px; color: var(--green); }
.cat-tile strong { font-size: 14px; line-height: 1.3; }
.cat-count { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

/* ---------- Card annuncio ---------- */
.cards-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.card {
  background: var(--surface); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(13,43,26,.12); }
.card-img { position: relative; aspect-ratio: 4/3; background: var(--surface-2); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-img img { transform: scale(1.05); }
.card-noimg {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--green); opacity: .55;
}
.card-noimg .icon { width: 44px; height: 44px; }
.card-sold {
  position: absolute; top: 10px; left: 10px;
  background: var(--ink); color: var(--yellow);
  padding: 5px 10px; border-radius: 6px;
}
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title {
  font-size: 15px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot { margin-top: auto; display: flex; flex-direction: column; gap: 3px; }
.card-price { font-size: 19px; font-weight: 900; letter-spacing: -.01em; }
.card-meta { display: block; }

/* ---------- Come funziona ---------- */
.how { background: var(--green-ink); color: #f2f0e4; border-radius: 22px; padding: 44px 40px; margin: 20px 0 60px; }
.how .mono-label { color: var(--yellow); }
.how h2 { font-size: clamp(22px, 3.4vw, 32px); font-weight: 900; margin: 10px 0 30px; }
.how-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.how-step .how-num {
  font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--yellow);
  display: block; margin-bottom: 10px;
}
.how-step h3 { font-size: 18px; margin-bottom: 7px; }
.how-step p { color: #c9cfbd; font-size: 14.5px; }

/* ---------- Ricerca ---------- */
.search-layout { display: grid; gap: 30px; grid-template-columns: 240px 1fr; padding: 36px 0 60px; align-items: start; }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: sticky; top: 84px; }
.filters h3 { font-size: 15px; margin-bottom: 14px; }
.filters .field { margin-bottom: 14px; }
.filters label { display: block; margin-bottom: 5px; }
.filters input, .filters select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-family: var(--font-main); font-size: 14px; background: var(--bg); color: var(--ink);
}
.filters-toggle { display: none; }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.results-count { color: var(--muted); font-size: 14px; }
.results-head select {
  padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line);
  font-family: var(--font-main); font-size: 14px; background: var(--surface); color: var(--ink);
}
.empty {
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 60px 30px; text-align: center; color: var(--muted);
}
.empty h3 { color: var(--ink); margin-bottom: 8px; }

/* ---------- Paginazione ---------- */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 36px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; text-decoration: none; font-weight: 700; font-size: 14px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); padding: 0 12px;
}
.pagination a:hover { border-color: var(--green); }
.pagination .cur { background: var(--green); border-color: var(--green); color: #fff; }

/* ---------- Pagina annuncio ---------- */
.listing-layout { display: grid; gap: 34px; grid-template-columns: 1.7fr 1fr; padding: 34px 0 60px; align-items: start; }
.gallery-main {
  border-radius: var(--radius); overflow: hidden; background: var(--surface-2);
  aspect-ratio: 4/3; border: 1px solid var(--line);
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; background: var(--surface-2); }
.gallery-thumbs { display: flex; gap: 9px; margin-top: 10px; flex-wrap: wrap; }
.gallery-thumbs button {
  border: 2px solid transparent; border-radius: 10px; overflow: hidden;
  width: 78px; height: 60px; cursor: pointer; padding: 0; background: var(--surface-2);
  transition: border-color .2s ease;
}
.gallery-thumbs button.active, .gallery-thumbs button:hover { border-color: var(--green); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.listing-title { font-size: clamp(23px, 3.4vw, 34px); font-weight: 900; letter-spacing: -.015em; margin: 8px 0 12px; }
.listing-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.listing-meta .icon { width: 17px; height: 17px; vertical-align: -3px; }
.listing-desc { white-space: pre-line; font-size: 16px; }
.spec-table { margin-top: 28px; border-top: 1px solid var(--line); }
.spec-row { display: flex; justify-content: space-between; gap: 20px; padding: 11px 2px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.spec-row dt { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.spec-row dd { font-weight: 600; text-align: right; }

.buy-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 24px; position: sticky; top: 84px;
  display: flex; flex-direction: column; gap: 16px;
}
.buy-price { font-size: 34px; font-weight: 900; letter-spacing: -.02em; }
.buy-ship { font-family: var(--font-mono); font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.buy-ship .icon { width: 16px; height: 16px; }
.seller-row { display: flex; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.avatar {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 19px;
}
.seller-row strong { display: block; font-size: 15px; }
.delivery-opts { display: flex; flex-direction: column; gap: 9px; }
.delivery-opt {
  display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  transition: border-color .2s ease, background .2s ease;
}
.delivery-opt:hover, .delivery-opt:has(input:checked) { border-color: var(--green); background: rgba(0,145,71,.05); }
.delivery-opt input { margin-top: 4px; accent-color: var(--green); }
.delivery-opt strong { font-size: 14.5px; display: block; }
.delivery-opt span { font-size: 13px; color: var(--muted); }
#addressField { display: none; }
#addressField.show { display: block; }
.field textarea, .field input[type=text], .field input[type=email],
.field input[type=password], .field input[type=number], .field select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-family: var(--font-main); font-size: 15px; background: var(--surface); color: var(--ink);
}
.field textarea:focus, .field input:focus, .field select:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(0,145,71,.14);
}

/* ---------- Form pagine ---------- */
.form-page { max-width: 640px; margin: 0 auto; padding: 40px 0 70px; }
.form-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 30px;
}
.form-card h1 { font-size: 26px; font-weight: 900; margin-bottom: 6px; }
.form-card .form-sub { color: var(--muted); font-size: 14.5px; margin-bottom: 24px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 7px; }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.field-row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; cursor: pointer; }
.checkbox-row input { margin-top: 4px; accent-color: var(--green); }
.form-alt { text-align: center; margin-top: 18px; font-size: 14.5px; color: var(--muted); }

.photo-drop {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 30px; text-align: center; cursor: pointer; color: var(--muted);
  transition: border-color .2s ease, background .2s ease;
}
.photo-drop:hover { border-color: var(--green); background: rgba(0,145,71,.04); }
.photo-drop .icon { width: 34px; height: 34px; color: var(--green); margin-bottom: 8px; }
.photo-preview { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.photo-preview img { width: 90px; height: 90px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.existing-photos { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.existing-photo { position: relative; }
.existing-photo img { width: 90px; height: 90px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.existing-photo button {
  position: absolute; top: -7px; right: -7px; width: 24px; height: 24px;
  border-radius: 50%; border: 0; background: var(--danger); color: #fff;
  font-size: 14px; line-height: 1; cursor: pointer;
}

/* ---------- Dashboard ---------- */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 34px 0 24px; }
.dash-head h1 { font-size: 28px; font-weight: 900; }
.dash-section { margin-bottom: 44px; }
.dash-section h2 { font-size: 19px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.dash-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.dash-table th {
  text-align: left; font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
  padding: 13px 16px; border-bottom: 1px solid var(--line);
}
.dash-table td { padding: 13px 16px; border-bottom: 1px solid var(--surface-2); vertical-align: middle; }
.dash-table tr:last-child td { border-bottom: 0; }
.dash-table .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; text-transform: uppercase;
  padding: 4px 9px; border-radius: 6px; display: inline-block;
}
.tag-active { background: #d9f2e2; color: var(--green-deep); }
.tag-sold { background: var(--ink); color: var(--yellow); }
.tag-pending { background: #fff3c4; color: #6d5b00; }
.tag-cancelled { background: #fadcd4; color: var(--danger); }
.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--green-deep); font-weight: 700; font-size: 14px;
  font-family: var(--font-main); text-decoration: underline;
}
.link-btn.danger { color: var(--danger); }
.inline-form { display: inline; }

.stripe-cta {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.stripe-cta .icon { width: 30px; height: 30px; color: var(--green); }

/* ---------- Messaggi ---------- */
.msg-layout { display: grid; grid-template-columns: 320px 1fr; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; margin: 30px 0 60px; min-height: 480px; }
.thread-list { border-right: 1px solid var(--line); overflow-y: auto; max-height: 640px; }
.thread-item { display: block; padding: 15px 18px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--surface-2); transition: background .15s ease; }
.thread-item:hover, .thread-item.active { background: var(--bg); }
.thread-item strong { display: block; font-size: 14.5px; }
.thread-item .mono-small { display: block; margin-top: 3px; }
.thread-item .unread-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-left: 6px; }
.chat { display: flex; flex-direction: column; max-height: 640px; }
.chat-head { padding: 15px 20px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 15px; background: var(--bg); }
.chat-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.bubble {
  max-width: 74%; padding: 11px 15px; border-radius: 16px; font-size: 14.5px;
  background: var(--surface-2); align-self: flex-start; border-bottom-left-radius: 4px;
}
.bubble.mine { background: var(--green); color: #fff; align-self: flex-end; border-bottom-left-radius: 16px; border-bottom-right-radius: 4px; }
.bubble .mono-small { display: block; margin-top: 5px; font-size: 10.5px; opacity: .75; color: inherit; }
.chat-form { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; padding: 12px 16px; border: 1px solid var(--line); border-radius: 999px; font-family: var(--font-main); font-size: 14.5px; min-width: 0; }
.chat-form input:focus { outline: none; border-color: var(--green); }
.chat-empty { display: flex; align-items: center; justify-content: center; color: var(--muted); flex: 1; padding: 40px; text-align: center; }

/* ---------- Ordine ---------- */
.order-card { max-width: 640px; margin: 40px auto 70px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 34px; }
.order-status { font-size: 22px; font-weight: 900; margin: 10px 0 20px; }

/* ---------- Pagine statiche ---------- */
.static-page { max-width: 720px; margin: 0 auto; padding: 40px 0 70px; }
.static-page h1 { font-size: 30px; font-weight: 900; margin-bottom: 22px; }
.static-page h2 { font-size: 20px; margin: 30px 0 10px; }
.static-page p, .static-page li { color: #333d31; margin-bottom: 12px; }
.static-page ul { padding-left: 22px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-ink); color: #e8e6d8; margin-top: auto; }
.footer-grid {
  display: grid; gap: 34px; padding: 52px 20px 34px;
  grid-template-columns: 2fr 1fr 1fr 1fr;
}
.footer-brand p { color: #b8bfa9; font-size: 14.5px; margin-top: 10px; max-width: 30ch; }
.footer-col { display: flex; flex-direction: column; gap: 9px; }
.footer-col .mono-label { color: var(--yellow); margin-bottom: 6px; }
.footer-col a { color: #e8e6d8; text-decoration: none; font-size: 14.5px; }
.footer-col a:hover { color: var(--yellow); }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 20px; border-top: 1px solid rgba(232,230,216,.15);
}
.footer-bottom .mono-small { color: #8fa083; }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: var(--surface);
  border-top: 3px solid var(--green);
  box-shadow: 0 -10px 34px rgba(13,43,26,.20);
  padding: 18px 0;
}
.cookie-banner[hidden] { display: none; }
.cookie-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.cookie-inner p { font-size: 14px; line-height: 1.55; max-width: 74ch; }
.cookie-actions { display: flex; gap: 10px; flex: none; }
@media (max-width: 720px) {
  .cookie-actions { width: 100%; }
  .cookie-actions .btn { flex: 1; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .search-layout { grid-template-columns: 1fr; }
  .filters { position: static; display: none; }
  .filters.open { display: block; }
  .filters-toggle { display: inline-flex; }
  .listing-layout { grid-template-columns: 1fr; }
  .buy-box { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .msg-layout { grid-template-columns: 1fr; }
  .thread-list { max-height: 220px; border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 720px) {
  .header-row { flex-wrap: wrap; gap: 10px; }
  .header-search { order: 3; flex-basis: 100%; max-width: none; }
  .nav-user span, .btn-pub span { display: none; }
  .hero { padding: 44px 0 34px; }
  .big-search { flex-direction: column; border-radius: 18px; }
  .big-search input + input { border-left: 0; border-top: 2px solid var(--surface-2); }
  .big-search button { padding: 15px; justify-content: center; }
  .field-row { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .how { padding: 30px 22px; margin: 10px 0 44px; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ============================================================
   PANNELLO ADMIN + BANNER PUBBLICITARI
   ============================================================ */
.admin-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 30px;
  padding-top: 34px;
  padding-bottom: 60px;
  align-items: start;
}
.admin-side {
  position: sticky;
  top: 96px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 14px;
}
.admin-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.admin-nav a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
}
.admin-nav a:hover { background: var(--surface-2); }
.admin-nav a.active { background: var(--green); color: #fff; }
.admin-back {
  display: block;
  margin-top: 14px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  font-size: .9rem;
  text-decoration: none;
}
.admin-title { font-size: 1.7rem; margin-bottom: 20px; letter-spacing: -.01em; }
.admin-h2 { font-size: 1.1rem; margin: 22px 0 12px; }
.admin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 30px; }
.admin-scroll { overflow-x: auto; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.stat-grid-2 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-bottom: 20px; }
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  text-decoration: none;
  color: var(--ink);
}
a.stat-card:hover { border-color: var(--green); }
.stat-num { font-size: 1.9rem; font-weight: 900; letter-spacing: -.02em; }
.stat-label { font-size: .68rem; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: .92rem;
}
.admin-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 14px;
  border-bottom: 2px solid var(--line);
  background: var(--surface-2);
}
.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .actions { white-space: nowrap; }
.admin-table .actions form { display: inline-flex; gap: 6px; margin: 2px 4px 2px 0; align-items: center; }
.row-banned { opacity: .62; }
.danger-text { color: var(--danger); }

.admin-search { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-search input[type="search"], .admin-search select {
  flex: 1;
  min-width: 200px;
  padding: 11px 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: var(--surface);
}
.admin-search select { flex: 0 1 auto; min-width: 0; }
.admin-inline-add { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.admin-inline-add input {
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: var(--surface);
}
.btn-sm { padding: 7px 13px; font-size: .85rem; }

.tag-ok { background: #d9f2e2; color: var(--green-deep); }
.tag-feat { background: var(--yellow); color: var(--ink); }

.ban-form input[type="text"] {
  padding: 7px 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: .85rem;
  width: 150px;
}

.report-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.report-card.report-resolved { border-left-color: var(--green); opacity: .75; }
.report-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.report-details { font-style: italic; color: var(--muted); margin-bottom: 8px; }
.report-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

.admin-filter { display: flex; gap: 10px; margin-bottom: 18px; }
.pill-active { background: var(--green) !important; color: #fff !important; border-color: var(--green) !important; }

.ad-admin-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.ad-admin-row.ad-off { opacity: .55; }
.ad-admin-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ad-admin-thumb { max-height: 54px; max-width: 160px; border-radius: 8px; border: 1px solid var(--line); }

.admin-form-grid .field textarea.code-editor,
.code-editor { font-family: var(--font-mono); font-size: .85rem; line-height: 1.5; }

.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.color-field {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
}
.color-field input[type="color"] {
  width: 46px;
  height: 46px;
  border: 0;
  padding: 0;
  background: none;
  border-radius: 10px;
  cursor: pointer;
}

.logo-admin-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo-admin-preview { max-height: 64px; max-width: 260px; border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: 6px; }
.logo-img { max-height: 42px; width: auto; display: block; }
.nav-admin { color: var(--yellow) !important; }

/* Spazi banner pubblici */
.ad-slot { margin: 26px 0; }
.ad-item {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}
.ad-item img { width: 100%; height: auto; display: block; }
.ad-listing_sidebar .ad-item img { max-height: 340px; object-fit: cover; }

/* Badge in evidenza sulle card */
.card-feat {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--yellow);
  color: var(--ink);
  padding: 4px 9px;
  border-radius: 7px;
  font-size: .62rem;
  z-index: 1;
}
.card-img { position: relative; }

/* Box segnalazione */
.report-box {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-size: .9rem;
}
.report-box summary {
  cursor: pointer;
  color: var(--muted);
  font-size: .85rem;
  list-style: none;
}
.report-box summary::before { content: '⚑ '; }
.report-box summary:hover { color: var(--danger); }
.report-box form { margin-top: 12px; }

@media (max-width: 860px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-side { position: static; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .admin-nav a { padding: 8px 10px; font-size: .85rem; }
  .admin-cols { grid-template-columns: 1fr; }
  .ban-form input[type="text"] { width: 110px; }
}
.admin-main { min-width: 0; }
