/*
  service-hub-v3 — Shine+ benefits (sparkle plate + benefit cards).
  Desktop: Figma 223:1231 · Mobile: Figma 229:1620
*/

.service-hub-v3 {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  /* Fallback while the sparkle plate loads */
  background-color: var(--color-bg);
  color: var(--color-text);
  border-block-end: 1px solid var(--color-border-subtle);
}

/* ---------- Decorative light sparkle plate ---------- */

.service-hub-v3__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Figma uses ~50% opacity on the plate */
.service-hub-v3__bg-img {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  opacity: 0.5;
}

/* ---------- Inner content band ---------- */

.service-hub-v3__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl); /* 32px */
  box-sizing: border-box;
  inline-size: 100%;
  max-inline-size: var(--header-frame-max);
  margin-inline: auto;
  padding-block: var(--service-hub-v3-pad-y-mobile); /* 56px */
  padding-inline: var(--space-md); /* 16px */
}

/* ---------- Header ---------- */

.service-hub-v3__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg); /* 24px — mobile heading stack */
  inline-size: 100%;
  max-inline-size: var(--service-hub-v3-header-max-mobile); /* 320px */
  text-align: center;
}

.service-hub-v3__title {
  margin: 0;
  inline-size: 100%;
  font-family: var(--font-heading);
  font-weight: var(--fw-black);
  font-size: var(--fs-service-hub-v3-title-mobile); /* 24px */
  line-height: var(--lh-service-hub-v3-title-mobile); /* 29px */
  letter-spacing: var(--ls-service-hub-v3);
  text-transform: uppercase;
  color: var(--color-text);
}

/* Desktop / mobile title variants (line breaks differ in Figma) */
.service-hub-v3__title-desktop {
  display: none;
}

.service-hub-v3__title-mobile {
  display: inline;
}

/* Red “+” accent on Shine+ — Figma 223:1235 */
.service-hub-v3__plus {
  color: var(--color-primary);
}

.service-hub-v3__intro {
  margin: 0;
  inline-size: 100%;
  font-family: var(--font-body-alt);
  font-weight: var(--fw-regular);
  font-size: var(--fs-service-hub-v3-intro-mobile); /* 14px */
  line-height: var(--lh-service-hub-v3-intro); /* 30px */
  letter-spacing: var(--ls-service-hub-v3);
  color: var(--color-text);
}

.service-hub-v3__intro--desktop {
  display: none;
}

.service-hub-v3__intro--mobile {
  display: block;
}

/* ---------- Carousel viewport / track ---------- */

.service-hub-v3__viewport {
  inline-size: 100%;
  overflow: hidden;
}

.service-hub-v3__track {
  --service-hub-v3-slide-w: var(--service-hub-v3-card-w-mobile); /* 289px */
  display: flex;
  gap: var(--service-hub-v3-cards-gap); /* 34px */
  margin: 0;
  /* Side padding so first/last slides can snap to center */
  padding-block: var(--space-xs); /* room for card shadow */
  padding-inline: max(0px, calc((100% - var(--service-hub-v3-slide-w)) / 2));
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.service-hub-v3__track::-webkit-scrollbar {
  display: none;
}

.service-hub-v3__slide {
  flex: 0 0 auto;
  inline-size: var(--service-hub-v3-slide-w);
  scroll-snap-align: center;
}

/* ---------- Benefit card ---------- */

.service-hub-v3__card {
  display: flex;
  flex-direction: column;
  align-items: center; /* Figma benefit cards — icon, title, body centered */
  gap: var(--service-hub-v3-card-gap-mobile); /* 25px */
  box-sizing: border-box;
  inline-size: 100%;
  min-block-size: var(--service-hub-v3-card-h-mobile); /* 344px */
  padding: var(--service-hub-v3-card-pad-mobile); /* 20px */
  border-radius: var(--radius-service-card);
  background-color: var(--color-bg);
  box-shadow: var(--shadow-service-hub-v3-card-mobile);
  color: var(--color-text);
  text-align: center;
}

/* Circular clip — Figma exports include a black square around the red badge */
.service-hub-v3__icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  inline-size: var(--service-hub-v3-icon-mobile); /* 51px */
  block-size: var(--service-hub-v3-icon-mobile);
  overflow: hidden;
  border-radius: var(--radius-pill);
  background-color: var(--color-service-hub-v3-icon);
}

.service-hub-v3__icon-img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.service-hub-v3__card-title {
  margin: 0;
  inline-size: 100%;
  max-inline-size: var(--local-shine-plus-card-title-max, 21.125rem);
  margin-inline: auto;
  font-family: var(--font-heading);
  font-weight: var(--fw-black);
  font-size: var(--fs-service-hub-v3-card-title); /* 24px */
  line-height: var(--lh-service-hub-v3-card-title); /* 29px */
  letter-spacing: var(--ls-service-hub-v3);
  text-transform: uppercase;
  color: var(--color-text);
}

.service-hub-v3__card-text {
  margin: 0;
  inline-size: 100%;
  max-inline-size: var(--local-shine-plus-card-text-max, 18.75rem);
  margin-inline: auto;
  font-family: var(--font-body-alt);
  font-weight: var(--fw-regular);
  font-size: var(--fs-service-hub-v3-card-body); /* 16px */
  line-height: var(--lh-service-hub-v3-card-body); /* 20px */
  letter-spacing: var(--ls-service-hub-v3);
  color: var(--color-text);
}

