/* ── Shared styles for individual tool pages ─────────────── */

/* Box-sizing & overflow global fix */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: hidden; }

/* Breadcrumb */
.tool-breadcrumb {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: .7rem 2rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .78rem;
  color: var(--gray-600);
}
.tool-breadcrumb a {
  color: var(--red);
  text-decoration: none;
  font-weight: 500;
}
.tool-breadcrumb a:hover { text-decoration: underline; }
.tool-breadcrumb span { color: var(--gray-400); }

/* Hero banner */
.tool-hero {
  background: linear-gradient(135deg, var(--navy-2) 0%, var(--navy) 65%, #1a3d72 100%);
  padding: 2.25rem 2rem;
  position: relative;
  overflow: hidden;
}
.tool-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 50%, rgba(196,36,50,.18), transparent 60%);
}
.tool-hero-inner {
  max-width: 760px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.tool-hero-icon {
  width: 60px;
  height: 60px;
  background: rgba(255,255,255,.1);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}
.tool-hero-inner > div { flex: 1; min-width: 0; }
.tool-hero h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.45rem;
  font-weight: 900;
  color: white;
  margin-bottom: .25rem;
  line-height: 1.25;
}
.tool-hero p {
  font-size: .85rem;
  color: rgba(255,255,255,.65);
  line-height: 1.5;
}
.tool-hero-badge {
  flex-shrink: 0;
  background: #16A34A;
  color: white;
  padding: .3rem .85rem;
  border-radius: 2rem;
  font-size: .72rem;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
}

/* Page body */
body { background: var(--gray-50); }

/* Main centered wrapper */
.tool-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* White calculator card */
.tool-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
  overflow: hidden;
  width: 100%;
}

/* Force inputs & selects to fill their grid cell */
.tool-card .calc-input,
.tool-card .calc-input-unit,
.tool-card input[type="text"],
.tool-card input[type="number"],
.tool-card input[type="date"],
.tool-card select {
  width: 100%;
  min-width: 0;
}

/* Calc grid fills card width */
.tool-card .calc-grid {
  width: 100%;
}

/* Prevent piece-row and devis-ligne grids from overflowing */
.tool-card .piece-row,
.tool-card .devis-ligne {
  min-width: 0;
}
.tool-card .piece-row > *,
.tool-card .devis-ligne > * {
  min-width: 0;
}

/* Tip box */
.tool-tip {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: var(--radius);
  padding: .9rem 1.1rem;
  margin-top: 1.25rem;
}
.tool-tip i {
  color: #2563EB;
  font-size: .95rem;
  margin-top: .1rem;
  flex-shrink: 0;
}
.tool-tip p {
  font-size: .82rem;
  color: #1E40AF;
  line-height: 1.55;
  margin: 0;
}
.tool-tip p a { color: var(--red); font-weight: 700; }

/* Other tools section */
.other-tools-section {
  border-top: 1px solid var(--gray-200);
  padding-top: 2rem;
}
.other-tools-section h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: .88rem;
  font-weight: 800;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 1rem;
}
.other-tools-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .75rem;
}
.other-tool-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: .9rem .5rem;
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  text-decoration: none;
  transition: var(--transition);
  text-align: center;
}
.other-tool-link:hover {
  border-color: var(--red);
  background: var(--red-light);
  transform: translateY(-2px);
}
.other-tool-link .ot-icon { font-size: 1.35rem; }
.other-tool-link span {
  font-size: .7rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
}
.other-tool-link:hover span { color: var(--red); }

/* Calc overrides for tool pages */
.tool-card .calc-result { margin-top: 1.5rem; }

@media (max-width: 768px) {
  .tool-breadcrumb { padding: .65rem 1rem; }
  .tool-hero { padding: 1.75rem 1.25rem; }
  .tool-hero h1 { font-size: 1.15rem; }
  .tool-hero-badge { display: none; }
  .tool-content { padding: 1.5rem 1rem 3rem; }
  .tool-card { padding: 1.25rem; }
  .other-tools-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .other-tools-grid { grid-template-columns: repeat(2, 1fr); }
  .tool-hero-inner { gap: .85rem; }
}
