/* Madeiras & produtos (prefixo ct-). Só tokens; a cor de cada madeira vem do dado da espécie (--cor). */

/* ===== Amostra de madeira: veio desenhado em CSS a partir da cor da espécie ===== */
.ct-wood { --esc: color-mix(in srgb, var(--cor) 70%, var(--red-deep)); --cla: color-mix(in srgb, var(--cor) 82%, var(--gold));
  display: block; position: relative; overflow: hidden;
  background:
    radial-gradient(ellipse 9% 5% at 68% 46%, var(--esc) 0 35%, transparent 75%),
    repeating-radial-gradient(ellipse 160% 70% at 68% 46%, transparent 0 7px, color-mix(in srgb, var(--esc) 55%, transparent) 7px 8.5px, transparent 8.5px 12px, color-mix(in srgb, var(--cla) 45%, transparent) 12px 13px),
    repeating-linear-gradient(176deg, transparent 0 3px, color-mix(in srgb, var(--esc) 30%, transparent) 3px 4px, transparent 4px 11px),
    linear-gradient(160deg, var(--cla), var(--cor) 45%, var(--esc));
}
.ct-wood::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 10%, transparent), transparent 40%, color-mix(in srgb, var(--red-deep) 22%, transparent)); pointer-events: none; }
/* topo da peça (anéis de crescimento) */
.ct-wood--topo { position: absolute; inset: 0; background:
    repeating-radial-gradient(circle at 18% 120%, color-mix(in srgb, var(--cor) 80%, var(--gold)) 0 3px, color-mix(in srgb, var(--cor) 70%, var(--red-deep)) 3px 4px, var(--cor) 4px 8px); }

/* ===== Lista ===== */
.ct-sec { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 6px 0 12px; }
.ct-sec h2 { display: flex; align-items: center; gap: 8px; font-size: var(--fs-lg); font-weight: 500; }
.ct-sec h2 svg { width: 17px; height: 17px; color: var(--gold-tx); }
.ct-sec .muted { font-size: var(--fs-xs); }

