
:root {
  --blue: #000cff;
  --blue-dark: #00099a;
  --red: #ff0000;
  --red-dark: #c00000;
  --ink: #18202b;
  --muted: #667085;
  --line: #d9dee8;
  --surface: #ffffff;
  --surface-alt: #f5f7fb;
  --shadow: 0 12px 32px rgba(12, 31, 74, .10);
  --radius: 12px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #eaf0ff;
  line-height: 1.55;
}
a { color: var(--blue); }
a:hover { color: var(--red-dark); }
button, a { -webkit-tap-highlight-color: transparent; }
.site-shell { min-height: 100vh; display: flex; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 285px; background: var(--surface);
  border-right: 1px solid var(--line); box-shadow: 4px 0 22px rgba(12,31,74,.07);
  z-index: 20; overflow-y: auto;
}
.sidebar-brand { padding: 24px 22px 20px; text-align: center; border-bottom: 1px solid var(--line); }
.logo { width: 150px; height: auto; display: block; margin: 0 auto 12px; }
.brand-name { color: var(--blue); font-size: 1.08rem; font-weight: 700; }
.brand-tagline { margin-top: 5px; color: #596273; font-size: .76rem; }
.site-nav { padding: 14px 12px 24px; }
.nav-group { margin: 2px 0; }
.nav-item {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  min-height: 44px; padding: 10px 14px; border: 0; border-radius: 9px;
  background: transparent; color: var(--ink); text-decoration: none; font: inherit;
  font-weight: 700; text-align: left; cursor: pointer; transition: background .16s ease, color .16s ease;
}
.nav-item:hover, .nav-item:focus-visible { background: #edf1ff; color: var(--blue); outline: none; }
.nav-item.active { background: var(--red); color: #fff; }
.nav-item.active:hover, .nav-item.active:focus-visible { background: var(--red-dark); color: #fff; }
.nav-item.parent-active:not(.active) { color: var(--blue); background: #eef1ff; }
.chevron { font-size: 1.3rem; line-height: 1; transform: rotate(0deg); transition: transform .16s ease; }
.nav-toggle[aria-expanded="true"] .chevron { transform: rotate(90deg); }
.submenu { display: none; padding: 3px 0 4px 13px; }
.submenu.open { display: block; }
.sub-item { min-height: 40px; font-size: .94rem; font-weight: 600; }
.sub-sub-item { font-size: .9rem; font-weight: 500; padding-left: 26px; }
.nested-menu { padding-left: 10px; }
.main {
  width: calc(100% - 285px); margin-left: 285px; min-width: 0;
}
.topbar {
  position: sticky; top: 0; z-index: 10; background: rgba(239,244,255,.96); backdrop-filter: blur(8px);
  border-bottom: 3px solid var(--red); min-height: 74px; display: flex; align-items: center;
  padding: 10px clamp(20px, 4vw, 52px); gap: 18px;
}
.mobile-toggle { display: none; }
.breadcrumb { color: var(--muted); font-size: .9rem; }
.breadcrumb strong { color: var(--ink); }
.content { max-width: 1180px; margin: 0 auto; padding: 42px clamp(20px, 4vw, 52px) 60px; }
.hero {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: 34px;
  align-items: center; margin-bottom: 42px;
}
.hero h1 { margin: 0 0 12px; color: var(--blue); font-size: clamp(2rem, 4vw, 3.35rem); line-height: 1.08; }
.hero .lead { font-size: 1.14rem; color: #394150; max-width: 700px; }
.hero-image { width: 100%; max-height: 330px; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.section-title { color: var(--blue); font-size: 1.55rem; margin: 0 0 18px; }
.prose { max-width: 900px; }
.prose p { margin: 0 0 18px; }
.original-table {
  width: 100%; border-collapse: collapse; margin: 20px 0; background: #fff; font-size: .92rem;
}
.original-table th, .original-table td { border: 1px solid #c8ced9; padding: 9px 10px; vertical-align: top; }
.original-table th { background: var(--blue); color: #fff; font-weight: 700; }
.original-table tr:nth-child(even) td { background: #f8f9fc; }
.table-wrap { overflow-x: auto; margin: 22px 0 28px; border-radius: 8px; box-shadow: 0 3px 14px rgba(12,31,74,.05); }
.table-wrap table { margin: 0; min-width: 680px; }
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin: 28px 0; }
.card {
  background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: var(--radius);
  padding: 20px; box-shadow: 0 5px 18px rgba(12,31,74,.05); text-decoration: none; color: var(--ink);
}
.card:hover { transform: translateY(-2px); border-top-color: var(--red); box-shadow: var(--shadow); }
.card h3 { margin: 0 0 6px; color: var(--blue); }
.product-intro-image { width: min(100%, 420px); display: block; margin: 0 auto 22px; }
.page-header { margin-bottom: 28px; }
.page-header h1 { margin: 0 0 6px; color: var(--blue); font-size: clamp(1.8rem, 3vw, 2.6rem); }
.page-header p { margin: 0; color: var(--muted); }
.figure-link { display: inline-block; }
.figure-link img { max-width: 100%; height: auto; border-radius: 8px; }
.contact-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 24px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: 0 5px 18px rgba(12,31,74,.05); }
.form-field { margin-bottom: 15px; }
.form-field label { display: block; font-weight: 700; margin-bottom: 6px; }
.form-field input, .form-field textarea { width: 100%; border: 1px solid #b9c1cf; border-radius: 7px; padding: 10px 12px; font: inherit; }
.form-field textarea { min-height: 150px; resize: vertical; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.button { display: inline-flex; align-items: center; justify-content: center; padding: 10px 17px; border-radius: 8px; border: 0; background: var(--red); color: #fff; font-weight: 700; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--red-dark); color: #fff; }
.button.secondary { background: #e9edff; color: var(--blue); }
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { margin: 10px 0; }
.contact-list a { font-weight: 700; }
.map-frame { width: 100%; min-height: 480px; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.footer { border-top: 1px solid var(--line); background: #fff; padding: 22px clamp(20px,4vw,52px); color: var(--muted); font-size: .85rem; }
.footer strong { color: var(--blue); }
.mobile-backdrop { display: none; }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; width: min(86vw, 320px); }
  .sidebar.open { transform: translateX(0); }
  .mobile-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 15; }
  .mobile-backdrop.open { display: block; }
  .main { width: 100%; margin-left: 0; }
  .topbar { min-height: 62px; }
  .mobile-toggle { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; color: var(--blue); border-radius: 8px; padding: 9px 12px; font-weight: 700; cursor: pointer; }
  .hero { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .content { padding-top: 28px; }
  .card-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
}

/* V4: navegação persistente e conteúdo sem tabelas de layout */
.nav-item.active { background: var(--red); color: #fff; }
.nav-item.parent-active { background: var(--red); color: #fff; }
.nav-item.parent-active.active { background: var(--red); color: #fff; }
.company-story { display: flex; gap: 34px; align-items: flex-start; margin: 0 0 34px; }
.company-story-intro .story-figure { flex: 0 0 284px; }
.company-story-secondary .prose { flex: 1 1 auto; }
.story-figure { margin: 0; }
.story-figure img { display: block; max-width: 100%; height: auto; border-radius: var(--radius); box-shadow: none; border: 1px solid #d6dbea; }
.story-figure figcaption { margin-top: 8px; color: var(--muted); font-size: .82rem; }
.story-figure-products { flex: 0 0 284px; }
@media (max-width: 760px) {
  .company-story { flex-direction: column; }
  .company-story-intro .story-figure, .story-figure-products { flex-basis: auto; width: min(100%, 420px); }
}


/* V5: a Home usa HTML/CSS em vez da tabela de posicionamento de 2006.
   O recuo original criado por par.gif (65px) agora é uma regra de CSS. */
.home-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 284px;
  gap: 34px;
  align-items: start;
}
.home-copy h1 {
  margin: 0 0 22px;
  color: var(--blue);
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.15;
}
.home-copy p {
  margin: 0 0 18px;
  padding-left: 65px;
}
.home-figure { margin: 0; }
.home-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.aerea-view { margin: 0; text-align: center; }
.aerea-view img {
  display: block;
  width: min(100%, 640px);
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius);
  box-shadow: none;
  border: 1px solid #d6dbea;
}
.aerea-view figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: .85rem;
}
@media (max-width: 760px) {
  .home-intro { grid-template-columns: 1fr; }
  .home-figure { width: min(100%, 420px); }
}

/* V5b: o fundo azul muito claro remete ao original sem competir com o conteúdo. */
.content { background: transparent; }
.home-modern { max-width: 850px; padding-top: 12px; }
.home-modern p { margin: 0 0 22px; padding-left: 0; font-size: 1.04rem; }
.product-overview { max-width: 900px; margin-bottom: 34px; }
.product-overview h1 { margin: 0 0 16px; color: var(--blue); font-size: clamp(1.8rem, 3vw, 2.6rem); }
.product-overview p { margin: 0 0 16px; }
.product-dimensions th { text-align: center; }
.product-dimensions td { text-align: center; }


/* V5c: tabelas de formatos e imagens explicativas */
.format-table .diagram-row th,
.format-table .diagram-row td {
  text-align: center;
  vertical-align: middle;
  background: #fff;
  padding: 14px;
}
.format-table .diagram-row img {
  display: inline-block;
  width: auto;
  max-width: 100%;
  height: auto;
}
.format-table thead th { text-align: center; vertical-align: middle; }
.format-table.product-dimensions thead tr:nth-child(2) th,
.format-table.product-dimensions thead tr:nth-child(3) th { background: var(--blue); color: #fff; }
.format-table.product-dimensions tbody td { text-align: center; vertical-align: middle; }
.contact-card h2, .whatsapp-card h2, .location-card h2 { margin-top: 0; color: var(--blue); }
.contact-emails { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.contact-emails h3 { margin: 0 0 10px; font-size: 1rem; color: var(--ink); }
.whatsapp-card { display: flex; flex-direction: column; justify-content: center; }
.whatsapp-message { margin: 18px 0; padding: 16px; border-left: 4px solid var(--red); background: #f7f8fc; border-radius: 6px; font-style: italic; }
.whatsapp-button { align-self: flex-start; }
.small-note { margin-top: 16px; color: var(--muted); font-size: .82rem; }
.location-card { padding: 0; overflow: hidden; }
.location-info { padding: 24px 28px 18px; }
.location-info p { margin: 0 0 10px; }
.location-phone { color: var(--muted); }
.location-card .map-frame { display: block; min-height: 500px; border-radius: 0; box-shadow: none; }


/* V5d: cabeçalhos das tabelas de formatos seguem o padrão azul institucional. */
.format-table tr:nth-child(2) th,
.format-table tr:nth-child(3) th {
  background: var(--blue);
  color: #fff;
  text-align: center;
  vertical-align: middle;
}
.format-table tr:nth-child(3) th { border-top-color: rgba(255,255,255,.35); }
.format-table .diagram-row td {
  background: #fff;
  text-align: center;
  vertical-align: middle;
  padding: 14px;
}
.format-table .diagram-row img {
  display: block;
  margin: 0 auto;
}
.form-field select {
  width: 100%;
  border: 1px solid #b9c1cf;
  border-radius: 7px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}
.contact-grid { align-items: stretch; }
.contact-card, .whatsapp-card { min-height: 100%; }
.location-card {
  background: #fff;
  border: 1px solid #cbd3e2;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(12,31,74,.10);
}
.location-info {
  background: linear-gradient(180deg, #f7f9ff 0%, #fff 100%);
  border-bottom: 1px solid var(--line);
}
.location-info h2 { margin-bottom: 10px; }


/* V5e: imagem histórica da fundição restaurada na Home. */
.home-figure figcaption {
  margin-top: 8px;
  font-size: 0.82rem;
  color: #5b6472;
  text-align: center;
}


/* V5f: a foto da fundição na Home não recebe legenda. */
.home-figure figcaption { display: none; }


/* V6: ajustes solicitados na revisão */
.sidebar-brand .logo {
  width: 150px;
  max-width: 100%;
  height: auto;
}

.product-overview {
  max-width: 900px;
}

.product-overview .product-intro-image {
  width: min(100%, 284px);
  height: auto;
  display: block;
  margin: 0 auto 24px;
}

.format-table .diagram-row td {
  text-align: center;
}

.format-table .diagram-row img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}


/* V7: a fotografia da fundição volta a ter presença discreta, sem dominar a Home. */
.home-figure {
  width: 160px;
  justify-self: center;
}
.home-figure img {
  width: 160px;
  max-width: 100%;
  height: auto;
  box-shadow: none;
}

/* V7: na abertura de Produtos, a imagem fica à direita, como na versão antiga. */
.product-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 284px;
  column-gap: 34px;
  align-items: start;
}
.product-overview h1,
.product-overview .product-copy {
  grid-column: 1;
}
.product-overview .product-intro-image {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 284px;
  max-width: 100%;
  margin: 0;
  border-radius: 8px;
  box-shadow: none;
  border: 1px solid #d6dbea;
}
.product-overview h1 {
  grid-row: 1;
}
.product-overview .product-copy {
  grid-row: 2;
}
@media (max-width: 760px) {
  .product-overview {
    display: flex;
    flex-direction: column;
  }
  .product-overview .product-intro-image {
    order: 1;
    width: min(100%, 284px);
    margin: 0 auto 24px;
  }
  .product-overview h1 { order: 0; }
  .product-overview .product-copy { order: 2; }
}


/* V9: texto corrido justificado; tabelas da página Produtos ficam centralizadas. */
.content p { text-align: justify; }
.location-info p,
.page-header p { text-align: left; }
body[data-page="produtos"] .original-table th,
body[data-page="produtos"] .original-table td {
  text-align: center;
  vertical-align: middle;
}
