/* ===== Reset & Variables ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4,
p {
  margin: 0 0 1rem;
}

:root {
  --color-primary: #faad43;
  --color-light: #f2f2f2;
  --color-dark: #404040;
  --color-black: #0d0d0d;
  --color-white: #fff;
  --header-h: 125px;
}

/* ===== Base ===== */
body {
  font-family: "Lato", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--color-light);
  color: var(--color-dark);
  margin: 0;
  line-height: 1.6;
}

/* ===== Headings ===== */
h1,
h2,
h3,
h4 {
  font-family: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-weight: 700;
}

/* ===== Layout Helpers ===== */
.container {
  max-width: 1400px;
  margin-inline: auto;
  padding-inline: 2rem;
}
section[id] {
  scroll-margin-top: var(--header-h);
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  text-align: center;
  transition: 0.25s ease;
  font-size: 1rem;
  cursor: pointer;
}
.btn-primary {
  background: var(--color-primary);
  color: var(--color-black);
  border: 2px solid var(--color-primary);
}
.btn-primary:hover {
  background: var(--color-black);
  color: var(--color-primary);
}
.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}
.btn-secondary:hover {
  background: var(--color-primary);
  color: var(--color-black);
}
.btn-tertiary {
  background: none;
  border: none;
  color: var(--color-dark);
}
.btn-tertiary:hover {
  color: var(--color-primary);
}

/* ===== Header ===== */
.header {
  background: var(--color-black);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ===== Hero ===== */
.heroSection {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-white);
  background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
    url("./imagenes/fondo2.jpg") center/cover no-repeat;
  padding: 6rem 1rem;
}
.heroSection-content {
  max-width: 800px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}
.heroSection h1 {
  font-size: 3rem;
  margin: 0;
}
.heroSection p {
  font-size: 1.25rem;
  line-height: 1.6;
  margin: 0;
}
.heroSection .btn {
  font-size: 1.2rem;
  padding: 1rem 2rem;
  border-radius: 10px;
}
.heroSection .highlight {
  color: var(--color-primary);
}
.heroSection-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Hero Animations */
@keyframes fadeUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
.heroSection h1,
.heroSection p,
.heroSection .btn {
  opacity: 0;
  animation: fadeUp 1s ease forwards;
}
.heroSection h1 {
  animation-delay: 0.3s;
}
.heroSection p {
  animation-delay: 0.6s;
}
.heroSection .btn {
  animation-delay: 0.9s;
}

/* ===== Services ===== */
#services {
  margin-top: 50px;
}
.services .text {
  text-align: center;
  padding: 2.5rem 1rem 1rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  padding: 0 1rem 1rem;
}
.card {
  background: var(--color-white);
  border: 1px solid #ececec;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  transition: 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow: hidden;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.foto {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-light);
  margin: 0;
}
.foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card h4 {
  margin: 0.25rem 0 0;
  font-size: 1.05rem;
  line-height: 1.25;
}
.card p {
  margin: 0;
  color: #4b4b4b;
}

/* ===== About (imagen izquierda | contenido derecha) ===== */
.about {
  padding: 2rem 1rem;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr; /* izquierda | derecha */
  grid-template-areas: "image content"; /* 1 sola fila */
  column-gap: 2rem;
  align-items: center; /* centra verticalmente respecto a la imagen */
}

.about-image {
  grid-area: image;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}
.about-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

/* La columna derecha apila elementos y controla el aire con gap */
.about-content {
  grid-area: content;
  display: flex;
  flex-direction: column;
  gap: 2rem; /* aire entre badge, h3, p y features */
}

/* Badge compacto, pegado al h3 */
.about-content .badge {
  align-self: flex-start;
  width: fit-content;
  margin: 0; /* sin margen extra */
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-primary);
  color: var(--color-black);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 600;
}
.about-content .badge::before {
  content: "🏆";
}

/* Título y párrafo sin márgenes grandes */
.about-content h3 {
  margin: 0;
  line-height: 1.25;
}
.about-content p {
  margin: 0;
  line-height: 1.55;
  max-width: 75ch;
}

