/* Reset and base */
.htscoped *, .htscoped *::before, .htscoped *::after {
  box-sizing: border-box;
}
.htscoped {
  margin: 0;
  font-family: 'Poppins';
  background: #ffffff;
  color: #222;
  line-height: 1.6;
}
.htscoped h2 {
  margin-top: 0;
  font-weight: 700;
  color: #2c3e50;
}
.htscoped button.cta {
  background-color: #000000;
  color: white;
  font-weight: 600;
  padding: 12px 24px;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-top: 16px;
}
.htscoped button.cta:hover,
.htscoped button.cta:focus {
  background-color: #565656;
}

/* Container and layout */
.htscoped .section {
  padding: 40px 5vw;
  margin: 0 auto;
}

/* Section 1 vertical split */
.htscoped .split-vertical {
  display: flex;
  min-height: 70vh;
  gap: 40px;
}
@media (max-width: 768px) {
  .htscoped .split-vertical {
    flex-direction: column;
    min-height: auto;
    gap: 30px;
  }
}

/* Left side: before-after slider container */
.htscoped .before-after-container {
  position: relative;
  flex: 1 1 50%;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  user-select: none;
  touch-action: none;
  background: #000;
}

.htscoped .before-image,
.htscoped .after-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.htscoped .after-image {
  clip-path: inset(0 0 0 50%);
  transition: clip-path 0.3s ease;
}

/* Slider handle */
.htscoped .slider-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  margin-left: -2px;
  background: linear-gradient(90deg, transparent, #c0c0c0, transparent);
  cursor: ew-resize;
  z-index: 10;
  transition: background-color 0.3s ease;
}
.htscoped .slider-handle:hover,
.htscoped .slider-handle.active {
  background-color: #27ae60;
}

/* Right side: scrollable sticky text */
.htscoped .text-scroll-container {
  flex: 1 1 50%;
  position: sticky;
  top: 40px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  padding-right: 15px;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 768px) {
  .htscoped .text-scroll-container {
    position: relative;
    max-height: none;
    overflow-y: visible;
    top: auto;
    padding-right: 0;
  }
}

.htscoped .steps {
  margin: 0;
  padding-left: 0;
  list-style-type: decimal;
  font-size: 1.1rem;
  color: #34495e;
}
.htscoped .steps li {
  margin-bottom: 18px;
}
.htscoped .benefits {
  margin-top: 32px;
  color: #2c3e50;
}
.htscoped .benefits ul {
  list-style-type: disc;
  padding-left: 20px;
  margin-top: 12px;
}
.htscoped .benefits li {
  margin-bottom: 10px;
}

/* Section 2 horizontal carousel with sticky text */
.htscoped .carousel-section {
  padding: 60px 5vw 80px 5vw;
  max-width: 1200px;
  margin: 0 auto;
}
.htscoped .carousel-wrapper {
  display: flex;
  gap: 30px;
  align-items: center;
}
@media (max-width: 768px) {
  .htscoped .carousel-wrapper {
    flex-direction: column;
    gap: 24px;
  }
}

/* Product carousel container */
.htscoped .product-carousel {
  flex: 1 1 65%;
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  gap: 20px;
  padding-bottom: 10px;
  scrollbar-width: thin;
  scrollbar-color: #27ae60 transparent;
  -webkit-overflow-scrolling: touch;
}
.htscoped .product-carousel::-webkit-scrollbar {
  height: 8px;
}
.htscoped .product-carousel::-webkit-scrollbar-thumb {
  background-color: #27ae60;
  border-radius: 4px;
}
.htscoped .product-card {
  min-width: 220px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 6px 15px rgb(0 0 0 / 0.1);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
.htscoped .product-card:active {
  cursor: grabbing;
}
.htscoped .product-image {
  width: 100%;
  height: 140px;
  object-fit: cover;
}
.htscoped .product-info {
  padding: 12px 16px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.htscoped .product-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: #2c3e50;
  margin-bottom: 6px;
  flex-grow: 1;
}
.htscoped .product-desc {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.3;
}

/* Sticky text next to carousel */
.htscoped .carousel-text {
  flex: 1 1 35%;
  position: sticky;
  top: 40px;
  align-self: flex-start;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  padding-left: 18px;
  border-left: 2px solid #27ae60;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 768px) {
  .htscoped .carousel-text {
    position: relative;
    max-height: none;
    border-left: none;
    padding-left: 0;
  }
}
.htscoped .carousel-text h3 {
  color: #27ae60;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 8px;
}
.htscoped .carousel-text p {
  font-size: 1rem;
  color: #34495e;
}

/* Footer note */
.htscoped footer {
  padding: 40px 5vw;
  text-align: center;
  font-size: 0.9rem;
  color: #999;
}

/* Enhanced responsiveness for mobile and small tablets */
@media (max-width: 600px) {
  .htscoped {
    font-size: 14px;
  }

  .htscoped .section {
    padding: 30px 4vw;
  }

  /* Section 1 split vertical stack tweaks */
  .htscoped .split-vertical {
    gap: 24px;
  }

  .htscoped .before-after-container,
  .htscoped .text-scroll-container {
    flex: 1 1 100%;
  }

  .htscoped .text-scroll-container {
    max-height: none;
    position: relative;
    overflow-y: visible;
    padding-right: 0;
    top: auto;
  }

  /* Slider handle wider for easier touch */
  .htscoped .slider-handle {
    width: 24px;
    margin-left: -12px;
  }

  /* Product carousel and cards adjustments */
  .htscoped .product-carousel {
    overflow-x: scroll;
    padding-bottom: 16px;
    gap: 16px;
  }
  .htscoped .product-card {
    min-width: 180px;
    border-radius: 10px;
  }

  /* Carousel sticky text resets */
  .htscoped .carousel-text {
    position: relative;
    max-height: none;
    border-left: none;
    padding-left: 0;
    margin-top: 12px;
    overflow-y: visible;
  }

  /* Buttons */
  .htscoped button.cta {
    padding: 10px 20px;
    font-size: 1rem;
  }
}

/* Optimize for small landscape phones or tight heights */
@media (max-height: 600px) {
  .htscoped .text-scroll-container,
  .htscoped .carousel-text {
    max-height: 50vh;
    overflow-y: auto;
  }
}