:root {
  --black: #000;
  --white: #fff;
  --red: #da0000;
  --red-hover: #b30000;
  --bg: #111;
  --bg-card: #1a1a1a;
  --muted: #bbb;
  --success: #4ade80;
  --error: #ef4444;
  --max-width: 1100px;
  --border-radius: 8px;
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  background: var(--bg);
  color: var(--white);
  line-height: 1.6;
  /* Added smooth scrolling */
  scroll-behavior: smooth;
}

a {
  color: var(--white);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--red);
}

img {
  max-width: 100%;
  display: block;
  height: auto;
}

.wrap {
  max-width: var(--max-width);
  margin: auto;
  padding: 20px;
}

/* HEADER */
header {
  background: rgba(15, 15, 15, 0.95);
  position: sticky;
  top: 0;
  border-bottom: 1px solid #222;
  z-index: 100;
  /* Added backdrop filter for better visual effect */
  backdrop-filter: blur(10px);
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
  /* Ajout du positionnement pour le logo central */
  position: relative;
}

/* Logo principal moins lumineux */
.brand img.logo-main {
  width: 120px;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.4));
  transition: filter 0.3s ease;
}

.brand img.logo-main:hover {
  filter: drop-shadow(0 0 4px rgba(218, 0, 0, 0.6));
}

/* Logo blanc BMT au centre du bandeau */
.brand-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
}

.brand-center .logo-title {
  width: 200px;
  height: auto;
  opacity: 0.9;
}

/* Burger menu repositionné à droite */
.burger {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
  margin-left: auto;
}

.burger-line {
  width: 100%;
  height: 3px;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.burger:hover .burger-line {
  background: var(--red);
}

/* BURGER MENU */
.menu {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100vh;
  padding: 80px 30px 30px;
  transform: translateX(100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0s linear 0.3s;
  z-index: 1000;
  /* Added border for better visual separation */
  border-left: 1px solid #333;
}

/* Ajustements pour le menu burger avec contact */
.menu-contact {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
}

.menu-phone,
.menu-appointment {
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  padding: 10px 15px;
  border-radius: 8px;
  background: rgba(218, 0, 0, 0.1);
  border: 1px solid rgba(218, 0, 0, 0.3);
  transition: all 0.3s ease;
  text-align: center;
}

.menu-phone:hover,
.menu-appointment:hover {
  background: rgba(218, 0, 0, 0.2);
  border-color: var(--red);
  transform: translateY(-2px);
}

.menu a {
  color: var(--white);
  font-weight: 500;
  font-size: 18px;
  padding: 10px 0;
  border-bottom: 1px solid transparent;
  transition: all 0.3s ease;
}

.menu a:hover {
  color: var(--red);
  border-bottom-color: var(--red);
}

.cta {
  background: var(--red);
  padding: 12px 20px;
  border-radius: var(--border-radius);
  margin-top: 10px;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.cta:hover {
  background: var(--red-hover);
  transform: translateY(-2px);
  color: var(--white) !important;
}

#nav.open .menu {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.close-menu {
  background: none;
  border: none;
  color: var(--white);
  font-size: 28px;
  align-self: flex-end;
  cursor: pointer;
  padding: 5px;
  transition: color 0.3s ease;
}

.close-menu:hover {
  color: var(--red);
}

/* HERO */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: url("https://bmt-moto.fr/cbr.webp") no-repeat center / cover;
  /* Added fallback background */
  background-color: var(--bg);
}

.hero .overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  padding: 20px;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 48px);
  margin-bottom: 16px;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.lead {
  color: var(--muted);
  margin-bottom: 24px;
  font-size: clamp(16px, 2.5vw, 18px);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  background: var(--red);
  color: var(--white);
  padding: 12px 24px;
  border-radius: var(--border-radius);
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 16px;
  text-align: center;
  display: inline-block;
}

.btn:hover {
  background: var(--red-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--white);
  color: var(--white);
}

.btn-outline:hover {
  background: var(--white);
  color: var(--bg);
}

/* SERVICES */
.section-title {
  font-size: clamp(24px, 4vw, 32px);
  margin: 40px 0 24px;
  text-align: center;
  font-weight: 600;
}

.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.service {
  background: var(--bg-card);
  padding: 30px;
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  /* Added border for better definition */
  border: 1px solid #333;
}

.service:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.svc-ico {
  font-size: 40px;
  margin-bottom: 16px;
}

.service h3 {
  margin: 0 0 16px 0;
  font-size: 20px;
  font-weight: 600;
}

.service ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.service ul li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 8px;
  font-size: 16px;
  text-align: left;
}

.service ul li::before {
  content: "◆";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--red);
  font-size: 14px;
}

.service-price {
  margin-top: 16px;
  font-weight: 600;
  color: var(--red);
  font-size: 18px;
  border-top: 1px solid #333;
  padding-top: 16px;
}

/* CONTACT */
.contact-section {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 40px 30px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow);
  border: 1px solid #333;
}

