/* ==========================================
   蔚蓝 定制服务组件样式 (v2 - 无 Swiper)
   ========================================== */

.weilan-custom-service {
  width: 100%;
  padding-bottom: 3.75rem;
  background: var(--bg-color, #fff);
}

.weilan-custom-service .container {
  padding: 0px;
}

.weilan-custom-service-header {
  margin-bottom: 4.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
}

/* ==========================================
   副标题样式（使用全局 weilan-subtitle 类）
   ========================================== */

.weilan-custom-service-header .weilan-subtitle {
  color: var(--color-second, #00ccb8);
  font-size: var(--font-size-lg, 1.125rem); /* 18px */
  font-weight: var(--font-weight-base, 400);
}

/* ==========================================
   标题样式
   ========================================== */

.weilan-custom-service-title {
  color: var(--title-text-color, #333);
}

/* ==========================================
   描述样式
   ========================================== */

.weilan-custom-service-description {
  font-family: var(--font-family);
  font-weight: var(--font-weight-base, 400);
  font-size: var(--font-size-lg, 1.125rem); /* 18px */
  color: var(--text-color-second, #666);
  text-align: center;
  max-width: 100%;
  padding: 0 10%;
}

/* ==========================================
   主要内容区域
   ========================================== */

.weilan-custom-service-content {
  position: relative;
  display: grid;
  grid-template-columns: 18.75rem 1fr;
  min-height: 50rem;
}

/* ==========================================
   左侧服务类型列表（悬浮在右侧之上）
   ========================================== */

.weilan-custom-service-types-sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 18.75rem;
  z-index: 10;
  height: 100%;
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.weilan-custom-service-types-sidebar::-webkit-scrollbar {
  display: none;
}

.weilan-custom-service-type-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  /* padding: var(--spacing-4xl); */
  cursor: pointer;
  background: #f5f5f5;
  overflow: hidden;
  min-height: 25%;
  flex: 1;
  border-bottom: 1px solid #ddd;
}

.weilan-custom-service-type-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    var(--color-second) 0%,
    var(--color-primary) 100%
  );
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.4s ease,
    visibility 0.4s ease;
  z-index: 0;
}

.weilan-custom-service-type-item.active::before,
.weilan-custom-service-type-item:hover::before {
  opacity: 1;
  visibility: visible;
}

.weilan-custom-service-type-item > * {
  position: relative;
  z-index: 1;
}

.weilan-custom-service-type-item .iconfont {
  display: none;
  color: #fff;
  text-align: center;
}
.weilan-custom-service-type-item.active .iconfont,
.weilan-custom-service-type-item:hover .iconfont {
  display: inline-block;
}

.weilan-custom-service-type-icon {
  position: relative;
  width: max(1.625rem, 24px);
  height: max(1.625rem, 24px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.3s ease;
}

.weilan-custom-service-type-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 默认图标 / 选中图标：叠放同一位置，默认显示 default，仅 hover 时显示 active */
.weilan-custom-service-type-icon-default,
.weilan-custom-service-type-icon-active {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.3s ease;
}

.weilan-custom-service-type-icon-default {
  opacity: 1;
}

/* hover 或 active 时隐藏默认图标、显示选中图标 */
.weilan-custom-service-type-item:has(
    .weilan-custom-service-type-icon-active
  ):hover
  .weilan-custom-service-type-icon-default,
.weilan-custom-service-type-item:has(
    .weilan-custom-service-type-icon-active
  ).active
  .weilan-custom-service-type-icon-default {
  opacity: 0;
  pointer-events: none;
}

.weilan-custom-service-type-icon-active {
  opacity: 0;
  pointer-events: none;
}

.weilan-custom-service-type-item:hover .weilan-custom-service-type-icon-active,
.weilan-custom-service-type-item.active
  .weilan-custom-service-type-icon-active {
  opacity: 1;
  pointer-events: auto;
}

.weilan-custom-service-type-title {
  color: var(--text-color);
  transition: color 0.3s ease;
}

.weilan-custom-service-type-item:hover .weilan-custom-service-type-title,
.weilan-custom-service-type-item.active .weilan-custom-service-type-title {
  color: #fff;
}

/* ==========================================
   右侧大图区域
   ========================================== */

.weilan-custom-service-map-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

/* 手机端地图切换按钮 */
.weilan-custom-service-map-nav-mobile {
  display: none;
}

.weilan-custom-service-map-prev-mobile,
.weilan-custom-service-map-next-mobile {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 6px;
  z-index: 10;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: all 0.3s ease;
  color: var(--text-color-light);
}

.weilan-custom-service-map-prev-mobile {
  left: var(--spacing-md);
}

.weilan-custom-service-map-next-mobile {
  right: var(--spacing-md);
}

.weilan-custom-service-map-prev-mobile:hover,
.weilan-custom-service-map-next-mobile:hover {
  color: var(--color-primary);
}

.weilan-custom-service-map-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
}

.weilan-custom-service-map-image.active {
  display: block;
}

.weilan-custom-service-map-image > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease;
  opacity: 1;
}

