/* Before and After Section Styles */
.before-after-section {
  padding: 3rem 2rem;
  background-color: #f8f9fa;
  margin: 2rem 0;
}

.before-after-section .section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.before-after-section .section-title h2 {
  font-size: 2rem;
  color: #75440b;
  white-space: nowrap;
  margin: 0;
}

.before-after-section .section-title hr {
  flex-grow: 1;
  border: none;
  border-top: 3px solid #ccc;
  max-width: 200px;
}

.section-description {
  text-align: center;
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Grid Layout for Before/After Images */
.before-after-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.comparison-set {
  background: white;
  border-radius: 15px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.comparison-set:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.before-after-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: center;
}

.image-container {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.image-container:hover {
  transform: scale(1.02);
}

.image-container img {
  width: 100%;
  height: 590px;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease;
}

.image-container img:hover {
  opacity: 0.95;
}

/* Clickable image cursor */
.clickable-image {
  cursor: pointer;
  transition: all 0.3s ease;
}

.clickable-image:hover {
  transform: scale(1.02);
  opacity: 0.9;
}

.image-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  text-align: center;
  padding: 1rem 0 0.8rem 0;
  font-weight: bold;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.image-container.before .image-label {
  background: linear-gradient(transparent, rgba(204, 85, 85, 0.9));
}

.image-container.after .image-label {
  background: linear-gradient(transparent, rgba(76, 175, 80, 0.9));
}

/* Call to Action */
.cta-container {
  text-align: center;
  padding: 2rem;
  background: linear-gradient(135deg, #75440b, #be6f13);
  border-radius: 15px;
  color: white;
  max-width: 600px;
  margin: 0 auto;
}

.cta-container p,
.cta-container h2 {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.cta-container .quote-button {
  background: white !important;
  color: #75440b !important;
  border: 2px solid white !important;
  font-weight: bold;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  margin: 0 !important;
  display: inline-block;
  width: auto;
  text-decoration: none;
  border-radius: 5px;
  transition: background 0.3s ease, transform 0.3s ease;
  box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.1);
}

.cta-container .quote-button:hover {
  background: #f8f9fa !important;
  transform: scale(1.05);
  color: #5a3009 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .before-after-section {
    padding: 2rem 1rem;
  }
  
  .before-after-section .section-title h2 {
    font-size: 1.5rem;
  }
  
  .before-after-pair {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .image-container img {
    height: 200px;
  }
  
  .section-description {
    font-size: 1rem;
    margin-bottom: 2rem;
  }
  
  .cta-container p,
  .cta-container h2 {
    font-size: 1.1rem;
  }
  
  .cta-container .quote-button {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .before-after-section {
    padding: 1.5rem 0.5rem;
  }
  
  .comparison-set {
    padding: 1rem;
  }
  
  .image-container img {
    height: 180px;
  }
  
  .image-label {
    font-size: 1rem;
    padding: 0.8rem 0 0.6rem 0;
  }
  
  .before-after-section .section-title {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .before-after-section .section-title hr {
    width: 100px;
    max-width: 100px;
  }
}

/* Animation for loading */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.comparison-set {
  animation: fadeInUp 0.6s ease forwards;
}

.comparison-set:nth-child(2) {
  animation-delay: 0.2s;
}

.comparison-set:nth-child(3) {
  animation-delay: 0.4s;
}

/* Image Modal Styles */
.image-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 1rem;
}

.image-modal-overlay.show {
  display: flex;
  opacity: 1;
}

.image-modal {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.4s ease forwards;
}

@keyframes modalSlideIn {
  from {
    transform: scale(0.8) translateY(-20px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.image-modal img {
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}

.close-image-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  z-index: 1001;
}

.close-image-modal:hover {
  background: rgba(0, 0, 0, 0.9);
}

.image-modal-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 2rem 1rem 1rem 1rem;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 500;
}

/* Prevent background scrolling when image modal is open */
body.image-modal-open {
  overflow: hidden;
}

/* Responsive adjustments for image modal */
@media (max-width: 768px) {
  .image-modal {
    max-width: 95vw;
    max-height: 95vh;
  }
  
  .image-modal img {
    max-height: 70vh;
  }
  
  .close-image-modal {
    width: 35px;
    height: 35px;
    font-size: 1.3rem;
    top: 0.5rem;
    right: 0.5rem;
  }
  
  .image-modal-caption {
    font-size: 1rem;
    padding: 1.5rem 0.5rem 0.8rem 0.5rem;
  }
}

@media (max-width: 480px) {
  .image-modal {
    border-radius: 10px;
  }
  
  .image-modal img {
    max-height: 60vh;
  }
  
  .close-image-modal {
    width: 30px;
    height: 30px;
    font-size: 1.1rem;
  }
  
  .image-modal-caption {
    font-size: 0.9rem;
    padding: 1rem 0.5rem 0.5rem 0.5rem;
  }
}
