/* Features Showcase - Stripe Inspired */
.features-showcase {
  position: relative;
  overflow: hidden;
  padding: 7rem 0 8rem;
  background: linear-gradient(180deg, #fff 0%, var(--background) 100%);
}

.features-showcase::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 138, 67, 0.12), transparent 55%),
              radial-gradient(circle at 80% 0%, rgba(99, 91, 255, 0.08), transparent 45%);
  pointer-events: none;
}

.features-showcase .container {
  position: relative;
  z-index: 1;
}

.features-header h2 {
  font-size: clamp(2rem, 3vw, 3.25rem);
  margin-bottom: 1.5rem;
}

.section-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(255, 138, 67, 0.12);
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
}

.features-shell {
  margin-top: 4rem;
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 3rem;
}

.feature-menu {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 120px;
}

.feature-chip {
  border: 1px solid rgba(10, 37, 64, 0.08);
  border-radius: var(--radius-lg);
  background: white;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text);
}

.feature-chip:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-md);
}

.feature-chip.active {
  border-color: transparent;
  background: radial-gradient(circle at top right, rgba(255, 91, 166, 0.15), transparent 60%) var(--white);
  box-shadow: 0 15px 40px rgb(255 138 67 / 0.18);
}

.feature-chip:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

.chip-icon {
  font-size: 1.75rem;
}

.chip-label {
  font-weight: 600;
  display: block;
  margin-bottom: 0.15rem;
}

.chip-meta {
  font-size: 0.9rem;
  color: var(--text-light);
}

.feature-stage {
  position: relative;
  min-height: 620px;
  height: var(--feature-stage-height, auto);
  border-radius: 32px;
  padding: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 30px 80px rgb(15 23 42 / 0.15);
  overflow: hidden;
}

.stage-glow,
.stage-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.stage-glow {
  background: radial-gradient(circle at 25% 20%, rgba(255, 138, 67, 0.25), transparent 40%),
              radial-gradient(circle at 80% 30%, rgba(99, 91, 255, 0.25), transparent 55%);
  filter: blur(40px);
  animation: glowPulse 12s ease-in-out infinite;
}

.stage-grid {
  background-image: linear-gradient(rgba(10, 37, 64, 0.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(10, 37, 64, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.35;
  mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
}

.feature-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 3rem;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease, visibility 0s linear 0.6s;
  padding: 2rem;
  pointer-events: none;
}

.feature-panel.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
  pointer-events: auto;
}

.panel-copy {
  position: relative;
  z-index: 2;
}

.panel-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.panel-copy h3 {
  font-size: clamp(1.75rem, 2vw, 2.5rem);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.panel-copy p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.panel-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0;
  margin: 0;
}

.panel-bullets li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 500;
}

.panel-bullets li::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: inline-block;
}

.panel-demo {
  position: relative;
  z-index: 2;
}

.floating-card {
  background: white;
  border-radius: 24px;
  padding: 2rem;
  border: 1px solid var(--gray-200);
  box-shadow: 0 30px 60px rgb(15 23 42 / 0.12);
  animation: float 8s ease-in-out infinite;
}

.floating-card:nth-child(1) { animation-delay: 0s; }
.floating-card:nth-child(2) { animation-delay: 1s; }

.floating-pill {
  margin-top: 1.5rem;
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.3rem;
  border-radius: var(--radius-full);
  background: rgba(255, 91, 166, 0.12);
  color: var(--secondary);
  font-weight: 600;
  animation: float 10s ease-in-out infinite;
}

/* Demo pieces */
.invoice-preview,
.chat-interface,
.calendar-view,
.patient-file,
.ai-visual,
.payment-verification {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.invoice-header,
.chat-header,
.calendar-header,
.file-header,
.verification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.badge-sat {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(99, 91, 255, 0.12);
  color: var(--accent);
  font-weight: 600;
}

.invoice-number {
  font-weight: 600;
  color: var(--text-light);
}

.invoice-details .detail-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  color: var(--text-light);
}

.detail-row.total span:last-child {
  font-size: 1.5rem;
  color: var(--text);
  font-weight: 700;
}

.invoice-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 600;
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.status-indicator.success {
  background: #16a34a;
}

.chat-interface {
  background: var(--gray-50);
  border-radius: 20px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.chat-header {
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.contact-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.message {
  max-width: 260px;
  border-radius: 16px;
  padding: 0.85rem;
  font-size: 0.95rem;
}

.message.sent {
  align-self: flex-end;
  background: var(--gradient-primary);
  color: white;
}

.message.received {
  background: white;
  border: 1px solid var(--gray-200);
}

.message.highlight {
  background: rgba(99, 91, 255, 0.12);
  border: 1px solid rgba(99, 91, 255, 0.3);
  color: var(--text);
}

.chat-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.chat-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(37, 211, 102, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-brand-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.chat-brand-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
}

.chat-template {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border: 1px dashed rgba(10, 37, 64, 0.1);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
}

.chat-template .template-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--primary);
  display: block;
}