/* ---------- Dots (mobile pager) ---------- */

.service-hub-v3__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  /* Figma slider: 12px dots, centers 24px apart → 12px visual gap */
  gap: 0.75rem;
  min-block-size: 0.75rem; /* 12px */
}

.service-hub-v3__dot {
  box-sizing: border-box;
  inline-size: 0.75rem; /* 12px */
  block-size: 0.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: var(--color-text);
  cursor: pointer;
  transition: background-color var(--transition-base);
}

.service-hub-v3__dot.is-active {
  background-color: var(--color-primary);
}

.service-hub-v3__dot:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* ---------- CTA — red pill, white label ---------- */

.service-hub-v3__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm); /* 10px */
  box-sizing: border-box;
  padding-block: var(--service-hub-v3-cta-pad-y); /* 20px */
  padding-inline: var(--service-hub-v3-cta-pad-x); /* 40px */
  border-radius: var(--radius-pill);
  background-color: var(--color-primary);
  font-family: var(--font-heading);
  font-weight: var(--fw-medium);
  font-size: var(--fs-cta); /* 18px */
  line-height: var(--lh-nav); /* 23px */
  letter-spacing: var(--ls-cta);
  text-decoration: none;
  white-space: nowrap;
  color: var(--color-text-inverse);
  transition: opacity var(--transition-base);
}

.service-hub-v3__cta:hover {
  opacity: 0.92;
}

.service-hub-v3__cta:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

.service-hub-v3__cta-text--desktop {
  display: none;
}

.service-hub-v3__cta-text--mobile {
  display: inline;
}

.service-hub-v3__cta-icon {
  display: block;
  flex-shrink: 0;
  inline-size: 0.875rem; /* 14px — Figma icon */
  block-size: 0.875rem;
}

/* ---------- Desktop — Figma 223:1231 ---------- */
/* --bp-lg: 1024px */

@media (min-width: 1024px) {
  .service-hub-v3__inner {
    padding-block: var(--service-hub-v3-pad-y); /* 120px */
    padding-inline: var(--header-pad-x); /* clamps toward 220px */
  }

  .service-hub-v3__header {
    gap: var(--space-xl); /* 32px */
    max-inline-size: var(--service-hub-v3-header-max); /* 1499px */
  }

  .service-hub-v3__title {
    font-size: var(--fs-service-hub-v3-title); /* 54px */
    line-height: var(--lh-service-hub-v3-title); /* 54px */
    letter-spacing: 0;
  }

  .service-hub-v3__title-desktop {
    display: inline;
  }

  .service-hub-v3__title-mobile {
    display: none;
  }

  .service-hub-v3__intro--desktop {
    display: block;
    max-inline-size: var(--service-hub-v3-intro-max); /* 973px */
    font-size: var(--fs-service-hub-v3-intro); /* 18px */
  }

  .service-hub-v3__intro--mobile {
    display: none;
  }

  /* Desktop: four cards in a row; disable horizontal scroll */
  .service-hub-v3__viewport {
    overflow: visible;
  }

  .service-hub-v3__track {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: var(--service-hub-v3-cards-gap); /* 34px */
    overflow: visible;
    padding: var(--space-xs);
    scroll-snap-type: none;
  }

  .service-hub-v3__slide {
    flex: 1 1 0;
    inline-size: auto;
    max-inline-size: var(--service-hub-v3-card-w); /* 345px */
    min-inline-size: 14rem; /* keep cards readable if the row wraps */
    scroll-snap-align: none;
  }

  .service-hub-v3__card {
    align-items: center; /* Desktop: centered (Figma 223:1248) */
    /* Top-align the stack so every icon shares one Y. Centering the
       whole column made 2-line titles sit higher than 1-line neighbors
       (laptop widths like 1536×960). Leftover height falls below. */
    justify-content: flex-start;
    gap: var(--service-hub-v3-card-gap); /* 32px */
    min-block-size: var(--service-hub-v3-card-h); /* 520px */
    padding: var(--service-hub-v3-card-pad); /* 24px */
    padding-block-start: var(--service-hub-v3-card-pad-top); /* 108px */
    box-shadow: var(--shadow-service-hub-v3-card);
    text-align: center;
  }

  .service-hub-v3--hub .service-hub-v3__card {
    justify-content: center;
    padding: var(--service-hub-v3-card-pad); /* 24px — Figma 367:2763 */
  }

  .service-hub-v3__icon {
    inline-size: var(--service-hub-v3-icon); /* 105px */
    block-size: var(--service-hub-v3-icon);
  }

  .service-hub-v3__card-title {
    max-inline-size: 21.125rem; /* 338px — Figma title band */
    /* Reserve two lines so 1-line titles still line up with wrapped ones. */
    min-block-size: var(--service-hub-v3-card-title-min); /* 58px */
  }

  .service-hub-v3__card-text {
    max-inline-size: var(--service-hub-v3-card-text-max); /* 300px */
  }

  /* Dots are mobile-only — hide on desktop 4-up layout */
  .service-hub-v3__dots {
    display: none;
  }

  .service-hub-v3__cta-text--desktop {
    display: inline;
  }

  .service-hub-v3__cta-text--mobile {
    display: none;
  }
}
