<template>
  <section class="mb-service-container">
    <div class="mb-service-content">
      <h2>为您定制的企业级安全服务包</h2>
      <div class="mb-service-cards">
        <div v-for="(item, index) in products" :key="index" class="mb-service-card">
          <div class="mb-card-title">{{ item.title }}</div>
          <template v-if="item.price">
            <div class="mb-card-price">
              <span class="mb-amount">${{ item.price }}</span>
              <span class="mb-unit">{{ item.unit }}</span>
            </div>
            <div class="mb-payment-support">
              支持 <img src="/images/products/icon.png" alt="icon"> 支付
            </div>
          </template>
          <template v-else>
            <div class="mb-customized-icon">
              <NuxtImg src="/images/products/customized.png" alt="定制" />
            </div>
          </template>
          <div class="mb-action-btn">{{ item.btnText }}</div>
          <div class="mb-features-list">
            <div v-for="(feature, idx) in item.features" :key="idx" class="mb-feature-item">
              <span class="mb-label">{{ feature.label }}</span>
              <span class="mb-value">{{ feature.value }}</span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </section>
</template>
<script setup>
const products = [
  {
    title: '标准版',
    price: '299',
    unit: '/月',
    btnText: '立即开通',
    features: [
      { label: 'DDoS 防护值', value: '150Gbps' },
      { label: 'CC 防御值', value: '30000QPS' },
      { label: '域名', value: '5 个' },
      { label: '防御端口', value: '10 个' },
      { label: '业务宽带', value: '50Mbps' },
      { label: 'SSL', value: '支持' },
      { label: 'Websocket', value: '支持' },
      { label: '网络', value: 'BGP/CN2 网络' },
    ]
  },
  {
    title: '高级版',
    price: '1199',
    unit: '/月',
    btnText: '立即开通',
    features: [
      { label: 'DDoS 防护值', value: '400Gbps' },
      { label: 'CC 防御值', value: '50000QPS' },
      { label: '域名', value: '10 个' },
      { label: '防御端口', value: '20 个' },
      { label: '业务宽带', value: '100Mbps' },
      { label: 'SSL', value: '支持' },
      { label: 'Websocket', value: '支持' },
      { label: '网络', value: 'BGP/CN2 网络' },
    ]
  },
  {
    title: '至尊版',
    price: '2999',
    unit: '/月',
    btnText: '立即开通',
    features: [
      { label: 'DDoS 防护值', value: '600Gbps' },
      { label: 'CC 防御值', value: '15WQPS' },
      { label: '域名', value: '50 个' },
      { label: '防御端口', value: '50 个' },
      { label: '业务宽带', value: '500Mbps' },
      { label: 'SSL', value: '支持' },
      { label: 'Websocket', value: '支持' },
      { label: '网络', value: 'BGP/CN2 网络' },
    ]
  },
  {
    title: '定制版',
    btnText: '联系商务',
    features: [
      { label: 'DDoS 防护值', value: 'T 级防御' },
      { label: 'CC 防御值', value: '免疫 98%CC' },
      { label: '域名', value: '定制' },
      { label: '防御端口', value: '定制' },
      { label: '业务宽带', value: '定制' },
      { label: 'SSL', value: '定制' },
      { label: 'Websocket', value: '定制' },
      { label: '网络', value: 'BGP/CN2 网络' },
    ]
  }
]
</script>
<style lang="scss" scoped>
.mb-service-container {
  width: 100%;
  position: relative;
  overflow: hidden;

  .mb-service-content {
    position: relative;
    z-index: 2;
    padding-top: 40px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;

    h2 {
      font-size: 20px;
      font-weight: 500;
      background: linear-gradient(91deg, #B8AFFF 10.8%, #C597FF 108.3%);
      background-clip: text;
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    .mb-service-cards {
      margin-top: 26px;
      display: flex;
      justify-content: center;
      flex-wrap: wrap;
      gap: 10px;

      .mb-service-card {
        border-radius: 4px;
        background: #1B192A;
        width: 166px;
        padding: 10px;
        display: flex;
        flex-direction: column;
        align-items: center;
        color: #fff;
        box-sizing: border-box;
        transition: transform .3s ease;

        // &:hover {
        //   transform: translateY(-5px);
        //   border: 1px solid #BF69FF;
        //   background: linear-gradient(176deg, rgba(146, 116, 254, 0.20) -10.82%, rgba(125, 70, 255, 0.20) 109.01%);
        // }

        // &:hover .mb-action-btn {
        //   background: linear-gradient(91deg, #A39DFF 1.24%, #7D46FF 122.93%);
        // }

        .mb-card-title {
          color: #FFF;
          text-align: center;
          font-size: 14px;
          font-weight: 400;
        }

        .mb-customized-icon {
          padding-top: 12px;

          :deep(img) {
            width: 60px;
            height: 60px;
          }
        }

        .mb-card-price {
          display: flex;
          align-items: baseline;
          padding: 10px 0;

          .mb-amount {
            font-size: 24px;
            font-weight: 700;
            background: linear-gradient(91deg, #B8AFFF 10.8%, #C597FF 108.3%);
            background-clip: text;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
          }

          .mb-unit {
            color: #FFF;
            font-size: 14px;
            font-weight: 400;
          }
        }

        .mb-payment-support {
          display: flex;
          align-items: center;
          gap: 2px;
          color: #FFF;
          font-size: 12px;
          font-weight: 400;

          img {
            width: 20px;
            height: 20px;
          }
        }

        .mb-action-btn {
          display: flex;
          justify-content: center;
          align-items: center;
          width: 146px;
          height: 28px;
          margin-top: 12px;
          border-radius: 28px;
          background: linear-gradient(91deg, #A39DFF 1.24%, #7D46FF 122.93%);
          color: #FFF;
          font-size: 14px;
          font-weight: 400;
        }

        .mb-features-list {
          width: 100%;
          display: flex;
          flex-direction: column;
          gap: 10px;
          margin-top: 10px;

          .mb-feature-item {
            display: flex;
            justify-content: space-between;
            font-size: 10px;
            font-weight: 400;

            .mb-label {
              color: rgba(255, 255, 255, 0.60)
            }

            .mb-value {
              color: #FFF;
              text-align: right;
            }
          }
        }
      }
    }
  }
}
</style>