.contact-grid {
  display: flex;
  flex-direction: row;
  gap: 40px;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
}

.contact-card {
  background: var(--bg);
  padding: 30px;
  border-radius: var(--border-radius);
  width: 100%;
  max-width: 450px;
  box-sizing: border-box;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: var(--shadow);
  border: 1px solid #333;
}

.contact-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: var(--shadow-hover);
}

.contact-card h3,
.contact-card h4 {
  margin-top: 0;
  color: var(--red);
  font-weight: 600;
}

.contact-card p {
  margin: 12px 0;
  font-size: 16px;
}

/* FORM STYLES */
form label {
  display: block;
  margin: 16px 0 6px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

form input,
form textarea {
  width: 100%;
  padding: 12px;
  border-radius: var(--border-radius);
  border: 1px solid #444;
  background: #222;
  color: var(--white);
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

form input:focus,
form textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(218, 0, 0, 0.2);
}

form button {
  background: var(--red);
  color: var(--white);
  padding: 12px 24px;
  border: none;
  border-radius: var(--border-radius);
  margin-top: 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s ease;
  width: 100%;
}

form button:hover:not(:disabled) {
  background: var(--red-hover);
  transform: translateY(-2px);
}

.form-feedback {
  font-size: 14px;
  margin-top: 12px;
  font-weight: 500;
}

/* Added loading states */
.btn-loading {
  opacity: 0.7;
}

/* ABOUT SECTION */
.about-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
  align-items: start;
  margin-bottom: 40px;
}

.about-content h3 {
  color: var(--red);
  margin-top: 30px;
  margin-bottom: 16px;
  font-size: 20px;
}

.about-content h3:first-child {
  margin-top: 0;
}

.certifications {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}

.certifications li {
  padding: 8px 0;
  color: var(--muted);
  font-size: 16px;
}

.about-image img {
  width: 100%;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

/* TESTIMONIALS SECTION */
.testimonials-section {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 40px 30px;
  margin-bottom: 40px;
  border: 1px solid #333;
}

.testimonials {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.testimonial {
  background: var(--bg);
  padding: 30px;
  border-radius: var(--border-radius);
  border: 1px solid #333;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.testimonial-content p {
  font-style: italic;
  margin-bottom: 20px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
}

.testimonial-author {
  border-top: 1px solid #333;
  padding-top: 16px;
}

.testimonial-author strong {
  color: var(--white);
  display: block;
  margin-bottom: 4px;
}

.testimonial-author span {
  color: var(--red);
  font-size: 14px;
}

/* GALLERY SECTION */
.gallery-section {
  margin-bottom: 40px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 30px;
}

.gallery-item {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.gallery-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
  padding: 30px 20px 20px;
  color: var(--white);
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
  transform: translateY(0);
}

.gallery-overlay h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
}

.gallery-overlay p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* QUOTE SECTION */
.quote-section {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 40px 30px;
  margin-bottom: 40px;
  border: 1px solid #333;
}

.quote-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 40px;
  align-items: start;
}

.quote-info h3 {
  color: var(--red);
  margin-bottom: 16px;
  font-size: 24px;
}

