:root {
  --primary: #ff0000;
  --dark: #0f0f0f;
  --dark-gray: #1a1a1a;
  --medium-gray: #333;
  --light-gray: #bbb;
  --white: #fff;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  --transition: all 0.3s ease-in-out;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--dark);
  color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 40px;
  background: rgba(0, 0, 0, 0.9);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #333;
}

.logo {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--white);
  text-decoration: none;
}

.logo span {
  color: var(--primary);
}

nav ul {
  display: flex;
  gap: 20px;
  list-style: none;
}

nav ul li a {
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 4px;
  transition: var(--transition);
  position: relative;
}

nav ul li a:hover {
  color: var(--primary);
}

nav ul li a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary);
  transition: width 0.3s ease;
}

nav ul li a:hover::after {
  width: 100%;
}

main {
  max-width: 1200px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  color: var(--white);
  position: relative;
  padding-bottom: 0.8rem;
  text-align: center;
  text-transform: uppercase;
}

h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 100px;
  height: 5px;

  transform: translateX(-50%);
}

.car-gallery {
  display: grid;
  grid-template-columns: 1fr 4fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  align-items: stretch;
  width: 100%;
}

.thumbnail-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 500px;
  overflow-y: auto;
}

.thumbnail {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.thumbnail:hover {
  border-color: var(--primary);
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(255, 0, 0, 0.3);
}

.main-image-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, var(--dark-gray), #222);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.main-image-container img {
  width: 100%;
  max-width: 800px;
  height: 500px;
  object-fit: cover;
  border-radius: 10px;
  transition: transform 0.4s ease;
}

.main-image-container img:hover {
  transform: scale(1.02);
}

.placeholder-container {
  background: linear-gradient(135deg, #222, var(--dark-gray));
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 500px;
  color: var(--light-gray);
  text-align: center;
  padding: 1.5rem;
  border: 2px dashed var(--light-gray);
  transition: var(--transition);
}

.placeholder-container:hover {
  background: linear-gradient(135deg, var(--dark-gray), #222);
}

.car-info {
  background: var(--dark-gray);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow);
  border-left: 5px solid var(--primary);
  width: 100%;
  max-width: 1200px;
  margin: 2rem auto;
}

.car-info h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--white);
  text-transform: uppercase;
}

.car-info p {
  font-size: 1rem;
  margin-bottom: 0.8rem;
  color: var(--light-gray);
  display: flex;
  align-items: center;
  font-size: large;
}

.car-info p i {
  color: var(--primary);
  margin-right: 0.7rem;
  font-size: 1.1rem;
}

.price {
  margin-top: 1.2rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.current-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
  background: var(--primary);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

.old-price {
  text-decoration: line-through;
  color: var(--light-gray);
  font-size: 1.2rem;
}

.back-link {
  display: inline-block;
  padding: 1rem 2rem;
  border: 2px solid var(--primary);
  border-radius: 8px;
  background: transparent;
  color: var(--white);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  text-transform: uppercase;
  font-size: 1rem;
}

.back-link:hover {
  background: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.financing-form,
.proposal-form {
  background: var(--dark-gray);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow);
  text-align: center; /* Ensure content inside is centered */
}

.form-container {
  max-width: 600px;
  margin: 0 auto;
}

.form-content {
  display: flex;
  flex-direction: column;
  align-items: center; /* Center items horizontally */
  text-align: center; /* Ensure text alignment is centered */
}

.form-content h1 {
  font-size: 1.6rem;
  color: var(--primary);
  margin-bottom: 1.2rem;
  text-transform: uppercase;
  text-align: center; /* Explicitly center the title */
  width: 100%; /* Ensure it spans the container for proper centering */
}

.form-content p {
  color: var(--light-gray);
  margin-bottom: 1.2rem;
  font-size: large;
}

.form-content label {
  display: block;
  font-weight: 500;
  color: var(--light-gray);
  margin-bottom: 0.6rem;
  font-size: large;
}

.form-content input,
.form-content select,
.form-content textarea {
  width: 100%;

  padding: 1rem;
  border: none;
  border-radius: 8px;
  background: #2a2a2a;
  color: var(--white);
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
  transition: var(--transition);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

.form-content input:focus,
.form-content select:focus,
.form-content textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.3);
  background: #333;
}

.form-content button {
  padding: 1rem 2rem;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin: 0; /* Remove margin-left to avoid offset */
  width: auto; /* Keep width auto for natural button size */
}

