/* ================================
   ALQUILER DE MAQUINARIA
   Extiende historia.css (hero parallax) y main.css
================================ */

/* ================================
   HERO — imagen de fondo
================================ */

.history-hero--am {
  background-image:
    linear-gradient(90deg, rgba(0,0,0,.80), rgba(0,0,0,.50), rgba(0,0,0,.26)),
    linear-gradient(180deg, rgba(0,0,0,.16), rgba(0,0,0,.62)),
    url("/img/servicios/banner-maquinaria.webp");
}

/* ================================
   SECCIÓN INTRODUCTORIA
================================ */

.am-intro {
  padding: 120px 0;
  background: #fff;
  color: #111;
  overflow: hidden;
}

.am-intro__inner {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.am-intro__inner h2 {
  margin: 14px 0 28px;
  font-size: clamp(2.1rem, 3.8vw, 3.6rem);
  font-weight: 900;
  line-height: .97;
  letter-spacing: -1.5px;
  text-transform: uppercase;
  color: #111;
}

.am-intro__inner h2 span {
  color: var(--red);
}

.am-intro__inner p {
  margin: 0 0 18px;
  color: #555;
  font-size: 1.04rem;
  line-height: 1.9;
  text-align: center;
}

.am-intro__inner p:last-of-type {
  margin-bottom: 0;
}

/* Pills de categorías de equipo */
.am-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 44px;
}

.am-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  background: rgba(211,14,51,.06);
  border: 1px solid rgba(211,14,51,.16);
  border-radius: 100px;
  color: #333;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  transition: background var(--transition), border-color var(--transition);
}

.am-pill i {
  font-size: 1.05rem;
  color: var(--red);
}

.am-pill:hover {
  background: rgba(211,14,51,.10);
  border-color: rgba(211,14,51,.28);
}

/* ================================
   SECCIÓN GALERÍA
================================ */

.am-gallery-section {
  padding: 100px 0 120px;
  background: #f5f5f5;
  overflow: hidden;
}

.am-gallery-head {
  max-width: 700px;
  margin: 0 auto 56px;
  text-align: center;
}

.am-gallery-head h2 {
  margin: 12px 0 14px;
  font-size: clamp(2rem, 3.6vw, 3.2rem);
  font-weight: 900;
  line-height: .98;
  letter-spacing: -1px;
  text-transform: uppercase;
  color: #111;
}

.am-gallery-head h2 span {
  color: var(--red);
}

.am-gallery-head p {
  margin: 0;
  color: #888;
  font-size: .9rem;
}

/* Grid galería — 4 columnas, paisaje */
.am-gallery.sus-gallery {
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* ================================
   GALERÍA (clases de lightbox.js)
================================ */

.sus-gallery {
  display: grid;
  gap: 16px;
}

.sus-gallery__item {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0,0,0,.12);
  cursor: zoom-in;
}

.sus-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.06) saturate(1.04);
  transition: transform .55s ease;
}

.sus-gallery__item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(125,28,36,.52));
  opacity: 0;
  transition: opacity .4s ease;
}

.sus-gallery__item:hover img {
  transform: scale(1.07);
}

.sus-gallery__item:hover::after {
  opacity: 1;
}

/* Pista de lupa */
.sus-gallery__zoom {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background: rgba(255,255,255,.94);
  color: #111;
  border-radius: 100px;
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .35s ease, transform .35s ease;
  pointer-events: none;
}

.sus-gallery__zoom i {
  font-size: .9rem;
  color: var(--red);
}

.sus-gallery__zoom em {
  font-style: normal;
}

.sus-gallery__item:hover .sus-gallery__zoom,
.sus-gallery__item:focus-visible .sus-gallery__zoom {
  opacity: 1;
  transform: translateY(0);
}

@media (hover: none) {
  .sus-gallery__zoom {
    opacity: 1;
    transform: none;
  }
}

/* ================================
   LIGHTBOX (acento rojo)
================================ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 5vw;
  background: rgba(7,8,10,.93);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility 0s linear .3s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity .3s ease;
}

.lightbox__figure {
  margin: 0;
  width: min(820px, 92vw);
  max-width: 92vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.lightbox__img {
  width: 100%;
  height: auto;
  max-height: 86vh;
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  object-fit: contain;
}

.lightbox__caption {
  max-width: 680px;
  color: rgba(255,255,255,.8);
  font-size: .9rem;
  line-height: 1.5;
  text-align: center;
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  z-index: 2;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  transition: .25s ease;
}

.lightbox__close:hover,
.lightbox__nav:hover {
  background: var(--red);
  border-color: var(--red);
}

.lightbox__close { top: 22px; right: 26px; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { left: 22px; }
.lightbox__nav--next { right: 22px; }

/* ================================
   BANDA DE CIFRAS
================================ */

.am-stats {
  padding: 90px 0;
  background: linear-gradient(135deg, #101214, #181b1f);
  color: #fff;
  overflow: hidden;
}

.am-stats__grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 0;
  align-items: center;
  text-align: center;
}

.am-stat__divider {
  width: 1px;
  height: 80px;
  background: rgba(255,255,255,.1);
  margin: 0 20px;
}

.am-stat {
  padding: 0 32px;
}

.am-stat__icon {
  display: block;
  font-size: 2rem;
  color: var(--red);
  margin-bottom: 16px;
  opacity: .85;
}

.am-stat__num {
  font-size: clamp(3rem, 5vw, 5rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -2px;
  color: #fff;
  margin-bottom: 12px;
}

.am-stat__num .counter {
  color: #fff;
}

.am-stat h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .3px;
  color: #fff;
  text-transform: uppercase;
}

.am-stat p {
  margin: 0;
  font-size: .82rem;
  color: rgba(255,255,255,.5);
  line-height: 1.5;
}

/* ================================
   RESPONSIVE
================================ */

@media (max-width: 1100px) {
  .am-gallery.sus-gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 860px) {
  .am-intro {
    padding: 90px 0;
  }

  .am-gallery-section {
    padding: 80px 0 100px;
  }
}

@media (max-width: 640px) {
  .am-gallery.sus-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .am-gallery-section {
    padding: 70px 0 90px;
  }
}

@media (max-width: 720px) {
  .am-stats__grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .am-stat__divider {
    display: none;
  }

  .am-stat {
    padding: 0;
  }
}

@media (max-width: 560px) {
  .am-intro {
    padding: 70px 0;
  }

  .am-stats {
    padding: 70px 0;
  }

  .lightbox__close,
  .lightbox__nav {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }

  .lightbox__nav--prev { left: 12px; }
  .lightbox__nav--next { right: 12px; }

  .lightbox__img {
    max-height: 74vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .history-hero--am {
    background-attachment: scroll;
  }
}
