/* ==========================================================================
   Single product page — one-page sections
   Product details, Specifications, Terms & Conditions and Reviews sit on one
   page. The sticky section nav scrolls to each one (see product-sections.js).
   Every content card has a maximum height with a "Show more" button.
   Loaded after devhub-single.css and devhub-single-mobile.css.
   ========================================================================== */

:root {
  /* Tallest a content card may be before it collapses behind "Show more". */
  --devhub-card-max: 520px;
}

@media (max-width: 767px) {
  :root {
    --devhub-card-max: 360px;
  }
}

/* ── Sticky section nav ───────────────────────────────────────────────────── */

/* style.css sets `html, body { overflow-x: hidden }`, which makes <body> a
   scroll container and stops `position: sticky` from working. On product
   pages clip sideways overflow instead: same look, no scroll container. */
body.single-product {
  overflow-x: clip;
  overflow-y: visible;
}

.devhub-single__tabs {
  /* Set by product-sections.js: bottom edge of the sticky site header. */
  --devhub-sticky-offset: 0px;
}

.devhub-single__tab-nav {
  position: sticky;
  top: var(--devhub-sticky-offset);
  z-index: 20;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  justify-content: safe center;
  gap: 6px;
  margin: 0 0 20px;
  padding: 10px 0;
  background: var(--devhub-white, #fff);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.devhub-single__tab-nav::-webkit-scrollbar {
  display: none;
}

/* The nav items are links now; keep the pill look of the old tab buttons. */
a.devhub-single__tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  white-space: nowrap;
  text-decoration: none;
}

a.devhub-single__tab-btn:visited {
  color: var(--devhub-mid);
}

a.devhub-single__tab-btn.devhub-single__tab-btn--active,
a.devhub-single__tab-btn.devhub-single__tab-btn--active:visited {
  color: var(--devhub-primary);
}

/* ── One card for every available section ─────────────────────────────────── */

.devhub-single__sections-card {
  background: var(--devhub-surface-elevated, #fff);
  border: 1px solid var(--devhub-border);
  border-radius: var(--devhub-radius-md);
  box-shadow: var(--devhub-shadow-card);
  padding: 2.4rem 2.8rem;
  min-width: 0;
}

.devhub-single__tab-panel {
  min-width: 0;
  /* Lands below the sticky header and nav when reached through a #link. */
  scroll-margin-top: calc(var(--devhub-sticky-offset, 0px) + 72px);
}

/* Sections are separated by a thin line inside the single card. */
.devhub-single__tab-panel + .devhub-single__tab-panel {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--devhub-border);
}

/* The inner content blocks no longer draw a card of their own. */
.devhub-single__sections-card .devhub-single__desc-card,
.devhub-single__sections-card .devhub-single__feature-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.devhub-single__sections-card .devhub-single__reviews-wrap {
  padding: 0;
}

/* ── Cards: maximum height + "Show more" ──────────────────────────────────── */

.devhub-single__feature-card {
  position: relative;
}

.devhub-single__feature-card.is-collapsed .devhub-single__features-content,
.devhub-single__feature-card.is-collapsed .devhub-single__details-images {
  max-height: var(--devhub-card-max);
  overflow-y: hidden !important;
}

/* Fade at the bottom edge of a collapsed card */
.devhub-single__feature-card.is-collapsed::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: 58px;
  height: 72px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff);
  pointer-events: none;
}

/* Button is only as wide as its text, centred under the card content. */
.devhub-showmore {
  display: block;
  width: fit-content;
  min-width: 140px;
  min-height: 44px;
  margin: 14px auto 0;
  padding: 10px 28px;
  border: 1px solid var(--devhub-primary);
  border-radius: 12px;
  background: #fff;
  color: var(--devhub-primary);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  outline: 0;
  -webkit-tap-highlight-color: transparent;
}

.devhub-showmore:hover,
.devhub-showmore:focus-visible {
  background: var(--devhub-primary-soft, #fff5f0);
}

.devhub-showmore[hidden] {
  display: none;
}

/* ── Phones ───────────────────────────────────────────────────────────────── */

@media (max-width: 767px) {
  .devhub-single__tab-nav {
    justify-content: flex-start;
    justify-content: safe center;
    margin-bottom: 12px;
    padding: 8px 2px;
  }

  /* No card around the sections on phones: no border, shadow or padding, so the
     content (tables, images, text) gets the full page width. */
  .devhub-single__sections-card {
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }

  .devhub-single__tab-panel + .devhub-single__tab-panel {
    margin-top: 20px;
    padding-top: 20px;
  }

  /* A smaller "Show more" button, in step with the compact text and bank cards
     of the tabs on a phone. The fade above it follows the button's height. */
  .devhub-showmore {
    min-width: 108px;
    min-height: 34px;
    margin-top: 12px;
    padding: 7px 20px;
    border-radius: 10px;
    font-size: 13px;
  }

  .devhub-single__feature-card.is-collapsed::after {
    bottom: 46px;
  }
}
