/* MAX B2B — portal de pedidos (pensado primeiro para o celular) */
:root { --blue: #1264d9; --blue-dark: #0d52b5; --navy: #071d34; --ink: #0b1c32; --muted: #5e6b7c; --line: #dce4ec; --bg: #f3f6f9; --wa: #25d366; --warn: #b45309; --warn-bg: #fdf3e2; --ok-bg: #e7f6ec; --ok: #15803d; --err-bg: #fdecec; --err: #b91c1c; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 "Segoe UI", Inter, system-ui, -apple-system, Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--blue); }
img { max-width: 100%; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }
.ic { width: 18px; height: 18px; vertical-align: -4px; flex-shrink: 0; }
:focus-visible { outline: 3px solid #3385f6; outline-offset: 2px; }
.p-wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.p-muted { color: var(--muted); }
.p-small { font-size: 13px; }

/* Cabeçalho */
.p-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.p-header-inner { display: flex; align-items: center; gap: 18px; min-height: 72px; }
.p-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.p-brand img { height: 46px; width: auto; }
.p-brand span { font-size: 12px; line-height: 1.25; border-left: 1px solid var(--line); padding-left: 10px; color: var(--muted); }
.p-brand b { color: var(--ink); letter-spacing: 1px; }
.p-search { flex: 1; max-width: 480px; }
.p-search input { width: 100%; height: 42px; border: 1px solid #c9d4df; border-radius: 99px; padding: 0 16px; font: inherit; background: #f8fafc; }
.p-user { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.p-user form { margin: 0; }
.p-company { display: flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); font-weight: 600; max-width: 220px; }
.p-company span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-link { background: none; border: 0; color: var(--blue); font: inherit; cursor: pointer; padding: 4px; }

/* Botões e avisos */
.p-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 99px; background: var(--blue); color: #fff; font: inherit; font-weight: 700; border: 0; cursor: pointer; text-decoration: none; }
.p-btn:hover { background: var(--blue-dark); }
.p-btn-wa { background: var(--wa); }
.p-btn-wa:hover { background: #1ebe5a; }
.p-btn-block { width: 100%; }
.p-alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; }
.p-alert-ok { background: var(--ok-bg); color: #14532d; }
.p-alert-erro { background: var(--err-bg); color: #7f1d1d; }
.p-tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.p-tag-warn { background: var(--warn-bg); color: var(--warn); }
.p-note { background: var(--warn-bg); color: #78350f; border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.p-empty { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 24px; text-align: center; color: var(--muted); }

/* Conteúdo */
.p-main { padding: 22px 0 48px; min-height: 60vh; }
.p-hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; background: linear-gradient(110deg, var(--navy), #0c3a6b); color: #fff; border-radius: 14px; padding: 26px 28px; margin-bottom: 20px; }
.p-hero h1 { margin: 0 0 6px; font-size: 26px; }
.p-hero p { margin: 0; color: #c9d6e4; max-width: 560px; }
.p-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.p-lead { font-size: 16px; margin: 0 0 16px; }
.p-cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 16px; }
.p-cats a { white-space: nowrap; padding: 8px 14px; border-radius: 99px; background: #fff; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.p-cats a.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.p-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.p-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--ink); transition: box-shadow .15s, transform .15s; }
.p-card:hover { box-shadow: 0 10px 24px #0b1c3218; transform: translateY(-2px); }
.p-card-img { aspect-ratio: 4 / 3; background: #fff; display: block; position: relative; overflow: hidden; border-bottom: 1px solid #eef2f6; }
.p-card-img img { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); object-fit: contain; display: block; }
.p-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.p-card-cat { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.p-card-title { font-size: 14.5px; line-height: 1.3; }
.p-sizes { display: flex; flex-wrap: wrap; gap: 4px; }
.p-sizes i { font-style: normal; font-size: 11.5px; font-weight: 700; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--muted); }
.p-card-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.p-price { font-weight: 800; font-size: 15px; }
.p-price small, td small { display: block; font-size: 11px; font-weight: 600; color: var(--warn); }

/* Produto */
.p-back { margin: 0 0 12px; }
.p-product { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 26px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.p-product-img img { width: 100%; border-radius: 10px; aspect-ratio: 1 / 1; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.p-product h1 { font-size: 22px; margin: 4px 0 6px; line-height: 1.25; }
.p-grade table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.p-grade th { text-align: left; font-size: 12px; text-transform: uppercase; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); }
.p-grade td { padding: 9px 8px; border-bottom: 1px solid #eef2f6; vertical-align: middle; }
.p-grade .num { text-align: right; }
.p-grade tr.falta td { background: #fffaf2; }
.p-grade input { width: 90px; height: 40px; border: 1px solid #c9d4df; border-radius: 8px; text-align: right; padding: 0 10px; font: inherit; font-size: 16px; }
.p-code { font-family: Consolas, monospace; font-size: 12.5px; color: var(--muted); }
.p-grade-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0 8px; font-size: 16px; }

/* Formulários e painéis */
.p-box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 26px; max-width: 480px; margin: 10px auto; }
.p-box h1 { font-size: 22px; margin: 0 0 12px; }
.p-text { max-width: 760px; }
.p-text h2 { font-size: 17px; margin: 20px 0 6px; }
.p-form label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 14px; margin-bottom: 14px; }
.p-form input:not([type=checkbox]) { height: 44px; border: 1px solid #c9d4df; border-radius: 8px; padding: 0 12px; font: inherit; font-weight: 400; }
.p-form small { font-weight: 400; color: var(--muted); }
.p-form .p-check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; }
.p-check input { width: 18px; height: 18px; margin-top: 2px; }
.p-title { font-size: 24px; margin: 0 0 16px; }
.p-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.p-panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.p-panel h2 { font-size: 17px; margin: 0 0 10px; }
.p-narrow { max-width: 520px; }
.p-dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0; }
.p-dl dt { color: var(--muted); }
.p-dl dd { margin: 0; }
.p-list { list-style: none; padding: 0; margin: 0; }
.p-list li { padding: 8px 0; border-top: 1px solid #eef2f6; }
.p-list li:first-child { border-top: 0; }
.p-list small { display: block; color: var(--muted); }

/* Rodapé */
.p-footer { background: var(--navy); color: #c9d6e4; font-size: 13px; }
.p-footer-inner { display: flex; flex-direction: column; gap: 4px; padding: 22px 0 28px; }
.p-footer a { color: #fff; }

@media (max-width: 760px) {
  .p-header-inner { flex-wrap: wrap; gap: 10px; padding: 10px 0; }
  .p-brand img { height: 38px; }
  .p-search { order: 3; flex-basis: 100%; max-width: none; }
  .p-company span { max-width: 120px; }
  .p-hero { padding: 20px; }
  .p-hero h1 { font-size: 21px; }
  .p-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .p-card-title { font-size: 13px; }
  .p-product { grid-template-columns: 1fr; padding: 14px; }
  .p-code { display: none; }
  .p-grade th:nth-child(2) { display: none; }
  .p-grade input { width: 76px; }
  .p-cols { grid-template-columns: 1fr; }
  .p-dl { grid-template-columns: 1fr; }
  .p-dl dd { margin-bottom: 6px; }
  .p-grade-foot .p-btn { width: 100%; }
}
.p-btn.p-disabled { opacity: .55; }

/* ---------- B2: carrinho e pedidos ---------- */
.p-navlink { position: relative; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); font-weight: 600; padding: 6px 8px; border-radius: 8px; }
.p-navlink.active, .p-navlink:hover { background: #eef3fb; color: var(--blue); }
.p-badge { position: absolute; top: -4px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--blue); color: #fff; font-style: normal; font-size: 11.5px; font-weight: 800; display: grid; place-items: center; }
.p-btn-ghost { background: #fff; color: var(--blue); border: 1px solid #b9cdeb; }
.p-btn-ghost:hover { background: #eef3fb; }
.p-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.p-inline { display: inline; }
.p-cart table, .p-items { width: 100%; border-collapse: collapse; }
.p-cart th, .p-items th { text-align: left; font-size: 12px; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.p-cart td, .p-items td { padding: 8px; border-bottom: 1px solid #eef2f6; vertical-align: middle; }
.p-cart .num, .p-items .num { text-align: right; white-space: nowrap; }
.p-cart input { width: 90px; height: 38px; border: 1px solid #c9d4df; border-radius: 8px; text-align: right; padding: 0 8px; font: inherit; font-size: 16px; }
.p-cart-group + .p-cart-group { margin-top: 18px; }
.p-cart-model { display: block; margin-bottom: 4px; }
.p-cart-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.p-checkout { margin-top: 16px; max-width: 560px; margin-left: auto; }
.p-checkout label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 14px; margin-bottom: 12px; }
.p-checkout input, .p-checkout textarea { border: 1px solid #c9d4df; border-radius: 8px; padding: 10px 12px; font: inherit; font-weight: 400; }
.p-checkout-total { display: flex; flex-direction: column; margin-bottom: 14px; }
.p-checkout-total b { font-size: 28px; }
.p-checkout-total small { color: var(--muted); }
.p-items small { display: block; font-size: 11.5px; color: var(--muted); }
.p-items tfoot td { border-top: 2px solid var(--line); border-bottom: 0; font-size: 15px; }
.p-orders { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.p-orders li + li { border-top: 1px solid #eef2f6; }
.p-orders a { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; text-decoration: none; color: var(--ink); }
.p-orders a:hover { background: #f8fafc; }
.p-orders small { display: block; color: var(--muted); }
.p-orders-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; white-space: nowrap; }
.p-st { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: #eef2f6; color: var(--muted); }
.p-st-wait { background: var(--warn-bg); color: var(--warn); }
.p-st-ok { background: #e8f0fc; color: var(--blue-dark); }
.p-st-done { background: var(--ok-bg); color: var(--ok); }
.p-st-err { background: var(--err-bg); color: var(--err); }
.p-success { background: var(--ok-bg); border: 1px solid #bfe5cb; border-radius: 12px; padding: 20px 22px; margin-bottom: 16px; }
.p-success h1 { margin: 0 0 6px; font-size: 22px; color: #14532d; }
.p-success p { margin: 0 0 14px; }
.p-steps { display: flex; list-style: none; padding: 0; margin: 0 0 18px; counter-reset: s; }
.p-steps li { flex: 1; counter-increment: s; position: relative; text-align: center; font-size: 13px; font-weight: 600; color: var(--muted); padding-top: 34px; }
.p-steps li::before { content: counter(s); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #e2e8ef; z-index: 1; }
.p-steps li + li::after { content: ""; position: absolute; top: 12px; right: 50%; width: 100%; height: 2px; background: var(--line); }
.p-steps li.done::before { content: "✓"; background: var(--ok); color: #fff; }
.p-steps li.done + li::after { background: var(--ok); }
.p-steps li.current { color: var(--ink); }
.p-steps li.current::before { background: var(--blue); color: #fff; }
.p-grade input:disabled { background: #f1f4f7; }
@media (max-width: 760px) {
  .p-navlink span { display: none; }
  .p-hide-sm { display: none; }
  .p-cart input { width: 70px; }
  .p-checkout { max-width: none; }
  .p-actions, .p-actions .p-btn { width: 100%; }
}
@media (max-width: 760px) {
  .p-user { gap: 4px; }
  .p-company span { display: none; }
  .p-cart td, .p-cart th { padding: 8px 4px; }
  .p-cart input { width: 64px; }
}
@media (max-width: 400px) {
  .p-brand span { display: none; }
}
