<template>
  <section class="service-container">
    <div class="service-content">
      <h2>为您定制的企业级安全服务包</h2>
      <div class="service-cards">
        <div v-for="(item, index) in products" :key="index" class="service-card">
          <div class="card-title">{{ item.title }}</div>
          <template v-if="item.price">
            <div class="card-price">
              <span class="amount">${{ item.price }}</span>
              <span class="unit">{{ item.unit }}</span>
            </div>
            <div class="payment-support">
              支持 <img src="/images/products/icon.png" alt="icon"> 支付
            </div>
          </template>
          <template v-else>
            <div class="customized-icon">
              <NuxtImg src="/images/products/customized.png" alt="定制" />
            </div>
          </template>
          <div class="action-btn">{{ item.btnText }}</div>
          <div class="features-list">
            <div v-for="(feature, idx) in item.features" :key="idx" class="feature-item">
              <span class="label">{{ feature.label }}</span>
              <span class="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>
.service-container {
  width: 100%;
  position: relative;
  overflow: hidden;

  .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;
    }

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

      .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 .action-btn {
        //   background: linear-gradient(91deg, #A39DFF 1.24%, #7D46FF 122.93%);
        // }

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

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

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

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

          .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;
          }

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

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

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

        .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;
        }

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

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

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

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