/* ========= VARIABLES ========= */
:root {
  --bg-main: #050507;
  --bg-dark: #08080b;
  --bg-alt: #060609;
  --gold: #f0c75e;
  --white: #f9f9f9;
  --text-muted: #a6a6a6;
  --border-soft: rgba(255, 255, 255, 0.08);
  --shadow-soft: 0 18px 35px rgba(0, 0, 0, 0.6);
  --radius-lg: 20px;
  --transition-fast: 0.25s ease;
}

/* ========= RESET ========= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Poppins", "Segoe UI",
    sans-serif;
  background: var(--bg-main);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ========= LOADER ========= */
#loader {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, #1b1b1f 0, #020203 55%, #000 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

body.loaded #loader {
  opacity: 0;
  visibility: hidden;
}

.loader-inner {
  text-align: center;
  animation: popIn 1.3s ease;
}

.loader-logo {
  width: 110px;
  animation: logoGlow 2.2s ease-in-out infinite;
}

#loader p {
  margin-top: 1rem;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}

#loader span {
  color: var(--gold);
  font-weight: 600;
}

.loader-bar {
  margin: 1.5rem auto 0;
  width: 220px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.loader-bar-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--gold), #fff);
  animation: loaderFill 2.5s ease forwards;
}

/* ========= FONDO ANIMADO ========= */
.bg-animated {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 0% 0%, #57401a 0, transparent 45%),
    radial-gradient(circle at 100% 100%, #946a21 0, transparent 50%),
    radial-gradient(circle at 100% 0%, #2f2f31 0, transparent 55%);
  opacity: 0.3;
  pointer-events: none;
  z-index: -1;
  animation: bgMove 18s linear infinite alternate;
}

/* ========= HEADER ========= */
.main-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: linear-gradient(
    90deg,
    rgba(5, 5, 7, 0.96),
    rgba(5, 5, 7, 0.9),
    rgba(5, 5, 7, 0.96)
  );
  border-bottom: 1px solid var(--border-soft);
  padding: 0.7rem 6vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.main-logo {
  width: 52px;
  animation: logoFloat 4s ease-in-out infinite;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.brand-tag {
  font-size: 0.75rem;
  color: var(--gold);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Botón idioma */
.lang-toggle {
  cursor: pointer;
  font-size: 0.78rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.3);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.lang-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--gold);
  transform: translateY(-1px);
}

/* Menú principal */
.main-nav {
  display: flex;
  gap: 1.7rem;
}

.main-nav a {
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  position: relative;
  padding-bottom: 0.1rem;
  transition: color var(--transition-fast);
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.2rem;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), #fff);
  transition: width var(--transition-fast);
}

.main-nav a:hover {
  color: var(--white);
}

.main-nav a:hover::after {
  width: 100%;
}

/* ========= HAMBURGER ========= */
.hamburger {
  display: none;
  width: 34px;
  height: 26px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  position: relative;
}

.hamburger span {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 999px;
  background: var(--white);
  transition: transform 0.25s ease, opacity 0.25s ease, top 0.25s ease,
    bottom 0.25s ease;
}

.hamburger span:nth-child(1) {
  top: 3px;
}

.hamburger span:nth-child(2) {
  top: 11px;
}

.hamburger span:nth-child(3) {
  bottom: 3px;
}

.hamburger.is-active span:nth-child(1) {
  top: 11px;
  transform: rotate(45deg);
}

.hamburger.is-active span:nth-child(2) {
  opacity: 0;
}

.hamburger.is-active span:nth-child(3) {
  bottom: 11px;
  transform: rotate(-45deg);
}

/* ========= HERO ========= */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr);
  padding: 4.5rem 6vw 3.5rem;
  gap: 2.5rem;
  align-items: center;
}

.hero-content h1 {
  font-size: clamp(2.1rem, 3vw, 2.8rem);
  max-width: 22ch;
  margin-bottom: 1rem;
}

.hero-content p {
  color: var(--text-muted);
  max-width: 38ch;
  margin-bottom: 1.6rem;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.btn {
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    background var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast);
}

