.tier-table {
  padding: 18px;
  background: #eff2ec;
}

.tier-table > strong {
  display: block;
  margin-bottom: 12px;
  font-size: 12px;
}

.tier-table > div {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  color: var(--muted);
  font-size: 11px;
}

.tier-table b {
  color: var(--ink);
}

.cart-dialog {
  width: min(620px, calc(100% - 30px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 0;
  background: var(--panel);
  box-shadow: 0 30px 100px rgb(16 34 38 / 30%);
}

.cart-dialog::backdrop {
  background: rgb(16 34 38 / 55%);
  backdrop-filter: blur(5px);
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 28px 30px 20px;
  border-bottom: 1px solid var(--line);
}

.dialog-header .eyebrow {
  margin-bottom: 8px;
}

.dialog-header h2 {
  margin: 0;
  font-size: 28px;
}

.dialog-header button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  font-size: 24px;
}

.cart-items {
  display: grid;
  max-height: 48vh;
  overflow-y: auto;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 22px 30px;
  border-bottom: 1px solid var(--line);
}

.cart-item h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.cart-item p {
  margin: 3px 0;
  color: var(--muted);
  font-size: 12px;
}

.cart-item strong {
  color: var(--teal);
}

.cart-item button {
  align-self: end;
  border: 0;
  background: transparent;
  color: #9d2e20;
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
}

.empty-cart {
  display: grid;
  min-height: 260px;
  place-items: center;
  align-content: center;
  color: var(--muted);
  text-align: center;
}

.empty-cart > span {
  margin-bottom: 10px;
  font-size: 45px;
}

.empty-cart p {
  margin: 6px 0 0;
  font-size: 12px;
}

.cart-footer {
  padding: 22px 30px 30px;
  border-top: 1px solid var(--line);
}

.cart-footer > span {
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}

.cart-footer > span strong {
  color: var(--teal);
  font-size: 22px;
}

.cart-footer .primary-button {
  justify-content: center;
}

#request-message {
  margin: 12px 0 0;
  color: var(--teal-dark);
  font-size: 12px;
  text-align: center;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 100px;
  padding: 24px clamp(20px, 4vw, 72px);
  background: var(--ink);
  color: white;
}

footer p {
  margin: 0;
  color: #aab9b8;
  font-size: 12px;
}

@media (max-width: 1040px) {
  .configurator {
    grid-template-columns: 1fr 340px;
  }

  .hero {
    grid-template-columns: 1fr 0.72fr;
  }
}

@media (max-width: 860px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .steps {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 50px;
  }

  .book-scene {
    min-height: 300px;
  }

  .configurator {
    grid-template-columns: 1fr;
  }

  .quote-panel {
    position: relative;
    top: auto;
    grid-row: 2;
  }
}

@media (max-width: 620px) {
  main {
    width: min(100% - 20px, 1420px);
  }

  .site-header {
    min-height: 66px;
    padding: 8px 14px;
  }

  .brand small,
  .cart-button > span {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 42px 10px 26px;
  }

  .hero h1 {
    font-size: 43px;
  }

  .book-cover,
  .book-pages,
  .book-shadow {
    width: 210px;
    height: 270px;
  }

  .panel,
  .quote-panel {
    padding: 22px 18px;
  }

  .segmented,
  .field-grid,
  .direction-options,
  .page-count-grid {
    grid-template-columns: 1fr 1fr;
  }

  .segmented > *,
  .field-grid > *,
  .direction-options > *,
  .page-count-grid > * {
    min-width: 0;
  }

  .special-fields {
    grid-template-columns: 1fr;
  }

  .special-type {
    width: 55vw;
  }

  legend span {
    display: block;
    margin: 5px 0 0;
  }

  footer {
    display: grid;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
