/* Servicios Section Styles */
.servicios-title {
  font-size: clamp(30px, 4.4vw, 52px);
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.servicios-desc {
  font-size: 1.125rem;
  color: #9aa3c7;
  max-width: 560px;
  margin-bottom: 3rem;
}

/* Bento Grid */
.services-bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}

.col-span-2 {
  grid-column: span 2;
}
.col-span-4 {
  grid-column: span 4;
}
.col-span-6 {
  grid-column: span 6;
}

@media (max-width: 900px) {
  .col-span-2,
  .col-span-4 {
    grid-column: span 3;
  }
}

/* Base Card */
.service-card {
  background: linear-gradient(
    180deg,
    rgba(18, 25, 52, 0.85) 0%,
    rgba(10, 14, 30, 0.85) 100%
  );
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 28px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: left;
  transition:
    transform 0.4s ease,
    border-color 0.4s ease;
  outline: none;
  cursor: default;
}

.service-card.flex-row {
  flex-direction: row;
  align-items: center;
  gap: 24px;
}

.service-card.flex-row .service-content-left {
  flex: 1;
}

.service-card.flex-row .demo-box {
  flex: 1;
}

@media (max-width: 640px) {
  .services-bento {
    display: flex;
    flex-direction: column;
  }
  .service-card.flex-row {
    flex-direction: column;
  }
  .demo-divider.vertical {
    width: 100%;
    height: 1px;
    margin: 1rem 0;
    border-top: 1px dashed var(--border-color);
    border-left: none;
  }
}

/* Glow Effect */
.card-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 50%),
    rgba(91, 91, 240, 0.15),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
  z-index: 0;
}

.service-card:hover,
.service-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(91, 91, 240, 0.5);
}

.service-card:hover .card-glow,
.service-card:focus-visible .card-glow {
  opacity: 1;
}

/* Icon Box */
.service-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(91, 91, 240, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
  transition: all 0.4s cubic-bezier(0.5, 0, 0.15, 1);
}

.service-card:hover .service-icon-box,
.service-card:focus-visible .service-icon-box {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  transform: scale(1.1) rotate(-8deg);
}

.service-icon-box svg {
  transition: transform 0.4s cubic-bezier(0.5, 0, 0.15, 1);
}

/* .service-card:hover .service-icon-box svg,
.service-card:focus-visible .service-icon-box svg {
  transform: scale(1.08) rotate(6deg);
} */

/* Typography inside card */
.service-title {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
  position: relative;
  z-index: 1;
}

.service-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

/* Mini Demos Common */
.demo-divider {
  border-top: 1px dashed var(--border-color);
  margin: auto -28px 1.5rem -28px;
  position: relative;
  z-index: 1;
}

.demo-divider.vertical {
  border-top: none;
  border-left: 1px dashed var(--border-color);
  margin: -28px 0;
  height: calc(100% + 56px);
  width: 1px;
}

.demo-box {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 80px;
}

/* 1. Sistemas: Barras llenándose */
.demo-sistemas {
  gap: 10px;
}
.demo-bar-wrap {
  align-items: center;
}
.demo-bar-label {
  font-size: 0.75rem;
  color: #9aa3c7;
  width: 65px;
}
.demo-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
}
.demo-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  width: var(--w);
}
.service-card:hover .demo-fill {
  animation: fill-bar 1.2s cubic-bezier(0.5, 0, 0.15, 1) forwards;
  animation-delay: var(--d);
  width: 0;
}
@keyframes fill-bar {
  to {
    width: var(--w);
  }
}

@media (min-width: 900px) {
  .demo-sistemas {
    flex-direction: row;
  }

  .demo-bar-wrap {
    display: grid;
    width: 33%;
  }
}

/* 2. CRM: Línea y Punto */
.demo-crm {
  gap: 12px;
}
.crm-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #9aa3c7;
  font-weight: 600;
}
.crm-line {
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  position: relative;
}
.crm-dot {
  position: absolute;
  top: 50%;
  left: 100%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--success);
}
.service-card:hover .crm-dot {
  animation: move-dot 1.6s ease-in-out forwards;
}
@keyframes move-dot {
  0% {
    left: 0%;
  }
  100% {
    left: 100%;
  }
}

/* 3. Automatización: Secuencia */
.demo-auto {
  flex-direction: row !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.auto-tag {
  background: rgba(46, 230, 166, 0.1);
  border: 1px solid rgba(46, 230, 166, 0.3);
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
}
.auto-arrow {
  color: #9aa3c7;
}

.service-card:hover .auto-tag {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-color);
  color: var(--text-muted);
  animation: auto-glow 1.5s forwards;
  animation-delay: var(--d);
}
@keyframes auto-glow {
  50% {
    background: rgba(46, 230, 166, 0.1);
    border-color: rgba(46, 230, 166, 0.3);
    color: var(--success);
  }
  100% {
    background: rgba(46, 230, 166, 0.1);
    border-color: rgba(46, 230, 166, 0.3);
    color: var(--success);
  }
}

/* 4. Web: Barra de Carga */
.demo-web {
  align-items: center;
  gap: 8px;
}
.web-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}
.web-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}
.web-text {
  font-size: 0.75rem;
  color: #9aa3c7;
}
.service-card:hover .web-fill {
  animation: fill-bar 0.8s ease-out forwards;
  width: 0;
  --w: 100%;
}

/* 5. Pago: Píldora de Éxito */
.demo-pago {
  align-items: center;
}
.pago-pill {
  background: rgba(46, 230, 166, 0.15);
  border: 1px solid rgba(46, 230, 166, 0.4);
  color: var(--success);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(46, 230, 166, 0.1);
  transform: scale(1);
}
.service-card:hover .pago-pill {
  animation: bounce-in 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes bounce-in {
  0% {
    transform: scale(0.7);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* 6. Soporte: Latido */
.demo-soporte {
  flex-direction: row !important;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.soporte-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--success);
  font-weight: 700;
  font-size: 0.95rem;
}
.soporte-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
}
.soporte-heartbeat {
  width: 68%;
  color: var(--success);
}
.heartbeat-line {
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
}
.service-card:hover .heartbeat-line {
  animation: heartbeat-anim 1.5s linear infinite;
}
@keyframes heartbeat-anim {
  0% {
    stroke-dashoffset: 100;
  }
  100% {
    stroke-dashoffset: -100;
  }
}

/* Footer */
.services-footer .text-cyan {
  font-weight: 600;
  text-decoration: none;
}
.services-footer .text-cyan:hover {
  text-decoration: underline;
}
