/* ============================================
   CarsFastMotor — Hoja de estilos
   Diseño moderno, mobile-first y adaptable.
   ============================================ */

/* ---------- Variables ---------- */
:root {
  --bg: #ffffff;
  --bg-alt: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --text: #1a2233;
  --text-muted: #5b6779;
  --primary: #16a34a;
  --primary-dark: #15803d;
  --primary-soft: rgba(22, 163, 74, 0.12);
  --accent: #e31837;
  --green: #25d366;
  --border: #e3e8ef;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 40px rgba(16, 32, 64, 0.08);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --container: 1180px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: var(--bg);
  padding: 10px 16px;
  z-index: 100;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  border: 2px solid transparent;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(22, 163, 74, 0.3);
}

.btn--primary:hover {
  box-shadow: 0 14px 30px rgba(22, 163, 74, 0.4);
  transform: translateY(-2px);
}

.btn--ghost {
  border-color: var(--border);
  color: var(--text);
  background: var(--surface);
}

.btn--ghost:hover {
  background: var(--surface-2);
  transform: translateY(-2px);
}

.btn--outline {
  border-color: var(--primary);
  color: var(--primary);
}

.btn--outline:hover {
  background: var(--primary-soft);
}

.btn--wa {
  background: var(--green);
  color: #04260f;
  box-shadow: 0 10px 24px rgba(37, 211, 102, 0.3);
}

.btn--wa:hover {
  box-shadow: 0 14px 30px rgba(37, 211, 102, 0.45);
  transform: translateY(-2px);
}

.btn--block {
  width: 100%;
}

/* ---------- Header ---------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.header.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 6px 24px rgba(16, 32, 64, 0.08);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.3px;
}

.logo__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
}

.logo__text span {
  color: var(--accent);
}

.logo--light .logo__icon {
  color: #ffffff;
}

/* Nav */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border-radius: 8px;
}

