.terms-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 3.3rem;
  align-items: stretch;
  padding-top: 2rem;
}

.terms-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-top: 0;
  padding-bottom: 5rem;
}

/* =========================================================
   HERO
========================================================= */

.terms-group .hero-title h2 {
  margin: 0;
  color: var(--sx-text);
  font-size: clamp(2rem, 3.5vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.terms-group .hero-title h3 {
  margin: 0;
  color: var(--sx-pink);
  font-size: clamp(1.2rem, 2.4vw, 2.5rem);
  font-weight: 400;
  line-height: 1.15;
}

.hero-title .divider-line {
  width: 50px;
  height: 5px;
  margin: 1rem 0;
  background: var(--sx-pink);
}

.terms-item__hero-text {
  overflow: hidden;
  margin-top: 1.5rem;
  padding: 2rem;
  background: var(--sx-card);
  border: 0;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.terms-item__hero-text p {
  margin: 0;
  color: var(--sx-muted);
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.7;
}

/* =========================================================
   SIDEBAR
========================================================= */

.terms-nav {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 2rem 0 25rem;
  overflow: hidden;
  box-sizing: border-box;
  background: var(--sx-card);
  border: 0;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.terms-nav a {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 1rem 2rem;
  box-sizing: border-box;
  color: var(--sx-text);
  font-size: clamp(0.9rem, 1vw, 1rem);
  font-weight: 300;
  line-height: 1.35;
  text-decoration: none;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.terms-nav a.terms-nav__head {
  font-weight: 700;
}

.terms-nav a:hover {
  color: var(--sx-text);
  background: #ececf0;
}

.terms-nav a.is-active {
  color: var(--sx-pink);
}

.terms-nav a:focus-visible {
  outline: 2px solid var(--sx-pink);
  outline-offset: -2px;
}

/* =========================================================
   AGB-GRUPPEN UND KARTEN
========================================================= */

.terms-group + .terms-group {
  margin-top: 3rem;
}

.terms-group__header {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.terms-group__header h2 {
  margin: 0;
  color: var(--sx-text);
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.terms-item {
  overflow: hidden;
  background: var(--sx-card);
  border: 0;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.terms-item:hover {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.13);
}

.terms-item__body {
  padding: 1.5rem;
  color: var(--sx-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.terms-item__body > :first-child {
  margin-top: 0;
}

.terms-item__body > :last-child {
  margin-bottom: 0;
}

.terms-item__body p,
.terms-item__body ul,
.terms-item__body ol,
.terms-item__body address {
  margin-top: 0;
  margin-bottom: 1rem;
}

.terms-item__body ul,
.terms-item__body ol {
  padding-left: 1.35rem;
}

.terms-item__body li + li {
  margin-top: 0.45rem;
}

.terms-item__body li::marker {
  color: var(--sx-pink);
}

.terms-item__body a {
  color: var(--sx-pink);
  text-underline-offset: 0.15em;
}

.terms-contact-card {
  padding: 1.25rem;
  background: var(--sx-background);
  border-left: 4px solid var(--sx-pink);
  border-radius: 6px;
  color: var(--sx-text);
  font-style: normal;
}

.terms-notice {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: #fff7fb;
  border-left: 4px solid var(--sx-pink);
  border-radius: 6px;
}

.terms-notice h3 {
  margin: 0 0 0.5rem;
  color: var(--sx-text);
  font-size: 1rem;
}

.terms-notice p {
  margin: 0;
}

.terms-page__updated {
  margin-top: 2rem !important;
  color: #6b7280;
  font-size: 0.82rem;
  font-weight: 700;
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 960px) {
  .terms-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .terms-nav {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: auto;
    padding: 1.5rem 0;
  }

  .terms-nav__head {
    grid-column: 1 / -1;
  }

  .terms-nav a {
    padding: 0.85rem 1.5rem;
  }

  .terms-content {
    margin-top: 0;
  }
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 640px) {
  .container {
    width: min(100% - 2rem, 930px);
  }

  .terms-layout {
    padding-top: 1rem;
  }

  .terms-nav {
    grid-template-columns: 1fr;
  }

  .terms-nav__head {
    grid-column: auto;
  }

  .terms-nav a {
    padding: 0.85rem 1.25rem;
  }

  .terms-group + .terms-group {
    margin-top: 2.5rem;
  }

  .terms-group__header {
    margin-bottom: 1rem;
  }

  .terms-group__header h2 {
    font-size: 1.4rem;
  }

  .terms-item__hero-text,
  .terms-item__body {
    padding: 1.25rem;
  }
}

/* =========================================================
   REDUZIERTE BEWEGUNG
========================================================= */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .terms-nav a,
  .terms-item {
    transition: none;
  }
}

/* =========================================================
   RESPONSIVE 
========================================================= */

.terms-section-page,
.terms-section-page *,
.terms-section-page *::before,
.terms-section-page *::after {
  box-sizing: border-box;
}

.terms-section-page {
  padding: 4rem 0 5rem;
  background: var(--sx-background, #f3f4f6);
}

.terms-section-page .terms-layout {
  width: min(100% - 3rem, 1280px);
  margin-inline: auto;
}

.terms-group {
  min-width: 0;
  scroll-margin-top: 6rem;
}

.terms-item__body,
.terms-contact-card,
.terms-notice {
  overflow-wrap: break-word;
  hyphens: auto;
}

@media (max-width: 960px) {

  .hero-title {
    margin-top: 1rem;
  }

  .terms-section-page {
    padding: 3rem 0 4rem;
  }

  .terms-section-page .terms-layout {
    width: min(100% - 2.5rem, 860px);
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding-top: 0;
  }

  .terms-nav {
    position: sticky;
    top: 4rem;
    z-index: 10;

    width: 100%;
    height: auto;
    padding: 0.75rem;

    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;

    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  .terms-nav__head,
  .terms-nav a {
    width: auto;
    min-width: max-content;
    min-height: 42px;
    padding: 0.65rem 1rem;

    display: inline-flex;
    justify-content: center;

    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
  }

  .terms-nav a:hover {
    background: #f3f4f6;
  }

  .terms-nav a.is-active {
    background: rgba(255, 0, 152, 0.08);
  }

  .terms-content {
    margin-top: 0;
  }
}

@media (max-width: 640px) {
  .terms-section-page {
    padding: 2rem 0 3rem;
  }

  .terms-section-page .terms-layout {
    width: min(100% - 2rem, 600px);
    gap: 2rem;
  }

  .terms-nav a {
    min-height: 40px;
    padding: 0.6rem 0.85rem;
  }

  .terms-group__header h2,
  .terms-group .hero-title h2,
  .terms-group .hero-title h3 {
    overflow-wrap: anywhere;
    hyphens: auto;
  }

  .terms-group__header h2 {
    font-size: clamp(1.25rem, 6vw, 1.4rem);
  }

  .terms-item__hero-text,
  .terms-item__body {
    padding: 1.25rem;
  }

  .terms-contact-card,
  .terms-notice {
    padding: 1rem;
  }
}

@media (max-width: 380px) {
  .terms-section-page .terms-layout {
    width: min(100% - 2.5rem, 360px);
  }

  .terms-item__hero-text,
  .terms-item__body {
    padding: 1rem;
  }

  .terms-group .hero-title h2 {
    font-size: 1.8rem;
  }

  .terms-group .hero-title h3 {
    font-size: 1.15rem;
  }
}