<template>
  <section class="product-cards multi-layout">
    <div v-for="(card, index) in cards" :key="index" class="product-card-wrapper">
      <div class="product-card">
        <h3 class="card-title">{{ card.title }}</h3>
        <p class="card-description">{{ card.description }}</p>
        <div class="card-features">
          <span v-for="(feature, idx) in card.features" :key="idx" class="feature-tag">{{ feature }}</span>
        </div>
        <div class="card-actions">
          <button class="btn-primary">更多详情</button>
          <button class="btn-secondary">0元体验</button>
        </div>
      </div>
      <div v-if="index < cards.length - 1" class="divider"></div>
    </div>
  </section>
</template>

<script setup>
defineProps({
  cards: {
    type: Array,
    required: true
  }
})
</script>

<style scoped lang="scss">
.multi-layout {
  max-width: 1200px;
  min-height: 474px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card-wrapper {
  display: flex;
  align-items: center;
}

.product-card {
  width: 266px;
  height: 336px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px 0 35px 0;

  .card-title {
    
    font-size: 20px;
    font-weight: 500;
    line-height: 20px;
    color: #ffffff;
    margin: 0;
    text-align: center;
  }

  .card-description {
    width: 266px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 24px;
  }

  .card-features {
    width: 266px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    .feature-tag {
      
      font-size: 14px;
      font-weight: 400;
      line-height: 14px;
      color: #9b71ff;
      margin-bottom: 12px;

      &:last-child {
        margin-bottom: 0;
      }
    }
  }

  .card-actions {
    width: 263px;
    display: flex;
    align-items: center;
    margin-top: 20px;

    .btn-primary {
      width: 120px;
      height: 40px;
      border-radius: 8px;
      background: linear-gradient(24.74deg, rgba(163, 157, 255, 1) 0%, rgba(125, 70, 255, 1) 100%);
      border: none;
      
      font-size: 14px;
      font-weight: 400;
      color: #ffffff;
      cursor: pointer;
      transition: opacity 0.3s ease;

      &:hover {
        opacity: 0.8;
      }
    }

    .btn-secondary {
      width: 120px;
      height: 40px;
      border-radius: 8px;
      border: 1px solid rgba(255, 255, 255, 0.5);
      background: rgba(255, 255, 255, 0.2);
      backdrop-filter: blur(15.2px);
      
      font-size: 14px;
      font-weight: 400;
      color: #ffffff;
      cursor: pointer;
      margin-left: 23px;
      transition: opacity 0.3s ease;

      &:hover {
        opacity: 0.8;
      }
    }
  }
}

.divider {
  width: 1px;
  height: 450px;
  background-color: rgba(255, 255, 255, 0.1);
  margin: 0 65.5px;
}
</style>
