/* Gift card terms modal, opened from the buy-section terms link.
   Phone: bottom sheet. Desktop (the lander's 1100px switch): centred box.
   The terms list matches the panel at the bottom of the page. */

dialog.gctm {
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  max-width: none;
  height: auto;
  max-height: 90vh;
  max-height: 90dvh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 24px 24px 0 0;
  background: var(--c-surface);
  color: var(--c-ink);
  font-family: var(--font-sans);
  box-shadow: 0 -18px 50px -12px rgba(27, 27, 28, 0.4);
  overflow: hidden;
  box-sizing: border-box;
}

dialog.gctm[open] {
  display: flex;
  flex-direction: column;
  animation: gctmSheetIn 0.26s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

dialog.gctm::backdrop {
  background: rgba(27, 27, 28, 0.55);
  animation: gctmScrimIn 0.2s ease both;
}

html.gc-terms-open {
  overflow: hidden;
}

.gctm__scroll {
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  padding: 0 0 calc(22px + env(safe-area-inset-bottom));
}

.gctm__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--c-surface);
  margin: 0 0 var(--sp-2);
  padding: var(--sp-4) var(--sp-6) var(--sp-1);
}

.gctm__title {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 26px;
  font-weight: 600;
  color: var(--c-ink);
}

.gctm__close {
  width: 44px;
  height: 44px;
  border-radius: var(--c-r-full);
  border: 1px solid var(--c-line);
  background: var(--c-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--c-ink-soft);
  padding: 0;
  flex: 0 0 auto;
}

.gctm__close:active {
  background: var(--c-accent-wash);
  color: var(--c-ink);
}

.gctm__close:focus-visible {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-tint);
  outline: none;
  color: var(--c-ink);
}

.gctm__list {
  margin: 0;
  padding: var(--sp-1) var(--sp-6) var(--sp-6) 46px;
  list-style: decimal;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 15px;
  line-height: 24px;
  color: var(--c-ink-2);
}

.gctm__list > li {
  display: list-item;
}

@media (hover: hover) and (pointer: fine) {
  .gctm__close:hover {
    background: var(--c-accent-wash);
    color: var(--c-ink);
  }
}

@media (min-width: 1100px) {
  dialog.gctm {
    inset: 0;
    width: 560px;
    max-width: calc(100% - var(--sp-12));
    height: fit-content;
    margin: auto;
    border-radius: var(--c-r-card);
    box-shadow: 0 30px 70px -22px rgba(27, 27, 28, 0.42),
      0 8px 24px -10px rgba(27, 27, 28, 0.16);
    animation: gctmModalIn 0.2s ease both;
  }

  .gctm__scroll {
    padding: 0 0 var(--sp-6);
  }

  .gctm__head {
    margin: 0 0 var(--sp-2);
    padding: var(--sp-6) var(--sp-6) var(--sp-1);
  }
}

@keyframes gctmScrimIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes gctmSheetIn {
  from { transform: translateY(100%); }
  to { transform: none; }
}

@keyframes gctmModalIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  dialog.gctm,
  dialog.gctm[open],
  dialog.gctm::backdrop {
    animation: none;
  }
}