.btn.primary {
  background: radial-gradient(circle at 0 0, #fff 0, var(--gold) 45%, #b58329);
  color: #1a1306;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.7);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.85);
}

.btn.ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--gold);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.8rem;
}

.hero-badges span {
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

/* Car */
.hero-car {
  justify-self: center;
}

.hero-car img {
  width: min(420px, 100%);
  border-radius: 16px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.6));
  animation: carFloat 5s ease-in-out infinite;
}

/* ========= SECCIONES ========= */
.section {
  padding: 3.8rem 6vw;
}

.section-dark {
  background: linear-gradient(180deg, #050507, #050506, #040309);
  border-block: 1px solid rgba(255, 255, 255, 0.03);
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.section-title {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-title h2 {
  font-size: 1.8rem;
  margin-bottom: 0.7rem;
}

.section-title p {
  color: var(--text-muted);
}

/* ========= SERVICIOS ========= */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.6rem;
}

.service-card {
  background: rgba(5, 5, 7, 0.95);
  border-radius: var(--radius-lg);
  padding: 1.7rem 1.4rem;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition-fast),
    border-color var(--transition-fast), box-shadow var(--transition-fast),
    background var(--transition-fast);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.service-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 0 0, rgba(240, 199, 94, 0.18), transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.service-card:hover::before {
  opacity: 1;
}

.service-card:hover {
  transform: translateY(-4px);
  border-color: rgba(240, 199, 94, 0.7);
  background: rgba(5, 5, 7, 0.98);
}

.service-icon {
  margin-bottom: 0.9rem;
  font-size: 1.7rem;
}

/* Iconos de servicios como imagen */
.service-icon img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
  filter: brightness(1.05);
}

.service-card h3 {
  margin-bottom: 0.4rem;
}

.service-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ========= SOBRE JOEL ========= */
.section-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 2.4rem;
  align-items: center;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

.about-list {
  list-style: none;
  margin-top: 0.8rem;
}

.about-list li {
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.about-photo {
  justify-self: center;
}

.photo-frame {
  border-radius: 30px;
  padding: 0.35rem;
  background: radial-gradient(circle at top, rgba(240, 199, 94, 0.32), transparent 60%);
}

.photo-frame img {
  display: block;
  border-radius: 26px;
  width: min(320px, 100%);
  object-fit: contain;
}

/* Ilustración animada */
.joel-illustration {
  animation: joelFloat 4s ease-in-out infinite;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.75));
}

/* ========= VEHÍCULO ========= */
.vehicle-layout {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 2rem;
  align-items: center;
}

.vehicle-options-title {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.7rem;
}

.vehicle-options {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.vehicle-option {
  width: 100%;
  text-align: left;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(5, 5, 7, 0.9);
  color: var(--text-muted);
  padding: 0.6rem 0.9rem;
  font-size: 0.86rem;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease,
    transform 0.2s ease;
}

.vehicle-option:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--white);
}

.vehicle-option.active {
  background: radial-gradient(circle at 0 0, #fff, var(--gold));
  color: #2b1a05;
  border-color: transparent;
  transform: translateY(-1px);
}

.vehicle-photo img {
  width: 100%;
  max-width: 460px;
  border-radius: 22px;
  display: block;
  object-fit: cover;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.9);
}

/* ========= CÓMO FUNCIONA ========= */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.6rem;
}

.step-card {
  background: rgba(5, 5, 7, 0.97);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.4rem 1.4rem;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  position: relative;
}

.step-number {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--gold);
}

.step-card h3 {
  margin-bottom: 0.4rem;
}

.step-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* ========= TESTIMONIOS ========= */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.6rem;
}

.testimonial-card {
  background: rgba(5, 5, 7, 0.96);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.4rem 1.4rem;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  position: relative;
}

.testimonial-avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: radial-gradient(circle at 0 0, #fff, var(--gold));
  color: #261a04;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.testimonial-tag {
  font-size: 0.8rem;
  color: var(--gold);
  margin-bottom: 0.4rem;
}

