/* Preisboxen block — Kaufen/Mieten switch + two function boxes joined by a "+".
   Figma PREISE 1267-23415. Exact desktop values; responsive below.
   Sits on the page background (no own bg), like .sun-fund. */
.sun-pricing { display: block; }
.sun-pricing__inner {
  box-sizing: border-box;
  width: min(1280px, 100% - 48px);
  margin-inline: auto;
  padding-block: 96px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ---- Mode switch ------------------------------------------------------- */
.sun-pricing__switch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.sun-pricing__toggle {
  box-sizing: border-box;
  margin: 0;
  padding: 4px;
  border: 0;
  display: flex;
  gap: 0;
  background: var(--sun-base);                   /* #ffffff */
  border-radius: 999px;
}

/* Visually hidden, still announced — the theme ships no global utility. */
.sun-pricing__legend {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* The radio stays in the a11y tree and keeps keyboard arrow-key behaviour;
   the label is what you see. */
.sun-pricing__radio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.sun-pricing__tab {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 32px;
  border-radius: 999px;
  font-family: var(--wp--preset--font-family--brand);
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  color: var(--sun-secondary);                   /* #132140 */
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease;
}
.sun-pricing__radio:checked + .sun-pricing__tab {
  background: var(--sun-primary);                /* #ff710a */
  color: var(--sun-base);
}
.sun-pricing__radio:focus-visible + .sun-pricing__tab {
  outline: 2px solid var(--sun-primary);
  outline-offset: 2px;
}

.sun-pricing__caption {
  margin: 0;
  text-align: center;
  font-family: var(--wp--preset--font-family--brand);
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  color: var(--sun-bluegrey);                    /* #4f5563 */
}

/* ---- Mode panels ------------------------------------------------------- */
/* Progressive enhancement, deliberately inverted: every mode is visible by
   default, and only a browser that understands :has() collapses it down to the
   selected one. Without :has() (or without CSS at all) the modes simply stack
   and stay readable — nothing disappears. */
@supports selector(:has(*)) {
  .sun-pricing:has(.sun-pricing__radio[value="0"]:checked) [data-mode="1"] { display: none; }
  .sun-pricing:has(.sun-pricing__radio[value="1"]:checked) [data-mode="0"] { display: none; }
}

/* ---- Box row ----------------------------------------------------------- */
/* 770 + 16 + 30 + 16 + 448 = 1280. The fr split reproduces the Figma widths
   exactly once the fixed "+" column and the two gaps are taken out. */
.sun-pricing__boxes {
  display: grid;
  grid-template-columns: minmax(0, 770fr) 30px minmax(0, 448fr);
  gap: 16px;
  align-items: stretch;
}
.sun-pricing__plus {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sun-secondary);
}
.sun-pricing .sun-pricing__plus-svg { display: block; width: 30px; height: 30px; }

/* ---- Box --------------------------------------------------------------- */
.sun-pricing__box {
  box-sizing: border-box;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px;
  border-radius: var(--sun-radius-card, 4px);
}
.sun-pricing__box--dark  { background: #0e1930; }
.sun-pricing__box--light { background: var(--sun-base); }

/* Top band — badge sits top-left, artwork hangs off the top-right.
   143px is the Figma band height; the artwork is drawn at natural size. */
.sun-pricing__box-top {
  position: relative;
  min-height: 143px;
}
.sun-pricing__art {
  position: absolute;
  top: 0;
  right: 0;
  line-height: 0;
}
.sun-pricing .sun-pricing__art-img {
  display: block;
  width: auto;
  height: 143px;
  max-width: 100%;
}

.sun-pricing__badge {
  position: relative;
  z-index: 1;
  margin: 1px 0 0;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 3.5px 8px 4.5px;
  border-radius: 4px;
  border: 1px solid var(--sun-primary);
  font-family: var(--wp--preset--font-family--brand);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
}
.sun-pricing__box--dark  .sun-pricing__badge { background: var(--sun-primary); color: var(--sun-base); }
.sun-pricing__box--light .sun-pricing__badge { background: #fff1e7; color: #733305; }

/* ---- Box body ---------------------------------------------------------- */
.sun-pricing__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sun-pricing__intro {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-block: 16px;
}
/* Orange rule under the intro — dark box only (Figma 1267-23425). */
.sun-pricing__box--dark .sun-pricing__intro { border-bottom: 1px solid var(--sun-primary); }

.sun-pricing__title {
  margin: 0;
  font-family: var(--wp--preset--font-family--brand);
  font-size: clamp(32px, 3.75vw, 48px);
  font-weight: 500;
  line-height: 1.1667;                           /* 56/48 */
  letter-spacing: -0.01em;
}
.sun-pricing__text {
  margin: 0;
  font-family: var(--wp--preset--font-family--brand);
  font-size: 18px;
  font-weight: 400;
  line-height: 24px;
}
.sun-pricing__box--dark  .sun-pricing__title { color: var(--sun-base); }
.sun-pricing__box--dark  .sun-pricing__text  { color: var(--sun-border); }   /* #efefef */
.sun-pricing__box--light .sun-pricing__title { color: var(--sun-secondary); }
.sun-pricing__box--light .sun-pricing__text  { color: var(--sun-bluegrey); }

/* Price — right-aligned block, amount over unit. */
.sun-pricing__price {
  margin: 0;
  padding-block: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  text-align: right;
}
.sun-pricing__amount {
  font-family: var(--wp--preset--font-family--brand);
  font-size: clamp(28px, 3.13vw, 40px);
  font-weight: 500;
  line-height: 1.2;                              /* 48/40 */
  letter-spacing: -0.005em;
  color: var(--sun-primary);
}
.sun-pricing__unit {
  font-family: var(--wp--preset--font-family--brand);
  font-size: 18px;
  font-weight: 500;
  line-height: 24px;
}
.sun-pricing__box--dark  .sun-pricing__unit { color: var(--sun-border); }
.sun-pricing__box--light .sun-pricing__unit { color: var(--sun-bluegrey); }

/* ---- Footnote ---------------------------------------------------------- */
.sun-pricing__note {
  margin: 0 auto;
  max-width: 560px;
  text-align: center;
  font-family: var(--wp--preset--font-family--brand);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: var(--sun-bluegrey);
}

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 900px) {
  .sun-pricing__inner { padding-block: 56px; }
  /* Stack the boxes; the "+" becomes the join between them. */
  .sun-pricing__boxes { grid-template-columns: minmax(0, 1fr); }
  .sun-pricing__plus { justify-self: center; }
  .sun-pricing__box-top { min-height: 112px; }
  .sun-pricing .sun-pricing__art-img { height: 112px; }
  .sun-pricing__title { font-size: 32px; }
}

@media (max-width: 480px) {
  .sun-pricing__tab { padding: 8px 20px; font-size: 15px; }
  .sun-pricing__box { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .sun-pricing__tab { transition: none; }
}
