/* A single pale blue stage lets the three-dimensional book covers stand alone. */
.checkout-page {
  --shop-blue: #e5f1f8;
  --shop-border: #afcbdc;
  --shop-ink: #17364c;
  background: var(--shop-blue);
  color: var(--shop-ink);
}

.checkout-main,
.checkout-section,
.checkout-volume,
.checkout-cover,
.choice-tile,
.set-choice,
.order-summary {
  background: var(--shop-blue);
}

.checkout-section,
.order-summary,
.choice-tile,
.set-choice,
.checkout-volume {
  border-color: var(--shop-border);
}

.checkout-section,
.order-summary {
  box-shadow: 0 12px 35px rgba(31, 74, 105, .055);
}

.checkout-section legend {
  background: var(--shop-blue);
  color: var(--shop-ink);
}

.checkout-section legend span,
.checkout-title .section-no,
.order-summary .kicker {
  color: #376e8b;
}

.checkout-title p,
.choice-tile small,
.set-choice small,
.checkout-volume em,
.coupon-message,
.summary-product span,
.gateway-lock,
.summary-help {
  color: #486b80;
}

.choice-tile:has(input:checked),
.set-choice:has(input:checked),
.checkout-volume:has(input:checked) {
  background: var(--shop-blue);
  border-color: #4385a9;
  box-shadow: inset 0 0 0 1px #4385a9;
}

.checkout-volume {
  transition: border-color .2s ease, box-shadow .2s ease;
}

.checkout-cover img {
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(5px 8px 7px rgba(25, 56, 79, .24));
}

.choice-tile input,
.set-choice input,
.checkout-volume input,
.consent input {
  accent-color: #327ca1;
}

.order-summary {
  color: var(--shop-ink);
}

.summary-product {
  border-color: var(--shop-border);
}

.summary-monogram {
  background: #c7e2f1;
  color: var(--shop-ink);
}

.summary-total {
  border-color: var(--shop-border);
}

.checkout-main input:not([type=radio]):not([type=checkbox]):not([type=hidden]),
.checkout-main select,
.checkout-main textarea {
  background: #f4faff;
  border-color: var(--shop-border);
  color: var(--shop-ink);
}

.checkout-main input:focus-visible,
.checkout-main select:focus-visible,
.checkout-main textarea:focus-visible,
.choice-tile:focus-within,
.set-choice:focus-within,
.checkout-volume:focus-within {
  outline: 2px solid #327ca1;
  outline-offset: 2px;
}

