html.kingdom-checkout-terms-open,
html.kingdom-checkout-terms-open body {
  overflow: hidden;
  overscroll-behavior: none;
}

html.kingdom-checkout-terms-open #site-header {
  z-index: 40;
  pointer-events: none;
}

#dialog-checkout-terms {
  z-index: 125;
}

/* —— Modal de termos no checkout: mobile = bottom sheet | desktop = caixa centralizada —— */
#dialog-checkout-terms[data-state='open'] {
  display: flex !important;
  flex-direction: column;
  touch-action: manipulation;
}

.kingdom-checkout-terms-dialog-panel.dialog-panel {
  width: 100%;
  max-width: 100%;
}

.kingdom-checkout-terms-dialog-panel .dialog-panel__body {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.kingdom-checkout-terms-dialog-panel .dialog-panel__header {
  padding-top: max(0.85rem, env(safe-area-inset-top, 0px));
}

.kingdom-checkout-terms-dialog {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(62dvh, 520px);
}

@media (max-width: 639px) {
  #dialog-checkout-terms[data-state='open'] {
    justify-content: flex-end;
    background: rgba(0, 0, 0, 0.72);
    padding: 0 !important;
  }

  #dialog-checkout-terms .kingdom-checkout-terms-dialog-panel.dialog-panel {
    max-height: min(96dvh, calc(100dvh - env(safe-area-inset-top, 0px))) !important;
    height: min(96dvh, calc(100dvh - env(safe-area-inset-top, 0px)));
    margin-top: auto;
    border-radius: 1.15rem 1.15rem 0 0;
    border-bottom: 0;
    box-shadow: 0 -18px 48px rgba(0, 0, 0, 0.55);
  }

  #dialog-checkout-terms .kingdom-checkout-terms-dialog-panel .dialog-panel__header h2 {
    font-size: 1.05rem;
    line-height: 1.35;
  }

  .kingdom-checkout-terms-dialog {
    max-height: none;
    height: 100%;
  }
}

@media (min-width: 640px) {
  #dialog-checkout-terms[data-state='open'] {
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.58) !important;
    padding: max(1rem, env(safe-area-inset-top, 0px)) 1.25rem max(1rem, env(safe-area-inset-bottom, 0px)) !important;
  }

  #dialog-checkout-terms .kingdom-checkout-terms-dialog-panel.dialog-panel {
    width: min(52rem, calc(100vw - 2rem)) !important;
    max-width: 52rem !important;
    max-height: min(90dvh, 860px) !important;
    height: auto !important;
    margin: 0 !important;
    flex: 0 1 auto;
    border-radius: 1rem;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  }

  #dialog-checkout-terms .kingdom-checkout-terms-dialog-panel .dialog-panel__header h2 {
    font-size: 1.2rem;
    line-height: 1.35;
  }

  #dialog-checkout-terms .kingdom-checkout-terms-dialog-panel .dialog-panel__body {
    overflow: hidden;
  }

  .kingdom-checkout-terms-dialog {
    height: auto;
    max-height: min(80dvh, 740px);
  }

  .kingdom-checkout-terms-dialog__scroll {
    max-height: min(62dvh, 560px);
  }

  .kingdom-checkout-terms-dialog__scroll .kingdom-legal-content {
    font-size: 0.98rem;
    line-height: 1.72;
  }

  .kingdom-checkout-terms-dialog__scroll .kingdom-legal-content h2 {
    font-size: 1.1rem;
  }

  .kingdom-checkout-terms-dialog__scroll .kingdom-legal-content h3 {
    font-size: 1rem;
  }

  .kingdom-checkout-terms-dialog__alert {
    font-size: 0.95rem;
  }

  .kingdom-checkout-terms-dialog__confirm {
    font-size: 0.95rem;
  }
}

@media (min-width: 1024px) {
  #dialog-checkout-terms .kingdom-checkout-terms-dialog-panel.dialog-panel {
    width: min(56rem, calc(100vw - 2.5rem)) !important;
    max-width: 56rem !important;
    max-height: min(92dvh, 920px) !important;
  }

  .kingdom-checkout-terms-dialog {
    max-height: min(84dvh, 800px);
  }

  .kingdom-checkout-terms-dialog__scroll {
    max-height: min(66dvh, 620px);
    padding: 1.1rem 1.35rem 1.65rem;
  }

  .kingdom-checkout-terms-dialog__scroll .kingdom-legal-content {
    font-size: 1.02rem;
    line-height: 1.74;
  }

  .kingdom-checkout-terms-dialog__scroll .kingdom-legal-content h2 {
    font-size: 1.16rem;
    margin: 1.1rem 0 0.55rem;
  }

  .kingdom-checkout-terms-dialog__scroll .kingdom-legal-content h3 {
    font-size: 1.05rem;
  }

  .kingdom-checkout-terms-dialog__footer {
    padding: 1rem 1.35rem 1.25rem;
  }

  .kingdom-checkout-terms-dialog__confirm {
    font-size: 1rem;
  }

  .kingdom-checkout-terms-dialog__btn {
    min-height: 3rem;
    font-size: 0.98rem;
  }
}
.kingdom-checkout-terms-dialog__sheet-handle {
  display: none;
}

