/* ============================================
   ERGO 360 Bundle Section Styles
   ============================================ */

/* ============================================
   Tab 样式
   ============================================ */

/* 滑动白色背景 */
.ergo-360-bundle__tab-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  height: calc(100% - 8px);
  background: #ffffff;
  border-radius: 12px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Tab slider 响应式圆角 */
@media screen and (min-width: 1024px) {
  .ergo-360-bundle__tab-slider {
    border-radius: 14px;
  }
}

@media screen and (min-width: 1280px) {
  .ergo-360-bundle__tab-slider {
    border-radius: 16px;
  }
}

.ergo-360-bundle__tab {
  position: relative;
  z-index: 2;
  color: #33363e;
  background-color: transparent;
  font-weight: 500;
  transition: color 0.3s ease, font-weight 0.3s ease;
}

.ergo-360-bundle__tab.is-active {
  color: #134BD6;
  font-weight: 600;
}

.ergo-360-bundle__tab:hover:not(.is-active) {
  color: #555;
}

.ergo-360-bundle__tab:focus {
  outline: none;
}

.ergo-360-bundle__tab:focus-visible {
  outline: 2px solid #134BD6;
  outline-offset: 2px;
}

/* ============================================
   Panel 切换动画
   ============================================ */

.ergo-360-bundle__panel {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.ergo-360-bundle__panel.is-active {
  opacity: 1;
  transform: translateY(0);
}

.ergo-360-bundle__panel[hidden] {
  display: none;
}

/* ============================================
   复选框自定义样式
   ============================================ */

/* 隐藏原生 checkbox - 使用 !important 确保优先级 */
.ergo-360-bundle__checkbox,
.ergo-360-bundle__checkbox.yd-sr-only,
input.ergo-360-bundle__checkbox {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border-width: 0 !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  opacity: 0 !important;
}
.ergo-360-bundle__checkbox-wrap .ergo-360-bundle__checkbox-custom{
  border: 2px solid #134BD6;
}
.ergo-360-bundle__checkbox:checked + .ergo-360-bundle__checkbox-custom {
  background-color: #134BD6;
  border-color: #134BD6;
}

.ergo-360-bundle__checkbox:checked + .ergo-360-bundle__checkbox-custom .ergo-360-bundle__checkbox-icon {
  opacity: 1;
}

.ergo-360-bundle__checkbox:disabled + .ergo-360-bundle__checkbox-custom {
  cursor: not-allowed;
}

.ergo-360-bundle__checkbox-wrap:hover .ergo-360-bundle__checkbox-custom {
  border-color: #134BD6;
}

.ergo-360-bundle__checkbox:disabled + .ergo-360-bundle__checkbox-custom:hover {
  border-color: #134BD6;
}

/* ============================================
   产品项样式
   ============================================ */

.ergo-360-bundle__item {
  transition: background-color 0.2s ease;
  cursor: pointer !important;
}

/* 可选产品行 hover 效果 */
.ergo-360-bundle__item:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

/* 必选产品不需要 pointer cursor */
.ergo-360-bundle__item[data-required="true"] {
  cursor: default !important;
}

/* 不可用产品禁用交互 */
.ergo-360-bundle__item[data-available="false"] {
  pointer-events: none;
  cursor: not-allowed !important;
}

/* ============================================
   提交按钮动画
   ============================================ */

.ergo-360-bundle__submit:not(:disabled):active {
  transform: scale(0.98);
}

.ergo-360-bundle__submit[aria-busy="true"] {
  position: relative;
  color: transparent;
}

.ergo-360-bundle__submit[aria-busy="true"]::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border: 2px solid #ffffff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: ergo-bundle-spin 0.8s linear infinite;
}

@keyframes ergo-bundle-spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* ============================================
   响应式调整
   ============================================ */

@media screen and (max-width: 767px) {
  .ergo-360-bundle__tabs-container {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .ergo-360-bundle__tabs-container::-webkit-scrollbar {
    display: none;
  }

  .ergo-360-bundle__tab {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .ergo-360-bundle__footer {
    align-items: stretch;
  }

  .ergo-360-bundle__total {
    justify-content: flex-end;
  }
}

/* ============================================
   无障碍优化
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .ergo-360-bundle__panel,
  .ergo-360-bundle__tab,
  .ergo-360-bundle__item,
  .ergo-360-bundle__checkbox-custom,
  .ergo-360-bundle__checkbox-icon,
  .ergo-360-bundle__submit {
    transition: none;
  }

  .ergo-360-bundle__submit[aria-busy="true"]::after {
    animation: none;
  }
}
