/**
 * FeatureCards — product features grid & pricing carousel
 * Load after tokens.css / cards.css
 */

/* ═══ Section (full-width band; content centered below) ═════ */
.tl-fc-section {
  width: 100%;
  padding: var(--spacing-10) 0;
  box-sizing: border-box;
}

@media (max-width: 767px) {
  .tl-fc-section {
    padding: var(--spacing-6) 0 var(--spacing-8);
  }
}

.tl-fc-section--white {
  background-color: var(--color-bg-surface);
}

.tl-fc-section--light-blue {
  background-color: #1890ff14;
}

.tl-fc-section--subtle {
  background-color: var(--color-bg-subtle);
}

.tl-fc-section--dark {
  background-color: var(--color-bg-section-dark);
}

/* ═══ Header ════════════════════════════════════════════════ */
.tl-fc-header {
  text-align: center;
  margin: 0 auto var(--spacing-8);
  padding: 0 var(--spacing-6);
  max-width: 56rem;
  width: 100%;
  box-sizing: border-box;
}

.tl-fc-title {
  font-family: var(--font-family-primary);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: var(--font-weight-bold);
  line-height: var(--font-line-height-tight);
  margin: 0 0 var(--spacing-2) 0;
}

.tl-fc-section--white .tl-fc-title,
.tl-fc-section--light-blue .tl-fc-title,
.tl-fc-section--subtle .tl-fc-title {
  color: var(--color-text-default);
}

.tl-fc-section--dark .tl-fc-title {
  color: var(--color-bg-surface);
}

.tl-fc-subtitle {
  font-family: var(--font-family-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--font-line-height-normal);
  margin: 0;
}

.tl-fc-section--white .tl-fc-subtitle,
.tl-fc-section--light-blue .tl-fc-subtitle,
.tl-fc-section--subtle .tl-fc-subtitle {
  color: var(--color-text-muted);
}

.tl-fc-section--dark .tl-fc-subtitle {
  color: var(--color-border-strong);
}

@media (max-width: 767px) {
  .tl-fc-header {
    margin-bottom: var(--spacing-5);
    padding-left: var(--spacing-4);
    padding-right: var(--spacing-4);
  }

  .tl-fc-title {
    font-size: clamp(1.25rem, 4.5vw, 1.5rem);
  }
}

/* ═══ Grid + carousel track — same row layout & card size ═══════════════════ */
.tl-fc-grid,
.tl-fc-carousel__track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: var(--spacing-4);
  max-width: 1400px;
  margin: 0 auto;
  box-sizing: border-box;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}

.tl-fc-grid {
  padding: 0 var(--spacing-8);
}