.quote-benefits {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.quote-benefits li {
  padding: 8px 0;
  color: var(--muted);
  font-size: 16px;
}

.quote-form {
  background: var(--bg);
  padding: 30px;
  border-radius: var(--border-radius);
  border: 1px solid #333;
  box-shadow: var(--shadow);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  margin-bottom: 6px;
}

.form-group select {
  width: 100%;
  padding: 12px;
  border-radius: var(--border-radius);
  border: 1px solid #444;
  background: #222;
  color: var(--white);
  font-family: inherit;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(218, 0, 0, 0.2);
}

/* MAP CONTAINER */
.map-container {
  margin-top: 20px;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* FOOTER */
footer {
  text-align: center;
  color: var(--muted);
  margin-top: 60px;
  padding: 30px 20px;
  font-size: 14px;
  border-top: 1px solid #333;
}

footer a {
  color: var(--muted);
  transition: color 0.3s ease;
}

footer a:hover {
  color: var(--red);
}

/* FADE ANIMATION */
.fade-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.fade-in {
  opacity: 1;
  transform: translateY(0);
}

/* CHATBOT WIDGET STYLES */
.chatbot-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.chatbot-toggle {
  width: 60px;
  height: 60px;
  background: var(--red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  border: none;
}

.chatbot-toggle:hover {
  background: var(--red-hover);
  transform: scale(1.1);
  box-shadow: var(--shadow-hover);
}

.chat-icon,
.close-icon {
  font-size: 24px;
  color: var(--white);
}

.chatbot-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  max-height: 500px;
  background: var(--bg-card);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-hover);
  border: 1px solid #333;
  overflow: hidden;
}

.chatbot-header {
  background: var(--red);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chatbot-header h4 {
  margin: 0;
  color: var(--white);
  font-size: 16px;
  font-weight: 600;
}

.chatbot-close {
  background: none;
  border: none;
  color: var(--white);
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-content {
  padding: 20px;
  max-height: 400px;
  overflow-y: auto;
}

/* Styles pour les messages du chat IA */
.chat-messages {
  max-height: 250px;
  overflow-y: auto;
  margin-bottom: 15px;
  padding-right: 5px;
}

.bot-message,
.user-message {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  align-items: flex-start;
}

.user-message {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.bot-message .message-avatar {
  background: var(--red);
}

.user-message .message-avatar {
  background: #333;
}

.message-content {
  background: #2a2a2a;
  padding: 10px 12px;
  border-radius: 12px;
  max-width: 220px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--white);
}

.user-message .message-content {
  background: var(--red);
  color: var(--white);
}

.chat-input-container {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
}

.chat-input-container input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #333;
  border-radius: 20px;
  background: #2a2a2a;
  color: var(--white);
  font-size: 14px;
}

.chat-input-container input:focus {
  outline: none;
  border-color: var(--red);
}

.chat-input-container button {
  padding: 8px 16px;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s ease;
}

.chat-input-container button:hover {
  background: var(--red-hover);
}

.quick-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-btn {
  padding: 6px 12px;
  background: #333;
  color: var(--white);
  border: none;
  border-radius: 15px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
}

.quick-btn:hover {
  background: var(--red);
  transform: translateY(-1px);
}

/* LEGAL PAGES STYLES */
.legal-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
  line-height: 1.8;
}

.legal-page h1 {
  color: var(--red);
  font-size: 32px;
  margin-bottom: 30px;
  text-align: center;
}

.legal-page h2 {
  color: var(--white);
  font-size: 24px;
  margin: 30px 0 15px 0;
  border-bottom: 2px solid var(--red);
  padding-bottom: 8px;
}

.legal-page h3 {
  color: var(--red);
  font-size: 18px;
  margin: 25px 0 10px 0;
}

.legal-page p {
  margin-bottom: 15px;
  color: var(--muted);
}

.legal-page ul {
  margin: 15px 0;
  padding-left: 25px;
}

.legal-page li {
  margin-bottom: 8px;
  color: var(--muted);
}

.legal-page strong {
  color: var(--white);
}

.legal-page a {
  color: var(--red);
  text-decoration: underline;
}

.legal-page a:hover {
  color: var(--red-hover);
}

.legal-nav {
  text-align: center;
  margin: 30px 0;
}

.legal-nav a {
  display: inline-block;
  margin: 0 15px;
  padding: 10px 20px;
  background: var(--bg-card);
  border-radius: var(--border-radius);
  border: 1px solid #333;
  transition: all 0.3s ease;
}

.legal-nav a:hover {
  background: var(--red);
  color: var(--white);
  text-decoration: none;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .services {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  /* Ajustements pour le logo central sur tablette */
  .brand-center .logo-title {
    width: 150px;
  }
}

@media (max-width: 768px) {
  .contact-grid {
    flex-direction: column;
    align-items: center;
    gap: 30px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .menu {
    width: 85%;
    padding-top: 80px;
  }

  .contact-section {
    padding: 30px 20px;
  }

  .wrap {
    padding: 15px;
  }

  .nav-inner {
    padding: 12px 15px;
    justify-content: center;
    position: relative;
  }

  .brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  .burger {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
  }

  /* Masquer le logo central sur mobile pour éviter l'encombrement */
  .brand-center {
    display: none;
  }

  .brand img.logo-main {
    width: 100px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .quote-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .testimonials {
    grid-template-columns: 1fr;
  }

  .gallery {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  .testimonials-section,
  .quote-section {
    padding: 30px 20px;
  }

  .chatbot-window {
    width: 300px;
    bottom: 70px;
    right: -10px;
  }

  .legal-page {
    padding: 20px 15px;
  }

  .legal-page h1 {
    font-size: 28px;
  }

  .legal-page h2 {
    font-size: 20px;
  }

  .legal-nav a {
    display: block;
    margin: 10px 0;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 280px;
  }

  .services {
    grid-template-columns: 1fr;
  }

  .menu {
    width: 100%;
    padding: 80px 20px 20px;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .chatbot-widget {
    bottom: 15px;
    right: 15px;
  }

  .chatbot-toggle {
    width: 50px;
    height: 50px;
  }

  .chat-icon,
  .close-icon {
    font-size: 20px;
  }

  .chatbot-window {
    width: calc(100vw - 30px);
    right: -15px;
    bottom: 65px;
  }

  .message-content {
    max-width: 180px;
  }
}

/* Added print styles */
@media print {
  .burger,
  .menu,
  .fade-scroll {
    display: none !important;
  }

  .hero {
    height: auto;
    padding: 40px 0;
  }

  body {
    background: white;
    color: black;
  }
}

/* Added accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Added focus styles for better accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}
