/* Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

* {
  font-family: "Poppins", sans-serif;
  margin: 0;
  padding: 0;
  scroll-padding-top: 1rem;
  scroll-behavior: smooth;
  list-style: none;
  text-decoration: none;
  box-sizing: border-box;
}

:root {
  --main-color: #d90429;
  --text-color: #020102;
  --bg-color: #fff;
  --container-max: 1068px;
}

/* Basic */
html, body {
  height: 100%;
  background: #fff;
  color: var(--text-color);
}

.container {
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

header {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  background: transparent;
  transition: background 0.3s, box-shadow 0.3s;
}

header.shadow {
  background: var(--bg-color);
  box-shadow: 2px 4px 20px rgba(15,54,55,0.1);
}

/* NAV */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 35px;
  gap: 1rem;
}

#menu-icon {
  font-size: 24px;
  cursor: pointer;
  color: var(--text-color);
  display: none; /* shown on mobile via media query */
}

.logo {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-color);
}
.logo span { color: var(--main-color); }

/* Desktop nav */
.navbar {
  display: flex;
  column-gap: 2rem;
  align-items: center;
}
.navbar a {
  color: var(--text-color);
  font-size: 0.95rem;
  text-transform: uppercase;
  font-weight: 500;
}
.navbar a:hover,
.navbar .active {
  color: var(--main-color);
  border-bottom: 3px solid var(--main-color);
}

/* HOME */
.home {
  margin: 0;
  width: 100%;
  min-height: 560px;
  display: flex;
  align-items: center;
  background: url(img/Background-home.png) center/cover no-repeat;
  padding-top: 72px; /* space for fixed header */
}

.home-text { padding-left: 2.5rem; max-width: 720px; }
.home-text h1 { font-size: 2.4rem; line-height: 1.05; }
.home-text span { color: var(--main-color); }
.home-text p { font-size: 0.95rem; font-weight: 300; margin: 0.6rem 0 1.2rem; }

.btn {
  padding: 10px 22px;
  background: var(--main-color);
  color: var(--bg-color);
  font-weight: 400;
  border-radius: 8px;
}

/* Headings */
.heading { text-align: center; margin-bottom: 1rem; }
.heading span { font-weight: 500; color: var(--main-color); }
.heading p { font-size: 0.95rem; font-weight: 300; }

/* CARS GRID */
.cars-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.cars-container .box {
  flex: 1 1 calc(33.333% - 1.25rem);
  min-width: 200px;
  position: relative;
  height: 220px;
  border-radius: 0.5rem;
  overflow: hidden;
  cursor: pointer;
}
.cars-container .box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.cars-container .box:hover img { transform: scale(1.08); }
.cars-container .box h2 {
  position: absolute;
  bottom: 0.8rem;
  left: 0.8rem;
  font-weight: 400;
  font-size: 0.95rem;
  background: var(--bg-color);
  padding: 8px;
  border-radius: 0.5rem;
  opacity: .9;
}
.cars-container .box:hover h2 {
  background: var(--main-color);
  color: var(--bg-color);
  opacity: 1;
}

/* ABOUT */
.about { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; padding-top: 1rem; }
.about-img, .about-text { flex: 1 1 320px; }