@media (max-width: 639px) {
  .kingdom-checkout-terms-dialog__sheet-handle {
    display: block;
    flex-shrink: 0;
    width: 2.75rem;
    height: 0.28rem;
    margin: 0.55rem auto 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
  }
}

.kingdom-checkout-terms-dialog__alert {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  flex-shrink: 0;
  margin: 0;
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid rgba(251, 191, 36, 0.18);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(251, 191, 36, 0.03));
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.86rem;
  line-height: 1.55;
}

.kingdom-checkout-terms-dialog__alert p {
  margin: 0;
}

.kingdom-checkout-terms-dialog__alert-short {
  display: inline;
}

.kingdom-checkout-terms-dialog__alert-full {
  display: none;
}

@media (min-width: 640px) {
  .kingdom-checkout-terms-dialog__alert-short {
    display: none;
  }

  .kingdom-checkout-terms-dialog__alert-full {
    display: inline;
  }
}

.kingdom-checkout-terms-dialog__progress-track {
  flex-shrink: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.kingdom-checkout-terms-dialog__progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, hsl(var(--primary) / 0.65), hsl(var(--primary)));
  transition: width 0.12s ease-out;
}

.kingdom-checkout-terms-dialog__alert-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
  color: #fbbf24;
}

.kingdom-checkout-terms-dialog__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem 1.15rem 1.25rem;
  -webkit-overflow-scrolling: touch;
  scroll-padding-bottom: 1.5rem;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.kingdom-checkout-terms-dialog__scroll::-webkit-scrollbar {
  width: 5px;
}

.kingdom-checkout-terms-dialog__scroll::-webkit-scrollbar-track {
  background: transparent;
}

.kingdom-checkout-terms-dialog__scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.kingdom-checkout-terms-dialog__scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

.kingdom-checkout-terms-dialog-panel .dialog-panel__body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.kingdom-checkout-terms-dialog-panel .dialog-panel__body {
  scrollbar-width: none;
}

@media (max-width: 639px) {
  .kingdom-checkout-terms-dialog__scroll {
    flex: 1 1 auto;
    min-height: 10rem;
    padding: 0.9rem 1rem 1.5rem;
  }

  .kingdom-checkout-terms-dialog__doc {
    font-size: 0.92rem;
    line-height: 1.68;
  }

  .kingdom-checkout-terms-dialog__doc h3 {
    font-size: 1.05rem;
  }

  .kingdom-checkout-terms-dialog__doc h4 {
    font-size: 0.98rem;
  }
}

.kingdom-checkout-terms-dialog__scroll .kingdom-legal-content {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
  line-height: 1.66;
}

.kingdom-checkout-terms-dialog__scroll .kingdom-legal-content h2 {
  margin: 1rem 0 0.5rem;
  color: #fff;
  font-size: 1.02rem;
  font-weight: 700;
}

.kingdom-checkout-terms-dialog__scroll .kingdom-legal-content h2:first-child,
.kingdom-checkout-terms-dialog__scroll .kingdom-legal-intro + .kingdom-legal-section h2 {
  margin-top: 0;
}

.kingdom-checkout-terms-dialog__scroll .kingdom-legal-content h3 {
  margin: 0.75rem 0 0.35rem;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.88rem;
  font-weight: 700;
}

.kingdom-checkout-terms-dialog__scroll .kingdom-legal-section {
  margin-bottom: 0.65rem;
}

.kingdom-checkout-terms-dialog__scroll .kingdom-legal-page__related--inline {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.62);
}

.kingdom-checkout-terms-dialog__doc-end {
  margin: 0.75rem 0 0;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.kingdom-checkout-terms-dialog__doc {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.86rem;
  line-height: 1.62;
}

.kingdom-checkout-terms-dialog__doc h3 {
  margin: 0 0 0.65rem;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}

.kingdom-checkout-terms-dialog__doc h4 {
  margin: 1rem 0 0.45rem;
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.92rem;
  font-weight: 700;
}

.kingdom-checkout-terms-dialog__doc p {
  margin: 0 0 0.65rem;
}

.kingdom-checkout-terms-dialog__doc ul {
  margin: 0 0 0.75rem;
  padding-left: 1.1rem;
}

.kingdom-checkout-terms-dialog__doc li + li {
  margin-top: 0.4rem;
}

.kingdom-checkout-terms-dialog__doc a {
  color: hsl(var(--primary));
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.kingdom-checkout-terms-dialog__steam-block {
  margin: 0.5rem 0 0.75rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(var(--platform-steam-rgb), 0.28);
  border-radius: 0.85rem;
  background: rgba(var(--platform-steam-rgb), 0.08);
}

.kingdom-checkout-terms-dialog__doc-end {
  margin-top: 1rem !important;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.62);
}

.kingdom-checkout-terms-dialog__footer {
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(13, 15, 20, 0.97), rgba(8, 10, 14, 1));
  box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.38);
  padding-bottom: max(0.65rem, env(safe-area-inset-bottom, 0px));
}

