/* ==============================================
   横向滚动服务展示 - 2KO Engineering
   实现 "What we do" 区块的横向滚动交互
   ============================================== */

/* 横向滚动包装器 - 视口 */
.horizontal-scroll-wrapper {
  width: 100%;
  overflow: hidden;
  position: relative;
}

/* 横向滚动容器 - 可平移的轨道 */
.horizontal-scroll-container {
  display: flex;
  width: 200%; /* 两组服务 = 200% */
  transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
  will-change: transform;
}

/* 横向滚动状态：显示第二组 */
.horizontal-scroll-container.scrolled {
  transform: translateX(-50%);
}

/* 每组服务占据50%宽度 */
.service-group {
  width: 50%;
  flex-shrink: 0;
}

/* ==============================================
   箭头导航按钮
   ============================================== */
.services-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #e0e0e0;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #2c2c2c;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.services-arrow:hover {
  background: #2c2c2c;
  color: #fff;
  border-color: #2c2c2c;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.services-arrow:active {
  transform: translateY(-50%) scale(0.95);
}

.services-arrow-left {
  left: 10px;
}

.services-arrow-right {
  right: 10px;
}

/* 禁用状态 */
.services-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  background: #f5f5f5;
}

.services-arrow:disabled:hover {
  background: #f5f5f5;
  color: #2c2c2c;
  border-color: #e0e0e0;
  transform: translateY(-50%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 拖拽时的光标 */
.horizontal-scroll-container.dragging {
  cursor: grabbing;
  user-select: none;
}

.horizontal-scroll-container:not(.dragging) {
  cursor: grab;
}

/* 特定服务图片位置调整 */
/* Sustainability 图片显示上半部分 */
.service-group:nth-child(2) .col-md-4:nth-child(2) .media__img-inner > img {
  object-position: center top;
}

/* 修复拖拽问题：让装饰性元素允许鼠标事件穿透 */
.horizontal-scroll-wrapper .media-service-1 .img-line {
  pointer-events: none;
}

.horizontal-scroll-wrapper .media-service-1 .media__img {
  pointer-events: none;
}

/* 调整序号位置，使其更明显（只移动序号，不移动标题） */
.horizontal-scroll-wrapper .media-service-1 .title-number .number {
  top: 0% !important;
}

/* 移动端标题 */
.section-title-mobile {
  display: none;
}

@media (max-width: 1500px) {
  /* 移动端也调整序号位置（只移动序号，不移动标题） */
  .media-service-1 .title-number .number {
    top: 0% !important;
  }
  
  .section-title-mobile {
    display: block;
    text-align: center;
    margin-bottom: 60px;
    padding-top: 20px;
  }
  
  .section-title-mobile .title-1 {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
  }
  
  /* 深色背景的标题 */
  .section-title-mobile--dark .title-1 {
    color: #ffffff;
  }
  
  /* 修复移动端横向溢出问题 */
  /* 防止整体页面横向滚动 */
  body {
    overflow-x: hidden;
  }
  
  /* Latest Works section 专门修复 */
  .section-pp[data-title="Latest works"] .container,
  .section-pp[data-title="Latest works"] .section-content {
    max-width: 100vw;
    overflow-x: clip;
  }
  
  /* 确保 Revolution Slider 箭头不超出 */
  .section-pp[data-title="Latest works"] .tp-leftarrow,
  .section-pp[data-title="Latest works"] .tp-rightarrow {
    margin: 0 10px;
  }
  
  /* 移动端：给左右切换按钮添加半透明背景 */
  .section-pp[data-title="Latest works"] .tp-leftarrow,
  .section-pp[data-title="Latest works"] .tp-rightarrow {
    background: rgba(0, 0, 0, 0.5) !important;
  }
  
  .section-pp[data-title="Latest works"] .tp-leftarrow:hover,
  .section-pp[data-title="Latest works"] .tp-rightarrow:hover {
    background: rgba(0, 0, 0, 0.7) !important;
  }
  
  /* 确保箭头图标始终为白色 */
  .section-pp[data-title="Latest works"] .tp-leftarrow:before,
  .section-pp[data-title="Latest works"] .tp-rightarrow:before,
  .section-pp[data-title="Latest works"] .tp-leftarrow:after,
  .section-pp[data-title="Latest works"] .tp-rightarrow:after {
    color: #ffffff !important;
    border-color: #ffffff !important;
  }
}

/* ==============================================
   圆点进度指示器
   ============================================== */
.horizontal-scroll-dots {
  text-align: center;
  margin-top: 50px;
  position: relative;
  z-index: 10;
}

.horizontal-scroll-dots .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-primary-lighter); /* 最浅紫色 #b080d0 */
  margin: 0 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.horizontal-scroll-dots .dot.active {
  background: var(--brand-primary); /* 主题紫色 #7030a0 */
  transform: scale(1.3);
}

.horizontal-scroll-dots .dot:hover {
  background: var(--brand-primary-light); /* 中等紫色 #9050c0 */
}

/* 移动端禁用横向滚动，垂直堆叠 */
@media (max-width: 1500px) {
  .horizontal-scroll-container {
    display: block;
    width: 100%;
    cursor: default;
  }
  
  .service-group {
    width: 100%;
    margin-bottom: 40px;
  }
  
  .service-group:last-child {
    margin-bottom: 0;
  }
  
  /* 移动端隐藏箭头 */
  .services-arrow {
    display: none;
  }
  
  /* 移动端隐藏圆点指示器 */
  .horizontal-scroll-dots {
    display: none;
  }
}