/* A compact, phone-first buying flow. */
.checkout-main { padding-block: 1.6rem 3rem; }
.checkout-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.checkout-title h1 { font-size: clamp(2rem, 3.2vw, 3rem); line-height: 1.08; }
.checkout-title p:last-child { max-width: 24rem; margin: 0 0 .2rem; font-size: .95rem; }
.checkout-title .section-no { margin: 0 0 .5rem; }
.checkout-layout { grid-template-columns: minmax(0, 1.7fr) minmax(280px, .7fr); gap: 1.2rem; }
.checkout-content { gap: 0; }
.market-selector { display: flex; align-items: end; justify-content: space-between; gap: 1rem; padding: .2rem 0 1.2rem; }
.market-selector label { display: grid; gap: .3rem; min-width: 12rem; font-size: .85rem; font-weight: 600; }
.market-selector select { min-height: 2.6rem; padding: .45rem .7rem; border: 1px solid var(--shop-border); border-radius: .35rem; }
.market-selector p { margin: 0 0 .35rem; max-width: 29rem; color: #486b80; font-size: .8rem; line-height: 1.4; }
.market-message a { font-size: .85rem; font-weight: 600; text-decoration: underline; text-underline-offset: .2rem; }
.market-message a[hidden] { display: none; }
.choice-tile[hidden] { display: none !important; }
.format-options:has(#print-choice[hidden]) { grid-template-columns: minmax(0, 1fr); }
.checkout-section {
  border: 0;
  border-top: 1px solid var(--shop-border);
  box-shadow: none;
  padding: 1.1rem 0 1.5rem;
  margin: 0;
}
.checkout-section legend { padding: 0 .65rem 0 0; font-size: 1.35rem; }
.checkout-section legend span { font-size: .78rem; }
.format-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; margin-top: .5rem; }
.choice-tile {
  margin: 0;
  padding: .9rem;
  gap: .65rem;
  align-items: flex-start;
  min-width: 0;
  min-height: 5.6rem;
  border-radius: .45rem;
  font-size: .95rem;
}
.choice-tile input { flex: none; margin: .28rem 0 0; }
.choice-tile span { min-width: 0; gap: .25rem; }
.choice-tile strong { font-size: .96rem; line-height: 1.25; }
.choice-tile small { font-size: .78rem; line-height: 1.35; }
.selection-section { padding-bottom: 1.8rem; }
.edition-group[hidden] { display: none !important; }
.edition-group + .edition-group { margin-top: 1.5rem; padding-top: 1.2rem; border-top: 1px solid var(--shop-border); }
.edition-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: .35rem 0 .7rem; }
.edition-heading h2 { font: 400 1.25rem var(--serif); margin: 0; }
.edition-heading p { font-size: .8rem; margin: .2rem 0 0; color: #486b80; }
.select-all { display: inline-flex; align-items: center; gap: .4rem; flex: none; font-size: .85rem; font-weight: 600; cursor: pointer; }
.select-all input { width: auto; min-height: auto; margin: 0; accent-color: #327ca1; }
.book-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .55rem; }
.book-option {
  position: relative;
  display: grid;
  place-items: center;
  gap: .25rem;
  min-width: 0;
  padding: .55rem .25rem .6rem;
  border: 1px solid var(--shop-border);
  border-radius: .4rem;
  cursor: pointer;
  text-align: center;
}
.book-option:has(input:checked) { border-color: #4385a9; box-shadow: inset 0 0 0 1px #4385a9; }
.book-option:focus-within { outline: 2px solid #327ca1; outline-offset: 2px; }
.book-option input { position: absolute; top: .45rem; left: .45rem; width: 1rem; min-height: 1rem; margin: 0; accent-color: #327ca1; }
.book-option-art { display: grid; place-items: center; height: 5.4rem; width: 100%; }
.book-option img { max-height: 5rem; max-width: 80%; object-fit: contain; filter: drop-shadow(3px 4px 3px rgba(25, 56, 79, .2)); }
.book-option-name { font-size: .8rem; font-weight: 600; white-space: nowrap; }
.order-summary { top: 1rem; padding: 1.4rem; border-radius: .5rem; }
.order-summary h2 { font-size: 1.65rem; }
.summary-product { padding: .85rem 0; }
.order-summary dl div { margin: .75rem 0; }
.mobile-total { display: none; }

@media (max-width: 900px) {
  .checkout-layout { grid-template-columns: 1fr; }
  .order-summary { position: static; }
}
@media (max-width: 650px) {
  .checkout-page { padding-bottom: 4.5rem; }
  .checkout-header { flex-wrap: nowrap; padding: .65rem 1rem; }
  .checkout-header-actions { margin-left: auto; }
  .checkout-header-actions .button { padding: .55rem .7rem; font-size: .75rem; white-space: nowrap; }
  .checkout-main { padding: 1.1rem 1rem 2rem; }
  .checkout-title { display: block; margin-bottom: .85rem; }
  .checkout-title h1 { font-size: 2rem; margin: 0 0 .2rem; }
  .checkout-title p:last-child { font-size: .85rem; }
  .checkout-section { padding: .8rem 0 1.05rem; }
  .market-selector { display: block; padding: 0 0 .85rem; }
  .market-selector label { font-size: .8rem; }
  .market-selector p { margin: .45rem 0 0; font-size: .76rem; }
  .checkout-section legend { font-size: 1.13rem; }
  .format-options { display: grid; grid-template-columns: 1fr; gap: .4rem; margin-top: .25rem; }
  .choice-tile { min-height: 0; padding: .6rem .8rem; align-items: center; }
  .choice-tile input { margin: 0; }
  .choice-tile span { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; width: 100%; }
  .choice-tile strong { font-size: .9rem; flex: none; }
  .choice-tile small { font-size: .72rem; text-align: right; }
  .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; }
  .book-option-art { height: 4.8rem; }
  .book-option img { max-height: 4.5rem; }
  .edition-heading h2 { font-size: 1.12rem; }
  .edition-heading p { font-size: .72rem; }
  .select-all { font-size: .78rem; }
  .mobile-total {
    position: fixed;
    z-index: 10;
    inset: auto 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .65rem 1rem calc(.65rem + env(safe-area-inset-bottom));
    background: #11334c;
    color: white;
    box-shadow: 0 -5px 18px rgba(17, 51, 76, .17);
    font-size: .84rem;
  }
  .mobile-total span:first-child { display: grid; }
  .mobile-total small { font-size: .72rem; color: #c8e2f0; }
  .mobile-total strong { font-size: 1.1rem; }
  .mobile-total span:last-child { text-decoration: underline; text-underline-offset: .2rem; }
}
@media (max-width: 420px) {
  .choice-tile span { display: grid; justify-content: start; gap: .1rem; }
  .choice-tile small { text-align: left; }
}
