/* =====================================================================before-after-main-section===================================================================== */

/* Global responsive improvements */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
  margin: 0;
  padding: 0;
}

.before-after-main-section{
  min-height: auto;
  width: 100%;
  background-color: #ebe3da;
  padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: clamp(2rem, 4vw, 3rem); /* Add top margin to prevent title cutoff */
}

.before-after-main-section h2{
  text-align: center;
  font-size: clamp(2rem, 5vw, 3rem);
  font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
  letter-spacing: 0.1rem;
  font-weight: 600;
  color: #2c1810;
  margin-bottom: clamp(1rem, 3vw, 2rem);
  margin-top: 0;
}

.before-after-main-section h3{
  text-align: center;
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
  letter-spacing: 0.05rem;
  font-weight: 400;
  color: #4a3326;
  margin-bottom: clamp(2rem, 5vw, 4rem);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.before-after-image-container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  align-items: flex-start;
}

.before-after-before-container,
.before-after-after-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0; /* Prevent flex items from overflowing */
}

.before-after-b-img-sub-container,
.before-after-a-img-sub-container {
  width: 100%;
  max-width: 600px;
  position: relative;
  border-radius: clamp(1rem, 2vw, 2rem);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  background: white;
  padding: clamp(1rem, 2vw, 2rem);
}

.before-after-before-images-content,
.before-after-after-images-content {
  position: relative;
  width: 100%;
  height: clamp(300px, 89vh, 619px);
  overflow: hidden;
  border-radius: clamp(0.5rem, 1vw, 1rem);
}

.before-after-before-images-content img,
.before-after-after-images-content img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  border-radius: clamp(0.5rem, 1vw, 1rem);
  display: block;
}

.before-after-before-images-content img.active,
.before-after-after-images-content img.active {
  opacity: 1;
}

/* Ensure first image shows by default */
.before-after-before-images-content img:first-child,
.before-after-after-images-content img:first-child {
  opacity: 1;
}