.ct-esps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding: 2px 2px 14px; margin-bottom: 18px; scroll-snap-type: x proximity; min-width: 0; align-items: start; }
.ct-esps::-webkit-scrollbar { height: 6px; }
.ct-esps::-webkit-scrollbar-thumb { background: var(--s4); border-radius: 6px; }
.ct-esp { position: relative; display: grid; grid-template-rows: 70px 1fr; align-content: start; text-align: left; border-radius: var(--r-lg); overflow: hidden; background: linear-gradient(180deg, var(--s2), var(--s1)); border: 1px solid var(--line-2); box-shadow: var(--shadow-1); scroll-snap-align: start; color: inherit; transition: transform var(--t-fast) var(--ease), border-color var(--t-fast), box-shadow var(--t-med); }
.ct-esp:hover { transform: translateY(-2px); border-color: var(--line-3); }
.ct-esp.on { border-color: var(--gold-line); box-shadow: 0 0 0 1px var(--gold-line), 0 16px 40px -18px color-mix(in srgb, var(--cor) 80%, transparent); }
.ct-esp__wood { height: 70px; }
.ct-esp__b { display: grid; gap: 8px; padding: 12px 14px 14px; align-content: start; }
.ct-esp__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ct-esp__top b { font-family: var(--serif); font-weight: 600; font-size: 19px; line-height: 1.1; }
.ct-esp__top .pill { height: 20px; font-size: 10.5px; padding: 0 8px; flex: none; }
.ct-esp__top .pill svg { width: 11px; height: 11px; }
.ct-esp__uso { font-size: var(--fs-xs); color: var(--tx-3); line-height: 1.4; min-height: 2.8em; }
.ct-esp__n { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--r-sm); }
.ct-esp__n > span { display: grid; gap: 1px; padding: 7px 10px; min-width: 0; }
.ct-esp__n > span + span { border-left: 1px solid var(--line); }
.ct-esp__n small { font-size: 10.5px; color: var(--tx-3); }
.ct-esp__n b { font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.ct-esp__f { font-size: var(--fs-2xs); color: var(--tx-3); }
.ct-esp__f em { font-style: normal; color: var(--gold-tx); }

.ct-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ct-busca { flex: 1 1 280px; max-width: 400px; min-width: 0; }
.ct-bar .select { height: 36px; font-size: var(--fs-xs); max-width: 230px; min-width: 0; }
.ct-conta { margin-left: auto; font-size: var(--fs-xs); }
.ct-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.ct-cats .chip { cursor: pointer; }
.ct-cats .chip:hover { color: var(--tx); border-color: var(--line-3); }
.ct-cats .chip em { font-style: normal; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: var(--r-pill); background: var(--s3); color: var(--tx-2); }
.ct-cats .chip.on em { background: var(--red-soft); color: var(--red-tx); }

.ct-tbl td { vertical-align: middle; }
.ct-tbl tbody tr { animation: rise .45s var(--ease) both; animation-delay: calc(var(--i) * 18ms); }
.ct-cod { font-size: 11.5px; padding: 3px 7px; border-radius: 6px; background: var(--s3); color: var(--tx-2); white-space: nowrap; }
.ct-prod { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.ct-prod .wood-dot { width: 12px; height: 26px; border-radius: 4px; }
.ct-prod b { font-weight: 500; display: block; }
.ct-prod small { font-size: var(--fs-2xs); color: var(--tx-3); }
.ct-un { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--tx-2); white-space: nowrap; }
.ct-un svg { width: 14px; height: 14px; color: var(--tx-3); }
.ct-comps { font-size: var(--fs-xs); color: var(--tx-2); white-space: nowrap; }
.ct-preco { font-weight: 600; white-space: nowrap; }
.ct-preco small { font-weight: 400; font-size: var(--fs-2xs); color: var(--tx-3); margin-left: 1px; }
.ct-sub { display: block; font-size: var(--fs-2xs); color: var(--tx-3); margin-top: 1px; white-space: nowrap; }
.ct-so-sm { display: none; }
.ct-go svg { width: 16px; height: 16px; color: var(--tx-4); transition: transform var(--t-fast), color var(--t-fast); }
.ct-tbl tr:hover .ct-so-sm { display: none; }
.ct-go svg { color: var(--red-tx); transform: translateX(3px); }
.ct-vazio { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 34px 16px; color: var(--tx-3); font-size: var(--fs-sm); flex-wrap: wrap; }
.ct-vazio > svg { width: 18px; height: 18px; }
.ct-vazio b { font-weight: 500; color: var(--tx-2); }
.ct-nota { display: flex; gap: 8px; align-items: flex-start; margin: 12px 2px 0; font-size: var(--fs-xs); color: var(--tx-3); line-height: 1.45; }
.ct-nota svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.ct-nota b { font-weight: 500; color: var(--tx-2); }

/* ===== Detalhe ===== */
.ct-hero { position: relative; display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 20px; margin-bottom: 16px; border-radius: var(--r-xl); border: 1px solid var(--line-2); overflow: hidden;
  background: radial-gradient(90% 160% at 0% 0%, color-mix(in srgb, var(--cor) 30%, transparent), transparent 60%), linear-gradient(180deg, var(--s2), var(--s1)); box-shadow: var(--shadow-1); }
.ct-hero__amostra { position: relative; height: 170px; border-radius: var(--r-lg); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line-2); }
.ct-wood--hero { position: absolute; inset: 0; }
.ct-secao { position: absolute; right: 14px; bottom: 30px; border-radius: 3px; overflow: hidden; box-shadow: var(--shadow-2), 0 0 0 1px color-mix(in srgb, var(--red-deep) 50%, transparent); }
.ct-secao__l { position: absolute; right: 14px; bottom: 8px; font-family: var(--mono); font-size: 10.5px; color: var(--tx); background: color-mix(in srgb, var(--bg) 70%, transparent); padding: 1px 6px; border-radius: 5px; }
.ct-hero__main { min-width: 0; display: grid; gap: 6px; }
.ct-hero__selos { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ct-hero h1 { font-family: var(--serif); font-weight: 600; font-size: 34px; line-height: 1.1; }
.ct-hero__esp { margin: 0; display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--tx-2); }
.ct-hero__n { display: grid; grid-template-columns: repeat(4, minmax(0, auto)); justify-content: start; margin-top: 8px; border: 1px solid var(--line); border-radius: var(--r-md); background: color-mix(in srgb, var(--bg) 35%, transparent); }
.ct-hero__n > div { display: grid; gap: 1px; padding: 9px 16px; min-width: 0; }
.ct-hero__n > div + div { border-left: 1px solid var(--line); }
.ct-hero__n small { font-size: var(--fs-2xs); color: var(--tx-3); }
.ct-hero__n b { font-size: var(--fs-md); font-weight: 600; white-space: nowrap; }
.ct-hero__n em { font-style: normal; font-weight: 400; font-size: var(--fs-xs); color: var(--tx-3); }
.ct-hero__acts { display: grid; gap: 8px; align-self: center; }
.ct-hero__acts .btn { justify-content: flex-start; }
.ct-hero__acts .btn > svg { flex: none; }

