/* ===== Base Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f8f9fa;
  color: #333;
  font-size: 18px;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Header ===== */
header {
  background: #222;
  color: #fff;
  display: flex;
  align-items: center;
  padding: 10px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}
header a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
  font-size: 1.5rem;
}
header img {
  height: 50px;
  margin-right: 15px;
}
nav ul {
  display: flex;
  flex-direction: row;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 20px;
}
nav a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 4px;
  transition: 0.3s ease;
}
nav a:hover,
nav a.active {
  background: #f39c12;
}

/* ===== Layout & Titles ===== */
main {
  flex-grow: 1;
  max-width: 1000px;
  margin: 40px auto 60px;
  padding: 0 20px;
}
main.form-container {
  max-width: 600px;
  background: #fff;
  padding: 30px 40px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
h2, p {
  text-align: center;
  color: #222;
  font-weight: 700;
  padding-bottom: 8px;
  margin-bottom: 30px;
  border-bottom: 3px solid #f39c12;
}
h2 { font-size: 2rem; }
p { font-size: 1.5rem; }

/* ===== Filters ===== */
.filters {
  text-align: center;
  margin-bottom: 30px;
}
.filters button {
  background: #ddd;
  border: none;
  padding: 10px 20px;
  margin: 5px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.3s ease;
}
.filters button:hover,
.filters button.active {
  background: #f39c12;
  color: #fff;
}

/* ===== Grid & Cards ===== */
.model-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
}
.model-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.1);
  overflow: hidden;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: 0.3s ease;
}
.model-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}
.model-card img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: #f4f4f4;
}
.model-card h3 {
  padding: 15px 10px;
  font-size: 1.2rem;
  color: #f39c12;
  font-weight: 700;
}

/* ===== Form Inputs ===== */
form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #444;
}
input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 25px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  transition: 0.3s ease;
}
}
input:focus,
textarea:focus {
  border-color: #f39c12;
  box-shadow: 0 0 8px rgba(243,156,18,0.5);
  outline: none;
}

/* ===== Buttons ===== */
button[type="submit"],
.btn-primary {
  background: #f39c12;
  color: #fff;
  font-weight: 700;
  border: none;
  padding: 15px 30px;
  font-size: 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 6px 14px rgba(243,156,18,0.6);
  transition: 0.3s ease;
}
.btn-primary {
  width: auto;
  padding: 16px 45px;
  font-size: 1.4rem;
}
button[type="submit"]:hover,
.btn-primary:hover {
  background: #d87e0a;
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(216,126,10,0.8);
}
button[type="submit"]:active,
.btn-primary:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(216,126,10,0.7);
}
.btn-secondary {
  background: #eee;
  color: #444;
  padding: 14px 35px;
  font-size: 1.2rem;
  font-weight: 600;
  border: 1px solid #ccc;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s ease;
}
.btn-secondary:hover {
  background: #f4f4f4;
  box-shadow: 0 8px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

/* ===== Car Page ===== */
.car-title {
  font-size: 3rem;
  font-weight: 900;
  text-align: center;
  color: #222;
  margin-bottom: 25px;
}
.description {
  font-size: 1.3rem;
  max-width: 700px;
  text-align: center;
  margin: 0 auto 40px;
  color: #444;
}
.car-image {
  text-align: center;
  margin-bottom: 40px;
}
.car-image img {
  max-width: 60%;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 25px;
  margin: 0 auto 50px;
  max-width: 700px;
}
.spec h3 {
  text-align: center;
  color: #f39c12;
  font-weight: 700;
  margin-bottom: 8px;
}
.spec p {
  font-size: 1.1rem;
  color: #555;
}
.actions {
  display: flex;
  justify-content: center;
  gap: 25px;
  flex-wrap: wrap;
  margin-bottom: 50px;
}

/* ===== Popup ===== */
.popup-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.popup-box {
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  width: 90%;
  max-width: 400px;
  animation: fadeIn 0.3s ease-in-out;
}
.popup-box p {
  font-size: 1.1rem;
  margin-bottom: 20px;
}
.popup-box button {
  background: #f39c12;
  border: none;
  color: #fff;
  padding: 10px 25px;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.3s ease;
}
.popup-box button:hover {
  background: #d87e0a;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .model-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  main { margin: 30px 15px 60px; padding: 25px 20px; }
  .car-title { font-size: 2.2rem; }
  .description { font-size: 1.1rem; margin-bottom: 30px; }
  .specs { grid-template-columns: 1fr; max-width: 100%; }
  .actions { flex-direction: column; gap: 15px; }
}
@media (max-width: 480px) {
  .model-grid { grid-template-columns: 1fr; }
  .filters button {
    margin: 5px 4px;
    padding: 8px 15px;
    font-size: 0.9rem;
  }
}
.filters {
  text-align: center;
  margin-bottom: 30px;
}

.filters button {
  background: #ddd;
  border: none;
  padding: 12px 24px;
  margin: 5px 8px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  color: #333;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.filters button:hover {
  background-color: #f39c12;
  color: #fff;
  box-shadow: 0 6px 14px rgba(243, 156, 18, 0.7);
}

.filters button.active,
.filters button[aria-pressed="true"] {
  background-color: #f39c12;
  color: white;
  box-shadow: 0 6px 20px rgba(243, 156, 18, 0.8);
}
textarea {
  min-height: 180px;
  height: auto;
  width: 100%;
  resize: vertical; /* autorise l'utilisateur à l'agrandir */
}
/* ===== Mobile-only Styles (max-width: 768px) ===== */
/* ===== Mobile-only Styles (max-width: 768px) ===== */
@media only screen and (max-width: 768px) {
  body {
    font-size: 16px;
    padding: 10px;
    background: #ffffff;
  }

  header {
    flex-direction: row; /* on garde en ligne */
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  nav ul {
    flex-direction: row; /* reste en ligne */
    gap: 12px;
    margin-left: auto;
    flex-wrap: wrap;
    padding-top: 8px;
  }

  nav a {
    font-size: 0.95rem;
    padding: 6px 10px;
  }

  .model-grid {
    grid-template-columns: repeat(1, 1fr);
    gap: 15px;
  }

  main.form-container {
    padding: 20px;
  }

  .car-title {
    font-size: 1.8rem;
  }

  .description {
    font-size: 1rem;
    margin-bottom: 20px;
  }

  .car-image img {
    max-width: 90%;
  }

  .filters button {
    padding: 8px 12px;
    font-size: 0.9rem;
    margin: 4px;
  }

  .btn-primary,
  button[type="submit"] {
    font-size: 1rem;
    padding: 12px 20px;
  }

  .actions {
    flex-direction: column;
    gap: 15px;
  }

  .popup-box {
    width: 95%;
    padding: 20px;
  }

  h2, p {
    font-size: 1.2rem;
  }

  .form-container {
    border-radius: 8px;
  }
}

