.gallery-intro,
.gallery-content {
  padding: 5rem 0;
  background-color: var(--light-color);
}

.gallery-hero {
  padding: 2.5rem 0;
}

.gallery-hero h1 {
  margin-bottom: 0.75rem;
}

.gallery-hero .hero-subtitle {
  margin-bottom: 0;
}

.gallery-intro .container,
.gallery-content .container {
  max-width: 1000px;
}

.gallery-intro p,
.gallery-content p {
  font-size: 1.1rem;
  line-height: 1.8;
  text-align: center;
}

.gallery-section {
  padding: 3rem 0 5rem;
  background-color: var(--white);
}

.gallery-section .carousel-container {
  max-width: 980px;
}

.gallery-section .carousel-track {
  height: 620px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  background-color: var(--dark-color);
}

.gallery-section .carousel-image {
  object-fit: contain;
  background-color: var(--dark-color);
  pointer-events: none;
}

.gallery-section .carousel-image.active {
  pointer-events: auto;
}

.carousel-caption {
  max-width: 900px;
  min-height: 2.8em;
  margin: 1rem auto 0;
  color: var(--dark-color);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

/* Comparativas antes/después
   Versión híbrida:
   - .before-after-grid sirve para varias comparativas.
   - .before-after-container mantiene cada pareja Antes/Después lado a lado.
   - .image-container/.image-label se mantienen por compatibilidad si el HTML nuevo los usa.
*/
.before-after-grid {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}

.before-after-card {
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background-color: var(--white);
}

.before-after-card > h3,
.before-after-card > h2,
.before-after-card > p {
  margin-left: 1.5rem;
  margin-right: 1.5rem;
}

.before-after-card > h3:first-child,
.before-after-card > h2:first-child {
  margin-top: 1.5rem;
}

.before-after-container {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.before-image,
.after-image,
.image-container {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 300px;
}

.before-image img,
.after-image img,
.image-container img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
  display: block;
}

.image-caption,
.image-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.5rem;
  text-align: center;
  color: var(--white);
  background-color: rgba(0, 0, 0, 0.7);
  font-size: 0.9rem;
  font-weight: 700;
}

/* Compatibilidad para HTML que ponga dos .image-container directamente dentro de la tarjeta */
.before-after-card > .image-container {
  width: 50%;
  float: left;
}

.before-after-card::after {
  content: "";
  display: block;
  clear: both;
}

.before-after-caption {
  clear: both;
  margin: 0;
  padding: 1rem 1.25rem 1.2rem;
  color: var(--dark-color);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  background-color: var(--white);
}

.gallery-thumb {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow);
  background-color: var(--white);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-thumb:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.gallery-thumb img,
.gallery-thumb video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.inspiration-gallery-page .gallery-section .carousel-image,
.inspiration-gallery-page .gallery-thumb img {
  transform: scaleY(1.2);
  transform-origin: center;
}

.gallery-services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.gallery-cta {
  padding: 4rem 0 5rem;
  text-align: center;
  background-color: var(--light-color);
}

.gallery-cta .container {
  max-width: 820px;
}

.gallery-cta p {
  max-width: 680px;
  margin: 0 auto 1.5rem;
  font-size: 1.1rem;
  line-height: 1.7;
}

.gallery-cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.gallery-cta-actions .btn-whatsapp {
  padding: 1rem 1.5rem;
  border-radius: 50px;
  font-size: 1.05rem;
}

.gallery-video {
  padding: 5rem 0;
  background-color: var(--white);
}

.gallery-video .container {
  max-width: 980px;
}

.gallery-video video {
  width: 100%;
  max-height: 620px;
  border-radius: 10px;
  background-color: var(--dark-color);
  box-shadow: var(--shadow);
}

@media (max-width: 768px) {
  .gallery-section .carousel-track {
    height: 440px;
  }

  .gallery-hero {
    padding: 2rem 0;
  }

  .gallery-intro,
  .gallery-content,
  .gallery-section,
  .gallery-video {
    padding: 4rem 0;
  }

  .before-after-container {
    grid-template-columns: 1fr;
  }

  .before-after-card > .image-container {
    width: 100%;
    float: none;
  }

  .before-image,
  .after-image,
  .image-container,
  .before-image img,
  .after-image img,
  .image-container img {
    min-height: 250px;
  }

  .gallery-cta {
    padding: 3rem 0 4rem;
  }

  .gallery-cta-actions {
    align-items: center;
    flex-direction: column;
  }

  .gallery-cta-actions .btn-primary,
  .gallery-cta-actions .btn-whatsapp {
    width: 100%;
    max-width: 320px;
  }
}

@media (max-width: 480px) {
  .gallery-section .carousel-track {
    height: 320px;
  }

  .gallery-thumbs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .before-image,
  .after-image,
  .image-container,
  .before-image img,
  .after-image img,
  .image-container img {
    min-height: 220px;
  }
}
