:root {
  --primary: #de0b07;
  --primary-dark: #cf0606;
  --secondary: #1A1A1A;
  --light: #FFFFFF;
  --dark: #222222;
  --gray: #F5F5F5;
  --text: #333333;
  --text-light: #777777;
  --overlay: rgba(0, 0, 0, 0.7);
  --section-padding: 5rem 2rem;
  --card-radius: 12px;
  --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Montserrat', sans-serif;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--light);
  overflow-x: hidden;
}

/* Typographie */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1.5rem;
  color: var(--text-light);
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: var(--section-padding);
}

/* Header & Navigation */
header {
  position: relative;
  min-height: 100vh;
  color: var(--light);
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('./IMG/poste-haute-tension-ou-tour-haute-tension.jpg') no-repeat center center/cover;
  opacity: 0.5;
  z-index: -1;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.6) 100%);
  z-index: -1;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background-color: var(--overlay);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}
.nav.scrolled {
  padding: 1rem 2rem;
  background-color: var(--secondary);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.logo {
  height: 50px;
}

.logo img {
  height: 100%;
  width: auto;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 75%;
}

.company-name {
  color: var(--light);
  font-size: 1.4rem;
  font-weight: 700;
  white-space: nowrap;
  transition: var(--transition);
}

@media (max-width: 768px) {
  .company-name {
    font-size: 1.1rem;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 480px) {
  .company-name {
    font-size: 0.9rem;
    max-width: 150px;
    white-space: normal;
    line-height: 1.2;
  }
  
  .logo img {
    max-height: 40px;
  }
}

.nav.scrolled .company-name {
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--light);
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--primary);
  transition: var(--transition);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a:hover {
  color: var(--primary);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--light);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 80px;
    right: -100%;
    flex-direction: column;
    background-color: var(--secondary);
    width: 100%;
    text-align: center;
    padding: 1rem 0;
    transition: var(--transition);
    box-shadow: var(--shadow-hover);
    gap: 0.5rem;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links li {
    margin: 0.5rem 0;
  }

  .nav-links a {
    padding: 0.5rem;
  }

  .hero-content {
    padding-top: 80px;
  }
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 70%; /* Empêche le débordement */
}

.company-name {
  color: var(--light);
  font-size: 1.4rem;
  font-weight: 700;
  white-space: nowrap;
  transition: var(--transition);
}

/* Sur les écrans très petits */
@media (max-width: 480px) {
  .company-name {
    display: none; /* Cache le nom sur mobile */
  }
  
  .logo-container {
    gap: 0.5rem;
  }
  
  .logo img {
    max-height: 40px; /* Réduit la taille du logo */
  }
}

/* Adaptation au scroll */
.nav.scrolled .company-name {
  font-size: 1.2rem; /* Taille réduite en scrollant */
}

/* Garantit l'espacement correct */
@media (max-width: 768px) {
  .nav {
    justify-content: space-between; /* Maintient l'espace entre logo et hamburger */
  }
  
  .company-name {
    font-size: 1.1rem; /* Taille réduite sur tablette */
  }
}

/* Hero Section */
.hero-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 90%;
  max-width: 900px;
  padding: 2rem;
}

.hero-content h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-content p {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  margin-bottom: 2.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.btn-group {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--primary);
  color: var(--light);
  padding: 1rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  transition: var(--transition);
  border: 2px solid transparent;
  box-shadow: 0 4px 15px rgba(255, 165, 0, 0.3);
}

.btn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 165, 0, 0.4);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--light);
  box-shadow: none;
}

.btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
}

/* CTA Bar */
.cta-bar {
  background-color: var(--primary);
  color: var(--light);
  text-align: center;
  padding: 1.5rem;
  font-weight: 600;
  font-size: 1.2rem;
  position: relative;
  z-index: 100;
}

/* Services Section */
.services {
  background-color: var(--gray);
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-size: 2.5rem;
  color: var(--secondary);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  width: 60%;
  height: 4px;
  background-color: var(--primary);
  bottom: -10px;
  left: 20%;
  border-radius: 2px;
}

