/* PROPOSTA B — PREMIUM CATALOG (Mobile First) */
:root {
  --bar-color: #164E70;
  --text-main: #172D40;
  --text-muted: #546B7E;
  --blue-deep: #164E70;
  --blue-action: #126C9C;
  --blue-soft: #BCD6E4;
  --blue-info: #E5F1F7;
  --bg-page: #F7F9FB;
  --surface: #FFFFFF;
  --border: #DCE7EE;
  --radius: 8px;
  --shadow: 0 2px 10px rgba(22, 78, 112, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', system-ui, -apple-system, sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: clip;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* Barra de demonstração de cor dinâmica */
.demo-color-bar {
  background: #102436;
  color: #E5F1F7;
  font-size: 0.78rem;
  padding: 8px 12px;
}
.demo-color-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.demo-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.swatch-btn {
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: #fff;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
}
.swatch-btn.active { background: #fff; color: #102436; font-weight: 700; }
.swatch-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.back-portal-link { color: var(--blue-soft); text-decoration: none; font-weight: 500; }

/* Cabeçalho dinâmico */
.site-header {
  background: var(--bar-color);
  color: #fff;
  padding: 14px;
}
.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.header-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  min-height: 44px;
}
.brand-link img {
  height: 36px;
  width: auto;
  background: #fff;
  padding: 4px 8px;
  border-radius: 6px;
}
.brand-title { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand-sub { font-size: 0.76rem; opacity: 0.9; }
.header-nav { display: flex; gap: 8px; }
.header-nav a {
  color: #fff;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.28);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.search-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.search-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.search-row { display: flex; flex-wrap: wrap; gap: 8px; }
.search-row .form-control { width: auto; flex: 1 1 100px; min-width: 0; }
.form-control {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--blue-soft);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text-main);
  background: #fff;
}
.btn-action {
  min-height: 44px;
  padding: 0 20px;
  background: var(--blue-action);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.92rem;
  cursor: pointer;
  white-space: nowrap;
}
.btn-action:hover { background: var(--blue-deep); }

.main-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 12px 44px;
  overflow-x: hidden;
}
.card-box, .search-panel { width: 100%; max-width: 100%; min-width: 0; }
.page-head { margin-bottom: 18px; max-width: 100%; }
.page-title, .breadcrumb { overflow-wrap: anywhere; }
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.breadcrumb a { color: var(--blue-action); text-decoration: none; font-weight: 500; }
.page-title {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--blue-deep);
}
.page-subtitle { margin: 0; font-size: 0.92rem; color: var(--text-muted); }

/* Toolbar */
.toolbar-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.pill-btn {
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--blue-soft);
  background: var(--surface);
  color: var(--blue-deep);
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pill-btn.active {
  background: var(--blue-action);
  color: #fff;
  border-color: var(--blue-action);
}
.pill-btn.print-btn {
  background: var(--blue-info);
  border-color: var(--blue-soft);
}

/* Grids */
.catalog-grid, .category-grid, .product-grid, .detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
.catalog-grid > *, .category-grid > *, .product-grid > *, .detail-layout > * {
  min-width: 0;
}

/* Cards de Catálogo */
.catalog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.catalog-accent { height: 6px; width: 100%; }
.catalog-visual {
  padding: 20px 16px 12px;
  background: #FAFBFD;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 150px;
}
.catalog-visual img { max-height: 100%; object-fit: contain; }
.catalog-content {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.catalog-badge {
  align-self: flex-start;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--blue-info);
  color: var(--blue-deep);
}
.catalog-content h3 { margin: 2px 0 0; font-size: 1.08rem; color: var(--text-main); }
.catalog-content p { margin: 0; font-size: 0.86rem; color: var(--text-muted); }
.catalog-foot {
  margin-top: auto;
  padding-top: 10px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--blue-action);
  display: flex;
  justify-content: space-between;
}

/* Categorias */
.category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.category-thumb {
  height: 130px;
  background: #FAFBFD;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.category-thumb img { max-height: 100%; object-fit: contain; }
.category-body { padding: 12px 14px; }
.category-body h3 { margin: 0 0 4px; font-size: 1rem; color: var(--blue-deep); }
.category-body span { font-size: 0.82rem; color: var(--text-muted); }

/* Cards de Produto (Proposta B: Composição Editorial + Tabela Clara) */
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.product-showcase {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  padding: 14px;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}
.product-photo {
  height: 190px;
  background: #FAFBFD;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}
.product-photo img { max-height: 100%; object-fit: contain; }
.product-ref {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--blue-action);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.product-name {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.38;
}

/* Tabela Clara (Proposta B: Rótulos em azul suave #E5F1F7, valores destacados pela tipografia) */
.light-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.light-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}
.light-table th, .light-table td {
  padding: 5px 6px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.light-table th {
  background: var(--blue-info);
  color: var(--blue-deep);
  font-weight: 500;
  text-align: left;
  white-space: normal;
  word-break: break-word;
}
.light-table td {
  background: #FFFFFF;
  color: var(--text-main);
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

/* Detalhamento do Produto */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.card-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card-box h2, .card-box h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  color: var(--blue-deep);
}
.gallery-stage {
  height: 280px;
  background: #FAFBFD;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.gallery-stage img { max-height: 100%; object-fit: contain; }

/* Tratamento claro das tabelas HTML importadas (detalhes_extras) */
.imported-tables-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.imported-tables-wrap table {
  width: 100% !important;
  border-collapse: collapse !important;
  border: 0 !important;
  font-size: 0.8rem !important;
  font-variant-numeric: tabular-nums;
}
.imported-tables-wrap td {
  width: auto !important;
  padding: 8px 10px !important;
  border: 1px solid var(--border) !important;
  white-space: nowrap;
  text-align: right;
  color: var(--text-main);
}
.imported-tables-wrap td br { display: none; }
.imported-tables-wrap tr[bgcolor="#6699ff"] td {
  background-color: var(--blue-info) !important;
  color: var(--blue-deep) !important;
  font-weight: 700 !important;
  border-bottom: 2px solid var(--blue-action) !important;
}
.imported-tables-wrap tr[bgcolor="#66b3ff"] td {
  background-color: #F4F9FC !important;
}
.imported-tables-wrap tr:not([bgcolor="#6699ff"]):not([bgcolor="#66b3ff"]) td {
  background-color: #FFFFFF !important;
}
.imported-tables-wrap td:first-child {
  text-align: left !important;
  font-weight: 500;
  position: sticky;
  left: 0;
  z-index: 1;
}
.imported-tables-wrap table:nth-of-type(2) { display: none; }

.site-footer {
  background: var(--bar-color);
  color: #fff;
  padding: 18px 14px;
  margin-top: 28px;
  text-align: center;
  font-size: 0.82rem;
}

@media (min-width: 600px) {
  .catalog-grid { grid-template-columns: repeat(2, 1fr); }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .main-container { padding: 24px 20px 52px; }
  .header-inner { flex-direction: row; align-items: center; justify-content: space-between; }
  .search-form { flex-direction: row; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-layout { grid-template-columns: 400px 1fr; align-items: start; }
}
@media (min-width: 1024px) {
  .catalog-grid { grid-template-columns: repeat(3, 1fr); }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1366px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .catalog-grid { grid-template-columns: repeat(5, 1fr); }
}