/* ==========================================
   信息点样式
   ========================================== */

.weilan-custom-service-info-item {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 6;
  cursor: pointer;
  background: #fff;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.weilan-custom-service-info-item.info-active {
  background: var(--color-primary);
}

.weilan-custom-service-info-item svg {
  position: absolute;
  top: -4px;
  left: -4px;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow: visible;
}

.weilan-custom-service-info-item.info-active svg {
  opacity: 1;
}

/* 圆点样式 */
.weilan-custom-service-info-item::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  z-index: 2;
}

.weilan-custom-service-info-item.info-active,
.weilan-custom-service-info-item:hover {
  background-color: var(--color-primary);
}

.weilan-custom-service-info-item.info-active::before {
  width: 16px;
  height: 16px;
  /* background: var(--color-primary, #103fa6); */
  border-color: rgba(255, 255, 255, 0.5);
}

/* 水波纹效果 */
.weilan-custom-service-info-item::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.6;
  z-index: 1;
  animation: ripple 2s infinite;
}

@keyframes ripple {
  0% {
    width: 12px;
    height: 12px;
    opacity: 0.6;
  }
  100% {
    width: 40px;
    height: 40px;
    opacity: 0;
  }
}

/* 圆点与 content 之间的连接线（SVG，位置由 JS 计算） */
.weilan-custom-service-info-connector {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
  z-index: 5;
  pointer-events: none;
  overflow: visible;
}

/* 连接线和 content 的显示由 JS 的 is-visible 类控制，避免闪烁 */
.weilan-custom-service-info-connector.is-visible {
  opacity: 1;
  visibility: visible;
}

.weilan-custom-service-info-connector-line {
  stroke: #0b62c1;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
}

.weilan-custom-service-info-connector-dot {
  fill: white;
  stroke: #0b62c1;
  stroke-width: 0.5;
}

/* 合并 title + products：item hover 时整体展示 */
.weilan-custom-service-info-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--spacing-sm);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, 0);
  margin-top: var(--spacing-md);
  /* background: rgba(255, 255, 255, 0.95); */
  border-radius: 8px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
  z-index: 10;
  pointer-events: none;
  min-width: 120px;
}

.weilan-custom-service-swiper
  .weilan-custom-service-swiper-wrapper
  .swiper-slide {
  width: 85px;
}

.weilan-custom-service-info-content.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* JS 动态定位时覆盖默认位置 */
.weilan-custom-service-info-content.is-positioned {
  margin-top: 0;
  margin-bottom: 0;
}

/* 测量尺寸时临时显示（不可见） */
.weilan-custom-service-info-content.is-measuring {
  opacity: 0 !important;
  visibility: visible !important;
  transition: none !important;
}

.weilan-custom-service-info-title {
  font-family: var(--font-family);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 140%;
  color: var(--text-color-light, #fff);
  white-space: nowrap;
  width: 100%;
  text-transform: capitalize;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6);
}

.weilan-custom-service-info-products {
  display: flex;
  flex-direction: row;
  gap: 0.625rem;
  align-items: stretch;
  max-width: 360px;
  overflow: hidden;
  /* 隐藏滚动条 - 兼容所有浏览器 */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */
}

/* swiper 滚动条样式 */
.weilan-custom-service-swiper .swiper-scrollbar {
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  margin-top: 0.5rem;
}

.weilan-custom-service-swiper .swiper-scrollbar-drag {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 2px;
}

/* 隐藏滚动条 - Webkit 浏览器 (Chrome, Safari, Edge) */
.weilan-custom-service-info-products::-webkit-scrollbar {
  display: none;
}

.weilan-custom-service-info-product {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--spacing-sm);
  /* background: rgba(255, 255, 255, 0.95); */
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.weilan-custom-service-info-product-icon {
  max-width: none !important;
  object-fit: contain;
  flex-shrink: 0;
  /* aspect-ratio: 97 / 80; */
  height: 100% !important;
  max-height: 5rem;
  user-select: none;
}

.weilan-custom-service-info-product-name {
  flex: 1;
  font-family: var(--font-family);
  font-size: var(--font-size-md);
  font-weight: 400;
  color: var(--text-color-light);
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6);
  line-height: 162.5%;
}

/* ==========================================
   服务卡片样式
   ========================================== */

.weilan-custom-service-card {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: auto;
  max-width: 50%;
  min-width: 300px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
  z-index: 10;
}

.weilan-custom-service-card.active {
  opacity: 1;
  visibility: visible;
}

.weilan-custom-service-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #103fa6;
  opacity: 0.85;
  z-index: 1;
}

.weilan-custom-service-card-content {
  position: relative;
  z-index: 2;
  padding: var(--spacing-4xl);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2xl);
  min-width: 34.1875rem;
}

