/* ================================
   CALIDAD
   Reutiliza el hero parallax de historia.css,
   el sistema de galería + lightbox y los tokens
   de main.css / home.css.
================================ */

/* ---- Hero: banner de calidad (parallax, igual que las otras páginas) ---- */
.history-hero--cal {
  background-image:
    linear-gradient(90deg, rgba(0,0,0,.80), rgba(0,0,0,.46), rgba(0,0,0,.22)),
    linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,.66)),
    url("/img/calidad-banner.webp");
}

/* ================================
   CERTIFICACIÓN (intro + sello)
================================ */

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

.cert-intro__grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 70px;
  align-items: center;
}

/* Sello ISO oficial en rojo (imagen original, sin alterar) */
.cert-seal {
  flex: 0 0 auto;
  width: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cert-seal img {
  width: 100%;
  height: auto;
}

.cert-intro__content h2 {
  margin: 12px 0 24px;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -1px;
  text-transform: uppercase;
  overflow-wrap: break-word;
  word-break: break-word;
}

.cert-intro__content h2 span {
  color: var(--red);
}

.cert-intro__content p {
  margin: 0 0 22px;
  color: #666;
  font-size: 1.04rem;
  line-height: 1.9;
}

.cert-intro__content p:last-child {
  margin-bottom: 0;
}

/* ================================
   OBJETIVOS (banda oscura)
================================ */

.objectives {
  padding: 110px 0;
  background:
    radial-gradient(circle at top left, rgba(211,14,51,.16), transparent 32%),
    linear-gradient(135deg, #101214, #181b1f);
  color: #fff;
  overflow: hidden;
}

.objectives__head {
  max-width: 780px;
  margin: 0 auto 56px;
  text-align: center;
}

.objectives__head h2 {
  margin: 10px 0 16px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

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

.objectives__head p {
  margin: 0 auto;
  max-width: 640px;
  color: rgba(255,255,255,.68);
  font-size: 1rem;
  line-height: 1.7;
}

.objectives__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.objective {
  position: relative;
  padding: 44px 34px 38px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 18px;
  overflow: hidden;
  transition: transform .35s ease, border-color .35s ease, background .35s ease, box-shadow .35s ease;
}

.objective::after {
  content: "";
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: 0;
  height: 3px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s ease;
}

.objective:hover {
  transform: translateY(-8px);
  background: rgba(255,255,255,.07);
  border-color: rgba(211,14,51,.7);
  box-shadow: 0 24px 55px rgba(0,0,0,.34);
}

.objective:hover::after {
  transform: scaleX(1);
}

.objective__num {
  display: block;
  margin-bottom: 16px;
  color: var(--red);
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -2px;
}

.objective__icon {
  width: 54px;
  height: 54px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(211,14,51,.14);
  color: var(--red);
  font-size: 1.7rem;
}

.objective p {
  margin: 0;
  color: rgba(255,255,255,.8);
  font-size: 1rem;
  line-height: 1.8;
}

/* ================================
   CERTIFICADO (imagen + lightbox)
================================ */

.cert {
  padding: 120px 0;
  background: #f7f7f7;
  color: #111;
  overflow: hidden;
}

.cert__head {
  max-width: 760px;
  margin: 0 auto 48px;
  text-align: center;
}

.cert__head h2 {
  margin: 10px 0 16px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

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

.cert__head p {
  margin: 0 auto;
  max-width: 640px;
  color: #666;
  font-size: 1rem;
  line-height: 1.8;
}

/* Certificado: imagen simple enmarcada (sin lupa / sin lightbox) */
.cert__doc {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 22px 55px rgba(0,0,0,.14);
}

.cert__doc img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}

/* ================================
   LABORATORIOS ACREDITADOS (ECA)
================================ */

.lab-quality {
  padding: 110px 0;
  background: var(--soft);
  color: #111;
  overflow: hidden;
}

.lab-quality__card {
  display: flex;
  gap: 56px;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
}

.lab-quality__icon {
  flex: 0 0 auto;
  width: 104px;
  height: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  background: rgba(211,14,51,.09);
  color: var(--red);
}

.lab-quality__icon svg {
  width: 54px;
  height: 54px;
}

.lab-quality__body h2 {
  margin: 10px 0 20px;
  font-size: clamp(2rem, 3.8vw, 3.2rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

.lab-quality__body h2 span {
  color: var(--red);
}

.lab-quality__body p {
  margin: 0;
  color: #666;
  font-size: 1.04rem;
  line-height: 1.9;
  max-width: 640px;
}

/* ================================
   GALERÍA DE OBRA
================================ */

.cal-gallery {
  padding: 110px 0;
  background: #fff;
  color: #111;
  overflow: hidden;
}

.cal-gallery__head {
  max-width: 780px;
  margin: 0 auto 48px;
  text-align: center;
}

.cal-gallery__head h2 {
  margin: 10px 0 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.cal-gallery__head h2 span {
  color: var(--red);
}

.cal-gallery__head p {
  margin: 16px auto 0;
  max-width: 600px;
  color: #666;
  font-size: 1rem;
  line-height: 1.7;
}

.cal-gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.cal-gallery__item {
  position: relative;
  height: 280px;
  overflow: hidden;
  border-radius: 8px;
  background: #e2e2e2;
  cursor: zoom-in;
}

.cal-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .6s ease;
}

.cal-gallery__item:hover img {
  transform: scale(1.04);
}

/* ---- Pista de lupa "Ampliar" (inyectada por lightbox.js) ---- */
.sus-gallery__zoom {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  background: rgba(255,255,255,.94);
  color: var(--red);
  border-radius: 100px;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  box-shadow: 0 6px 18px 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: 1rem;
  color: var(--red);
}

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

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

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

/* ---- Lightbox ---- */
.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__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; }

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

@media (max-width: 768px) {
  .cal-gallery__grid {
    grid-template-columns: 1fr 1fr;
  }

  .cal-gallery__item:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .cal-gallery__grid {
    grid-template-columns: 1fr;
  }

  .cal-gallery__item:last-child {
    grid-column: auto;
  }
}

@media (max-width: 992px) {
  .cert-intro,
  .objectives,
  .cert,
  .lab-quality,
  .cal-gallery {
    padding: 88px 0;
  }

  .lab-quality__card {
    flex-direction: column;
    gap: 36px;
    text-align: center;
  }

  .lab-quality__body p {
    margin: 0 auto;
  }

  .cert-intro__grid {
    grid-template-columns: 1fr;
    gap: 44px;
    justify-items: center;
    text-align: center;
  }

  .objectives__grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

@media (max-width: 560px) {
  .cert-intro,
  .objectives,
  .cert,
  .lab-quality,
  .cal-gallery {
    padding: 68px 0;
  }

  .cert-intro__content h2 {
    font-size: clamp(1.5rem, 6vw, 2rem);
    letter-spacing: -0.5px;
    text-align: center;
  }

  .cert-seal {
    width: 220px;
  }

  .lightbox__close {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
    top: 14px;
    right: 16px;
  }
}
