:root {
  --bg: #fbfaf5;
  --bg-soft: #f1f1e8;
  --ink: #1e2a22;
  --muted: #67735f;
  --line: #e0e3d5;
  --green: #2f7d4e;
  --green-dark: #1b4d3e;
  --green-soft: #e3efe3;
  --green-ghost: #f0f5ea;
  --wood: #8b5e34;
  --wood-soft: #a9743f;
  --amber: #a9743f;
  --red: #c2503f;
  --radius: 12px;
  --shadow-sm: 0 1px 3px rgba(30, 42, 34, .07);
  --shadow-md: 0 4px 14px rgba(30, 42, 34, .1), 0 1px 3px rgba(30, 42, 34, .06);
  --shadow-lg: 0 12px 32px rgba(30, 42, 34, .14);
  --ring: 0 0 0 3px rgba(47, 125, 78, .2);
  --font: "Market Sans", Arial, "Helvetica Neue", Helvetica, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.5; font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -.015em; }
.shell { max-width: 1220px; margin: 0 auto; padding: 0 20px; }
main { max-width: 1220px; margin: 0 auto; padding: 16px 20px 56px; }
button, input, select, textarea { font-family: inherit; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }

/* ---------- Barra utilitaria ---------- */
.utilbar { background: var(--bg-soft); border-bottom: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.utilbar .shell { display: flex; justify-content: space-between; align-items: center; padding-top: 6px; padding-bottom: 6px; gap: 12px; flex-wrap: wrap; }
.utilbar nav { display: flex; gap: 16px; align-items: center; }
.utilbar a { color: var(--muted); transition: color .15s; }
.utilbar a:hover { color: var(--green); text-decoration: none; }
.inline { display: inline; }
.flags { display: inline-flex; gap: 7px; margin-left: 6px; }
.flag { display: inline-flex; line-height: 0; opacity: .4; transition: opacity .15s, transform .15s; }
.flag svg { width: 22px; height: 15px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.flag:hover { opacity: .85; transform: scale(1.08); }
.flag.on { opacity: 1; }
.linklike { background: none; border: none; color: var(--muted); cursor: pointer; font-size: .8rem; padding: 0; transition: color .15s; }
.linklike:hover { color: var(--green); }

/* ---------- Cabecera principal ---------- */
.masthead { border-bottom: 1px solid var(--line); background: var(--bg); }
.masthead .shell { display: flex; align-items: center; gap: 22px; padding-top: 16px; padding-bottom: 16px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 1.5rem; color: var(--ink); font-weight: 800; letter-spacing: -.03em; }
.logo:hover { text-decoration: none; }
.logo em { font-style: normal; color: var(--green); }
.logo-img { height: 125px; width: auto; display: block; }

.search { flex: 1 1 320px; display: flex; max-width: 525px; margin: 0 auto; }
.search input { flex: 1; border: 2px solid var(--green-dark); border-right: none; border-radius: 24px 0 0 24px; padding: 11px 20px; font-size: .95rem; outline: none; min-width: 0; transition: box-shadow .15s; }
.search input:focus { box-shadow: inset 0 0 0 1px var(--green); }
.search .btn { border-radius: 0 24px 24px 0; padding: 11px 26px; }

.mast-actions { display: flex; align-items: center; gap: 18px; }
.iconlink { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink); font-size: .7rem; transition: color .15s; }
.ibadge { position: absolute; top: -6px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: .66rem; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--bg); }
.ibadge-green { background: var(--green); }
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; }
.usermenu summary::-webkit-details-marker { display: none; }
.avatar-btn { width: 40px; height: 40px; border: 2px solid transparent; transition: border-color .15s, transform .15s; }
.usermenu[open] .avatar-btn, .avatar-btn:hover { border-color: var(--green-dark); transform: scale(1.05); }
.usermenu-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 180px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 50; display: flex; flex-direction: column; }
.usermenu-name { font-weight: 700; font-size: .85rem; padding: 8px 10px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.usermenu-panel a, .usermenu-panel .linklike { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; color: var(--ink); font-size: .88rem; }
.usermenu-panel a:hover, .usermenu-panel .linklike:hover { background: var(--green-ghost); color: var(--green-dark); text-decoration: none; }
.inbox { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.inbox-row { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; color: inherit; transition: box-shadow .15s, border-color .15s; }
.inbox-row:hover { text-decoration: none; box-shadow: var(--shadow-md); border-color: #c8cfba; }
.inbox-img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--bg-soft); flex: none; }
.inbox-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inbox-title { font-weight: 700; font-size: .95rem; }
.inbox-meta { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-unread { margin-left: auto; flex: none; background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 12px; }
.iconlink svg { width: 22px; height: 22px; transition: transform .15s; }
.iconlink:hover { text-decoration: none; color: var(--green); }
.iconlink:hover svg { transform: scale(1.12); }
.btn-sell { background: var(--wood-soft); color: #fff !important; padding: 11px 28px; box-shadow: var(--shadow-sm); }
.btn-sell:hover { background: var(--wood); box-shadow: var(--shadow-md); }

/* ---------- Nav de categorías ---------- */
.catnav { border-bottom: 1px solid var(--line); background: var(--bg); }
.catnav .shell { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; justify-content: safe center; }
.catnav .shell::-webkit-scrollbar { display: none; }
.catnav a { position: relative; color: var(--ink); font-size: .88rem; font-weight: 500; padding: 12px 14px; white-space: nowrap; transition: color .15s; }
.catnav a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--green); transform: scaleX(0); transition: transform .18s ease; }
.catnav a:hover { text-decoration: none; color: var(--green); }
.catnav a:hover::after { transform: scaleX(1); }

/* ---------- Botones ---------- */
.btn { display: inline-block; padding: 10px 20px; border-radius: 24px; border: none; cursor: pointer; font-size: .92rem; font-weight: 700; text-align: center; transition: background .15s, box-shadow .15s, transform .1s; }
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--green); color: #fff !important; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--green-dark); box-shadow: var(--shadow-md); }
.btn-lg { padding: 13px 30px; font-size: 1rem; }
.btn-light { background: #fff; color: var(--green-dark) !important; box-shadow: var(--shadow-md); }
.btn-light:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-ghost { background: transparent; color: #fff !important; border: 1.5px solid rgba(255,255,255,.55); }
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,.1); }
.btn-outline { background: #fff; color: var(--green) !important; border: 1.5px solid var(--green); }
.btn-outline:hover { background: var(--green-ghost); }
.btn-block { display: block; width: 100%; }

/* ---------- Promo ---------- */
.promo { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; background:
  radial-gradient(700px 300px at 90% -40%, rgba(255,255,255,.16), transparent 60%),
  radial-gradient(500px 260px at -5% 130%, rgba(169,116,63,.4), transparent 65%),
  linear-gradient(105deg, #12352a, #1b4d3e 45%, #2f7d4e 80%, #3fa96b);
  color: #fff; border-radius: 16px; padding: 34px 38px; margin: 12px 0 14px; box-shadow: var(--shadow-md); }
.promo h1 { font-size: 1.6rem; margin: 0 0 6px; letter-spacing: -.02em; }
.promo p { margin: 0; opacity: .88; font-size: .95rem; }
.promo-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.loggedout-cta { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

/* ---------- Secciones ---------- */
.section { margin: 34px 0; }
.section-title { font-size: 1.3rem; margin: 0 0 16px; }
.rowhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.rowhead .section-title { margin: 0; }
.rowhead > a { font-size: .88rem; font-weight: 700; }

/* ---------- Categorías (tiles) ---------- */
.catrow { display: flex; flex-wrap: wrap; justify-content: center; gap: 30px 58px; }
.section:has(.catrow) .section-title { text-align: center; }
.cattile { display: flex; flex-direction: column; align-items: center; gap: 7px; color: var(--ink); text-align: center; padding: 8px 4px; }
.cattile:hover { text-decoration: none; }
.cattile:hover .catname { color: var(--green); }
.catimg { width: 92px; height: 92px; border-radius: 50%; background: var(--green-soft) center/cover; border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease; }
.cattile:hover .catimg { transform: translateY(-3px) scale(1.05); box-shadow: var(--shadow-md), 0 0 0 4px var(--green-soft); }
.catname { font-weight: 700; font-size: .88rem; transition: color .15s; }
.catcount { font-size: .76rem; color: var(--muted); }

/* ---------- Tarjetas ---------- */
.grid { display: grid; gap: 16px; }
.grid.g4 { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
.grid.g3 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.cardwrap { position: relative; }
.card { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: inherit; height: 100%; transition: box-shadow .18s ease, transform .18s ease, border-color .18s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #c8cfba; text-decoration: none; }
.card:hover h3 { color: var(--green); }
.thumb { position: relative; aspect-ratio: 1 / 1; border-bottom: 1px solid var(--line); background: var(--green-soft) center/cover no-repeat; }
.badge { position: absolute; top: 10px; left: 10px; font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 4px 10px; border-radius: 6px; color: #fff; box-shadow: var(--shadow-sm); }
.badge-hot { background: linear-gradient(120deg, #d84a3a, var(--red)); }
.badge-new { background: linear-gradient(120deg, #c79a63, var(--amber)); }
.card-body { padding: 12px 14px 14px; }
.card-body h3 { margin: 0 0 6px; font-size: .9rem; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; transition: color .15s; }
.card-price { margin: 0; font-size: 1.18rem; font-weight: 800; letter-spacing: -.01em; }
.card-meta { margin: 3px 0 0; font-size: .8rem; color: var(--muted); }
.card-meta .ends { color: var(--red); font-weight: 600; }
.card-seller { margin: 5px 0 0; font-size: .78rem; color: var(--muted); }

.watchbtn { position: absolute; top: 10px; right: 10px; }
.watchbtn button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.96); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--ink); padding: 0; box-shadow: var(--shadow-sm); transition: transform .12s, color .12s, border-color .12s; }
.watchbtn button:hover { color: var(--red); border-color: var(--red); transform: scale(1.1); }
.watchbtn.on button { color: var(--red); }
.watchbtn svg { width: 18px; height: 18px; fill: none; }

.avatar { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--green), #3fa96b); color: #fff; font-weight: 700; font-size: 1rem; flex: none; box-shadow: var(--shadow-sm); }
.avatar.sm { width: 22px; height: 22px; font-size: .7rem; box-shadow: none; }
.avatar.xl { width: 68px; height: 68px; font-size: 1.7rem; }

/* ---------- Últimas ventas ---------- */
.salesrow { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 10px; }
.sale { flex: 0 0 172px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: inherit; transition: transform .15s, box-shadow .15s; }
.sale:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.sale-img { aspect-ratio: 4 / 3; background: var(--green-soft) center/cover no-repeat; filter: saturate(.8); }
.sale-info { display: flex; flex-direction: column; padding: 9px 11px; }
.sale-info strong { font-size: .95rem; }
.sale-info span { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Cómo funciona ---------- */
.howto { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 44px 0 10px; }
@media (max-width: 700px) { .howto { grid-template-columns: 1fr; } }
.howstep { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; transition: transform .15s, box-shadow .15s; }
.howstep:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.howstep span { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--green), #3fa96b); color: #fff; font-weight: 700; font-size: .9rem; box-shadow: var(--shadow-sm); }
.howstep h3 { margin: 12px 0 4px; font-size: 1rem; }
.howstep p { margin: 0; color: var(--muted); font-size: .88rem; }

/* ---------- Listado con filtros ---------- */
.crumbs { color: var(--muted); font-size: .82rem; margin: 6px 0 14px; }
.crumbs span { margin: 0 5px; color: #aeb6a1; }
.listing { display: grid; grid-template-columns: 215px 1fr; gap: 28px; align-items: start; }
@media (max-width: 760px) { .listing { grid-template-columns: 1fr; } }
.filters { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow-sm); }
.filters h4 { margin: 18px 0 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.filters h4:first-child { margin-top: 0; }
.catlist { list-style: none; margin: 0; padding: 0; }
.catlist li { padding: 4px 0; font-size: .9rem; }
.catlist li a { color: var(--ink); transition: color .12s; }
.catlist li a:hover { color: var(--green); }
.catlist li.sel a { color: var(--green); font-weight: 700; }
.pricerange { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.pricerange input { width: 100%; min-width: 0; padding: 8px 10px; font-size: .88rem; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar h1 { font-size: 1.3rem; margin: 0; }
.count { font-size: .8rem; font-weight: 700; color: var(--green); background: var(--green-soft); border-radius: 20px; padding: 3px 10px; margin-left: 6px; vertical-align: 2px; }
.sort select { border: 1px solid var(--line); border-radius: 20px; padding: 8px 12px; background: #fff; font-size: .88rem; cursor: pointer; box-shadow: var(--shadow-sm); }

/* ---------- Resultados en filas (estilo eBay) ---------- */
.rowlist { border-top: 1px solid var(--line); }
.rowitem { display: grid; grid-template-columns: 185px 1fr 150px; gap: 18px; padding: 18px 8px; border-bottom: 1px solid var(--line); align-items: start; border-radius: 10px; transition: background .15s; }
.rowitem:hover { background: var(--green-ghost); }
@media (max-width: 640px) { .rowitem { grid-template-columns: 120px 1fr; } .rowside { grid-column: 2; flex-direction: row; align-items: center; } }
.rowimg { position: relative; display: block; aspect-ratio: 1 / 1; border-radius: 10px; background: var(--green-soft) center/cover no-repeat; border: 1px solid var(--line); overflow: hidden; transition: box-shadow .15s; }
.rowimg:hover { box-shadow: var(--shadow-md); }
.rowmain { min-width: 0; }
.rowtitle { display: block; color: var(--ink); font-size: 1.08rem; line-height: 1.35; margin-bottom: 2px; transition: color .12s; }
.rowtitle:hover { color: var(--green); }
.rowcat { margin: 0 0 10px; color: var(--muted); font-size: .8rem; }
.rowprice { margin: 0; font-size: 1.4rem; font-weight: 800; letter-spacing: -.01em; }
.rowmeta { margin: 4px 0 0; font-size: .85rem; color: var(--muted); }
.rowmeta .ends { color: var(--red); font-weight: 700; }
.rowside { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.rowseller { font-size: .84rem; font-weight: 700; }
.watchbtn.static { position: static; }

/* ---------- Ficha de subasta ---------- */
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 780px) { .detail { grid-template-columns: 1fr; } }
.detail-media { position: sticky; top: 16px; }
@media (max-width: 780px) { .detail-media { position: static; } }
.detail-img { aspect-ratio: 1 / 1; border-radius: 16px; background: var(--green-soft) center/cover no-repeat; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.detail-info h1 { font-size: 1.5rem; margin: 0 0 14px; line-height: 1.3; }

.bidpanel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; box-shadow: var(--shadow-md); }
.bidpanel-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.label { font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.price.big { font-size: 2.3rem; font-weight: 800; margin: 0; letter-spacing: -.03em; }
.bidcount { color: var(--muted); font-size: .95rem; font-weight: 500; }
.endline { margin: 8px 0 2px; color: var(--muted); font-size: .9rem; }
.endline .ends { color: var(--red); }
.watchers { margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; padding: 6px 12px; border-radius: 8px; }
.chip.dark { background: var(--green-soft); color: var(--green-dark); }
.chip.ends::before { content: "⏱ "; }
.bidform { margin-top: 14px; }
.bidrow { display: flex; gap: 8px; }
.bidrow input { flex: 1; border: 1.5px solid #9faa93; border-radius: 24px; padding: 12px 20px; font-size: 1.05rem; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.bidrow input:focus { outline: none; border-color: var(--green); box-shadow: var(--ring); }
.hint { color: var(--muted); font-size: .85rem; }
.watchrow { margin-top: 10px; }

.shipblock { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 9px; }
.shipblock > div { display: grid; grid-template-columns: 70px 1fr; gap: 10px; font-size: .85rem; }
.shipblock span:last-child { color: var(--muted); }
.shiplabel { font-weight: 700; color: var(--ink); }

.sellerpanel { display: flex; align-items: center; gap: 12px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-top: 14px; transition: box-shadow .15s; }
.sellerpanel:hover { box-shadow: var(--shadow-sm); }
.sellerdata { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.sellername { font-weight: 700; font-size: 1rem; color: var(--ink); }

.descblock { margin-top: 26px; }
.descblock h3 { font-size: 1.05rem; margin: 0 0 10px; border-bottom: 2px solid var(--green-soft); padding-bottom: 8px; }
.bidlist { list-style: none; padding: 0; margin: 0; }
.bidlist li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.bidamount { font-weight: 800; }
.bidlist time { margin-left: auto; color: var(--muted); font-size: .78rem; }

/* ---------- Formularios ---------- */
.formpage { max-width: 600px; margin: 20px auto; }
.formpage.narrow { max-width: 430px; }
.formpage h1 { margin-bottom: 4px; font-size: 1.5rem; }
.lead { color: var(--muted); margin-top: 0; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 26px 28px; box-shadow: var(--shadow-md); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: .88rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { .two { grid-template-columns: 1fr; } }
input, textarea, select { padding: 10px 13px; border: 1.5px solid #bcc5ae; border-radius: 10px; font-size: .95rem; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--green); box-shadow: var(--ring); }

.sellerhead { display: flex; align-items: center; gap: 16px; margin: 16px 0 4px; }
.sellerhead h1 { margin: 0; font-size: 1.4rem; }

.empty { text-align: center; padding: 48px 24px; background: var(--bg-soft); border: 1px dashed #c2cbb2; border-radius: 16px; color: var(--muted); }
.hint { display: block; font-size: .78rem; color: var(--muted); margin-top: 4px; font-weight: 400; }
.empty .btn { margin-top: 10px; }

.alert { background: #f8e9e3; color: var(--red); padding: 11px 15px; border-radius: 10px; margin-bottom: 12px; font-size: .9rem; }
.alert.ok { background: var(--green-soft); color: var(--green-dark); }

/* ---------- Chat ---------- */
.chatpage { max-width: 640px; margin: 12px auto; }
.chathead { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.chathead h1 { font-size: 1.2rem; margin: 0; }
.chatinfo { margin-bottom: 12px; }
.chatbox { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 16px; padding: 16px; height: 380px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; box-shadow: inset 0 1px 4px rgba(16,27,20,.05); }
.chatempty { text-align: center; margin-top: 40px; }
.msg { max-width: 78%; align-self: flex-start; }
.msg.mine { align-self: flex-end; text-align: right; }
.msgbody { display: inline-block; background: #fff; border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 9px 13px; font-size: .92rem; text-align: left; white-space: pre-wrap; word-break: break-word; box-shadow: var(--shadow-sm); }
.msg.mine .msgbody { background: linear-gradient(135deg, var(--green), #3fa96b); color: #fff; border-color: transparent; border-radius: 14px 14px 4px 14px; }
.msgmeta { font-size: .72rem; color: var(--muted); margin-top: 3px; }
.chatform { display: flex; gap: 8px; margin-top: 12px; }
.chatform input { flex: 1; border-radius: 24px; padding: 12px 18px; }

/* ---------- Footer ---------- */
.foot { background: var(--bg-soft); border-top: 1px solid var(--line); color: var(--muted); margin-top: 44px; }
.foot-inner { max-width: 1220px; margin: 0 auto; padding: 42px 20px 30px; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 28px; }
@media (max-width: 760px) { .foot-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .foot-inner { grid-template-columns: 1fr; } }
.foot-logo { font-size: 1.25rem; color: var(--ink); font-weight: 800; }
.foot-logo em { font-style: normal; color: var(--green); }
.foot-brand p { font-size: .85rem; max-width: 320px; }
.foot-col { display: flex; flex-direction: column; gap: 8px; }
.foot-col h4 { margin: 0 0 3px; color: var(--ink); font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; }
.foot-col a { color: var(--muted); font-size: .88rem; transition: color .12s; }
.foot-col a:hover { color: var(--green); }
.foot-disclaimer { border-top: 2px solid var(--amber); background: #f5efe1; padding: 20px; text-align: center; }
.foot-disclaimer strong { color: var(--ink); }
.foot-disclaimer > strong { display: block; font-size: .95rem; margin-bottom: 6px; }
.foot-disclaimer p { max-width: 860px; margin: 0 auto; font-size: .85rem; line-height: 1.65; color: #5e5340; }
.foot-legal { border-top: 1px solid var(--line); text-align: center; padding: 15px; font-size: .8rem; }

/* ---------- Centro de ayuda (discreto, se abre desde el pie) ---------- */
.foot-help-link { background: none; border: none; padding: 0; cursor: pointer; font: inherit; color: inherit; text-align: left; }
.foot-help-link:hover { color: var(--green); text-decoration: underline; }
.help-panel { position: fixed; right: 18px; bottom: 18px; width: 320px; max-width: calc(100vw - 36px); background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 60; display: flex; flex-direction: column; overflow: hidden; }
.help-panel[hidden] { display: none; }
.help-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--green); color: #fff; font-size: .92rem; }
.help-x { background: none; border: none; color: #fff; font-size: 1.25rem; cursor: pointer; line-height: 1; padding: 0 2px; }
.help-msgs { padding: 12px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: 280px; min-height: 110px; background: var(--bg-soft); }
.help-msg { padding: 8px 11px; border-radius: 12px; font-size: .85rem; max-width: 88%; white-space: pre-line; }
.help-msg.bot { background: #fff; border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.help-msg.user { background: var(--green); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.help-form { padding: 10px; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); background: #fff; }
.help-form input { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: .85rem; width: 100%; min-width: 0; }
.help-row { display: flex; gap: 8px; }
.help-row .btn { padding: 8px 14px; font-size: .82rem; }
