:root {
  --primary: #c0392b;
  --green: #1e8449;
  --blue: #1f618d;
  --dark: #1a1a1a;
  --light: #f7f7f7;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', Arial, sans-serif; color: var(--dark); }
h1, h2, h3 { margin: 0; }

.site-header {
  position: sticky; top: 0; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.1); z-index: 100;
}
.header-inner {
  max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 8px 20px;
}
.brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.logo { height: 72px; width: auto; max-width: 220px; object-fit: contain; }
.brand { font-weight: bold; font-size: 1.4rem; color: var(--primary); letter-spacing: .5px; }

#main-nav { display: flex; gap: 8px; padding: 8px 0; }
.nav-item { position: relative; }
.nav-item > a {
  display: flex; align-items: center; gap: 4px; text-decoration: none; color: var(--dark);
  font-weight: 600; font-size: .9rem; text-transform: uppercase; letter-spacing: .3px;
  padding: 10px 14px; border: 2px solid var(--primary); border-radius: 8px;
  transition: color .2s, background .2s, border-color .2s;
}
.nav-item:nth-child(3n+2) > a { border-color: var(--green); }
.nav-item:nth-child(3n+3) > a { border-color: var(--blue); }
.nav-item:nth-child(3n+1) > a:hover { background: var(--primary); color: #fff; }
.nav-item:nth-child(3n+2) > a:hover { background: var(--green); color: #fff; }
.nav-item:nth-child(3n+3) > a:hover { background: var(--blue); color: #fff; }
.caret { font-size: .7rem; }

.dropdown {
  display: none; position: absolute; top: 100%; left: 0; background: #fff; min-width: 240px;
  box-shadow: 0 10px 24px rgba(0,0,0,.18); border-radius: 8px; padding: 10px 0; flex-direction: column;
  border: 2px solid var(--primary); margin-top: 6px;
}
.nav-item:nth-child(3n+2) .dropdown { border-color: var(--green); }
.nav-item:nth-child(3n+3) .dropdown { border-color: var(--blue); }
.has-dropdown:hover .dropdown { display: flex; }
.dropdown a {
  padding: 10px 18px; text-decoration: none; color: var(--dark); white-space: nowrap;
  font-weight: 500; border-left: 3px solid transparent; transition: background .15s, border-color .15s;
}
.dropdown a:hover { background: var(--light); color: var(--primary); border-left-color: var(--primary); }

#nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

.hero {
  background: linear-gradient(rgba(0,0,0,.55), rgba(0,0,0,.55)), url('construction-batiment.jpg') center/cover;
  color: #fff; padding: 100px 20px; text-align: center;
}
.hero-content h1 { font-size: 2.2rem; max-width: 800px; margin: 0 auto 16px; }
.hero-content p { font-size: 1.1rem; margin-bottom: 24px; }

.page-hero {
  background: linear-gradient(rgba(0,0,0,.6), rgba(0,0,0,.6)), url('Travaux publics.jpg') center/cover;
  color: #fff; padding: 70px 20px; text-align: center; position: relative;
  border-bottom: 4px solid var(--primary);
}
.page-hero h1 {
  font-size: 2.2rem; text-transform: uppercase; letter-spacing: 1px;
  display: inline-block; padding-bottom: 12px; border-bottom: 3px solid var(--primary);
}

.btn {
  display: inline-block; background: var(--primary); color: #fff; padding: 12px 26px;
  border: none; border-radius: 6px; text-decoration: none; font-weight: 600; cursor: pointer;
}
.btn:hover { background: #a83224; }

section { padding: 60px 20px; max-width: 1100px; margin: 0 auto; }
section h2 {
  text-align: center; font-size: 1.9rem; margin-bottom: 36px; color: var(--primary);
  position: relative; padding-bottom: 14px;
}
section h2::after {
  content: ""; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 60px; height: 4px; background: var(--primary); border-radius: 2px;
}
.sub-section {
  padding: 28px 24px; margin-bottom: 28px; border-radius: 10px; background: var(--light);
  border: 2px solid var(--primary); box-shadow: 0 3px 10px rgba(0,0,0,.06);
}
.sub-section:nth-of-type(3n+2) { border-color: var(--green); }
.sub-section:nth-of-type(3n+2) h2 { color: var(--green); }
.sub-section:nth-of-type(3n+2) h2::after { background: var(--green); }
.sub-section:nth-of-type(3n+3) { border-color: var(--blue); }
.sub-section:nth-of-type(3n+3) h2 { color: var(--blue); }
.sub-section:nth-of-type(3n+3) h2::after { background: var(--blue); }
.sub-section h2 { text-align: left; padding-bottom: 14px; }
.sub-section h2::after { left: 0; transform: none; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.card {
  background: var(--light); border-radius: 10px; overflow: hidden; box-shadow: 0 3px 10px rgba(0,0,0,.08);
  border: 2px solid #e3e3e3; border-top: 4px solid var(--primary); transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 10px 24px rgba(0,0,0,.15); }
.grid .card:nth-child(3n+2) { border-top-color: var(--green); }
.grid .card:nth-child(3n+2):hover { border-color: var(--green); }
.grid .card:nth-child(3n+3) { border-top-color: var(--blue); }
.grid .card:nth-child(3n+3):hover { border-color: var(--blue); }
.grid .card:nth-child(3n+1):hover { border-color: var(--primary); }
.card img { width: 100%; height: 160px; object-fit: cover; }
.card h3, .card p { padding: 0 16px; }
.card h3 { padding-top: 16px; font-size: 1.15rem; color: var(--dark); }
.card p { padding-bottom: 16px; color: #555; }

.contact-wrap { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; }
.contact-info p { margin: 8px 0; }
.contact-form, .devis-form { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 12px; }
.contact-form input, .contact-form textarea,
.devis-form input, .devis-form select, .devis-form textarea {
  padding: 10px; border: 1px solid #ccc; border-radius: 6px; font: inherit;
}
#form-status { text-align: center; color: var(--primary); font-weight: 600; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.gallery-grid img { width: 100%; height: 180px; object-fit: cover; border-radius: 8px; }

.list-simple { max-width: 700px; margin: 0 auto; }
.list-simple li { margin-bottom: 10px; }

.site-footer { background: var(--dark); color: #ddd; padding: 50px 20px 0; }
.footer-inner {
  max-width: 1100px; margin: 0 auto; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; padding-bottom: 30px;
}
.footer-col h4 {
  color: #fff; font-size: 1.05rem; margin-bottom: 14px; text-transform: uppercase;
  letter-spacing: .5px; border-bottom: 2px solid var(--primary); display: inline-block; padding-bottom: 6px;
}
.footer-col p { margin: 6px 0; font-size: .92rem; color: #bbb; }
.footer-col a { display: block; color: #bbb; text-decoration: none; margin: 6px 0; font-size: .92rem; }
.footer-col a:hover { color: var(--primary); }
.footer-logo {
  height: 56px; object-fit: contain; margin-bottom: 12px; background: #fff;
  padding: 6px 10px; border-radius: 8px;
}

.social-row { display: flex; gap: 10px; }
.social-icon {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255,255,255,.08); color: #fff; transition: background .2s, transform .2s;
}
.social-icon:hover { background: var(--primary); transform: translateY(-3px); }

.footer-bottom {
  text-align: center; padding: 18px 0; border-top: 1px solid rgba(255,255,255,.1);
  font-size: .85rem; color: #999;
}

@media (max-width: 800px) {
  #main-nav {
    position: absolute; top: 60px; left: 0; right: 0; background: #fff; flex-direction: column;
    padding: 10px; display: none; box-shadow: 0 2px 6px rgba(0,0,0,.1);
  }
  #main-nav.open { display: flex; }
  .nav-item { width: 100%; }
  .dropdown { position: static; display: none; box-shadow: none; padding-left: 16px; }
  .has-dropdown.open .dropdown { display: flex; }
  #nav-toggle { display: block; }
}