.dentallabel {
  margin-top: clamp(1rem, 3vw, 2rem);
  padding: clamp(0.8rem, 2vw, 1.2rem) clamp(2rem, 4vw, 3rem);
  background: linear-gradient(45deg, #8B4513, #A0522D);
  color: white;
  font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 600;
  letter-spacing: 0.2rem;
  border-radius: clamp(1.5rem, 3vw, 2rem);
  text-align: center;
  box-shadow: 0 6px 20px rgba(139, 69, 19, 0.3);
  text-transform: uppercase;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.dentallabel:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(139, 69, 19, 0.4);
}

/* ============================================================================= People Slider Section =========================================================================== */




@media (max-width: 768px) {
  

  .whatsapp-no {
    bottom: 70px;
    right: 15px;
  }

  .whatsapp-no a {
    color: #25D366;
    font-size: clamp(3rem, 6vw, 5rem);
    transition: transform 0.3s ease;
  }
}

@media (max-width: 480px) {
  

  .whatsapp-no {
    bottom: 60px;
    right: 10px;
  }

  .whatsapp-no a {
    color: #25D366;
            font-size: clamp(3rem, 6vw, 5rem);
            transition: transform 0.3s ease;
  }

  /* Swiper navigation adjustments for small mobile */
  
}



/* ============================================================================= Enhanced Mobile Side-by-Side Layout =========================================================================== */

@media (max-width: 1024px) {
  .before-after-image-container {
      gap: clamp(1.2rem, 3vw, 1.8rem);
  }
  
  .before-after-before-images-content,
  .before-after-after-images-content {
      height: clamp(280px, 45vh, 450px);
  }
}

/* Tablet and large mobile - maintain side by side */
@media (max-width: 768px) {
  .before-after-main-section {
      padding: clamp(1.5rem, 4vw, 2.5rem) clamp(0.8rem, 2.5vw, 1.2rem);
  }
  
  .before-after-image-container {
      display: flex;
      flex-direction: row;
      gap: clamp(0.8rem, 2vw, 1.2rem);
      align-items: flex-start;
      justify-content: center;
      max-width: 100%;
  }
  
  .before-after-before-container,
  .before-after-after-container {
      flex: 1;
      width: 48%;
      min-width: 0;
      max-width: none;
  }
  
  .before-after-b-img-sub-container,
  .before-after-a-img-sub-container {
      padding: clamp(0.8rem, 2vw, 1.2rem);
      width: 100%;
      box-sizing: border-box;
  }
  
  .before-after-before-images-content,
  .before-after-after-images-content {
      height: clamp(200px, 35vh, 280px);
      width: 100%;
  }
  
  .dentallabel {
      font-size: clamp(0.8rem, 2.2vw, 1rem);
      padding: clamp(0.4rem, 1.2vw, 0.6rem) clamp(0.8rem, 2vw, 1.2rem);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
  }
}

/* Small mobile - optimized side by side */
@media (max-width: 480px) {
  .before-after-main-section {
    margin-top: 7REM;
      padding: clamp(1rem, 3vw, 1.5rem) clamp(0.5rem, 1.5vw, 0.8rem);
  }
  
  .before-after-image-container {
      display: flex;
      flex-direction: row;
      gap: clamp(0.5rem, 1.5vw, 0.8rem);
      align-items: flex-start;
      justify-content: space-between;
      width: 100%;
  }
  
  .before-after-before-container,
  .before-after-after-container {
      flex: 1;
      width: calc(50% - clamp(0.25rem, 0.75vw, 0.4rem));
      min-width: 0;
  }
  
  .before-after-b-img-sub-container,
  .before-after-a-img-sub-container {
      padding: clamp(0.5rem, 1.5vw, 0.8rem);
      border-radius: clamp(0.8rem, 2vw, 1.2rem);
      width: 100%;
      height: 19rem;
      box-sizing: border-box;
  }
  
  .before-after-before-images-content,
  .before-after-after-images-content {
      height: clamp(18rem, 35vw, 220px);
      border-radius: clamp(0.4rem, 1vw, 0.8rem);
  }
  
  .dentallabel {
      font-size: clamp(0.7rem, 2vw, 0.9rem);
      padding: clamp(0.3rem, 1vw, 0.5rem) clamp(0.6rem, 1.5vw, 1rem);
      margin-top: clamp(0.5rem, 2vw, 1rem);
      letter-spacing: 0.1rem;
      border-radius: clamp(1rem, 2.5vw, 1.5rem);
  }
  
  .before-after-main-section h2 {
      font-size: clamp(1.5rem, 4vw, 2.2rem);
      margin-bottom: clamp(0.8rem, 2vw, 1.2rem);
  }
  
  .before-after-main-section h3 {
      font-size: clamp(1rem, 2.5vw, 1.3rem);
      margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
  }
}

/* Extra small mobile - ultra-compact side by side */
@media (max-width: 320px) {
  .before-after-main-section {
      padding: clamp(0.8rem, 2.5vw, 1.2rem) clamp(0.3rem, 1vw, 0.5rem);
  }
  
  .before-after-image-container {
      gap: clamp(0.3rem, 1vw, 0.5rem);
  }
  
  .before-after-before-container,
  .before-after-after-container {
      width: calc(50% - clamp(0.15rem, 0.5vw, 0.25rem));
  }
  
  .before-after-b-img-sub-container,
  .before-after-a-img-sub-container {
      padding: clamp(0.3rem, 1vw, 0.5rem);
      border-radius: clamp(0.5rem, 1.5vw, 0.8rem);
  }
  
  .before-after-before-images-content,
  .before-after-after-images-content {
      height: clamp(120px, 40vw, 180px);
      border-radius: clamp(0.3rem, 0.8vw, 0.5rem);
  }
  
  .dentallabel {
      font-size: clamp(0.6rem, 1.8vw, 0.8rem);
      padding: clamp(0.2rem, 0.8vw, 0.4rem) clamp(0.4rem, 1.2vw, 0.8rem);
      letter-spacing: 0.05rem;
      border-radius: clamp(0.8rem, 2vw, 1.2rem);
  }
}

/* Force side-by-side layout for all mobile sizes */
@media (max-width: 768px) {
  .before-after-image-container {
      flex-wrap: nowrap !important;
      flex-direction: row !important;
  }
  
  .before-after-before-container,
  .before-after-after-container {
      flex-shrink: 1;
      flex-grow: 1;
      flex-basis: 50%;
  }
}

/* ============================================================================= Floating Elements & Mobile Optimizations =========================================================================== */

/* Floating phone and WhatsApp buttons */
#contact-btn .phn-no {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 18px);
  background: linear-gradient(45deg, #8B4513, #A0522D);
  color: white;
  border: none;
  border-radius: 25px;
  font-size: clamp(0.8rem, 2vw, 1rem);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  text-decoration: none;
  white-space: nowrap;
}

#contact-btn .phn-no:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  background: linear-gradient(45deg, #A0522D, #8B4513);
}

