/* Integrations / Your Stack section */

.integrations-section {
  position: relative;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(52px, 7vh, 96px) clamp(20px, 5vw, 32px);
  z-index: 1;
}

.integrations-section .section-intro { margin-bottom: clamp(28px, 4vh, 48px); }

/* ===== STACK DIAGRAM ===== */
.stack-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 1;
  min-height: 340px;
  max-width: 1080px;
  margin: 0 auto;
}

.stack-connections {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* ===== CENTER NODE ===== */
.shoplabs-node {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 132px; height: 132px;
  z-index: 5;
}
.shoplabs-node-inner {
  position: relative;
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgba(75, 42, 99, 0.18),
    0 0 0 8px rgba(75, 42, 99, 0.06),
    0 0 0 24px rgba(75, 42, 99, 0.03),
    0 24px 60px -16px rgba(75, 42, 99, 0.45),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.18);
  color: var(--cream);
  z-index: 2;
}

/* Pulsing rings */
.shoplabs-node::before,
.shoplabs-node::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 1px solid rgba(75, 42, 99, 0.2);
  pointer-events: none;
  animation: stack-ping 4s ease-out infinite;
  z-index: 1;
}
.shoplabs-node::after { animation-delay: 2s; }

@keyframes stack-ping {
  0%   { width: 100%; height: 100%; opacity: 0.6; }
  100% { width: 220%; height: 220%; opacity: 0; }
}

.shoplabs-node-logo {
  width: 80px;
  height: auto;
  display: block;
  filter: brightness(0) invert(1);
  opacity: 0.92;
}
.shoplabs-node-tag {
  margin-top: 6px;
  font-size: var(--fs-label-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(199, 166, 222, 0.85);
  font-weight: 600;
}

/* ===== CATEGORY CLUSTERS ===== */
.cluster { position: absolute; z-index: 3; }
.cluster.nw { top: 0; left: 0; }
.cluster.ne { top: 0; right: 0; }
.cluster.sw { bottom: 0; left: 0; }
.cluster.se { bottom: 0; right: 0; }

.cluster-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(250, 246, 253, 0.94) 100%);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid rgba(75, 42, 99, 0.1);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 16px 36px -12px rgba(75, 42, 99, 0.18),
    0 6px 16px -4px rgba(75, 42, 99, 0.08);
  width: 320px;
}
.cluster-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(75, 42, 99, 0.08);
}
.cluster-num {
  width: 22px; height: 22px;
  background: rgba(75, 42, 99, 0.08);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--fs-body-xs);
  color: var(--primary);
  font-weight: 500;
  flex-shrink: 0;
}
.cluster-label {
  font-size: var(--fs-label-md);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  line-height: 1.3;
}
.cluster-logos { display: flex; flex-wrap: wrap; gap: 6px; }

/* ===== LOGO TILES ===== */
.logo-tile {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(26, 26, 26, 0.06);
  border-radius: var(--radius-sm);
  font-size: var(--fs-ui-md);
  font-weight: 600;
  color: var(--charcoal);
  transition: all var(--duration-base) var(--ease-smooth);
  cursor: default;
  letter-spacing: -0.005em;
}
.logo-tile:hover {
  background: var(--white);
  border-color: rgba(26, 26, 26, 0.12);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(75, 42, 99, 0.08);
}
.logo-tile .logo-img {
  height: 18px;
  width: auto;
  display: block;
}

/* Icon-only logos (square) need a width cap so they don't stretch the tile */
.logo-tile.shopify .logo-img,
.logo-tile.salesforce .logo-img { height: 20px; }

/* ===== ENDPOINT DOTS ===== */
.endpoint-dot {
  position: absolute;
  width: 12px; height: 12px;
  background: var(--white);
  border: 2px solid var(--primary);
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(75, 42, 99, 0.2);
}
.endpoint-dot::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(75, 42, 99, 0.15);
  animation: endpoint-pulse 2.4s ease-out infinite;
}
@keyframes endpoint-pulse {
  0%   { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}
.endpoint-dot.nw { top: calc(50% - 1px); left: calc(25% - 1px); transform: translate(-50%, -50%); }
.endpoint-dot.ne { top: calc(50% - 1px); left: calc(75% + 1px); transform: translate(-50%, -50%); }
.endpoint-dot.sw { top: calc(50% + 1px); left: calc(25% - 1px); transform: translate(-50%, -50%); }
.endpoint-dot.se { top: calc(50% + 1px); left: calc(75% + 1px); transform: translate(-50%, -50%); }

/* ===== SVG CONNECTION LINES ===== */
.connection-line {
  fill: none;
  stroke: rgba(75, 42, 99, 0.25);
  stroke-width: 1.5;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: draw-connection 1600ms var(--ease-smooth) forwards;
}
.connection-line.delay-1 { animation-delay: 100ms; }
.connection-line.delay-2 { animation-delay: 250ms; }
.connection-line.delay-3 { animation-delay: 400ms; }
.connection-line.delay-4 { animation-delay: 550ms; }

@keyframes draw-connection {
  to { stroke-dashoffset: 0; }
}

.data-packet {
  fill: var(--accent);
  filter: drop-shadow(0 0 4px rgba(155, 207, 106, 0.7));
}

/* ===== CALLOUT BAR ===== */
.integration-callout {
  margin-top: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 32px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(75, 42, 99, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 6px 20px -8px rgba(75, 42, 99, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.callout-feature { display: flex; align-items: center; gap: 12px; }
.callout-icon {
  width: 36px; height: 36px;
  background: rgba(155, 207, 106, 0.15);
  border: 1px solid rgba(155, 207, 106, 0.3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4D8F2A;
  flex-shrink: 0;
}
.callout-icon svg { width: 16px; height: 16px; }
.callout-text { font-size: var(--fs-body-xs); line-height: 1.3; }
.callout-text strong { display: block; color: var(--charcoal); font-weight: 600; margin-bottom: 1px; }
.callout-text span { color: var(--charcoal-50); }
.callout-divider { width: 1px; height: 36px; background: rgba(75, 42, 99, 0.1); }

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
  .integrations-section { padding: 56px 20px; }
  .stack-stage { aspect-ratio: auto; display: flex; flex-direction: column; gap: 16px; max-width: 100%; }
  .stack-connections, .endpoint-dot { display: none; }
  .shoplabs-node { position: relative; top: auto; left: auto; transform: none; margin: 0 auto 8px; }
  .cluster { position: relative; top: auto; bottom: auto; left: auto; right: auto; width: 100%; }
  .cluster-card { width: 100%; }
  .integration-callout { flex-direction: column; align-items: stretch; gap: 14px; }
  .callout-divider { width: 100%; height: 1px; }
}
