/* Onboarding da loja + preview do card público. */

:root {
  --bg: #f5f6f8; --fg: #1c2430; --panel: #ffffff; --muted: #5a6472;
  --line: #d7dce3; --brand: #1c4fd6; --err-bg: #fdecea; --err-fg: #8a1f11;
  --ok-bg: #e8f5ec; --ok-fg: #1e6b38;
  --portal-frame-neutral: #c9d0d9;   /* resultado orgânico */
  --portal-frame-sponsored: #b8860b; /* moldura comercial do portal */
  --card-bg: #ffffff;
}

* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; margin: 0; background: var(--bg); color: var(--fg); }
.wrap { display: flex; gap: 1.5rem; max-width: 70rem; margin: 0 auto; padding: 1.5rem 1rem; }
nav.steps { width: 15rem; flex-shrink: 0; }
nav.steps ol { list-style: none; padding: 0; margin: 0; }
nav.steps li { margin-bottom: .35rem; }
nav.steps a, nav.steps span.locked {
  display: flex; justify-content: space-between; gap: .5rem;
  padding: .45rem .6rem; border-radius: 6px; text-decoration: none;
  color: var(--fg); font-size: .88rem; border: 1px solid transparent;
}
nav.steps a:hover { border-color: var(--line); background: var(--panel); }
nav.steps a.current { background: var(--panel); border-color: var(--brand); }
nav.steps span.locked { color: var(--muted); cursor: not-allowed; }
.badge { font-size: .7rem; padding: .1rem .4rem; border-radius: 999px; align-self: center; white-space: nowrap; }
.badge.NOT_STARTED { background: #e6e9ee; color: var(--muted); }
.badge.IN_PROGRESS { background: #fff3cd; color: #7a5b00; }
.badge.PENDING_REVIEW { background: #ffe5c9; color: #8a4b00; }
.badge.COHERENT { background: var(--ok-bg); color: var(--ok-fg); }
.badge.VERIFIED { background: #d9e9ff; color: #1c4fd6; }
.badge.REJECTED { background: var(--err-bg); color: var(--err-fg); }

main.panel { flex: 1; background: var(--panel); border-radius: 8px; padding: 1.5rem;
             box-shadow: 0 1px 4px rgba(0,0,0,.06); min-width: 0; }
h1 { font-size: 1.25rem; margin-top: 0; }
label { display: block; margin: .8rem 0 .25rem; font-weight: 600; font-size: .88rem; }
input[type=text], input[type=email], input[type=tel], input[type=number], select {
  width: 100%; max-width: 28rem; padding: .5rem; border: 1px solid var(--line); border-radius: 4px; }
input[type=color] { width: 3.5rem; height: 2.2rem; padding: 0; border: 1px solid var(--line); border-radius: 4px; }
button { margin-top: 1rem; padding: .55rem 1.2rem; border: 0; border-radius: 4px;
         background: var(--brand); color: #fff; font-size: .95rem; cursor: pointer; }
button.secondary { background: #5a6472; }
.error { background: var(--err-bg); color: var(--err-fg); padding: .6rem .8rem; border-radius: 4px; margin-bottom: 1rem; }
.notice { background: var(--ok-bg); color: var(--ok-fg); padding: .6rem .8rem; border-radius: 4px; margin-bottom: 1rem; }
.muted { color: var(--muted); font-size: .85rem; }
table.data { border-collapse: collapse; width: 100%; font-size: .88rem; }
table.data th, table.data td { text-align: left; padding: .4rem .6rem; border-bottom: 1px solid var(--line); }
.color-row { display: flex; gap: 1.5rem; flex-wrap: wrap; }

/* ---------------- preview de cards (§11.1) ---------------- */

.preview-grid { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 1rem; }
.preview-cell { text-align: center; }
.preview-cell figcaption { font-size: .78rem; color: var(--muted); margin-top: .4rem; }

.theme-dark { --card-bg: #1c232d; --fg-card: #e8ecf1; --muted-card: #93a0b0;
              --portal-frame-neutral: #3a4656; background: #12161c;
              padding: 1rem; border-radius: 8px; }
.theme-light { --fg-card: #1c2430; --muted-card: #5a6472; background: var(--bg);
               padding: 1rem; border-radius: 8px; }

/* Uma única borda externa. A busca injeta --store-border com a cor
   principal configurada pelo lojista; anúncios particulares usam o neutro. */
.la-card {
  border: 1px solid var(--store-border, var(--portal-frame-neutral));
  border-radius: 10px;
  background: var(--card-bg);
  width: 20rem; text-align: left; display: inline-flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 2px 8px rgba(28, 36, 48, .06);
  transition: box-shadow .18s ease, transform .18s ease;
}
.la-card:hover { box-shadow: 0 7px 20px rgba(28, 36, 48, .11); transform: translateY(-1px); }
.la-card.mobile { width: 17rem; }
.la-card.selected { box-shadow: 0 7px 20px rgba(28, 79, 214, .18); }
.la-card.selected .la-select { font-weight: 700; }
.la-card.selected .la-select::after { content: " ✓ selecionado"; }
.la-card:focus-within { outline: 3px solid #1c4fd6; outline-offset: 2px; }
.la-card.editorial[hidden] { display: none; }
/* Ficha de catálogo compacta: metade da largura do anúncio no grid, com
   um único risco fino, sólido e arredondado. As declarações explícitas
   impedem que a antiga moldura tracejada sobreviva por cascata. */
.la-card.catalog { --store-border: var(--line); border: 1px solid var(--line) !important;
                   border-style: solid !important; border-radius: 10px; box-shadow: none; }
.la-card.catalog:hover { box-shadow: 0 4px 12px rgba(28, 36, 48, .08); }
.la-card.catalog .la-content { min-width: 0; }
.la-catalog-heading { padding: .45rem .6rem; border-bottom: 1px solid var(--line); }
.la-catalog-heading-link { color: var(--accent); font-size: .68rem; font-weight: 750;
                           letter-spacing: .025em; text-decoration: none; }
.la-catalog-heading-link:hover { text-decoration: underline; }
.la-card.catalog .la-photo { aspect-ratio: 16 / 10; }
.la-card.catalog .la-catalog-generic-photo { opacity: .5; }
.la-card.catalog .la-body { padding: .5rem .6rem .65rem; }
.la-card.catalog .la-eyebrow { font-size: .56rem; }
.la-card.catalog .la-title { min-height: 0; margin: .18rem 0 .45rem; font-size: .76rem;
                             line-height: 1.25; overflow-wrap: anywhere; }
.la-catalog-meta { margin: 0; color: var(--muted-card); font-size: .62rem; line-height: 1.35;
                   overflow-wrap: anywhere; }
.la-card.catalog .la-price { border-top: 0; margin: .55rem 0 0; padding-top: 0; font-size: .76rem;
                             overflow-wrap: anywhere; }
.la-card.catalog .catalog-fipe-unavailable { font-weight: 400; font-size: .65rem; color: var(--muted-card); }
.la-content { background: var(--card-bg); color: var(--fg-card); position: relative;
              display: flex; flex-direction: column; height: 100%; }
.la-photo-link { display: block; position: relative; color: inherit; text-decoration: none; }
.la-photo { position: relative; aspect-ratio: 16 / 10; background: #d9dde3;
            display: flex; align-items: center; justify-content: center; overflow: hidden; }
.la-vehicle-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.la-photo-placeholder { flex-direction: column; gap: .45rem; color: #6f7885;
                        background: linear-gradient(145deg, #eef0f3, #d7dbe1); font-size: .75rem; }
.la-photo-placeholder svg { width: 45%; max-width: 8rem; opacity: .7; }
.la-media-badges { position: absolute; inset: .65rem .65rem auto; display: flex;
                    justify-content: space-between; align-items: flex-start; pointer-events: none; }
.la-flag, .la-year-badge { display: inline-flex; align-items: center; min-height: 1.55rem;
  border-radius: 4px; background: rgba(255,255,255,.94); color: #394252;
  box-shadow: 0 1px 3px rgba(0,0,0,.12); padding: .2rem .45rem; font-size: .63rem;
  letter-spacing: .05em; font-weight: 750; }
.la-flag { color: #8a6500; }
.la-year-badge { font-size: .72rem; letter-spacing: 0; }
.la-body { padding: .85rem .9rem .8rem; display: flex; flex-direction: column; flex: 1; }
.la-card-heading { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.la-eyebrow { margin: 0; color: var(--muted-card); font-size: .64rem; font-weight: 750;
              letter-spacing: .1em; text-transform: uppercase; }
.la-select { display: inline-flex; align-items: center; gap: .25rem; margin: 0; padding: 0;
             color: var(--muted-card); font-size: .68rem; font-weight: 500; cursor: pointer; }
.la-select input { margin: 0; }
.la-title { font-size: .92rem; line-height: 1.3; font-weight: 700; margin: .25rem 0 .7rem;
            min-height: 2.4em; }
.la-title a { color: inherit; text-decoration: none; }
.la-title a:hover { text-decoration: underline; }
.la-meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem .8rem;
                color: var(--muted-card); font-size: .72rem; }
.la-meta-item { min-width: 0; display: flex; align-items: center; gap: .35rem; }
.la-meta-item > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.la-meta-icon { width: .95rem; height: .95rem; flex: 0 0 auto; }
.la-price { font-size: 1.08rem; font-weight: 750; margin: .85rem 0 0; padding-top: .75rem;
            border-top: 1px solid var(--line); }
.la-card-footer { display: flex; align-items: center; justify-content: space-between; gap: .6rem;
                  margin-top: .65rem; min-width: 0; }
.la-store { min-width: 0; display: flex; align-items: center; gap: .35rem;
            font-size: .68rem; color: var(--muted-card); margin: 0; }
.la-store > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.la-store .la-meta-icon { width: .85rem; height: .85rem; }
.la-store-logo { width: 1.5rem; height: 1.5rem; flex: 0 0 auto; object-fit: contain; border-radius: 3px; }
.la-store a { color: inherit; }
.la-seller-type { flex: 0 0 auto; border-radius: 999px; background: #eef1f5; color: #5a6472;
                  padding: .18rem .4rem; font-size: .6rem; white-space: nowrap; }
.la-sponsored-extras { padding: .45rem .9rem .7rem; background: #faf7ed; }
.la-compat { display: block; font-size: .68rem; color: var(--ok-fg, #1e6b38); margin-bottom: .25rem; }
.la-sponsored-actions { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .68rem; }
.la-why { color: var(--muted-card); }
.la-hide-form { display: inline; margin: 0; }
.la-hide-btn { font-size: .68rem; padding: .1rem .35rem; margin: 0; background: transparent;
               color: var(--muted-card); border: 1px solid var(--line); border-radius: 3px; cursor: pointer; }

/* ---------------- abertura responsiva da página do carro (§49, 9C.2) --- */
body.la-modal-open { overflow: hidden; }
.la-modal { position: fixed; inset: 0; z-index: 1000; background: rgba(20,24,30,.6);
            display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; }
.la-modal-inner { background: var(--bg); width: 100%; min-height: 100%; box-sizing: border-box; }
.la-modal-close { position: sticky; top: 0; left: 0; z-index: 1; width: 100%; text-align: right;
                   padding: .6rem 1rem; background: var(--panel); border: 0; border-bottom: 1px solid var(--line);
                   font-size: .95rem; cursor: pointer; }
/* <768px (§49.4): modal de tela inteira */
@media (max-width: 767px) {
  .la-modal-inner { max-width: none; }
}
/* 768-1023px (§49.4): modal amplo, não necessariamente tela inteira */
@media (min-width: 768px) and (max-width: 1023px) {
  .la-modal { padding: 2rem 1rem; }
  .la-modal-inner { max-width: 40rem; margin: 0 auto; border-radius: 8px; overflow: hidden; min-height: 0; }
}
/* barra inferior de contato fixa no celular (§49.1) — parte da própria
   página do carro, funciona tanto no modal quanto no acesso direto. */
@media (max-width: 767px) {
  .car-contact-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1001;
    background: var(--panel); border-top: 1px solid var(--line); padding: .6rem 1rem;
    display: flex; gap: .5rem; box-shadow: 0 -2px 6px rgba(0,0,0,.08); }
  .car-contact-bar a { flex: 1; text-align: center; padding: .55rem; border-radius: 6px;
    background: var(--brand); color: #fff; text-decoration: none; font-size: .88rem; }
  main.panel { padding-bottom: 4rem; }
}
@media (min-width: 768px) { .car-contact-bar { display: none; } }
