/* ──────────────────────────────────────────────────────────────
   Product Related Section — matches Figma 3660:12760
   Section bg uses the CURRENT product's theme-100.
   Each card uses its OWN target product's theme-100 bg and
   theme-700 button, so the row reads as a colorful palette.
   ────────────────────────────────────────────────────────────── */

.product-related {
  --ivory-100: #fefefd;
  /* Left inset equal to where inner content starts.
     Matches max-width:1920px + section padding:96px layout. */
  --pr-inset-left: max(96px, calc((100vw - 1728px) / 2 + 96px));
  display: block;
  width: 100%;
  color: var(--theme-900, #313745);
  padding: 96px 0;
  box-sizing: border-box;
  overflow-x: clip;
}

/* Section background = chosen theme-100 (matches Figma palettes) */
.product-related[data-theme="glacier"] { background: #e9edf6; --theme-700: #626e8b; --theme-900: #313745; }
.product-related[data-theme="moss"]    { background: #eef1f0; --theme-700: #737d79; --theme-900: #393e3c; }
.product-related[data-theme="shale"]   { background: #dddee2; --theme-700: #383c49; --theme-900: #1c1e24; }
.product-related[data-theme="dune"]    { background: #f8f6f3; --theme-700: #938b83; --theme-900: #494641; }
.product-related[data-theme="canyon"]  { background: #f7ece6; --theme-700: #8e6a58; --theme-900: #47352c; }
.product-related[data-theme="ivory"]   { background: #fefefd; --theme-700: #545a6d; --theme-900: #2a2d37; }

.product-related *,
.product-related *::before,
.product-related *::after { box-sizing: border-box; }

.product-related__inner {
  display: flex;
  flex-direction: column;
  gap: 96px;
}
.product-related__heading-wrap {
  max-width: 1920px;
  width: 100%;
  margin: 0 auto;
  padding: 0 96px;
}

/* ── Heading ────────────────────────────────────────────── */
.product-related__heading {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  text-align: center;
}
.product-related__eyebrow {
  font-family: 'Lexend Deca', sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 1.6px;
  /* Eyebrow is the only place we intentionally render in all caps — this
     matches the Figma spec for the section eyebrow on product-related.
     Button text everywhere else should be title case (see .haven-btn). */
  text-transform: uppercase;
  color: var(--theme-700);
  margin: 0;
}
.product-related__title {
  font-family: 'Conso Serif', Georgia, serif;
  font-weight: 400;
  font-size: 48px;
  line-height: 56px;
  color: var(--theme-900);
  max-width: 872px;
  margin: 0;
}

/* ── Card row ───────────────────────────────────────────── */
.product-related__row {
  width: 100%;
  display: flex;
  gap: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* `safe center` centers the cards when they all fit on one line,
     and falls back to start-alignment (respecting padding-left) when
     they overflow — preventing the first card from getting clipped. */
  justify-content: safe center;
  padding-left: var(--pr-inset-left);
  padding-right: var(--pr-inset-left);
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  scroll-padding-left: var(--pr-inset-left);
  scrollbar-width: thin;
}
.product-related__row::-webkit-scrollbar { height: 6px; }
.product-related__row::-webkit-scrollbar-thumb {
  background: var(--theme-700);
  border-radius: 3px;
  opacity: 0.4;
}
.product-related__row-spacer {
  flex: 0 0 var(--pr-inset-left);
}

.product-related__card {
  --card-bg: #e9edf6;
  --card-btn-bg: #626e8b;
  --card-btn-text: #e9edf6;
  --card-name: #313745;
  --card-subtitle: #626e8b;

  flex: 0 0 280px;
  max-width: 280px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  background: var(--card-bg);
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.product-related__card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

/* Per-card theme palettes (Figma tokens) */
.product-related__card[data-card-theme="glacier"] {
  --card-bg: #e9edf6; --card-btn-bg: #626e8b; --card-btn-text: #e9edf6;
  --card-name: #313745; --card-subtitle: #626e8b;
}
.product-related__card[data-card-theme="moss"] {
  --card-bg: #eef1f0; --card-btn-bg: #737d79; --card-btn-text: #eef1f0;
  --card-name: #393e3c; --card-subtitle: #737d79;
}
.product-related__card[data-card-theme="shale"] {
  --card-bg: #dddee2; --card-btn-bg: #383c49; --card-btn-text: #dddee2;
  --card-name: #1c1e24; --card-subtitle: #383c49;
}
.product-related__card[data-card-theme="dune"] {
  --card-bg: #f8f6f3; --card-btn-bg: #938b83; --card-btn-text: #f8f6f3;
  --card-name: #494641; --card-subtitle: #938b83;
}
.product-related__card[data-card-theme="canyon"] {
  --card-bg: #f7ece6; --card-btn-bg: #8e6a58; --card-btn-text: #f7ece6;
  --card-name: #47352c; --card-subtitle: #8e6a58;
}

.product-related__card-image {
  width: 100%;
  height: 280px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.04);
}
.product-related__card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-related__card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 8px;
  flex: 1 1 auto;
}
.product-related__card-name {
  font-family: 'Conso Serif', Georgia, serif;
  font-weight: 400;
  font-size: 34px;
  line-height: 40px;
  color: var(--card-name);
  margin: 0;
}
.product-related__card-subtitle {
  font-family: 'Lexend Deca', sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 24px;
  color: var(--card-subtitle);
  margin: 0;
}
.product-related__card-price {
  font-family: 'Conso Serif', Georgia, serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 28px;
  color: var(--card-name);
  margin: 4px 0 0 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.product-related__card-sub-price {
  font-family: 'Lexend Deca', sans-serif;
  font-weight: 300;
  font-size: 14px;
  line-height: 20px;
  color: var(--card-subtitle);
  white-space: nowrap;
}

.product-related__card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  padding: 8px 24px;
  border-radius: 8px;
  background: var(--card-btn-bg);
  color: var(--card-btn-text);
  font-family: 'Lexend Deca', sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 24px;
  letter-spacing: 1.4px;
  /* Title case per brand rule (see .haven-btn in design-system.css).
     Card uses themed bg/text from its own data-card-theme custom props. */
  text-transform: capitalize;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}
.product-related__card:hover .product-related__card-cta {
  filter: brightness(0.9);
}
.product-related__card:active .product-related__card-cta {
  filter: brightness(0.85);
  border-color: var(--card-btn-bg);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1200px) {
  .product-related {
    padding: 64px 0;
    --pr-inset-left: 64px;
  }
  .product-related__inner { gap: 64px; }
  .product-related__heading-wrap { padding: 0 64px; }
  .product-related__title { font-size: 40px; line-height: 48px; }
}

@media (max-width: 900px) {
  .product-related {
    padding: 48px 0;
    --pr-inset-left: 24px;
  }
  .product-related__inner { gap: 48px; }
  .product-related__heading-wrap { padding: 0 24px; }
  .product-related__title { font-size: 32px; line-height: 40px; }
  .product-related__card {
    flex: 0 0 260px;
    max-width: 260px;
  }
}