.testimonial-text {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ========= CONTACTO / FORMULARIO ========= */
.contact-inner {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
}

.contact-info p {
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.contact-details p {
  margin-bottom: 0.35rem;
}

.contact-details a {
  color: var(--gold);
  text-decoration: none;
}

.contact-details a:hover {
  text-decoration: underline;
}

.contact-form {
  background: rgba(5, 5, 7, 0.95);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.4rem;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
}

.contact-form h3 {
  margin-bottom: 0.9rem;
}

.contact-form label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.9rem;
}

.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(10, 10, 10, 0.8);
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease,
    background 0.25s ease;
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(240, 199, 94, 0.4);
  background: rgba(6, 6, 10, 0.98);
}

.contact-form textarea {
  resize: vertical;
  min-height: 80px;
}

.contact-form select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.contact-form .btn {
  margin-top: 0.8rem;
  width: 100%;
}

/* Botón de ubicación centrado */
.btn-ubicacion {
  margin-top: 0.5rem;
  display: inline-flex;
  justify-content: center;
  width: auto;
  min-width: 70%;
  align-self: center;
  font-size: 0.85rem;
}

/* Error form */
.form-error {
  display: none;
  background: rgba(180, 37, 37, 0.16);
  border: 1px solid rgba(255, 68, 68, 0.6);
  color: #ffdddd;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
}

.form-error.visible {
  display: block;
}

.field-error {
  border-color: rgba(255, 88, 88, 0.9) !important;
}

/* ========= CRÉDITO ========= */
.credit-section {
  background: #000;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  padding: 0.8rem 1rem;
  color: #999;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.credit-section span {
  background: linear-gradient(90deg, #f0c75e, #ffffff, #f0c75e);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 3s linear infinite;
}

/* ========= FOOTER ========= */
.main-footer {
  padding: 1.2rem 6vw 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ========= MODAL SEGURIDAD ========= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  max-width: 420px;
  width: 100%;
  background: rgba(5, 5, 7, 0.98);
  border-radius: 18px;
  padding: 1.8rem 1.6rem 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.9);
  text-align: center;
}

.modal-content h3 {
  margin-bottom: 0.6rem;
}

.modal-content p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
}

.modal-actions {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ========= REVEAL (SCROLL) ========= */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========= KEYFRAMES ========= */
@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes logoGlow {
  0%,
  100% {
    filter: drop-shadow(0 0 6px rgba(240, 199, 94, 0.3));
    transform: translateY(0) scale(1);
  }
  50% {
    filter: drop-shadow(0 0 16px rgba(240, 199, 94, 0.8));
    transform: translateY(-4px) scale(1.03);
  }
}

@keyframes loaderFill {
  to {
    width: 100%;
  }
}

@keyframes bgMove {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(-20px, 10px, 0) scale(1.05);
  }
}

@keyframes logoFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes carFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes shine {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

@keyframes joelFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* ========= RESPONSIVE ========= */
@media (max-width: 900px) {
  .main-header {
    padding-inline: 4vw;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    padding: 0.8rem 4vw 1rem;
    background: rgba(5, 5, 7, 0.98);
    display: none;
    flex-direction: column;
    gap: 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    font-size: 0.82rem;
  }

  .hamburger {
    display: inline-block;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 3.2rem;
  }

  .hero-car {
    order: -1;
  }

  .section-inner,
  .contact-inner,
  .vehicle-layout {
    grid-template-columns: 1fr;
  }

  .section {
    padding-inline: 4vw;
  }

  .vehicle-photo {
    text-align: center;
  }

  .btn-ubicacion {
    min-width: 100%;
  }
}

@media (max-width: 600px) {
  .hero-buttons {
    flex-direction: column;
  }

  .main-header {
    padding-block: 0.6rem;
  }

  .logo-area .brand-name {
    font-size: 0.75rem;
  }

  .logo-area .brand-tag {
    font-size: 0.68rem;
  }
}