.ct-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 370px); gap: 16px; align-items: start; }
.ct-col { display: grid; gap: 16px; align-content: start; min-width: 0; }
.ct-pad { padding: 14px 20px 18px; display: grid; gap: 10px; }
.ct-side .card-head { padding: 16px 18px 0; }
.ct-side .ct-pad { padding: 12px 18px 16px; }

.ct-cub { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ct-cub > div { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r-md); background: var(--bg-2); border: 1px solid var(--line); min-width: 0; }
.ct-cub small { font-size: var(--fs-2xs); color: var(--tx-3); }
.ct-cub b { font-size: var(--fs-lg); font-weight: 600; }
.ct-cub span { font-size: var(--fs-2xs); color: var(--tx-3); }
.ct-mini th, .ct-mini td { padding: 9px 12px; }

.ct-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--s1); color: inherit; transition: border-color var(--t-fast); }
a.ct-row:hover { border-color: var(--red-line); }
.ct-row__m { display: grid; gap: 2px; min-width: 0; }
.ct-row__m b { display: flex; gap: 8px; font-size: var(--fs-sm); font-weight: 500; min-width: 0; }
.ct-row__m b .mono { font-size: var(--fs-xs); color: var(--tx-2); flex: none; padding-top: 1px; }
.ct-row__t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-row__m small { font-size: var(--fs-2xs); color: var(--tx-3); }
.ct-row__r { display: grid; justify-items: end; gap: 6px; }
.ct-row__r b { font-size: var(--fs-sm); font-weight: 600; }

.ct-disp { --c: var(--ok); display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: center; padding: 12px; border-radius: var(--r-md); background: color-mix(in srgb, var(--c) 9%, var(--s1)); border: 1px solid color-mix(in srgb, var(--c) 28%, transparent); }
.ct-disp.warn { --c: var(--warn); } .ct-disp.info { --c: var(--info); }
.ct-disp__ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.ct-disp__ic svg { width: 17px; height: 17px; }
.ct-disp b { font-size: var(--fs-md); font-weight: 600; color: var(--c); display: block; }
.ct-disp small { font-size: var(--fs-xs); color: var(--tx-2); }
.ct-dl { margin: 0; display: grid; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.ct-dl > div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 10px; padding: 8px 12px; font-size: var(--fs-xs); }
.ct-dl > div + div { border-top: 1px solid var(--line); }
.ct-dl dt { color: var(--tx-3); }
.ct-dl dd { margin: 0; overflow-wrap: anywhere; }
.ct-link { display: inline-flex; align-items: center; gap: 6px; justify-self: start; font-size: var(--fs-xs); color: var(--red-tx); font-weight: 500; }
.ct-link svg { width: 14px; height: 14px; transition: transform var(--t-fast); }
.ct-link:hover svg { transform: translateX(3px); }
.ct-espbox { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: center; }
.ct-espbox__wood { width: 56px; height: 56px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line-2); }
.ct-espbox b { font-family: var(--serif); font-weight: 600; font-size: 20px; display: block; }
.ct-espbox small { font-size: var(--fs-xs); color: var(--tx-3); }
.ct-irmaos { display: grid; gap: 6px; }
.ct-irmaos > small { font-size: var(--fs-2xs); color: var(--tx-3); }
.ct-irmaos > div { display: flex; flex-wrap: wrap; gap: 6px; }
.ct-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); color: var(--tx-2); border: 1px solid var(--line-2); background: var(--s1); white-space: nowrap; transition: border-color var(--t-fast), color var(--t-fast); cursor: pointer; }
.ct-chip:hover { border-color: var(--line-3); color: var(--tx); }
.ct-chip.on { border-color: var(--gold-line); background: var(--gold-soft); color: var(--tx); }
.ct-chip em { font-style: normal; color: var(--tx-3); font-size: var(--fs-2xs); }
.ct-empty { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 18px 12px; border: 1px dashed var(--line-2); border-radius: var(--r-md); }
.ct-empty__ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--s3); color: var(--tx-3); margin-bottom: 4px; }
.ct-empty__ic svg { width: 17px; height: 17px; }
.ct-empty b { font-size: var(--fs-sm); font-weight: 500; }
.ct-empty small { font-size: var(--fs-xs); color: var(--tx-3); max-width: 46ch; line-height: 1.45; }