/* Features más cerca del párrafo */
.features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.4rem;
  margin-top: 0.4rem; /* muy cerca del p */
}
.features li {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: flex-start;
  gap: 0.5rem;
}
.features .icon {
  font-size: 1.4rem;
  line-height: 1;
}

/* Imagen */
.about > .about-image {
  grid-area: image;
  align-self: start;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}
.about > .about-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* ===== Testimonials ===== */
.testimonials {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 2rem;
  align-items: center;
  justify-items: center;
  padding: 3rem 2rem;
  background: var(--color-white);
}
.testimonials figure {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}
.testimonials img {
  width: clamp(90px, 12vw, 140px);
  height: auto;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.8;
  transition: filter 0.3s ease, opacity 0.3s ease, transform 0.2s ease;
}
.testimonials img:hover {
  filter: none;
  opacity: 1;
  transform: translateY(-2px);
}

/* ===== Contact ===== */
#contact {
  margin-top: 50px;
}
.contact .container {
  padding: 3rem 1rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1rem;
}
.contact .card {
  background: var(--color-white);
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 1.25rem;
  transition: 0.3s ease;
}
.contact .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.map-container iframe {
  width: 100%;
  height: 300px;
  border: none;
  border-radius: 12px;
  margin-top: 2rem;
  margin-bottom: 5rem; /* fixed */
}

.telefonos {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}
.telefonos:hover {
  color: var(--color-primary);
}

/* ===== Footer ===== */
.footer {
  background: var(--color-black);
  color: #fff;
  padding: 16px;
}
.footer-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  text-align: center;
}
.footer p {
  margin: 0;
  line-height: 1;
}

.social-icons {
  display: flex;
  gap: 14px;
}
.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}
.social-icons svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: #fff;
  transition: fill 0.3s ease;
}
.social-icons a:hover svg {
  fill: var(--color-primary);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .heroSection h1 {
    font-size: 2.5rem;
  }
  .heroSection p {
    font-size: 1.1rem;
  }
  .testimonials {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

@media (max-width: 900px) {
  .about {
    grid-template-columns: 1fr;
    grid-template-areas:
      "image"
      "content";
    row-gap: 1rem;
    align-items: start; /* en móvil suele verse mejor arriba */
  }
  .about-content .badge {
    align-self: stretch;
    text-align: center;
  }
  .features {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 110px;
  }

  .header {
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    position: relative;
  }
  .logo img {
    height: 55px;
    width: auto;
  }

  .nav {
    display: none;
    width: 100%;
    text-align: center;
    background: var(--color-black);
    position: absolute;
    top: 100%;
    left: 0;
  }
  .nav.active {
    display: block;
  }
  .nav-list {
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem 0;
  }

  .cards {
    grid-template-columns: 1fr;
  }
  .foto {
    aspect-ratio: 16/9;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .testimonials {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding: 2rem 1.25rem;
  }
  .testimonials img {
    width: clamp(80px, 22vw, 120px);
  }

  .heroSection {
    min-height: 70vh;
    padding: 4rem 1rem;
  }
  .heroSection h1 {
    font-size: 2rem;
  }
  .heroSection p {
    font-size: 1rem;
  }
  .heroSection .btn {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
  }
}

/* ===== Hamburger Button ===== */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-white);
  font-size: 2rem;
  line-height: 1;
}
.icon-close {
  display: none;
}

@media (max-width: 640px) {
  .nav-toggle {
    display: block;
  }
  .nav-toggle.active .icon-hamburger {
    display: none;
  }
  .nav-toggle.active .icon-close {
    display: inline;
  }
}

/* ===== Top Nav Links ===== */
.nav {
  margin-left: auto;
}
.nav-list {
  display: flex;
  gap: 1.5rem;
}
.nav-list a {
  color: var(--color-white);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding-bottom: 5px;
  transition: color 0.3s ease;
}
.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: var(--color-primary);
  transition: width 0.3s ease;
}
.nav-list a:hover {
  color: var(--color-primary);
}
.nav-list a:hover::after {
  width: 100%;
}

/* Active by scroll */
.nav-list a.active,
.nav-list a[aria-current="page"] {
  color: var(--color-primary);
}
.nav-list a.active::after,
.nav-list a[aria-current="page"]::after {
  width: 100%;
}