.chat-template p {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
}

.chat-template button {
  border: none;
  background: var(--gray-900);
  color: white;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  cursor: pointer;
}

.calendar-view {
  background: var(--gray-50);
  border-radius: 18px;
  padding: 1.5rem;
}

.appointments-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.appointment-item {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem;
  border-radius: var(--radius);
  background: white;
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
}

.time-badge {
  font-weight: 700;
  color: var(--accent);
}

.patient-file {
  background: radial-gradient(circle at top right, rgba(255, 138, 67, 0.15), rgba(255, 255, 255, 0.95));
  padding: 1.75rem;
  border-radius: 22px;
}

.nom-badge {
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: rgba(255, 138, 67, 0.2);
  color: var(--primary);
  font-weight: 700;
}

.file-stats {
  display: flex;
  gap: 1.5rem;
  margin-top: 1.25rem;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text);
}

.patient-notes {
  margin-top: 1.5rem;
  display: grid;
  gap: 1rem;
}

.note-card {
  background: white;
  border-radius: 18px;
  padding: 1rem;
  border: 1px solid rgba(10, 37, 64, 0.08);
  box-shadow: var(--shadow-sm);
}

.note-card.secondary {
  background: rgba(255, 138, 67, 0.08);
  border-color: rgba(255, 138, 67, 0.25);
}

.note-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.note-card p {
  margin: 0 0 0.75rem 0;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
}

.note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.note-tags li {
  font-size: 0.8rem;
  background: var(--gray-100);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  color: var(--text);
  font-weight: 600;
}

.note-card.secondary .note-tags li {
  background: rgba(255, 255, 255, 0.6);
}

.ai-visual {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
}

.ai-visual img {
  width: 100%;
  display: block;
  border-radius: 24px;
  object-fit: cover;
}

.ai-overlay {
  position: absolute;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 1.5rem;
  background: rgba(10, 37, 64, 0.85);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  color: white;
  box-shadow: 0 20px 35px rgba(10, 37, 64, 0.45);
}

.ai-overlay-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.ai-overlay ul {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

.ai-accuracy-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.18);
  color: #22c55e;
  font-weight: 700;
  font-size: 0.8rem;
}

.payment-verification {
  background: var(--gray-50);
  border-radius: 20px;
  padding: 1.5rem;
}

.banxico-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.4rem 0;
  color: var(--text);
}

.banxico-logo {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(10, 37, 64, 0.08);
}

.banxico-title {
  font-weight: 700;
  display: block;
}

.banxico-sub {
  font-size: 0.85rem;
  color: var(--text-light);
}

.amount-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}

.payment-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-light);
  margin: 0.75rem 0;
}

.no-fees {
  font-weight: 600;
  color: var(--primary);
}

.banxico-cta {
  display: inline-flex;
  margin-top: 0.75rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(10, 37, 64, 0.1);
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
}

/* Animations */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.1); }
}

/* Responsive */
@media (max-width: 1200px) {
  .feature-stage {
    min-height: 640px;
  }
}

@media (max-width: 1024px) {
  .features-shell {
    grid-template-columns: 1fr;
  }

  .feature-menu {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .feature-chip {
    flex: 1 1 calc(50% - 0.75rem);
  }

  .feature-stage {
    padding: 2.5rem;
  }

  .feature-panel {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  .features-showcase {
    padding: 4.5rem 0 5rem;
  }

  .feature-menu {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
  }

  .feature-chip {
    flex: 0 0 250px;
  }

  .feature-stage {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    padding: 1rem 0 2.5rem;
    min-height: auto;
    height: auto;
    border: none;
    background: transparent;
    box-shadow: none;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .feature-stage::-webkit-scrollbar {
    display: none;
  }

  .feature-panel {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    min-width: 85%;
    opacity: 0.5;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    padding: 1.75rem;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 28px;
    box-shadow: 0 25px 50px rgb(15 23 42 / 0.18);
    scroll-snap-align: start;
    gap: 1.5rem;
  }

  .feature-panel.active {
    opacity: 1;
    box-shadow: 0 30px 60px rgb(15 23 42 / 0.2);
  }

  .panel-copy h3 {
    font-size: 1.75rem;
  }

  .panel-demo {
    order: -1;
  }

  .stage-glow,
  .stage-grid {
    display: none;
  }

  .floating-card {
    padding: 1.5rem;
  }
}
