/* Anuncio Libre — hoja de estilos principal */
:root {
  --brand: #0b7a5c;
  --brand-600: #096a50;
  --brand-50: #e8f5f0;
  --accent: #ffc94d;
  --accent-600: #f2b52a;
  --ink: #13201b;
  --ink-2: #2f3d37;
  --muted: #5e6c66;
  --line: #e1e7e4;
  --line-2: #cbd5d1;
  --bg: #f4f6f5;
  --card: #ffffff;
  --danger: #c0392b;
  --danger-50: #fdecea;
  --warn-50: #fff6dd;
  --ok-50: #e7f6ef;
  --info-50: #eaf2fb;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 32, 26, .06), 0 4px 16px rgba(16, 32, 26, .06);
  --shadow-lg: 0 10px 30px rgba(16, 32, 26, .12);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.55 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #1d8cf8; outline-offset: 2px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; background: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.page { padding-top: 20px; padding-bottom: 48px; min-height: 60vh; }
.page-home { padding-bottom: 48px; }
.page-narrow { max-width: 860px; margin: 0 auto; }
[hidden] { display: none !important; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: #fff; color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none !important; line-height: 1.2; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:hover { background: #f1f4f3; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #2b2100; }
.btn-accent:hover { background: var(--accent-600); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-50); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-ghost { background: transparent; border-color: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-50); }
.btn-sm { padding: 6px 11px; font-size: .875rem; }
.btn-lg { padding: 13px 22px; font-size: 1.05rem; }
.btn-block { width: 100%; margin-top: 8px; }
.btn-icon { padding: 9px; border-radius: 50%; }
.link { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font: inherit; }
.link:hover { text-decoration: underline; }

/* ---------- Cabecera ---------- */
.topbar { background: var(--ink); color: #fff; text-align: center; font-size: .9rem; padding: 6px 16px; }
.hdr { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.hdr-in { display: flex; align-items: center; gap: 16px; height: 66px; }
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; text-decoration: none !important; flex-shrink: 0; }
.logo b { color: var(--brand); font-weight: 800; }
.hdr-search { flex: 1; display: flex; max-width: 640px; border: 2px solid var(--line-2); border-radius: 999px; overflow: hidden; background: #fff; transition: border-color .15s; }
.hdr-search:focus-within { border-color: var(--brand); }
.hdr-search input { flex: 1; min-width: 0; border: 0; padding: 9px 16px; outline: none; background: transparent; }
.hdr-search select { border: 0; border-left: 1px solid var(--line); padding: 0 10px; background: transparent; max-width: 150px; outline: none; color: var(--muted); }
.hdr-search button { border: 0; background: var(--brand); color: #fff; padding: 0 16px; cursor: pointer; }
.hdr-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.ico-link { position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 1px; color: var(--ink-2); padding: 4px 8px; border-radius: 10px; font-size: .75rem; text-decoration: none !important; }
.ico-link:hover { background: #f1f4f3; }
.badge-dot { position: absolute; top: 0; right: 4px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.badge-dot.static { position: static; }
.btn-publish { margin-left: 6px; }
.catbar { border-top: 1px solid var(--line); background: #fff; }
.catbar-in { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-top: 6px; padding-bottom: 6px; }
.catbar-in::-webkit-scrollbar { display: none; }
.catbar a { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; padding: 6px 12px; border-radius: 999px; color: var(--ink-2); font-size: .9rem; font-weight: 500; text-decoration: none !important; }
.catbar a:hover, .catbar a[aria-current] { background: var(--brand-50); color: var(--brand-600); }

/* ---------- Avatar ---------- */
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--brand-50); color: var(--brand-600); font-weight: 800; flex-shrink: 0; }
.avatar.sm { width: 26px; height: 26px; font-size: .72rem; }
.avatar.lg { width: 76px; height: 76px; font-size: 1.6rem; }

/* ---------- Avisos ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin: 0 0 16px; border: 1px solid transparent; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert-ok { background: var(--ok-50); border-color: #b5e2cd; }
.alert-error { background: var(--danger-50); border-color: #f2bdb7; color: #7c1d14; }
.alert-warn { background: var(--warn-50); border-color: #f3dc99; }
.alert-info { background: var(--info-50); border-color: #c4d9f2; }

/* ---------- Portada ---------- */
.hero { background: radial-gradient(1200px 400px at 85% -10%, rgba(255, 201, 77, .35), transparent 60%), linear-gradient(160deg, #0b7a5c, #0a5d47); color: #fff; padding: 48px 0 56px; }
.hero h1 { font-size: clamp(1.8rem, 4.4vw, 3rem); max-width: 760px; margin-bottom: 12px; letter-spacing: -.025em; }
.hero h1 span { color: var(--accent); }
.hero-sub { font-size: 1.1rem; max-width: 640px; opacity: .92; }
.hero-search { display: grid; grid-template-columns: 1fr 220px 190px auto; gap: 8px; background: #fff; padding: 8px; border-radius: 16px; margin-top: 24px; box-shadow: var(--shadow-lg); max-width: 980px; }
.hero-search input, .hero-search select { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; color: var(--ink); min-width: 0; }
.hero-points { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; padding: 0; margin: 20px 0 0; font-size: .95rem; opacity: .95; }
.block { margin-top: 36px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.block-head h2 { margin: 0; }
.cat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.cat-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-align: center; text-decoration: none !important; transition: box-shadow .15s, transform .15s; }
.cat-tile:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.cat-ico { font-size: 1.9rem; line-height: 1; }
.cat-name { font-weight: 600; font-size: .93rem; }
.cat-n { color: var(--muted); font-size: .8rem; }
.why { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.why-grid span { font-size: 1.8rem; }
.why-grid h3 { margin: 6px 0 4px; }
.why-grid p { color: var(--muted); margin: 0; font-size: .95rem; }
.cta-band { margin-top: 36px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--ink); color: #fff; border-radius: var(--radius); padding: 28px 32px; }
.cta-band h2 { margin: 0 0 4px; }
.cta-band p { margin: 0; opacity: .8; }

/* ---------- Tarjetas ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-dest { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.card-img { position: relative; aspect-ratio: 4 / 3; background: #eef2f0; display: block; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.noimg { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 2.6rem; opacity: .5; }
.tag { position: absolute; left: 8px; top: 8px; background: rgba(19, 32, 27, .82); color: #fff; font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.tag.static { position: static; display: inline-block; margin-bottom: 6px; }
.tag-dest { background: var(--accent); color: #2b2100; }
.tag-demanda { background: #2563eb; }
.tag-dest + .tag-demanda { top: 34px; }
.tag-fotos { left: auto; right: 8px; top: auto; bottom: 8px; background: rgba(0, 0, 0, .55); font-weight: 600; }
.fav { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.fav svg, .fav-big svg { fill: none; stroke: var(--ink-2); stroke-width: 1.9; }
.fav.on svg, .fav-big.on svg { fill: #e5484d; stroke: #e5484d; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.card-price { font-weight: 800; font-size: 1.12rem; margin: 0; }
.card-title { font-size: .95rem; font-weight: 500; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a { color: var(--ink); }
.card-title a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.card .fav { z-index: 2; }
.card-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .8rem; margin: auto 0 0; padding-top: 6px; }
.card-meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; }
.chip { display: inline-flex; align-items: center; gap: 3px; font-size: .74rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eef2f0; color: var(--ink-2); }
.chip-ok { background: var(--ok-50); color: #0a6a4f; }
.chip-warn { background: var(--warn-50); color: #7a5600; }
.drop { color: #0a8a5f; font-size: .78rem; font-weight: 700; background: var(--ok-50); padding: 1px 6px; border-radius: 6px; vertical-align: middle; }
.drop.big { font-size: .9rem; text-decoration: line-through; color: var(--muted); background: none; }

/* ---------- Listado ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: .875rem; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.list-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.list-head h1 { margin-bottom: 2px; }
.subcats { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 16px; }
.subcats a { padding: 6px 13px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-size: .88rem; text-decoration: none !important; }
.subcats a[aria-current] { background: var(--ink); color: #fff; border-color: var(--ink); }
.list-layout { display: grid; grid-template-columns: 270px 1fr; gap: 20px; align-items: start; margin-top: 8px; }
.filters { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; position: sticky; top: 130px; max-height: calc(100vh - 150px); overflow: auto; }
.filters-toggle { display: none; }
.f-group { margin: 0 0 14px; border: 0; padding: 0; min-width: 0; }
.f-group > label, .f-group > legend { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 5px; padding: 0; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=url], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11, 122, 92, .15); }
[aria-invalid=true] { border-color: var(--danger) !important; }
textarea { resize: vertical; }
.f-range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.f-check { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 10px; font-size: .93rem; cursor: pointer; }
.f-check input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--brand); flex-shrink: 0; }
.f-actions { display: flex; gap: 8px; margin-top: 12px; }
.f-err { color: var(--danger); font-size: .86rem; margin: 5px 0 0; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: .88rem; background: #fff; }
.seg input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid #1d8cf8; outline-offset: 2px; }
.results-bar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.sort { display: flex; align-items: center; gap: 8px; }
.sort label { font-size: .9rem; color: var(--muted); white-space: nowrap; }
.sort select { width: auto; padding: 7px 10px; }
.grid-list { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 28px 0 0; }
.pager a, .pager span { min-width: 40px; padding: 8px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line); text-align: center; color: var(--ink); text-decoration: none !important; }
.pager span[aria-current] { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 700; }
.empty { text-align: center; background: var(--card); border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 40px 20px; }
.empty p { color: var(--muted); max-width: 520px; margin-left: auto; margin-right: auto; }
.empty.big { padding: 60px 20px; border-style: solid; }
.empty-code { font-size: 3rem; font-weight: 800; color: var(--brand); margin: 0; }

/* ---------- Ficha de anuncio ---------- */
.ficha-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.gallery { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gallery-main { position: relative; background: #111; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-empty { background: #eef2f0; flex-direction: column; color: var(--muted); }
.gallery-empty span { font-size: 4rem; }
.g-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .9); font-size: 1.6rem; line-height: 1; cursor: pointer; box-shadow: var(--shadow); }
.g-prev { left: 12px; } .g-next { right: 12px; }
.g-count { position: absolute; bottom: 10px; right: 12px; background: rgba(0, 0, 0, .6); color: #fff; font-size: .8rem; padding: 3px 9px; border-radius: 999px; }
.gallery-thumbs { display: flex; gap: 6px; padding: 8px; overflow-x: auto; }
.gallery-thumbs button { flex: 0 0 72px; height: 56px; border: 2px solid transparent; border-radius: 8px; overflow: hidden; padding: 0; cursor: pointer; background: #eee; }
.gallery-thumbs button[aria-current] { border-color: var(--brand); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.ficha-info { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-top: 16px; }
.ficha-title-row { display: flex; justify-content: space-between; gap: 14px; }
.ficha-title-row h1 { margin-bottom: 6px; }
.ficha-price { font-size: 1.8rem; font-weight: 800; margin: 0 0 6px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ficha-tools { display: flex; gap: 6px; align-items: flex-start; }
.specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 18px 0; padding: 14px; background: #f7f9f8; border-radius: var(--radius-sm); }
.specs div { min-width: 0; }
.specs dt { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.specs dd { margin: 0; font-weight: 600; }
.h-sec { font-size: 1.1rem; margin-top: 18px; }
.ficha-desc { white-space: normal; overflow-wrap: anywhere; color: var(--ink-2); }
.ficha-foot { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .85rem; }
.ficha-side { position: sticky; top: 130px; display: flex; flex-direction: column; gap: 14px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.ficha-side .panel { margin-bottom: 0; }
.seller-head { display: flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none !important; }
.seller-head strong { display: block; }
.seller-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0; }
.stars { color: #f5a524; letter-spacing: 1px; }
.stars-off { color: #d6dcd9; }
.contact-form label { font-weight: 600; font-size: .9rem; display: block; margin: 4px 0; }
.owner-box p { font-size: .9rem; }
.acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.acts form { margin: 0; }
.tips h2 { font-size: 1rem; }
.tips ul { padding-left: 18px; margin: 0 0 8px; font-size: .9rem; color: var(--ink-2); }

/* ---------- Publicar ---------- */
.pub-form .step h2 { display: flex; align-items: center; gap: 10px; }
.step-n { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; align-items: center; justify-content: center; font-size: .95rem; flex-shrink: 0; }
.f-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.f-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 14px; }
.f-checks { display: flex; flex-direction: column; justify-content: center; padding-top: 22px; }
.f-sm { max-width: 140px; }
.counter { display: block; text-align: right; font-size: .78rem; color: var(--muted); margin-top: 3px; }
.drop-zone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px 16px; border: 2px dashed var(--line-2); border-radius: var(--radius); background: #fafcfb; cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.drop-zone:hover, .drop-zone.over { border-color: var(--brand); background: var(--brand-50); }
.drop-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-preview, .photo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 12px; }
.photo-preview figure, .photo-item { position: relative; margin: 0; border-radius: 10px; overflow: hidden; background: #eee; aspect-ratio: 1; }
.photo-preview img, .photo-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview figure:first-child::after, .photo-list .photo-item:first-child::after { content: "Portada"; position: absolute; left: 6px; top: 6px; background: var(--accent); color: #2b2100; font-size: .7rem; font-weight: 700; padding: 2px 6px; border-radius: 5px; }
.photo-item span { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, .6); color: #fff; font-size: .8rem; padding: 4px 6px; display: flex; gap: 4px; align-items: center; cursor: pointer; }
.pub-submit { display: flex; gap: 10px; align-items: center; margin: 8px 0 24px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Cuenta ---------- */
.acc-nav { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; margin-bottom: 20px; }
.acc-nav a, .acc-nav .link { padding: 7px 12px; border-radius: 9px; color: var(--ink-2); font-weight: 500; font-size: .93rem; text-decoration: none !important; }
.acc-nav a:hover { background: #f1f4f3; }
.acc-nav a[aria-current] { background: var(--brand-50); color: var(--brand-600); font-weight: 700; }
.acc-nav form { margin: 0 0 0 auto; }
.acc-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.stats-4 { grid-template-columns: repeat(3, 1fr); }
.stats div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stats strong { display: block; font-size: 1.6rem; }
.stats span { color: var(--muted); font-size: .88rem; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; text-decoration: none !important; }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--brand); }
.count { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 999px; background: #eef2f0; font-size: .78rem; text-align: center; color: var(--ink-2); }
.count.hot { background: var(--danger); color: #fff; }
.row-list, .admin-list, .saved, .reviews, .inbox { list-style: none; padding: 0; margin: 0; }
.item-row { display: grid; grid-template-columns: 150px 1fr; gap: 16px; }
.row-img { display: block; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #eef2f0; }
.row-img img { width: 100%; height: 100%; object-fit: cover; }
.row-body h2 { font-size: 1.05rem; margin: 2px 0; }
.row-body h2 a { color: var(--ink); }
.status { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: #eef2f0; }
.status-activo { background: var(--ok-50); color: #0a6a4f; }
.status-pendiente, .status-sin_confirmar { background: var(--warn-50); color: #7a5600; }
.status-rechazado, .status-eliminado { background: var(--danger-50); color: #8a1c12; }
.status-vendido { background: var(--info-50); color: #1d4f8a; }
.saved li { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.danger-zone summary { cursor: pointer; color: var(--danger); font-weight: 600; }
.profile { display: flex; gap: 20px; align-items: flex-start; }

/* ---------- Mensajes ---------- */
.inbox li { border-bottom: 1px solid var(--line); }
.inbox a { display: flex; gap: 12px; align-items: center; padding: 12px; color: var(--ink); text-decoration: none !important; border-radius: 10px; }
.inbox a:hover { background: #fff; }
.inbox .unread .inbox-top strong, .inbox .unread .inbox-last { color: var(--ink); font-weight: 700; }
.inbox-img { width: 60px; height: 60px; border-radius: 10px; overflow: hidden; background: #eef2f0; flex-shrink: 0; }
.inbox-img img { width: 100%; height: 100%; object-fit: cover; }
.inbox-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.inbox-top { display: flex; justify-content: space-between; gap: 8px; }
.inbox-sub, .inbox-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.chat-item { display: flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none !important; }
.chat-user { display: flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 600; }
.chat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-height: 300px; max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.chat-note { font-size: .82rem; color: var(--muted); background: #f7f9f8; border-radius: 10px; padding: 8px 12px; text-align: center; }
.msg { display: flex; flex-direction: column; max-width: 78%; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.them { align-self: flex-start; }
.bubble { padding: 9px 13px; border-radius: 16px; background: #eef2f0; overflow-wrap: anywhere; }
.msg.me .bubble { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.them .bubble { border-bottom-left-radius: 4px; }
.msg-time { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.msg-warn { font-size: .8rem; color: #7a5600; background: var(--warn-50); padding: 4px 8px; border-radius: 8px; margin-top: 4px; }
.chat-form { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.chat-form textarea { flex: 1; }
.rate { margin-top: 16px; }
.rate summary { cursor: pointer; font-weight: 600; }
.star-input { display: inline-flex; flex-direction: row-reverse; border: 0; padding: 0; margin: 10px 0; }
.star-input input { position: absolute; opacity: 0; }
.star-input label { font-size: 2rem; color: #d6dcd9; cursor: pointer; padding: 0 2px; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: #f5a524; }
.star-input input:focus-visible + label { outline: 2px solid #1d8cf8; }

/* ---------- Auth ---------- */
.auth { max-width: 440px; margin: 24px auto; }
.auth h1 { text-align: center; }

/* ---------- Admin ---------- */
.admin-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.admin-filter select, .admin-filter input { width: auto; flex: 0 1 280px; }
.inline-reject { display: flex; gap: 4px; }
.inline-reject input { width: 200px; padding: 6px 10px; font-size: .875rem; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: #f7f9f8; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.bars .bar-row { display: grid; grid-template-columns: 160px 1fr 60px; gap: 10px; align-items: center; padding: 4px 0; }
.bar { height: 10px; background: #eef2f0; border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.code { background: #13201b; color: #d9f2e8; padding: 12px 14px; border-radius: 10px; overflow-x: auto; font-size: .85rem; }

/* ---------- Textos legales ---------- */
.prose { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; }
.prose h2 { margin-top: 1.4em; font-size: 1.15rem; }
.prose li { margin-bottom: 6px; }
.prose details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.prose summary { cursor: pointer; font-weight: 600; }
.prose details p { margin: 8px 0 0; color: var(--ink-2); }

/* ---------- Pie ---------- */
.ftr { background: #0f1b17; color: #b8c6c0; margin-top: 40px; font-size: .92rem; }
.ftr-in { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; padding-top: 36px; padding-bottom: 24px; }
.ftr h2 { color: #fff; font-size: .95rem; margin-bottom: 10px; }
.ftr a { display: block; color: #b8c6c0; padding: 3px 0; }
.ftr a:hover { color: #fff; }
.logo-ftr { color: #fff; }
.logo-ftr b { color: var(--accent); }
.ftr-bottom { border-top: 1px solid #22322c; padding-top: 14px; padding-bottom: 18px; font-size: .82rem; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .2s, transform .2s; z-index: 100; pointer-events: none; font-size: .93rem; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .ficha-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .hero-search { grid-template-columns: 1fr 1fr; }
  .hero-search input { grid-column: 1 / -1; }
  .hero-search button { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .hdr-in { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .hdr-search { order: 3; flex-basis: 100%; max-width: none; }
  .hdr-search select { max-width: 120px; }
  .ico-link .lbl { display: none; }
  .list-layout { grid-template-columns: 1fr; }
  .filters-toggle { display: inline-flex; justify-self: start; }
  .filters { display: none; position: static; max-height: none; }
  .filters.open { display: block; }
  .ficha-layout { grid-template-columns: 1fr; }
  .ficha-side { position: static; }
  .ftr-in { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .stats-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .hide-sm { display: none; }
  .logo span { display: none; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .cat-tile { padding: 12px 4px; }
  .cat-n { display: none; }
  .grid, .grid-list { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-body { padding: 8px 10px 10px; }
  .card-price { font-size: 1rem; }
  .why-grid { grid-template-columns: 1fr; }
  .cta-band { flex-direction: column; align-items: flex-start; padding: 22px; }
  .hero { padding: 32px 0 36px; }
  .hero-search { grid-template-columns: 1fr; }
  .ficha-info, .prose { padding: 18px; }
  .ficha-title-row { flex-direction: column; }
  .ficha-price { font-size: 1.5rem; }
  .item-row { grid-template-columns: 96px 1fr; gap: 10px; }
  .stats { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .stats div { padding: 10px; }
  .stats strong { font-size: 1.2rem; }
  .ftr-in { grid-template-columns: 1fr; }
  .profile { flex-direction: column; }
  .msg { max-width: 90%; }
  .inline-reject input { width: 140px; }
  .bars .bar-row { grid-template-columns: 100px 1fr 40px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Mejoras v5 ---------- */
.tag-nuevo { background: var(--brand); }
.tag-nuevo + .tag-demanda { top: 34px; }
.caduca-pronto { color: var(--danger); font-weight: 600; }
.err-search { grid-template-columns: 1fr auto; margin: 20px auto 12px; box-shadow: var(--shadow); }
.err-cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.diag { list-style: none; margin: 0 0 24px; padding: 8px 18px; }
.diag li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.diag li:last-child { border-bottom: 0; }
.diag li.ok > span:first-child { color: var(--brand); }
.diag li.ko > span:first-child { color: #b7791f; }
@media (max-width: 640px) { .err-search { grid-template-columns: 1fr; } }

/* ---------- v6: ideas de Wallapop, Vinted y Milanuncios ---------- */
/* Tarjetas: reservado, vendido, contador de favoritos y modo lista */
.tag-res { background: #7c3aed; }
.tag-sold { background: #4b5563; }
.tag-res + .tag-demanda, .tag-sold + .tag-demanda { top: 34px; }
.card-sold .card-img img { filter: grayscale(.7); opacity: .75; }
.fav { width: auto; min-width: 36px; padding: 0 8px; border-radius: 18px; gap: 4px; }
.fav-n { font-size: .74rem; font-weight: 700; color: var(--ink-2); }
.card-desc { display: none; }
.grid.as-list { grid-template-columns: 1fr; }
.grid.as-list .card { flex-direction: row; }
.grid.as-list .card-img { flex: 0 0 220px; aspect-ratio: 4 / 3; }
.grid.as-list .card-desc { display: block; color: var(--muted); font-size: .88rem; margin: 2px 0 4px; }
@media (max-width: 560px) {
  .grid.as-list .card-img { flex-basis: 120px; }
  .grid.as-list .card-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
.grid-scroll { grid-auto-flow: column; grid-auto-columns: minmax(200px, 220px); grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.grid-scroll > * { scroll-snap-align: start; }
.view-toggle { display: flex; gap: 4px; }
.view-toggle [aria-pressed="true"] { background: var(--brand-50); border-color: var(--brand); color: var(--brand); }
.results-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Chips */
.chip-res { background: #ede9fe; color: #5b21b6; }
.chip-good { background: #dcfce7; color: #166534; }
.chip-xs { font-size: .66rem; padding: 1px 6px; }
.chip-x { background: var(--brand-50); color: var(--brand-600); border: 1px solid #bfe3d5; }
.chip-x:hover { background: #d6efe5; }
button.chip { border: 1px solid var(--line-2); cursor: pointer; font-family: inherit; }
button.chip:hover { border-color: var(--brand); color: var(--brand); }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 12px; }
.alert-res { background: #f5f3ff; border-color: #ddd6fe; color: #4c1d95; }

/* Lo más buscado */
.popular { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.popular a { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; color: var(--ink); }
.popular a:hover { border-color: var(--brand); }
.popular span { color: var(--muted); font-size: .8rem; }

/* Ficha: ofertas, actividad del vendedor y barra fija en móvil */
.offer-box { margin-bottom: 10px; }
.offer-box summary { list-style: none; cursor: pointer; }
.offer-box summary::-webkit-details-marker { display: none; }
.offer-box form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.offer-input { display: flex; align-items: center; gap: 6px; }
.offer-input input { flex: 1; font-size: 1.3rem; font-weight: 700; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 10px; min-width: 0; }
.offer-input span { font-size: 1.2rem; font-weight: 700; }
.offer-sugg { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; }
.seller-activity { margin: 4px 0 10px; }
.follow-form { margin-bottom: 12px; }
.explore { margin-top: 18px; }
.sticky-cta { display: none; }
@media (max-width: 860px) {
  .sticky-cta { display: flex; position: fixed; left: 0; right: 0; bottom: 58px; z-index: 40; background: #fff; border-top: 1px solid var(--line); padding: 8px 12px; gap: 8px; align-items: center; box-shadow: 0 -4px 16px rgba(0, 0, 0, .08); }
  .sticky-price { flex: 1; font-weight: 800; font-size: 1.1rem; }
  body:has(.sticky-cta) main { padding-bottom: 70px; }
}

/* Chat: ofertas, avisos del sistema, respuestas rápidas */
.bubble.offer { display: flex; flex-direction: column; gap: 2px; min-width: 210px; border: 2px solid var(--accent); background: #fffbeb; color: var(--ink); }
.offer-lbl { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #92400e; }
.offer-amount { font-size: 1.5rem; }
.offer-state { font-size: .8rem; font-weight: 700; }
.bubble.offer-aceptada { border-color: #16a34a; background: #f0fdf4; }
.offer-aceptada .offer-state { color: #15803d; }
.bubble.offer-rechazada, .bubble.offer-retirada { border-color: var(--line-2); background: #f8fafc; opacity: .85; }
.offer-rechazada .offer-amount, .offer-retirada .offer-amount { text-decoration: line-through; }
.offer-acts { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.offer-pending { color: #b45309; }
.msg-sys { text-align: center; color: var(--muted); font-size: .84rem; background: #f1f5f3; border-radius: 999px; padding: 4px 12px; margin: 8px auto; max-width: 90%; }
.quick-replies { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 4px; }
.quick-replies .chip { white-space: nowrap; }
.chat-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.chat-user { display: flex; align-items: center; gap: 8px; }
.chat-tools { display: flex; gap: 6px; }
.chat-block { text-align: center; margin-top: 18px; }

/* Perfil, seguidos y calidad del anuncio */
.profile { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.profile-main { flex: 1; min-width: 220px; }
.follow-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.follow-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; }
.follow-list a { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.quality { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.quality-bar { flex: 0 0 90px; height: 7px; background: #e5ebe8; border-radius: 4px; overflow: hidden; }
.quality-bar span { display: block; height: 100%; }
.q-ok { background: #16a34a; }
.q-mid { background: #f59e0b; }
.q-low { background: var(--danger); }

/* Publicar: portada y borrar foto */
.photo-list .photo-item:first-child::after { content: none; }
.photo-item label { position: absolute; left: 0; right: 0; background: rgba(0, 0, 0, .6); color: #fff; font-size: .78rem; padding: 3px 6px; display: flex; gap: 4px; align-items: center; cursor: pointer; }
.photo-item label:nth-of-type(1) { top: 0; }
.photo-item label:nth-of-type(2) { bottom: 0; }

/* Galería a pantalla completa */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(0, 0, 0, .92); }
.lightbox img { max-width: 94vw; max-height: 90vh; object-fit: contain; position: absolute; inset: 0; margin: auto; }
.lightbox button { position: absolute; z-index: 2; background: rgba(255, 255, 255, .15); color: #fff; border: 0; font-size: 2rem; width: 52px; height: 52px; border-radius: 50%; cursor: pointer; }
.lightbox .lb-close { top: 14px; right: 14px; font-size: 1.4rem; }
.lightbox .lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 14px; top: 50%; transform: translateY(-50%); }

/* Admin: gráfico de 14 días */
.chart14 { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding: 14px; }
.c14-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.c14-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; gap: 2px; }
.c14-bars span { flex: 1; min-height: 2px; border-radius: 3px 3px 0 0; }
.c14-a { background: var(--brand); }
.c14-m { background: var(--accent); }
.c14-lbl { font-size: .7rem; color: var(--muted); margin-top: 4px; }
.c14-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; }

/* Menú inferior en móvil, como en las apps */
.bottom-nav { display: none; }
@media (max-width: 860px) {
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: #fff; border-top: 1px solid var(--line); padding: 4px 0 calc(4px + env(safe-area-inset-bottom)); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; font-size: .7rem; color: var(--muted); padding: 4px 0; position: relative; }
  .bottom-nav a span { font-size: 1.25rem; line-height: 1.2; }
  .bottom-nav a[aria-current="page"] { color: var(--brand); }
  .bottom-nav .bn-pub span { background: var(--accent); color: #2b2100; border-radius: 50%; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; font-weight: 800; }
  .bottom-nav .badge-dot { top: 0; right: calc(50% - 22px); }
  body { padding-bottom: 62px; }
  .toast { bottom: 80px; }
}

.offer-note { font-size: .86rem; font-style: italic; color: var(--ink-2); }

.list-intro { color: var(--ink-2); max-width: 760px; margin: 4px 0 0; line-height: 1.5; }
.gone h1 { font-size: 1.5rem; }