.nav-toggle__bar {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav {
  position: absolute;
  top: 68px;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.nav.open {
  max-height: 480px;
}

.nav__list {
  display: flex;
  flex-direction: column;
}

.nav__link {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav__link:hover,
.nav__link.active {
  color: var(--primary);
}

.nav__cta {
  margin: 16px 0 20px;
}

@media (min-width: 992px) {
  .nav-toggle {
    display: none;
  }

  .nav {
    position: static;
    display: flex;
    align-items: center;
    gap: 24px;
    background: transparent;
    border: none;
    padding: 0;
    max-height: none;
    overflow: visible;
  }

  .nav__list {
    flex-direction: row;
    gap: 4px;
  }

  .nav__link {
    padding: 8px 12px;
    border: none;
    color: var(--text);
    border-radius: 8px;
    font-size: 0.95rem;
  }

  .nav__link:hover,
  .nav__link.active {
    color: var(--primary);
    background: var(--primary-soft);
  }

  .nav__cta {
    margin: 0;
    padding: 10px 20px;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 60px;
  background:
    radial-gradient(circle at 85% 15%, rgba(22, 163, 74, 0.1), transparent 45%),
    radial-gradient(circle at 10% 85%, rgba(227, 24, 55, 0.06), transparent 40%),
    linear-gradient(180deg, #ffffff, var(--bg-alt));
  overflow: hidden;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(15, 30, 60, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.6;
  pointer-events: none;
}

.hero__inner {
  position: relative;
}

.hero__tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 18px;
}

.hero__title {
  font-size: clamp(2.1rem, 5.5vw, 3.6rem);
  line-height: 1.15;
  margin-bottom: 18px;
  max-width: 20ch;
}

.hero__title span {
  color: var(--primary);
}

.hero__subtitle {
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
  max-width: 62ch;
  margin-bottom: 30px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 48px;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 560px;
}

.hero__stats li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: 0 4px 14px rgba(16, 32, 64, 0.05);
}

.hero__stats strong {
  display: block;
  font-size: 1.6rem;
  color: var(--primary);
}

.hero__stats span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (min-width: 560px) {
  .hero__stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------- Secciones ---------- */
.section {
  padding: 72px 0;
}

.section--alt {
  background: var(--bg-alt);
}

.section__header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 44px;
}

.section__tag {
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.8rem;
  margin-bottom: 10px;
}

.section__title {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  line-height: 1.2;
  margin-bottom: 12px;
}

.section__lead {
  color: var(--text-muted);
}

/* ---------- Nosotros ---------- */
.about {
  display: grid;
  gap: 36px;
}

.about__media {
  position: relative;
  min-height: 300px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 30% 30%, rgba(22, 163, 74, 0.14), transparent 50%),
    linear-gradient(135deg, #ffffff, var(--surface-2));
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
}

.about__badge {
  text-align: center;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 44px;
  backdrop-filter: blur(4px);
  box-shadow: var(--shadow);
}

.about__badge strong {
  display: block;
  font-size: 2.6rem;
  color: var(--primary);
  line-height: 1.1;
}

.about__badge span {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.about__content p {
  color: var(--text-muted);
  margin-bottom: 14px;
}

.about__list {
  display: grid;
  gap: 10px;
  margin: 20px 0 26px;
}

.about__list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text);
}

.about__list li::before {
  content: "✓";
  color: var(--primary);
  font-weight: 800;
}

@media (min-width: 900px) {
  .about {
    grid-template-columns: 1fr 1.1fr;
    align-items: center;
    gap: 56px;
  }
}

/* ---------- Servicios ---------- */
.services {
  display: grid;
  gap: 20px;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.service-card:hover {
  transform: translateY(-6px);
  border-color: rgba(22, 163, 74, 0.5);
  box-shadow: var(--shadow);
}

.service-card__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 18px;
}

.service-card__icon .icon {
  width: 26px;
  height: 26px;
}

.service-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.service-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 16px;
}

.service-card__link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.service-card__link::after {
  content: "→";
  transition: transform 0.2s ease;
}

.service-card:hover .service-card__link::after {
  transform: translateX(4px);
}

@media (min-width: 620px) {
  .services {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .services {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Marcas ---------- */
.brands {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 22px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.95rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.brand:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.brand__logo {
  width: auto;
  max-width: 110px;
  max-height: 42px;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.brand:hover .brand__logo {
  transform: scale(1.08);
}

.brand__name {
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (min-width: 620px) {
  .brands {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 992px) {
  .brands {
    grid-template-columns: repeat(7, 1fr);
  }
}

/* ---------- Galería ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
  border: 1px solid var(--border);
  background: var(--surface);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease, opacity 0.35s ease;
  opacity: 0;
}

.gallery-item img.loaded {
  opacity: 1;
}

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

.gallery-item__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px;
  background: linear-gradient(to top, rgba(5, 10, 20, 0.85), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item__overlay {
  opacity: 1;
}

.gallery-item__overlay h3 {
  font-size: 0.95rem;
  color: #ffffff;
}

.gallery-item__overlay span {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
}

@media (min-width: 620px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 992px) {
  .gallery {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(5, 10, 20, 0.92);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn 0.25s ease;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__figure {
  max-width: 900px;
  width: 100%;
  text-align: center;
}

.lightbox__img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  background-size: cover;
  background-position: center;
}

.lightbox__caption {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.lightbox__caption strong {
  color: var(--primary);
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 2.4rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.7);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: color 0.2s ease, background 0.2s ease;
}

.lightbox__close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---------- Contacto ---------- */
.contact {
  display: grid;
  gap: 32px;
}

.contact__info h3,
.contact__socials h3 {
  font-size: 1.05rem;
  margin-bottom: 14px;
}

.contact__list {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
}

.contact__list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--text-muted);
}

.contact__list .icon {
  color: var(--primary);
  margin-top: 3px;
}

.socials {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.social {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.social:hover {
  transform: translateY(-4px);
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-soft);
}

.contact__form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.form__grid {
  display: grid;
  gap: 18px;
  margin-bottom: 22px;
}

.form__group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form__group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.form__group input,
.form__group select,
.form__group textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  resize: vertical;
}

.form__group input::placeholder,
.form__group textarea::placeholder {
  color: #9aa5b5;
}

.form__group input:focus,
.form__group select:focus,
.form__group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.form__group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b6779' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.form__group select option {
  background: var(--bg-alt);
  color: var(--text);
}

.form__error {
  font-size: 0.8rem;
  color: #f87171;
  min-height: 1em;
  display: none;
}

.form__group.invalid input,
.form__group.invalid select,
.form__group.invalid textarea {
  border-color: #f87171;
}

.form__group.invalid .form__error {
  display: block;
}

.form__note {
  margin-top: 12px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

@media (min-width: 620px) {
  .form__grid {
    grid-template-columns: 1fr 1fr;
  }

  .form__group--full {
    grid-column: 1 / -1;
  }
}

@media (min-width: 992px) {
  .contact {
    grid-template-columns: 0.85fr 1.15fr;
    align-items: start;
  }
}

/* ---------- Footer ---------- */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}

.footer__inner {
  display: grid;
  gap: 32px;
  padding: 48px 20px 32px;
}

.footer h4 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text);
  margin-bottom: 14px;
}

.footer__brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 12px;
}

.footer__map {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.footer__map .icon {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.footer__map:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-soft);
}

.footer__nav ul,
.footer__services ul {
  display: grid;
  gap: 8px;
}

.footer__nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer__nav a:hover {
  color: var(--primary);
}

.footer__services li {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer__bottom {
  border-top: 1px solid var(--border);
}

.footer__bottom p {
  padding: 18px 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

@media (min-width: 900px) {
  .footer__inner {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 40px;
  }
}

/* ---------- WhatsApp flotante ---------- */
.wa-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 40;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  box-shadow: 0 12px 28px rgba(37, 211, 102, 0.4);
  transition: transform 0.25s ease;
}

.wa-float .icon {
  width: 28px;
  height: 28px;
}

.wa-float:hover {
  transform: translateY(-4px) scale(1.05);
}

/* ---------- Animación de aparición ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