.kingdom-checkout-terms-dialog__scroll-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-shrink: 0;
  margin: 0;
  padding: 0.65rem 1rem 0.45rem;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.kingdom-checkout-terms-dialog__scroll-hint-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  animation: kingdom-terms-scroll-bounce 1.35s ease-in-out infinite;
}

.kingdom-checkout-terms-dialog__scroll-hint-pct {
  display: none;
  min-width: 2.4rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 639px) {
  .kingdom-checkout-terms-dialog__scroll-hint-pct {
    display: inline-block;
  }

  .kingdom-checkout-terms-dialog__scroll-hint-text {
    flex: 1;
    text-align: left;
  }
}

.kingdom-checkout-terms-dialog__scroll-hint--done .kingdom-checkout-terms-dialog__scroll-hint-icon {
  animation: none;
}

.kingdom-checkout-terms-dialog__scroll-hint--done {
  color: #86efac;
}

.kingdom-checkout-terms-dialog__scroll-hint--done .kingdom-checkout-terms-dialog__scroll-hint-pct {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}

@keyframes kingdom-terms-scroll-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(3px);
  }
}

.kingdom-checkout-terms-dialog__confirm {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex-shrink: 0;
  margin: 0;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 639px) {
  .kingdom-checkout-terms-dialog__confirm {
    min-height: 3.25rem;
    padding: 0.85rem 1rem;
    font-size: 0.92rem;
    border-radius: 0.75rem;
    margin: 0 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
  }

  .kingdom-checkout-terms-dialog__confirm:has(input:not(:disabled)) {
    border-color: hsl(var(--primary) / 0.35);
    background: hsl(var(--primary) / 0.08);
  }
}

.kingdom-checkout-terms-dialog__confirm:has(input:disabled) {
  opacity: 0.55;
  cursor: not-allowed;
}

.kingdom-checkout-terms-dialog__checkbox {
  margin-top: 0.2rem;
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  accent-color: hsl(var(--primary));
}

@media (max-width: 639px) {
  .kingdom-checkout-terms-dialog__checkbox {
    width: 1.35rem;
    height: 1.35rem;
    margin-top: 0.05rem;
  }
}

.kingdom-checkout-terms-dialog__checkbox:disabled {
  cursor: not-allowed;
}

.kingdom-checkout-terms-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-shrink: 0;
  padding: 0.35rem 1rem 0.85rem;
}

@media (max-width: 639px) {
  .kingdom-checkout-terms-dialog__actions {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem 0.75rem;
  }
}

.kingdom-checkout-terms-dialog__btn {
  min-height: 2.75rem;
  padding: 0.6rem 1.15rem;
  border-radius: 0.8rem;
  font-size: 0.92rem;
  font-weight: 700;
  transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease, transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 639px) {
  .kingdom-checkout-terms-dialog__btn {
    width: 100%;
    min-height: 3.15rem;
    font-size: 1rem;
    border-radius: 0.9rem;
  }

  .kingdom-checkout-terms-dialog__btn:active:not(:disabled) {
    transform: scale(0.99);
  }
}

.kingdom-checkout-terms-dialog__btn--ghost {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
}

.kingdom-checkout-terms-dialog__btn--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}

.kingdom-checkout-terms-dialog__btn--primary {
  border: 1px solid hsl(var(--primary) / 0.45);
  background: hsl(var(--primary) / 0.22);
  color: #fff;
}

.kingdom-checkout-terms-dialog__btn--primary:hover:not(:disabled) {
  background: hsl(var(--primary) / 0.34);
}

.kingdom-checkout-terms-dialog__btn--primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.kingdom-legal-page__back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.kingdom-legal-page__back:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.kingdom-legal-page__back i,
.kingdom-legal-page__back svg {
  width: 1rem;
  height: 1rem;
}

.kingdom-category-steam-terms-note {
  margin-top: 1rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 0.95rem;
  background: rgba(251, 191, 36, 0.05);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.86rem;
  line-height: 1.55;
  text-align: left;
}

.kingdom-category-steam-terms-note strong {
  color: #fff;
}

.kingdom-category-steam-terms-note a {
  color: hsl(var(--primary));
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.14em;
}