.section-subtitle {
  color: var(--text-light);
  max-width: 700px;
  margin: 0 auto;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.card {
  background-color: var(--light);
  border-radius: var(--card-radius);
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow);
  position: relative;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
}

.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.card-content {
  padding: 1.5rem;
}

.card-title {
  font-size: 1.3rem;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.card-text {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.card-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}

.card-btn:hover {
  color: var(--primary-dark);
  gap: 1rem;
}

/* Team Section */
.team {
  background-color: var(--light);
  text-align: center;
  overflow: hidden;
}

.team-container {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 2rem;
  padding: 1rem 0;
  -webkit-overflow-scrolling: touch;
}

.team-container::-webkit-scrollbar {
  height: 8px;
}

.team-container::-webkit-scrollbar-track {
  background: var(--gray);
}

.team-container::-webkit-scrollbar-thumb {
  background-color: var(--primary);
  border-radius: 20px;
}

.team-member {
  flex: 0 0 300px;
  scroll-snap-align: start;
  background: var(--light);
  border-radius: var(--card-radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.team-member:hover {
  transform: translateY(-5px);
}

.member-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  border: 3px solid var(--primary);
}

.member-social {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.member-social a {
  color: var(--text-light);
  transition: var(--transition);
}

.member-social a:hover {
  color: var(--primary);
}

/* Newsletter */
.newsletter {
  background-color: #f1efef;
  text-align: center;
}

.newsletter-form {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.newsletter h2{
  color: #000000;
}

.newsletter-input {
  flex: 1;
  min-width: 250px;
  padding: 1rem;
  border: 2px solid var(--light);
  border-radius: 50px;
  background: transparent;
  color: var(--light);
}

/* Footer */
.footer {
  background-color: #000;
  color: #fff;
  padding: 3rem 1.5rem;
  font-family: Arial, sans-serif;
}

.footer-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-block {
  margin-bottom: 1.5rem;
}

.footer-title {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.footer-text {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
}

.footer-text a {
  color: #fff;
  text-decoration: none;
}

.footer-text a:hover {
  text-decoration: underline;
}

.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-list li {
  margin-bottom: 0.5rem;
}

.footer-list a {
  color: #fff;
  text-decoration: none;
}

.footer-list a:hover {
  text-decoration: underline;
}

.footer-socials {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.footer-socials a {
  color: #fff;
  font-size: 1.2rem;
  transition: color 0.3s ease;
}

.footer-socials a:hover {
  color: #ff0000;
}

.footer-map {
  width: 100%;
  height: 200px;
  border: 0;
  border-radius: 8px;
}

/* Responsive : 2 colonnes sur medium, 4 sur large */
@media (min-width: 768px) {
  .footer-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer-container {
    grid-template-columns: repeat(4, 1fr);
  }
}

.animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate.show {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 {
  transition-delay: 0.2s;
}

.delay-2 {
  transition-delay: 0.4s;
}

.delay-3 {
  transition-delay: 0.6s;
}

#message {
  transition: opacity 1s ease;
  opacity: 1;
}
.fade-out {
  opacity: 0;
}

.fade-in {
  opacity: 0;
  animation: fadeIn 1s ease-in-out forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 3rem 1rem;
  }
  
  .container {
    padding: 0 1rem;
  }
}

/* Footer */
@media (max-width: 768px) {
  .footer-block iframe {
    width: 100% !important;
    height: 200px !important;
  }
}

/* Formulaire Newsletter */
.newsletter-form {
  flex-direction: column;
  width: 100%;
}

.newsletter-input {
  width: 100%;
  margin-bottom: 1rem;
}

/* Cartes de services */
@media (max-width: 480px) {
  .cards {
    grid-template-columns: 1fr;
  }
  
  .card {
    margin: 0 0.5rem;
  }
}

/* Navigation mobile améliorée */
@media (max-width: 768px) {
  .nav-links {
    top: 70px;
    padding: 2rem 0;
    gap: 1rem;
  }

  .nav-links a {
    font-size: 1.1rem;
  }
}

/* Ajustements du hero */
@media (max-width: 480px) {
  .hero-content {
    padding: 1rem;
    width: 100%;
  }

  .btn {
    width: 100%;
    padding: 1rem;
    font-size: 0.9rem;
  }
}