/* ============================================================
   SERVICES
   ============================================================ */

.services {
  position: relative;
  padding-block: 64px;
  border-top: 1px solid var(--color-bg-3);
}

.services::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 600px 400px at 50% 100%,
    rgba(226, 75, 74, 0.03) 0%,
    transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.services__header {
  display: flex;
  flex-direction: column;
  margin-bottom: 36px;
  max-width: 640px;
  position: relative;
  z-index: 1;
}

.services__title {
  font-size: clamp(32px, 4.5vw, 56px);
  margin-bottom: 10px;
}

/* ── 3-column grid: all cards equal ── */
.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  position: relative;
  z-index: 1;
}

/* Badge fix */
.services .section-badge {
  display: inline-flex;
  width: auto;
  align-self: flex-start;
  padding: 9px 18px;
  font-size: 12px;
  margin-bottom: 16px;
}

/* Demo note below title */
.services__demo-note {
  font-size: 13px;
  color: #888780;
  margin: 0;
  max-width: 480px;
  line-height: 1.5;
}

/* ── Card shell ── */
.services__card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.07);
  background: #0A0A0A;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.3s ease,
              border-color 0.3s ease;
  cursor: default;
  height: 460px;
  display: flex;
  flex-direction: column;
}

.services__card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 24px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(226,75,74,0.15);
  border-color: rgba(226,75,74,0.2);
}

.services__card::before {
  display: none;
}