/* ===== Calculadora ===== */
.modal.ct-modal { width: min(660px, calc(100vw - 24px)); }
.ct-calc { display: grid; gap: 16px; }
.ct-calc__bits { display: grid; gap: 6px; }
.ct-calc__bits > small { font-size: var(--fs-2xs); color: var(--tx-3); }
.ct-calc__bits > div { display: flex; flex-wrap: wrap; gap: 6px; }
.ct-calc__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ct-f { min-width: 0; }
.ct-f--esp { grid-column: 1 / -1; }
.ct-f--esp .select { width: 100%; }
.ct-f__in { position: relative; }
.ct-f__in .input { width: 100%; padding-right: 44px; font-size: var(--fs-md); font-weight: 500; }
.ct-f__in span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: var(--fs-xs); color: var(--tx-3); pointer-events: none; }
.ct-calc__res { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; }
.ct-res { display: grid; gap: 2px; padding: 14px; border-radius: var(--r-md); background: var(--bg-2); border: 1px solid var(--line); min-width: 0; }
.ct-res small { font-size: var(--fs-2xs); color: var(--tx-3); }
.ct-res b { font-size: var(--fs-xl); font-weight: 600; white-space: nowrap; }
.ct-res span { font-size: var(--fs-2xs); color: var(--tx-3); }
.ct-res--main { background: var(--gold-soft); border-color: var(--gold-line); }
.ct-res--main b { color: var(--gold-tx); font-size: var(--fs-2xl); }