.whatsapp-no {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 1000;
}

.whatsapp-no a {
  color: #25D366;
            font-size: clamp(3rem, 6vw, 5rem);
            transition: transform 0.3s ease;
}

.whatsapp-no a i{
  font-size: 60px;
}

.whatsapp-no a:hover {
  transform: scale(1.1);
}

/* Footer Responsive Adjustments */
footer {
  background: #333;
  color: white;
  padding: clamp(2rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem);
  width: 100%;
}

.last-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.first-footer-section {
  text-align: center;
  margin-bottom: clamp(1rem, 3vw, 2rem);
}

.first-footer-section p {
  margin: 0.5rem 0;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
}

.second-footer-section {
  text-align: center;
}

.second-footer-section p {
  margin: 1rem 0;
  line-height: 1.6;
  font-size: clamp(0.8rem, 1.8vw, 1rem);
}

#add1 {
  font-size: clamp(0.7rem, 1.5vw, 0.9rem);
  opacity: 0.8;
}

#address span {
  font-weight: bold;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
}

/* Mobile Specific Adjustments */
@media (max-width: 768px) {
  /* Adjust floating buttons for mobile */
  #contact-btn .phn-no {
      bottom: 15px;
      right: 15px;
      padding: clamp(6px, 1.5vw, 10px) clamp(10px, 2.5vw, 15px);
  }
  
  .whatsapp-no {
      bottom: 65px;
      right: 15px;
  }
  
  /* Ensure no horizontal scrolling */
  body {
      max-width: 100vw;
      overflow-x: hidden;
  }
  
  /* Footer adjustments */
  .first-footer-section {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
  }
  
  /* Force side-by-side on all mobile sizes */
  
}

@media (max-width: 480px) {
  /* Adjust floating buttons for very small screens */
  #contact-btn .phn-no {
      font-size: clamp(0.7rem, 1.8vw, 0.9rem);
      padding: clamp(5px, 1.2vw, 8px) clamp(8px, 2vw, 12px);
  }
  
  .whatsapp-no {
      bottom: 60px;
      right: 12px;
  }
  
  .whatsapp-no a {
    color: #25D366;
    font-size: clamp(3rem, 6vw, 5rem);
    transition: transform 0.3s ease;
  }
}

/* Performance optimization - reduce animations on mobile */
@media (prefers-reduced-motion: reduce) {
  * {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .before-after-main-section h2,
  .before-after-main-section h3 {
      text-shadow: 2px 2px 0 #000;
  }
}

/* Print styles */
@media print {
  .whatsapp-no,
  #contact-btn {
      display: none !important;
  }
  
  body {
      background: white !important;
      color: black !important;
  }
  
  .before-after-main-section {
      background: none !important;
  }
}