/* ── Card media — flex child, ocupa el espacio superior ── */
.services__card-media {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* Fade sutil al borde inferior del media */
.services__card-media::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: linear-gradient(to top, #0A0A0A, transparent);
  pointer-events: none;
  z-index: 1;
}

.services__card-media--web,
.services__card-media--auto,
.services__card-media--ai {
  background: #0A0A0A;
  padding: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

/* ── Card overlay — zona fija inferior, nunca se superpone ── */
.services__card-overlay {
  flex-shrink: 0;
  padding: 16px 20px 22px;
  background: #0A0A0A;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── Card content elements ── */
.services__card-icon {
  width: 36px;
  height: 36px;
  background: rgba(226,75,74,0.15);
  border: 1px solid rgba(226,75,74,0.25);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #E24B4A;
  margin-bottom: 4px;
}

.services__card-icon i,
.services__card-icon [data-lucide] {
  width: 18px;
  height: 18px;
  stroke-width: 1.5;
}

.services__card-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0;
}

.services__card-desc {
  font-size: 13px;
  line-height: 1.6;
  color: #888780;
  margin: 0;
}

/* ── Web Builder V3 — skeleton con texto real ── */
.wb3 {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.wb3__browser {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #0D0D0D;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
}

.wb3__bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  background: #161616;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  flex-shrink: 0;
  position: relative;
}

.wb3__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wb3__url-pill {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
  padding: 2px 10px;
  margin: 0 6px;
}

.wb3__url-text {
  font-size: 10px;
  color: #555;
  font-family: 'Courier New', monospace;
}

.wb3__bar-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, #E24B4A, #FF6B6A);
  width: 0%;
  transition: width 0.4s ease;
  border-radius: 0 999px 999px 0;
}

.wb3__canvas {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.wb3__status {
  font-size: 10px;
  font-family: 'Courier New', monospace;
  color: #E24B4A;
  padding: 4px 12px 8px;
  flex-shrink: 0;
  min-height: 22px;
}

/* WB3 skeleton blocks */
.wb3-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1A1A1A;
  border-radius: 4px;
  padding: 6px 10px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.wb3-nav.built { opacity: 1; transform: translateY(0); }
.wb3-nav__logo {
  font-size: 10px;
  font-weight: 700;
  color: #FFFFFF;
  font-family: 'Manrope', sans-serif;
}
.wb3-nav__links { display: flex; gap: 8px; }
.wb3-nav__link { font-size: 9px; color: #555; font-family: 'Manrope', sans-serif; }

.wb3-hero {
  background: linear-gradient(135deg, rgba(226,75,74,0.15) 0%, rgba(163,45,45,0.08) 100%);
  border-radius: 6px;
  padding: 12px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.wb3-hero.built { opacity: 1; transform: translateY(0); }
.wb3-hero__title {
  font-size: 13px;
  font-weight: 800;
  color: #FFFFFF;
  font-family: 'Manrope', sans-serif;
  margin-bottom: 4px;
  line-height: 1.2;
}
.wb3-hero__sub { font-size: 9px; color: #888780; font-family: 'Manrope', sans-serif; }
.wb3-hero__cta {
  display: inline-block;
  margin-top: 6px;
  background: #E24B4A;
  color: #FFFFFF;
  font-size: 8px;
  font-weight: 700;
  font-family: 'Manrope', sans-serif;
  padding: 3px 10px;
  border-radius: 999px;
}

.wb3-cards {
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.wb3-cards.built { opacity: 1; transform: translateY(0); }
.wb3-card {
  flex: 1;
  background: #1A1A1A;
  border-radius: 4px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.05);
}
.wb3-card__label { font-size: 8px; color: #555; font-family: 'Manrope', sans-serif; margin-bottom: 3px; }
.wb3-card__val   { font-size: 11px; font-weight: 700; color: #FFFFFF; font-family: 'Manrope', sans-serif; }

.wb3-footer {
  background: #111;
  border-radius: 4px;
  padding: 5px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.wb3-footer.built { opacity: 1; transform: translateY(0); }
.wb3-footer__text { font-size: 8px; color: #444; font-family: 'Manrope', sans-serif; }
.wb3-footer__link { font-size: 8px; color: #E24B4A; font-family: 'Manrope', sans-serif; }

/* ── Auto Loop V2 ── */
.auto-loop {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auto-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.auto-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #E24B4A;
  background: rgba(226,75,74,0.1);
  border: 1px solid rgba(226,75,74,0.2);
  padding: 2px 7px;
  border-radius: 999px;
}

.auto-type {
  font-size: 12px;
  font-weight: 700;
  color: #FFFFFF;
  font-family: 'Manrope', sans-serif;
  flex: 1;
}

.auto-tasks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow: hidden;
}

.auto-task {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #888780;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.35s ease, transform 0.35s ease, color 0.3s ease;
}

.auto-task.is-visible { opacity: 1; transform: translateX(0); }
.auto-task.is-done    { color: #D3D1C7; }

.auto-task__icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 9px;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.auto-task.is-done .auto-task__icon {
  background: rgba(107,203,119,0.15);
  border-color: rgba(107,203,119,0.4);
  color: #6BCB77;
}

.auto-task__text { flex: 1; }

.auto-task__check {
  font-size: 11px;
  color: #6BCB77;
  opacity: 0;
  transition: opacity 0.3s ease;
  flex-shrink: 0;
}

.auto-task.is-done .auto-task__check { opacity: 1; }

/* ── AI live badge ── */
.ai-live-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  color: #D3D1C7;
  letter-spacing: 0.04em;
}

.ai-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6BCB77;
  flex-shrink: 0;
  animation: live-pulse 1.5s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(107,203,119,0.4); }
  50%       { opacity: 0.7; box-shadow: 0 0 0 4px rgba(107,203,119,0); }
}

/* ── AI chat messages ── */
.ai-chat__messages {
  flex: 1;
  padding: 36px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow: hidden;
}

.ai-msg {
  font-size: 11px;
  padding: 7px 10px;
  border-radius: 10px;
  max-width: 82%;
  line-height: 1.4;
  opacity: 0;
  animation: msg-pop 0.3s ease forwards;
}

.ai-msg--user {
  background: rgba(226, 75, 74, 0.12);
  color: #D3D1C7;
  align-self: flex-end;
  border-bottom-right-radius: 3px;
}

.ai-msg--bot {
  background: rgba(255, 255, 255, 0.05);
  color: #FFFFFF;
  align-self: flex-start;
  border-bottom-left-radius: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-msg--bot::before {
  content: '◉';
  font-size: 8px;
  color: #E24B4A;
  flex-shrink: 0;
}

.ai-chat__typing {
  padding: 6px 12px 8px;
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

.ai-chat__typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #888780;
  animation: typing-bounce 1s ease infinite;
}

.ai-chat__typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-chat__typing span:nth-child(3) { animation-delay: 0.30s; }

@keyframes msg-pop {
  from { opacity: 0; transform: translateY(5px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes typing-bounce {
  0%, 100% { transform: translateY(0);    opacity: 0.4; }
  50%       { transform: translateY(-4px); opacity: 1; }
}

@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .services__grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-live-dot,
  .ai-chat__typing span { animation: none; opacity: 1; }
  .wb3-nav,
  .wb3-hero,
  .wb3-cards,
  .wb3-footer { transition: none; }
}
