@pkg: goods-detail-drawer;

.@{pkg} {
  &-section {
    padding: 24px 20px 24px 32px;
    border-bottom: 1px solid #f9f9f9;

    &:last-child {
      border-bottom: none;
    }

    &-title {
      position: relative;
      font-weight: 500;
      font-size: 16px;
      color: #1d2531;
      line-height: 22px;
      margin-bottom: 20px;

      &::before {
        content: '';
        position: absolute;
        left: -12px;
        top: 50%;
        transform: translateY(-50%);
        width: 4px;
        height: 14px;
        background-color: var(--fle-ui-primary-color, #2c6bff);
      }
    }
  }
}

.@{pkg}-contain {
  .fle-ui-drawer-header-title {
    flex-direction: row-reverse;

    .fle-ui-drawer-close {
      margin-right: 0;
    }
  }

  .fle-ui-drawer-body {
    padding: 0;
  }

  // 使用动态 Alert 高度的示例
  .alert-height-example {
    // 使用 CSS 变量获取 Alert 高度
    margin-top: var(--alert-height, 0px);

    // 或者根据高度动态调整布局
    &.with-alert {
      padding-top: calc(var(--alert-height, 0px) + 20px);
    }
  }

  // 商品视频区域
  .goods-video-cover {
    display: inline-block;
    position: relative;
    cursor: pointer;
    transition: box-shadow 0.3s;
    overflow: hidden;

    &:hover {
      box-shadow: 0 4px 16px rgba(44, 107, 255, 0.15);
      &::after {
        content: '';
        opacity: 1;
      }
      .anticon {
        font-size: 28px;
      }
    }
    &::after {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.5);
      opacity: 0;
      pointer-events: none;
      transition: background-color 0.3s, opacity 0.3s;
    }
    .anticon {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate3d(-50%, -50%, 0);
      color: #fff;
      font-size: 24px;
      z-index: 1;
      transition: font-size 0.3s;
    }
  }
  .goods-video {
    video {
      border-radius: 4px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
  }

  // 描述列表样式优化
  .fle-ui-descriptions {
    margin-bottom: 16px;

    .fle-ui-descriptions-header {
      margin-bottom: 16px;
      .fle-ui-descriptions-title {
        font-weight: 500;
        font-size: 14px;
        color: #1d2531;
        line-height: 22px;
      }
    }

    .fle-ui-descriptions-item-label {
      text-wrap: nowrap;
      min-width: 90px;
    }

    &.fle-ui-descriptions-bordered.fle-ui-descriptions-small
      .fle-ui-descriptions-row
      > .fle-ui-descriptions-item-label {
      padding: 0 10px;
      background-color: rgba(0, 0, 0, 0.02) !important;
    }

    .fle-ui-descriptions-item-content {
      color: #1d2531;
    }

    .fle-ui-descriptions-view {
      border-radius: 0;
    }
  }

  .fle-ui-alert-info {
    background-color: #f5f5f5;

    .fle-ui-alert-icon {
      color: #aaa;
    }
  }

  // 标签样式
  .fle-ui-tag {
    margin-right: 4px;
    margin-bottom: 4px;
  }

  // 分割线样式
  .fle-ui-divider {
    margin: 0;
  }

  // 商品详情HTML内容样式
  .goods-detail-html {
    background-color: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    padding: 16px;
    white-space: wrap;

    img,
    video {
      max-width: 100%;
      height: auto;
      vertical-align: middle;
    }

    p {
      margin: 0;
    }
  }

  // Loading 骨架屏样式
  .goods-detail-skeleton-section {
    padding: 24px 0;
    width: 100%;
  }
  .goods-skeleton {
    padding: 24px;
  }

  // 空状态样式
  .goods-empty {
    padding: 48px 24px;
    text-align: center;
  }

  // 文件图标样式
  .file-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
  }

  // 锚点导航样式
  .fle-ui-anchor {
    height: 40px;

    &-wrapper {
      margin: 0;
      padding: 0;
    }

    &-link {
      line-height: 40px;
      padding: 0 !important;
      margin-right: 30px;
    }
  }

  // 锚点导航容器
  .anchor-navigation {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #fff;
    padding: 0 20px;
  }

  .fx__goods-sku-table,
  .fx__goods-score-table {
    &-header,
    &-footer {
      border-left: 1px solid #f0f0f0;
      border-right: 1px solid #f0f0f0;
      padding: 10px;
      font-size: 14px;
      color: #1d2531;
    }

    &-header {
      border-top: 1px solid #f0f0f0;
    }

    &-footer {
      border-bottom: 1px solid #f0f0f0;
    }

    table.form-table {
      border-collapse: collapse;
      border-spacing: 0;
      width: 100%;

      thead {
        display: table-header-group;
        vertical-align: middle;
        border-color: inherit;
        background-color: rgba(0, 0, 0, 0.02);
      }

      th,
      td {
        position: relative;
        font-weight: 400;
        text-align: left;
        color: #333;
        border: 1px solid rgba(5, 5, 5, 0.06);
        font-size: 14px;
        padding: 8px 10px;
        text-wrap: wrap;
      }
    }
  }

  .freight-description-wrap {
    padding: 10px;
    line-height: 18px;
    border: 1px solid #f0f0f0;
  }

  .fle-ui-typography a,
  a.fle-ui-typography {
    color: var(--fle-ui-primary-color, #2c6bff);
  }
}
