/* Terms and Conditions page */
.terms {
  --terms-accent: #48001e;
  --terms-accent-soft: #f4e6ea;
  --terms-card: #fffdf8;
  --terms-line: #e6dfd0;
  --terms-muted: #6b6459;
  --terms-header: 78px;
  background: #f3efe4;
  color: #1a1a1a;
}

.terms__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 96px;
}

.terms__back {
  margin-bottom: 32px;
}

/* Hero */
.terms__hero {
  padding: 48px 56px;
  margin-bottom: 40px;
  border-radius: 24px;
  background: var(--terms-accent);
  color: #fff;
}

.terms__eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.terms__title {
  margin: 0 0 24px;
  font-family: Montserrat, sans-serif;
  font-size: 48px;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
  color: #fff;
}

.terms__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.terms__badge {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  font-weight: 700;
  color: var(--terms-accent);
}

/* Layout */
.terms__layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

/* Table of contents */
.terms__toc {
  position: sticky;
  top: calc(var(--terms-header) + 24px);
}

.terms__toc-box {
  padding: 20px;
  border: 1px solid var(--terms-line);
  border-radius: 16px;
  background: var(--terms-card);
}

.terms__toc-box summary {
  list-style: none;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terms-muted);
  cursor: default;
}

.terms__toc-box summary::-webkit-details-marker {
  display: none;
}

.terms__toc ol {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.terms__toc a {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.35;
  color: #1a1a1a;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.terms__toc a span {
  min-width: 18px;
  font-weight: 700;
  color: var(--terms-muted);
}

.terms__toc a:hover {
  background: #f8f1ec;
  color: var(--terms-accent);
}

.terms__toc a.is-active {
  background: var(--terms-accent-soft);
  font-weight: 600;
  color: var(--terms-accent);
}

.terms__toc a.is-active span {
  color: var(--terms-accent);
}

/* Content */
.terms__content {
  min-width: 0;
  max-width: 820px;
}

.terms__intro {
  padding: 32px 40px;
  margin-bottom: 24px;
  border-left: 4px solid var(--terms-accent);
  border-radius: 16px;
  background: var(--terms-card);
  font-size: 16px;
  line-height: 1.7;
}

.terms__intro p {
  margin: 0;
}

.terms__intro p + p {
  margin-top: 14px;
}

.terms__section {
  padding: 40px;
  margin-bottom: 24px;
  border: 1px solid var(--terms-line);
  border-radius: 16px;
  background: var(--terms-card);
  scroll-margin-top: calc(var(--terms-header) + 24px);
}

.terms__h2 {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--terms-line);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  text-transform: uppercase;
}

.terms__h2-num {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--terms-accent);
  font-size: 18px;
  color: #fff;
}

.terms__subtitle {
  display: flex;
  gap: 12px;
  margin: 32px 0 16px;
  font-size: 17px;
  font-weight: 700;
  color: var(--terms-accent);
  scroll-margin-top: calc(var(--terms-header) + 24px);
}

.terms__clause {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 18px;
  font-size: 15px;
  line-height: 1.7;
  scroll-margin-top: calc(var(--terms-header) + 24px);
}

.terms__clause p,
.terms__text {
  margin: 0;
}

.terms__clause strong {
  font-weight: 700;
  color: #000;
}

.terms__clause-num {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.85;
  color: var(--terms-accent);
}

.terms__clause--sub {
  margin-left: 24px;
}

.terms__clause--sub2 {
  margin-left: 48px;
  grid-template-columns: 76px minmax(0, 1fr);
}

.terms__text {
  margin-bottom: 18px;
  font-size: 15px;
  line-height: 1.7;
}

/* Commission table */
.terms__table-wrap {
  margin: 4px 0 24px 76px;
  overflow-x: auto;
  border: 1px solid var(--terms-line);
  border-radius: 12px;
}

.terms__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.terms__table th,
.terms__table td {
  padding: 14px 20px;
  text-align: left;
  white-space: nowrap;
}

.terms__table th {
  background: var(--terms-accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
}

.terms__table tbody tr:nth-child(even) {
  background: #f7f2e7;
}

.terms__table td strong {
  color: var(--terms-accent);
}

/* Back to top */
.terms__top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--terms-accent);
  font-size: 20px;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(72, 0, 30, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.terms__top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.terms__top:hover {
  color: #fff;
}

@media (max-width: 1024px) {
  .terms__layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .terms__toc {
    position: static;
  }

  .terms__toc-box summary {
    margin-bottom: 0;
    cursor: pointer;
  }

  .terms__toc-box summary::after {
    content: "+";
    float: right;
    font-size: 18px;
    line-height: 1;
  }

  .terms__toc-box[open] summary {
    margin-bottom: 12px;
  }

  .terms__toc-box[open] summary::after {
    content: "−";
  }

  .terms__toc ol {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
  }

  .terms__content {
    max-width: none;
  }
}

@media (max-width: 768px) {
  .terms {
    --terms-header: 64px;
  }

  .terms__container {
    padding: 24px 16px 72px;
  }

  .terms__back {
    margin-bottom: 20px;
  }

  .terms__hero {
    padding: 28px 22px;
    margin-bottom: 24px;
    border-radius: 18px;
  }

  .terms__title {
    margin-bottom: 18px;
    font-size: 28px;
  }

  .terms__toc ol {
    grid-template-columns: 1fr;
  }

  .terms__intro {
    padding: 22px 20px;
    font-size: 15px;
  }

  .terms__section {
    padding: 24px 18px;
    margin-bottom: 16px;
  }

  .terms__h2 {
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    font-size: 18px;
  }

  .terms__h2-num {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 15px;
  }

  .terms__clause,
  .terms__clause--sub2 {
    display: block;
    font-size: 14px;
  }

  .terms__clause-num {
    display: block;
    margin-bottom: 2px;
    font-size: 13px;
  }

  .terms__clause--sub {
    margin-left: 12px;
    padding-left: 12px;
    border-left: 2px solid var(--terms-line);
  }

  .terms__clause--sub2 {
    margin-left: 24px;
  }

  .terms__text {
    font-size: 14px;
  }

  .terms__table-wrap {
    margin-left: 0;
  }

  .terms__table th,
  .terms__table td {
    padding: 12px 14px;
    font-size: 13px;
    white-space: normal;
  }

  .terms__top {
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
  }
}
