<script setup>
import { RouterLink } from 'vue-router'

defineProps({
  product: { type: Object, required: true },
})

const iconMap = {
  ai: '∿',
  security: '⌬',
  comms: '⤬',
  asic: '◇',
  other: '◍',
}
</script>

<template>
  <RouterLink :to="`/products/${product.slug}`" class="product">
    <div class="product__head">
      <span class="product__icon mono">{{ iconMap[product.category] || '◍' }}</span>
      <span class="pill">{{ product.category_label }}</span>
    </div>
    <h3 class="product__name">{{ product.name }}</h3>
    <p class="product__tagline">{{ product.tagline }}</p>
    <p class="product__summary">{{ product.summary }}</p>
    <span class="product__more">Read more →</span>
  </RouterLink>
</template>

<style scoped>
.product {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: linear-gradient(180deg, var(--color-surface), var(--color-surface-2));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  color: var(--color-text);
  transition: border-color var(--transition), transform var(--transition);
  height: 100%;
}
.product:hover {
  border-color: rgba(0, 229, 255, 0.4);
  transform: translateY(-3px);
  color: var(--color-text);
}

.product__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}
.product__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-size: 1.5rem;
  border: 1px solid rgba(0, 229, 255, 0.25);
}
.product__name { margin: 0; font-size: 1.3rem; }
.product__tagline { color: var(--color-accent); font-size: 0.95rem; margin: 0; }
.product__summary { color: var(--color-text-muted); margin: 0; flex: 1; }
.product__more {
  color: var(--color-accent);
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: var(--space-2);
}
</style>