.form-content button:hover {
  background: #cc0000;
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.form-content button i {
  margin-left: 0.5rem;
}

#financingResult,
#resultado {
  margin-top: 1.2rem;
}

.toast {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: none;
  font-size: 0.9rem;
  animation: fadeIn 0.3s ease-in;
}

.toast-success {
  background: #28a745;
  color: var(--white);
}

.toast-error {
  background: #dc3545;
  color: var(--white);
}

.toast-info {
  background: #17a2b8;
  color: var(--white);
}

.show {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.whatsapp-fixed {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #25d366;
  color: white;
  padding: 12px 20px;
  border-radius: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  transition: var(--transition);
  z-index: 1000;
  text-decoration: none;
  text-transform: uppercase;
}

.whatsapp-fixed i {
  font-size: 1.6rem;
}

.whatsapp-fixed span {
  display: none;
}

.whatsapp-fixed:hover {
  background: #128c7e;
  transform: scale(1.05);
}

.whatsapp-fixed:hover span {
  display: inline;
}

.whatsapp-fixed.pulse {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

footer {
  background: #000;
  color: #fff;
  padding: 60px 20px 20px;
  border-top: 2px solid rgba(255, 0, 0, 0.2);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px;
}

.footer-column {
  margin-bottom: 30px;
}

.footer-column h3 {
  color: var(--primary);
  font-size: 1.4rem;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.footer-column p {
  color: #ccc;
  line-height: 1.6;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.social-icons {
  display: flex;
  gap: 15px;
}

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #1a1a1a;
  border-radius: 50%;
  color: #fff;
  transition: var(--transition);
  font-size: 1rem;
  text-decoration: none;
}

.social-icons a:hover {
  background: var(--primary);
  transform: rotate(360deg);
}

.footer-column ul li {
  margin-bottom: 12px;
  list-style: none;
}

.footer-column ul li a {
  color: #ccc;
  transition: var(--transition);
  font-size: 0.9rem;
  display: block;
  text-decoration: none;
}

.footer-column ul li a:hover {
  color: var(--primary);
  padding-left: 8px;
}

.contact-info li {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  color: #ccc;
  font-size: 0.9rem;
  list-style: none;
}

.contact-info i {
  color: var(--primary);
  margin-right: 10px;
  font-size: 1.1rem;
}

.footer-bottom {
  max-width: 1200px;
  margin: 40px auto 0;
  padding-top: 20px;
  border-top: 1px solid #333;
  color: #777;
  font-size: 0.9rem;
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 10px;
}

.footer-links a {
  color: #777;
  transition: var(--transition);
  text-decoration: none;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.footer-links a:hover {
  color: var(--primary);
}

/* Responsiveness */
@media (max-width: 1024px) {
  .car-gallery {
    grid-template-columns: 1fr 3fr 1fr;
  }

  .thumbnail {
    height: 90px;
  }

  .main-image-container img {
    height: 450px;
  }

  .placeholder-container {
    height: 450px;
  }
}

@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
  }

  nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
  }

  .car-gallery {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .thumbnail-container {
    flex-direction: row;
    gap: 0.8rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }

  .thumbnail {
    height: 80px;
    min-width: 100px;
  }

  .main-image-container img {
    height: 300px;
  }

  .placeholder-container {
    height: 300px;
    margin-top: 1rem;
  }

  .form-container {
    padding: 1rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .footer-links {
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  header {
    padding: 10px 20px;
  }

  .logo {
    font-size: 1.5rem;
    text-align: center;
    width: 100%;
  }

  nav ul {
    gap: 10px;
  }

  nav ul li a {
    font-size: 0.85rem;
    padding: 6px 8px;
  }

  nav ul li a::after {
    bottom: -3px;
    height: 1.5px;
  }

  .thumbnail {
    height: 60px;
    min-width: 80px;
  }

  .main-image-container img {
    height: 250px;
  }

  .placeholder-container {
    height: 250px;
  }

  .car-info h2 {
    font-size: 1.4rem;
  }

  .car-info p {
    font-size: 0.9rem;
  }

  .current-price {
    font-size: 1.4rem;
  }

  .whatsapp-fixed {
    bottom: 15px;
    right: 15px;
    padding: 10px 15px;
  }

  .whatsapp-fixed i {
    font-size: 1.2rem;
  }

  .whatsapp-fixed span {
    display: none;
  }
}