/* ===== Telas menores ===== */
@media (max-width: 1240px) {
  .ct-hero { grid-template-columns: 180px minmax(0, 1fr); }
  .ct-hero__acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; }
}
@media (max-width: 1100px) {
  .ct-grid { grid-template-columns: minmax(0, 1fr); }
  .ct-col--side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .ct-hide-sm { display: none; }
  .ct-tbl th, .ct-tbl td { padding-left: 10px; padding-right: 10px; }
  .ct-prod { min-width: 150px; }
  .ct-so-sm { display: block; margin-top: 5px; }
  .ct-so-sm .pill { height: 20px; font-size: 10.5px; padding: 0 8px; }
  .ct-esps { grid-auto-columns: minmax(228px, 78%); }
  .ct-bar .select { flex: 1 1 140px; max-width: none; }
  .ct-busca { flex-basis: 100%; max-width: none; }
  .ct-hero { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 16px; }
  .ct-hero__amostra { height: 130px; }
  .ct-hero h1 { font-size: 26px; }
  .ct-hero__n { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ct-hero__n > div:nth-child(3) { border-left: 0; }
  .ct-hero__n > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .ct-hero__acts .btn { flex: 1 1 auto; justify-content: center; }
  .ct-col--side { grid-template-columns: minmax(0, 1fr); }
  .ct-cub { grid-template-columns: minmax(0, 1fr); }
  .ct-calc__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ct-calc__res { grid-template-columns: minmax(0, 1fr); }
  .ct-row { grid-template-columns: minmax(0, 1fr); }
  .ct-row__r { justify-items: start; display: flex; gap: 8px; align-items: center; }
}

/* ---------- Tabela de preços (#catalogo/precos) — prefixo tp- ---------- */
.tp-pg .page-head { margin-top: 6px; }
.tp-esps { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.tp-esp { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--s1); }
.tp-esp.mud { border-color: var(--gold-line, var(--line-3)); }
.tp-esp .wood-dot { width: 12px; height: 12px; }
.tp-esp__b { display: grid; min-width: 0; }
.tp-esp__b b { font-weight: 600; font-size: var(--fs-sm); }
.tp-esp__b small { font-size: var(--fs-2xs); color: var(--tx-3); }
.tp-esp__v { font-size: var(--fs-md); }
.tp-esp__v em, .tp-in em { font-style: normal; font-size: var(--fs-2xs); color: var(--tx-3); margin-left: 2px; font-weight: 400; }
.tp-esp .tp-var { grid-column: 2 / -1; justify-self: end; }
.tp-in { display: inline-flex; align-items: center; gap: 6px; }
.tp-in > span { font-size: var(--fs-xs); color: var(--tx-3); }
.tp-in .input { width: 104px; height: 34px; text-align: right; padding: 0 10px; }
.tp-esp .tp-in .input { width: 96px; }
.tp-in--pc .input { width: 90px; }
.tp-tbl td { vertical-align: middle; }
.tp-tbl tr.mud td { background: color-mix(in srgb, var(--gold) 7%, transparent); }
.tp-tbl tr.mud .tp-in .input { border-color: var(--gold); }
.tp-cat td { padding-top: 16px; font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .07em; color: var(--tx-3); font-weight: 600; background: var(--bg-2); }
.tp-cat em { font-style: normal; margin-left: 8px; color: var(--tx-3); font-weight: 400; }
.tp-preco b small { font-size: var(--fs-2xs); color: var(--tx-3); font-weight: 400; margin-left: 2px; }
.tp-de { font-size: var(--fs-2xs); display: inline-flex; align-items: center; gap: 6px; }
.tp-var { display: inline-flex; align-items: center; gap: 2px; font-size: var(--fs-2xs); font-weight: 600; margin-left: 6px; }
.tp-var svg { width: 12px; height: 12px; }
.tp-var.up { color: var(--ok); } .tp-var.down { color: var(--warn); }
.tp-salvar { position: sticky; top: 70px; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 14px; border-radius: var(--r-md); border: 1px solid var(--gold); background: var(--s2); box-shadow: var(--sh-2, 0 8px 24px rgba(0,0,0,.18)); }
.tp-salvar > span { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; flex-wrap: wrap; }
.tp-salvar > span svg { width: 15px; height: 15px; color: var(--gold-tx); }
.tp-salvar small { color: var(--tx-3); font-size: var(--fs-xs); }
.tp-hist { display: grid; }
.tp-hist__r { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.tp-hist__r:first-child { border-top: 0; }
.tp-hist__q { display: grid; min-width: 0; }
.tp-hist__q b { font-weight: 500; font-size: var(--fs-sm); }
.tp-hist__q small { font-size: var(--fs-2xs); color: var(--tx-3); }
.tp-hist__v { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: var(--fs-sm); }
.tp-hist__v svg { width: 12px; height: 12px; color: var(--tx-3); }
.tp-rj .span-2 { grid-column: 1 / -1; }
.tp-rj { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tp-rj__prev { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--r-md); background: var(--bg-2); font-size: var(--fs-sm); }
.tp-rj__r { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-xs); }
.tp-rj__r > span:last-child { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tp-rj__r svg { width: 12px; height: 12px; color: var(--tx-3); }
@media (max-width: 760px) {
  .tp-hide-sm { display: none; }
  .tp-in .input { width: 92px; }
  .tp-salvar { top: 60px; flex-wrap: wrap; }
  .tp-hist__r { flex-direction: column; align-items: flex-start; gap: 4px; }
  .tp-rj { grid-template-columns: 1fr; }
}