/* PARTS CARDS */
.parts-container { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; }
.parts-container .box { flex: 1 1 220px; background: #f6f6f6; padding: 18px; border-radius: 8px; position: relative; }
.parts-container .box img { height: 150px; object-fit: contain; margin-bottom: 1rem; }

/* VIDEO (responsive) */
.videoDodge {
  border-radius: 8px;
  border: 6px solid rgba(183,205,233,0.78);
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  display: block;
  max-width: 100%;
  width: 560px;
  height: auto;
  margin: 1rem auto;
}

/* Blog / Maps */
.blog-container { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; }
.blog-container .box { flex: 1 1 300px; padding: 20px; background: white; border-radius: 10px; }
.blog-container .box .maps {
  width: 100%;
  max-width: 100%;
  height: 300px;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
  border: 1px solid rgba(2,1,2,0.22);
}

/* FOOTER */
.footer {
  background: var(--text-color);
  color: #f6f6f6;
  border-top: 2px solid var(--main-color);
  padding: 30px 0;
}
.footer-container { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; }
.footer-box { flex: 1 1 200px; min-width: 180px; }
.footer-container .logo { color: var(--bg-color); margin-bottom: 1rem; }
.social a { font-size: 20px; color: var(--bg-color); margin-right: 0.5rem; }

/* SLIDER (fluid) */
.slider {
  margin: 40px auto;
  overflow: hidden;
  width: 100%;
  max-width: 1068px;
  border: 2px solid var(--main-color);
  height: auto;
  border-radius: 12px;
}
.slider img { width: 100%; height: auto; display: block; }
.slider figure {
  position: relative;
  width: 500%;
  margin: 0;
  left: 0;
  animation: 20s slider infinite;
  display: flex;
}
.slider figure .image { width: 20%; flex: 0 0 20%; }
@keyframes slider {
  12% { left: 0%; }
  20% { left: -100%; }
  40% { left: -200%; }
  60% { left: -300%; }
  80% { left: -400%; }
}

/* DESPRE LOCATIE */
.despreLocatie { text-align: center; padding: 1rem 0; }

/* POPUP */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.35s ease, visibility 0.35s;
  z-index: 9999;
}
.overlay.visible { visibility: visible; opacity: 1; }

.popup {
  background: #ffffff;
  padding: 22px;
  border-radius: 12px;
  width: 90%;
  max-width: 720px; /* larger on desktop */
  text-align: center;
  position: relative;
  animation: slideIn 0.45s ease;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.popup img.promoImage { width: 100%; height: auto; border-radius: 8px; display: block; margin-bottom: 12px; }

@keyframes slideIn {
  from { transform: translateY(-24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #444;
}

/* ===== MOBILE / RESPONSIVE RULES ===== */
@media (max-width: 1080px) {
  .container { padding-left: 1rem; padding-right: 1rem; }
}

@media (max-width: 991px) {
  #menu-icon { display: inline-block; }
  .navbar {
    display: none; /* hidden by default on mobile, toggled with .nav.open */
    position: absolute;
    top: 64px;
    right: 16px;
    background: var(--bg-color);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 12px;
    flex-direction: column;
    gap: 8px;
    min-width: 170px;
    z-index: 110;
  }
  .nav.open .navbar { display: flex; }
  .navbar a { padding: 8px 12px; border-bottom: none; color: var(--text-color); white-space: nowrap; }
  .home { min-height: 420px; padding-top: 72px; }
  .home-text { padding-left: 1rem; }
  .cars-container .box { flex: 1 1 calc(50% - 0.75rem); height: 180px; }
  .videoDodge { width: 100%; max-width: 480px; }
  .blog-container .box .maps { height: 260px; }
}

@media (max-width: 600px) {
  .home { min-height: 360px; background-position: center; padding-top: 64px; }
  .home-text h1 { font-size: 1.6rem; }
  .home-text p { font-size: 0.95rem; }
  .cars-container .box { flex: 1 1 100%; height: 180px; }
  .about { flex-direction: column; }
  .parts-container .box { flex-direction: column; }
  .footer-container { flex-direction: column; gap: 1rem; }
  .slider { border-radius: 8px; }
  .blog-container .box { margin-top: 0; }
  .popup { padding: 14px; max-width: 92%; }
  .close-btn { top: 8px; right: 10px; font-size: 20px; }
}

/* small phones */
@media (max-width: 420px) {
  .home-text { padding-left: 12px; padding-right: 12px; }
  .home-text h1 { font-size: 1.4rem; }
  .btn { padding: 10px 16px; font-size: 0.95rem; }
  .popup { padding: 12px; }
}
