/* Shared shell for the pages around the landing page: checkout, success,
   legal, errors. Tokens mirror index.html so the flow feels continuous. */
:root {
  --cream: #FBF1E1;
  --cream-2: #F3E6CE;
  --ink: #2C1D12;
  --ink-soft: #5A4A3A;
  --chile: #A9382A;
  --chile-dark: #7E2A20;
  --masa: #E0A73B;
  --avocado: #63713A;
  --line: rgba(44, 29, 18, 0.14);
  --card: #FFFDF8;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Karla', system-ui, sans-serif;
}
:root:not([data-theme="light"]) {
  @media (prefers-color-scheme: dark) {
    --cream: #221812; --cream-2: #2C1F16; --ink: #F3E6CE; --ink-soft: #CBB89E;
    --card: #2A1D14; --line: rgba(243, 230, 206, 0.14);
    --chile: #E2604B; --chile-dark: #C94E3B; --masa: #F0BE5E; --avocado: #93A462;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
a { color: var(--chile); }

.wrap { width: min(1080px, 92vw); margin-inline: auto; }
.narrow { width: min(560px, 92vw); margin-inline: auto; }
.prose { width: min(680px, 92vw); margin-inline: auto; }
.prose p, .prose li { color: var(--ink-soft); }
.prose h2 { margin-top: 2em; font-size: 1.3rem; }

header.site {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  background: var(--cream);
  position: sticky;
  top: 0;
  z-index: 10;
}
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--chile); flex: none; }
.back-link { font-size: .9rem; color: var(--ink-soft); text-decoration: none; }
.back-link:hover { color: var(--chile); }

main { padding: 48px 0 72px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
}
.card + .card { margin-top: 18px; }

/* --- order summary -------------------------------------------------- */
.summary { display: flex; align-items: center; gap: 16px; }
.summary .thumb {
  width: 58px; height: 76px; flex: none; border-radius: 6px;
  background: linear-gradient(150deg, var(--chile), var(--chile-dark));
  color: #FFFDF8; font-family: var(--font-display); font-size: .6rem;
  display: flex; align-items: flex-end; padding: 8px; line-height: 1.15;
  object-fit: cover;
}
.summary .meta { flex: 1; min-width: 0; }
.summary .meta strong { display: block; font-family: var(--font-display); font-size: 1.05rem; }
.summary .meta span { color: var(--ink-soft); font-size: .9rem; }
.summary .amount { font-family: var(--font-display); font-size: 1.5rem; white-space: nowrap; }
.compare { color: var(--ink-soft); text-decoration: line-through; font-size: .95rem; margin-left: 6px; }

/* About This Book Section */
.about-section {
  border-left: 3px solid var(--chile);
  background: linear-gradient(to right, rgba(169, 56, 42, 0.03), transparent);
}
.product-description-full {
  font-size: .9rem;
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0 0 12px 0;
}
.view-more-btn {
  background: none;
  border: none;
  color: var(--chile);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0;
  text-decoration: underline;
  transition: opacity .2s;
}
.view-more-btn:hover { opacity: .7; }

/* --- forms ----------------------------------------------------------- */
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.field { margin-bottom: 18px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%;
  padding: 13px 14px;
  font: inherit;
  font-size: 16px; /* keeps iOS from zooming on focus */
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--chile);
  outline-offset: 1px;
  border-color: transparent;
}
.hint { font-size: .82rem; color: var(--ink-soft); margin: 6px 0 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .9rem; color: var(--ink-soft); }
.check input { margin-top: 4px; flex: none; }

.tip-field { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 24px; }
.tip-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; margin-top: 12px; }
.tip-option {
  position: relative; display: flex; align-items: center; justify-content: center;
  padding: 12px; border: 2px solid var(--line); border-radius: 10px;
  cursor: pointer; transition: all .15s; font-weight: 600; font-size: .95rem;
}
.tip-option:hover { border-color: var(--masa); background: rgba(224, 167, 59, .08); }
.tip-option input[type="radio"] { position: absolute; opacity: 0; }
.tip-option input[type="radio"]:checked + span,
.tip-option input[type="radio"]:checked ~ span {
  color: var(--chile);
}
.tip-option:has(input[type="radio"]:checked) {
  border-color: var(--chile); background: rgba(169, 56, 42, .06);
}
.tip-custom { padding: 0; }
.tip-custom-input {
  width: 100%; border: none; background: transparent; text-align: center;
  padding: 12px 8px; font-weight: 600; font-size: .95rem;
}
.tip-custom-input:focus { outline: none; }

.book-lang-field { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 24px; }
.book-lang-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 12px; }
.book-lang-option {
  position: relative; display: flex; align-items: center; justify-content: center;
  padding: 14px 16px; border: 2px solid var(--line); border-radius: 10px;
  cursor: pointer; transition: all .15s; font-weight: 600; font-size: 1rem;
}
.book-lang-option:hover { border-color: var(--avocado); background: rgba(139, 158, 87, .08); }
.book-lang-option input[type="radio"] { position: absolute; opacity: 0; }
.book-lang-option:has(input[type="radio"]:checked) {
  border-color: var(--avocado); background: rgba(139, 158, 87, .12);
  color: var(--avocado-dark);
}

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 16px 24px;
  background: var(--chile); color: #FFFDF8;
  font: inherit; font-weight: 700; font-size: 1.02rem;
  border: none; border-radius: 999px; cursor: pointer;
  text-decoration: none; text-align: center;
  transition: background .15s, transform .06s;
}
.btn-primary:hover:not(:disabled) { background: var(--chile-dark); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-ghost {
  display: inline-block; padding: 12px 22px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600;
}

.trust-row {
  display: flex; flex-wrap: wrap; gap: 10px 20px; justify-content: center;
  margin-top: 20px; font-size: .84rem; color: var(--ink-soft);
}
.trust-row span::before { content: '\2713'; color: var(--avocado); font-weight: 700; margin-right: 6px; }

.alert { padding: 14px 16px; border-radius: 10px; margin-bottom: 20px; font-size: .92rem; }
.alert-error { background: rgba(169, 56, 42, .1); border: 1px solid rgba(169, 56, 42, .3); color: var(--chile); }
.alert-note { background: rgba(224, 167, 59, .14); border: 1px solid rgba(224, 167, 59, .4); }

.center { text-align: center; }
.badge {
  display: inline-block; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; background: var(--cream-2); color: var(--ink-soft);
}
.tick {
  width: 62px; height: 62px; border-radius: 50%; margin: 0 auto 20px;
  background: var(--avocado); color: #FFFDF8;
  display: flex; align-items: center; justify-content: center; font-size: 2rem;
}

footer.site {
  border-top: 1px solid var(--line);
  padding: 30px 0 calc(30px + env(safe-area-inset-bottom, 0px));
  color: var(--ink-soft); font-size: .85rem; text-align: center;
}
footer.site a { color: var(--ink-soft); text-decoration: none; margin: 0 10px; }
footer.site a:hover { color: var(--chile); }

@media (max-width: 560px) {
  .card { padding: 22px 18px; }
  .summary .amount { font-size: 1.25rem; }
}