.tl-fc-carousel__track {
  padding: var(--spacing-3) 0;
  flex: unset;
  min-height: 0;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.tl-fc-carousel__track::-webkit-scrollbar {
  display: none;
}

/* Features row: horizontal scroll */
.tl-fc-grid .tl-fc-card {
  flex: 1 1 0;
  min-width: 200px;
  max-width: 100%;
  scroll-snap-align: start;
  box-sizing: border-box;
}

/* Pricing carousel: exactly 5 cards visible; extra cards scroll horizontally */
.tl-fc-carousel .tl-fc-card {
  flex: 0 0 calc((100% - 4 * var(--spacing-4)) / 5);
  min-width: 0;
  max-width: none;
  box-sizing: border-box;
  scroll-snap-align: start;
}

@media (max-width: 767px) {
  .tl-fc-grid,
  .tl-fc-carousel__track {
    padding-left: var(--spacing-4);
    padding-right: var(--spacing-4);
    gap: var(--spacing-3);
  }

  /* Features: one card per row, vertical stack (no horizontal scroll) */
  .tl-fc-grid {
    flex-direction: column;
    flex-wrap: nowrap;
    overflow-x: visible;
    overflow-y: visible;
    scroll-snap-type: none;
    touch-action: auto;
    overscroll-behavior-x: auto;
    -webkit-overflow-scrolling: auto;
  }

  /* Slightly narrower than pricing carousel cards — centered stack */
  .tl-fc-grid .tl-fc-card {
    flex: 0 0 auto;
    width: min(100%, calc(100vw - 4.5rem));
    max-width: 17.5rem;
    align-self: center;
    min-width: 0;
    scroll-snap-align: none;
  }

  .tl-fc-carousel__track {
    padding-top: var(--spacing-3);
    padding-bottom: var(--spacing-3);
    padding-left: 0;
    padding-right: 0;
  }

  /* Pricing carousel: one primary card width + peek of next */
  .tl-fc-carousel .tl-fc-card {
    flex: 0 0 min(100%, calc(100vw - 3.5rem));
    max-width: 20rem;
    scroll-snap-align: center;
  }

  .tl-fc-carousel__track {
    scroll-snap-type: x mandatory;
    padding-left: var(--spacing-4);
    padding-right: var(--spacing-4);
  }

  .tl-fc-carousel__track:focus-visible {
    outline: 2px solid var(--color-brand-primary);
    outline-offset: 2px;
    border-radius: var(--radius-md);
  }
}

/* ═══ Carousel (pricing) — track same width as grid; arrows overlay edges ═══ */
.tl-fc-carousel {
  position: relative;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--spacing-8);
  box-sizing: border-box;
}

.tl-fc-carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-pill);
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  color: var(--color-text-default);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.tl-fc-carousel__arrow--prev {
  left: var(--spacing-2);
}

.tl-fc-carousel__arrow--next {
  right: var(--spacing-2);
}

.tl-fc-carousel__arrow:hover {
  background-color: var(--color-bg-subtle);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.tl-fc-carousel__arrow:focus-visible {
  outline: 2px solid var(--color-brand-primary);
  outline-offset: 2px;
}

.tl-fc-section--dark .tl-fc-carousel__arrow {
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}

@media (max-width: 767px) {
  .tl-fc-carousel {
    padding: 0 var(--spacing-4);
  }

  .tl-fc-carousel__arrow {
    display: none;
  }
}

/* ═══ Card ══════════════════════════════════════════════════ */
.tl-fc-card {
  border-radius: var(--radius-xl);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  padding: var(--spacing-5) var(--spacing-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}

.tl-fc-grid .tl-fc-card,
.tl-fc-carousel .tl-fc-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
  .tl-fc-grid .tl-fc-card:hover,
  .tl-fc-carousel .tl-fc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tl-fc-grid .tl-fc-card,
  .tl-fc-carousel .tl-fc-card {
    transition: none;
  }

  .tl-fc-grid .tl-fc-card:hover,
  .tl-fc-carousel .tl-fc-card:hover {
    transform: none;
  }
}

.tl-fc-card--default {
  background-color: var(--color-bg-surface);
}

.tl-fc-card--white {
  background-color: var(--color-off-white);
}

.tl-fc-card--light-blue {
  background-color: #1890ff14;
}

.tl-fc-card--dark {
  background-color: var(--color-bg-section-dark);
}

.tl-fc-card__img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: var(--spacing-4);
}

.tl-fc-card__text {
  font-family: var(--font-family-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  line-height: var(--font-line-height-normal);
  margin: 0;
}

@media (max-width: 767px) {
  .tl-fc-card {
    padding: var(--spacing-4) var(--spacing-3);
  }

  .tl-fc-card__img {
    width: 96px;
    height: 96px;
    margin-bottom: var(--spacing-3);
  }

  .tl-fc-card__text {
    font-size: var(--font-size-xs);
    line-height: var(--font-line-height-relaxed);
  }
}

.tl-fc-card--default .tl-fc-card__text,
.tl-fc-card--white .tl-fc-card__text,
.tl-fc-card--light-blue .tl-fc-card__text {
  color: var(--color-text-default);
}

.tl-fc-card--dark .tl-fc-card__text {
  color: var(--color-border-strong);
}