.weilan-custom-service-card-title {
  font-family: var(--title-font-family, 'Inter', sans-serif);
  font-weight: var(--font-weight-lg, 600);
  font-size: var(--font-size-h4, 1.375rem);
  line-height: 1.5;
  color: var(--text-color-light, #fff);
  margin: 0;
}

.weilan-custom-service-card-button {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 0.5rem 1.25rem;
  background: var(--primary-gradient-270);
  border-radius: 6px;
  color: var(--text-color-light, #fff) !important;
  font-family: var(--font-family, 'Inter', sans-serif);
  font-weight: var(--font-weight-md, 500);
  font-size: var(--font-size-md, 1rem);
  line-height: 1.875;
  text-decoration: none;
  transition: all 0.3s ease;
  width: fit-content;
}
.weilan-custom-service-card-button .iconfont {
  font-size: 0.875rem;
  transition: all 0.3s;
}

.weilan-custom-service-card-button:hover .iconfont {
  transform: translateX(2px);
  color: var(--text-color-light);
}

.weilan-custom-service-card-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.weilan-custom-service-card-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.weilan-custom-service-card-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-second, #00ccb8);
  flex-shrink: 0;
}

.weilan-custom-service-card-text {
  font-family: var(--font-family, 'Inter', sans-serif);
  font-weight: var(--font-weight-base, 400);
  font-size: var(--font-size-md, 1rem);
  line-height: 1.625;
  color: var(--text-color-light, #fff);
}

.weilan-custom-service-types-mobile {
  display: none;
  flex-wrap: wrap;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.weilan-custom-service-type-item-mobile {
  padding: var(--spacing-sm) var(--spacing-xl);
  border-radius: 99px;
  background: #f5f5f5;
  font-family: var(--font-family);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-base);
  user-select: none;
}

.weilan-custom-service-type-item-mobile.active {
  color: var(--color-primary);
}

/* ==========================================
   移动端信息展示区域（默认隐藏，小于820px时显示）
   ========================================== */

.weilan-custom-service-info-mobile {
  display: none;
  margin-top: var(--spacing-2xl, 2rem);
}

.weilan-custom-service-info-mobile-group {
  display: none;
}

.weilan-custom-service-info-mobile-group.active {
  display: block;
}

.weilan-custom-service-info-mobile-item {
  background: #fff;
  border-radius: 12px;
  padding: var(--spacing-xl, 1.5rem);
  margin-bottom: var(--spacing-lg, 1.25rem);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: none;
}

.weilan-custom-service-info-mobile-item.active {
  display: block;
}

.weilan-custom-service-info-mobile-title {
  font-size: var(--font-size-lg, 1.125rem);
  font-weight: var(--font-weight-medium, 500);
  color: var(--title-text-color, #333);
  margin-bottom: var(--spacing-md, 1rem);
  padding-bottom: var(--spacing-sm, 0.75rem);
  border-bottom: 2px solid var(--color-primary, #0b62c1);
  text-transform: capitalize;
}

.weilan-custom-service-info-mobile-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--spacing-md, 1rem);
}

.weilan-custom-service-info-mobile-product {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--spacing-sm, 0.75rem);
}

.weilan-custom-service-info-mobile-product-icon {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.weilan-custom-service-info-mobile-product-name {
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--text-color, #333);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================
   底部板块样式
   ========================================== */

.weilan-custom-service-bottom-section {
  /* margin-top: 5rem; */
  /* padding: 3rem; */
  margin-top: 2rem;
  /* background: #f8f9fa; */
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  text-align: center;
}

.weilan-custom-service-bottom-description {
  font-size: var(--font-size-lg);
  font-weight: 400;
  color: var(--text-color);
  line-height: 1.66;
}

.weilan-custom-service-bottom-button {
}

@media screen and (max-width: 1024px) {
  .weilan-custom-service .container {
    padding: 0px var(--container-spacing);
  }

  .weilan-custom-service-content {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .weilan-custom-service-types-mobile {
    display: flex;
  }
  .weilan-custom-service-types-sidebar {
    display: none !important;
  }

  .weilan-custom-service-card {
    display: none !important;
  }

  .weilan-custom-service-map-image {
    height: auto;
    /* aspect-ratio: 16 / 9; */
    position: relative;
  }

  .weilan-custom-service-map-wrapper {
    min-height: 0;
  }
  .weilan-custom-service-map-nav-mobile {
    display: block;
  }
}

/* ==========================================
   小于820px时的特殊布局
   ========================================== */

@media screen and (max-width: 820px) {
  /* 显示移动端信息展示区域 */
  .weilan-custom-service-info-mobile {
    display: block;
  }

  /* 隐藏地图上的连接线（SVG） */
  .weilan-custom-service-info-connector {
    display: none !important;
  }

  /* 隐藏地图上的弹出内容 */
  .weilan-custom-service-info-content {
    display: none !important;
  }

  /* 恢复信息点圆点的交互能力，用于控制下方卡片显示 */
  .weilan-custom-service-info-item {
    cursor: pointer;
    pointer-events: auto;
  }

  /* 激活状态的圆点视觉反馈 */
  .weilan-custom-service-info-item.mobile-active {
    background: var(--color-primary);
    transform: translate(-50%, -50%) scale(1.5);
    box-shadow: 0 0 0 4px rgba(11, 98, 193, 0.3);
  }
}
