/* ===========================================
   PRODUCTS - Ecosystem & Product Cards
   =========================================== */

/* ===== ECOSYSTEM SECTION ===== */
.ecosystem {
  position: relative;
  background: var(--pie-neutral-dark);
  overflow: hidden;
}

.ecosystem::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 100%
  );
}

.ecosystem-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto var(--space-3xl);
}

.ecosystem-badge {
  margin-bottom: var(--space-lg);
}

.ecosystem-title {
  margin-bottom: var(--space-lg);
}

.ecosystem-description {
  color: rgba(253, 254, 254, 0.7);
  font-size: 1.125rem;
  line-height: 1.7;
}

/* Visual diagram */
.ecosystem-visual {
  position: relative;
  max-width: 800px;
  margin: 0 auto var(--space-3xl);
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ecosystem-diagram {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Central hub */
.ecosystem-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 160px;
  height: 160px;
  background: linear-gradient(
    135deg,
    var(--pie-secondary) 0%,
    var(--pie-accent-1) 100%
  );
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 60px rgba(41, 135, 207, 0.4);
  z-index: 10;
}

.ecosystem-hub-logo {
  width: 64px;
  height: auto;
  margin-bottom: var(--space-sm);
}

.ecosystem-hub-text {
  font-size: var(--font-small);
  font-weight: var(--weight-bold);
  color: var(--pie-primary);
}

/* Orbit nodes */
.ecosystem-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  height: 400px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.ecosystem-node {
  position: absolute;
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  cursor: pointer;
}

.ecosystem-node:hover {
  background: rgba(41, 135, 207, 0.2);
  border-color: var(--pie-secondary);
  transform: scale(1.1);
}

.ecosystem-node svg {
  width: 32px;
  height: 32px;
  color: var(--pie-neutral-2);
}

/* Ecosystem node tooltip */
.ecosystem-node.has-tooltip::after {
  content: attr(data-tooltip-title) "\A" attr(data-tooltip-desc) "\A\A"
    "Click for more info →";
  white-space: pre-wrap;
  position: absolute;
  bottom: calc(100% + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--pie-primary);
  border: 1px solid rgba(41, 135, 207, 0.4);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--pie-neutral-2);
  text-align: center;
  min-width: 200px;
  max-width: 260px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  pointer-events: none;
  z-index: 100;
}

/* Tooltip arrow */
.ecosystem-node.has-tooltip::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: rgba(41, 135, 207, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  z-index: 101;
}

.ecosystem-node.has-tooltip:hover::after,
.ecosystem-node.has-tooltip:hover::before {
  opacity: 1;
  visibility: visible;
}

/* Position adjustments for bottom nodes (tooltip appears below) */
.ecosystem-node:nth-child(4).has-tooltip::after {
  bottom: auto;
  top: calc(100% + 16px);
}

.ecosystem-node:nth-child(4).has-tooltip::before {
  bottom: auto;
  top: calc(100% + 8px);
  border-top-color: transparent;
  border-bottom-color: rgba(41, 135, 207, 0.4);
}

/* Node positions (6 products in circle - evenly distributed at 60° intervals) */
.ecosystem-node:nth-child(1) {
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
}
.ecosystem-node:nth-child(2) {
  top: 12%;
  right: -5%;
}
.ecosystem-node:nth-child(3) {
  bottom: 12%;
  right: -5%;
}
.ecosystem-node:nth-child(4) {
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
}
.ecosystem-node:nth-child(5) {
  bottom: 12%;
  left: -5%;
}
.ecosystem-node:nth-child(6) {
  top: 12%;
  left: -5%;
}

/* ===== PRODUCTS GRID ===== */
.products {
  position: relative;
  background: var(--pie-primary);
}

.products-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto var(--space-3xl);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

/* Featured products (larger) */
.products-featured {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

/* ===== PRODUCT CARD ===== */
.product-card {
  position: relative;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  overflow: hidden;
  transition: all var(--transition-slow);
  display: flex;
  flex-direction: column;
}

.product-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--pie-secondary) 0%,
    var(--pie-accent-1) 100%
  );
  opacity: 0;
  transition: opacity var(--transition-base);
}

.product-card:hover {
  transform: translateY(-8px);
  border-color: rgba(41, 135, 207, 0.4);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.product-card:hover::before {
  opacity: 1;
}

/* Available product state */
.product-card.available {
  border-color: rgba(64, 224, 208, 0.3);
}

.product-card.available::before {
  background: var(--pie-accent-1);
  opacity: 1;
}

.product-card.available:hover {
  border-color: rgba(64, 224, 208, 0.5);
  box-shadow: 0 20px 60px rgba(64, 224, 208, 0.15);
}

/* Product header */
.product-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.product-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(
    135deg,
    rgba(41, 135, 207, 0.2) 0%,
    rgba(64, 224, 208, 0.1) 100%
  );
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-icon svg {
  width: 28px;
  height: 28px;
  color: var(--pie-secondary);
}

.product-card.available .product-icon {
  background: linear-gradient(
    135deg,
    rgba(64, 224, 208, 0.2) 0%,
    rgba(64, 224, 208, 0.1) 100%
  );
}

.product-card.available .product-icon svg {
  color: var(--pie-accent-1);
}

/* Product content */
.product-name {
  font-size: var(--font-h4);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-sm);
}

.product-description {
  color: rgba(253, 254, 254, 0.7);
  font-size: var(--font-small);
  line-height: 1.6;
  margin-bottom: var(--space-lg);
  flex-grow: 1;
}

/* Product features */
.product-features {
  margin-bottom: var(--space-lg);
}

.product-feature {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-small);
  color: rgba(253, 254, 254, 0.6);
  margin-bottom: var(--space-sm);
}

.product-feature::before {
  content: "→";
  color: var(--pie-accent-1);
  font-size: var(--font-xs);
}

/* Product CTA */
.product-cta {
  margin-top: auto;
}

.product-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-small);
  font-weight: var(--weight-medium);
  color: var(--pie-secondary);
  transition: all var(--transition-fast);
}

.product-link:hover {
  color: var(--pie-accent-1);
  gap: var(--space-md);
}

.product-link svg {
  width: 16px;
  height: 16px;
  transition: transform var(--transition-fast);
}

.product-link:hover svg {
  transform: translateX(4px);
}

/* Coming soon overlay */
.product-coming {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-small);
  color: rgba(253, 254, 254, 0.5);
}

.product-coming svg {
  width: 16px;
  height: 16px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ecosystem-orbit {
    width: 300px;
    height: 300px;
  }

  .ecosystem-hub {
    width: 120px;
    height: 120px;
  }

  .ecosystem-node {
    width: 60px;
    height: 60px;
  }
}

@media (max-width: 768px) {
  .products-featured,
  .products-grid {
    grid-template-columns: 1fr;
  }

  .ecosystem-visual {
    display: none;
  }

  .product-card {
    padding: var(--space-xl);
  }
}
