:root {
  --bg: #f7f3ee; --card: #fff; --ink: #2b2622; --muted: #8a8077; --line: #e7dfd6;
  --accent: #b5654a; --accent-2: #7d8f6e; --warn: #b4552d; --warn-bg: #fbeee6; --ok: #4f7a4f;
  --r: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 Inter, system-ui, sans-serif; }
a { color: inherit; }
h1, h2, h3 { font-family: 'DM Serif Display', Georgia, serif; font-weight: 400; margin: 0 0 .5em; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 17px; font-family: Inter; font-weight: 600; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 14px 28px; border-bottom: 1px solid var(--line); background: #fffaf5; position: sticky; top: 0; z-index: 5; }
.brand { font-family: 'DM Serif Display', serif; font-size: 22px; text-decoration: none; }
.brand em { color: var(--accent); font-style: normal; }
.top nav { display: flex; gap: 18px; align-items: center; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a.active { color: var(--ink); font-weight: 600; }
main { max-width: 1240px; margin: 0 auto; padding: 28px; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--ink); color: #fff !important; padding: 10px 16px; border-radius: 999px; font: 500 14px Inter; cursor: pointer; text-decoration: none; }
.btn:hover { opacity: .88; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.ghost { background: transparent; color: var(--ink) !important; border: 1px solid var(--line); }
.btn.accent { background: var(--accent); }
.btn.green { background: var(--accent-2); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.grid { display: grid; gap: 18px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 12px 0 4px; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font: 14px Inter; background: #fffdfb; color: var(--ink); }
textarea { resize: vertical; min-height: 70px; }
input:focus, textarea:focus { outline: 2px solid #e8c9bb; border-color: var(--accent); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; }
.between { justify-content: space-between; }
.aviso { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 6px 10px; font-size: 13px; margin-top: 6px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #efe7de; }
.badge.mercadolivre { background: #fff3b8; } .badge.shopee { background: #ffe1d6; } .badge.amazon { background: #dfe9f5; }

/* lista */
.posts { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.post-card { text-decoration: none; display: block; transition: transform .15s; }
.post-card:hover { transform: translateY(-2px); }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 12px; }
.thumbs img, .thumbs div { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 6px; background: #efe7de; }

/* stepper */
.steps { display: flex; gap: 6px; margin: 8px 0 22px; flex-wrap: wrap; }
.steps span { padding: 6px 14px; border-radius: 999px; background: #efe7de; font-size: 13px; color: var(--muted); }
.steps span.on { background: var(--ink); color: #fff; }
.steps span.done { background: #dfe7d6; color: var(--ok); }

/* editor */
.section { margin-bottom: 26px; }
.copy-grid { grid-template-columns: 1fr 1fr; }
.prod-grid { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.prod .imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prod .imgs figure { margin: 0; }
.prod .imgs figcaption { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
.prod .imgs img, .ph { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 10px; background: #f1ebe4; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; text-align: center; padding: 8px; }
.prod .imgs img.ref { object-fit: contain; background: #fff; border: 1px solid var(--line); }
.prod .imgs figure.off .ph { opacity: .6; flex-direction: column; gap: 4px; }
.prod label.check { display: flex; align-items: center; gap: 8px; margin: 10px 0 2px; font-weight: 600; cursor: pointer; text-transform: none; letter-spacing: 0; }
.prod label.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.minis { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.minis img { width: 38px; height: 38px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid transparent; }
.minis img.sel { border-color: var(--accent); }
.prod-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
.prod-head .num { font-family: 'DM Serif Display'; font-size: 22px; color: var(--accent); }
.icon-btns { display: flex; gap: 4px; }
.icon-btns button { border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 30px; height: 30px; cursor: pointer; }

/* prévia */
.preview { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x mandatory; }
.slide { flex: 0 0 240px; aspect-ratio: 4/5; border-radius: 12px; overflow: hidden; position: relative; background: #e9e0d6; scroll-snap-align: start; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide .cover-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; height: 100%; gap: 2px; }
.slide .cover-grid > * { width: 100%; height: 100%; object-fit: cover; background: #ddd2c6; }
.slide .over { position: absolute; inset: auto 0 0 0; padding: 14px; color: #fff; background: linear-gradient(transparent, rgba(30,20,15,.75)); }
.slide .over.center { inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; background: rgba(30,20,15,.42); }
.slide .over b { font-family: 'DM Serif Display'; font-weight: 400; font-size: 21px; line-height: 1.15; display: block; }
.slide .over small { font-size: 11px; opacity: .9; }
.slide.cta { background: var(--accent); color: #fff; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 20px; }
.slide.cta .kw { font-family: 'DM Serif Display'; font-size: 40px; border: 2px solid #fff; padding: 4px 18px; border-radius: 12px; margin: 10px 0; }

.final-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.final-grid img { width: 100%; border-radius: 8px; border: 1px solid var(--line); }
pre.box { white-space: pre-wrap; background: #fbf8f4; border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: 13px/1.5 Inter; max-height: 260px; overflow: auto; }

.status-list { list-style: none; padding: 0; margin: 0; }
.status-list li { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.ok { color: var(--ok); font-weight: 600; } .no { color: var(--warn); font-weight: 600; }

#overlay { position: fixed; inset: 0; background: rgba(247,243,238,.85); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 50; }
#overlay[hidden] { display: none; }
.spinner { width: 42px; height: 42px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; z-index: 60; max-width: 90vw; white-space: pre-wrap; }
#toast.err { background: var(--warn); }

@media (max-width: 760px) {
  main { padding: 16px; } .top { padding: 12px 16px; } .copy-grid { grid-template-columns: 1fr; } .prod-grid { grid-template-columns: 1fr; }
}
