/* Mahogany Lenz — hardcover checkout page (modeled on Stripe's checkout layout) */
@font-face {
  font-family: 'Meeshy2';
  src: url('../assets/fonts/Meeshy2-Regular.ttf') format('truetype');
  font-display: swap;
}
:root {
  --tan: #d6ba90; --ink: #2a241e; --soft: #5b4f43; --mahogany: #7A2A1A;
  --line: rgba(42,36,30,.16); --field: #d9d9de; --blue: #0570de;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Avenir Next', Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--ink); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }

/* ---------- Desktop: two panels ---------- */
.co { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.co-m-top, .co-m-hero, .co-scrim, .co-close-btn { display: none; }
.co-left { background: var(--tan); display: flex; justify-content: flex-end; }
.co-right { background: #fff; box-shadow: -12px 0 30px -20px rgba(0,0,0,.25); }
.co-left-in { width: 100%; max-width: 540px; padding: 56px 64px 56px 40px; }
.co-right-in { width: 100%; max-width: 540px; padding: 56px 40px 56px 64px; }

.co-brand { display: flex; align-items: center; gap: 10px; }
.co-logo { width: 54px; height: auto; display: block; }
.co-back { color: var(--soft); text-decoration: none; font-size: 18px; padding: 4px; }
.co-title { font-family: 'Avenir Next', Avenir, -apple-system, 'Segoe UI', sans-serif; font-weight: 600; font-size: 32px; line-height: 1.2; letter-spacing: -.01em; color: var(--soft); margin: 36px 0 4px; }
.co-ships { font-family: 'Meeshy2', cursive; font-size: 22px; color: var(--mahogany); margin: 0; }
.co-amount { font-size: 46px; font-weight: 700; letter-spacing: -.02em; margin: 16px 0 40px; min-height: 56px; }

.co-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; }
.co-item > img { width: 64px; border-radius: 4px; }
.co-item-main { min-width: 0; }
.co-item-price { font-size: 16px; text-align: right; white-space: nowrap; }
.co-each { font-size: 13px; color: var(--soft); margin-top: 4px; }

/* Text that truncates with a chevron to expand (like Stripe) */
.co-clamp { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.co-clamp > span:first-child { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.co-item-name { font-size: 16px; line-height: 1.35; text-transform: uppercase; }
.co-item-name > span:first-child { -webkit-line-clamp: 2; }
.co-item-desc { font-size: 14px; line-height: 1.55; color: var(--soft); margin-top: 6px; }
.co-item-desc > span:first-child { -webkit-line-clamp: 2; }
.co-clamp[aria-expanded="true"] > span:first-child { -webkit-line-clamp: unset; display: block; }
.co-chev { display: inline-block; width: 8px; height: 8px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg); margin: 0 4px 6px; opacity: .75; }
.co-clamp[aria-expanded="true"] .co-chev, .co-chev-up { transform: rotate(-135deg); margin-bottom: 0; }

.co-qty { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; background: rgba(0,0,0,.07); border-radius: 6px; padding: 3px 4px 3px 10px; font-size: 14px; font-weight: 600; }
.co-qty select { font: inherit; font-weight: 600; border: 0; background: transparent; color: var(--ink); padding: 2px 4px; cursor: pointer; }
.co-msg { font-size: 13px; color: #8a1c0a; margin: 8px 0 0; }

.co-sums { margin: 28px 0 0 80px; border-top: 1px solid var(--line); }
.co-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; font-size: 16px; }
.co-muted { color: var(--soft); font-size: 15px; }
.co-row > span:first-child { white-space: nowrap; }
.co-live { display: inline-block; white-space: nowrap; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mahogany); background: rgba(255,255,255,.45); border-radius: 999px; padding: 3px 8px; margin-left: 6px; }
.co-total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 18px; font-weight: 700; font-size: 17px; }
.co-total b { font-size: 20px; }

/* ---------- Right panel (Stripe fields) ---------- */
.co-sec { margin-bottom: 28px; }
.co-h { font-size: 16px; font-weight: 600; margin: 0 0 10px; color: #1a1a1a; }
.co-note { font-size: 15px; color: #4a4a55; line-height: 1.5; }
.co-live-tag { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #6b6b76; margin: -2px 0 10px; }
.co-live-tag i { width: 7px; height: 7px; border-radius: 50%; background: #c4c4cc; flex: none; }
.co-live-tag.is-live { color: #3f7d46; } .co-live-tag.is-live i { background: #3fa34d; }
.co-live-tag.is-busy i { background: var(--blue); animation: co-pulse 1s infinite; }
.co-live-tag.is-error { color: #8a1c0a; } .co-live-tag.is-error i { background: #c0392b; }
@keyframes co-pulse { 50% { opacity: .3; } }

.co-options { border: 1px solid var(--field); border-radius: 8px; overflow: hidden; }
.co-options:empty { display: none; }
.co-opt { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--field); cursor: pointer; }
.co-opt:last-child { border-bottom: 0; }
.co-opt input { grid-row: span 2; width: 16px; height: 16px; accent-color: var(--blue); margin: 0; }
.co-opt-name { font-size: 14.5px; font-weight: 500; }
.co-opt-eta { font-size: 12.5px; color: #6b6b76; }
.co-opt-price { grid-row: span 2; font-weight: 600; }
.co-opt:has(input:checked) { background: #f6f8fa; box-shadow: inset 0 0 0 2px var(--blue); }

.co-btn { display: block; width: 100%; text-align: center; text-decoration: none; background: var(--blue); color: #fff; font: inherit; font-weight: 600; font-size: 17px; padding: 14px; border: 0; border-radius: 8px; margin-top: 8px; cursor: pointer; }
.co-btn:disabled { opacity: .55; cursor: not-allowed; }
.co-error { background: #fdecea; color: #8a1c0a; border-radius: 8px; padding: 10px 14px; font-size: 14px; margin: 0 0 8px; }
.co-foot { text-align: center; font-size: 12px; color: #8a8a94; margin-top: 18px; }

/* ---------- Phones: Stripe-style mobile layout ---------- */
@media (max-width: 820px) {
  .co { display: block; background: var(--tan); }
  .co-desk, .co-back { display: none; }

  .co-m-top { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 6px; }
  .co-m-top .co-logo { width: 52px; }
  .co-details-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 6px 0; font-size: 17px; color: var(--ink); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 4px; }
  .co-details-btn .co-chev { text-decoration: none; margin-bottom: 5px; }
  .co-details-btn .co-chev-up { margin-bottom: 0; margin-top: 4px; }

  .co-m-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 4px 24px 28px; }
  .co-m-hero .co-title { font-size: 24px; margin: 6px 0 2px; }
  .co-m-hero .co-ships { font-size: 20px; margin-bottom: 18px; }
  .co-m-cover { width: 58%; max-width: 240px; border-radius: 6px; box-shadow: 0 14px 30px -16px rgba(0,0,0,.45); }
  .co-m-name { font-size: 19px; line-height: 1.3; color: var(--soft); text-transform: uppercase; margin-top: 20px; }
  .co-m-total { font-size: 42px; font-weight: 700; letter-spacing: -.02em; margin: 4px 0 6px; min-height: 50px; }
  .co-m-desc { font-size: 16px; line-height: 1.45; color: var(--soft); text-align: center; max-width: 520px; }
  .co-m-desc > span:first-child { -webkit-line-clamp: 2; }
  .co-m-each { font-size: 16px; color: var(--soft); margin-top: 4px; }
  .co-qty-lg { font-size: 17px; padding: 10px 14px 10px 20px; border-radius: 8px; margin-top: 18px; }

  /* "Details" sheet slides down over the page */
  .co-left { display: block; position: fixed; inset: 0 0 auto 0; z-index: 20; max-height: 88vh; overflow-y: auto; transform: translateY(-110%); transition: transform .28s ease, box-shadow .28s ease; }
  .co.details-open .co-left { transform: none; box-shadow: 0 20px 40px -10px rgba(0,0,0,.35); }
  .co-scrim { display: block; position: fixed; inset: 0; z-index: 19; background: rgba(43,22,13,.35); opacity: 0; pointer-events: none; transition: opacity .28s ease; }
  .co.details-open .co-scrim { opacity: 1; pointer-events: auto; }
  .co.details-open { overflow: hidden; }
  .co-left-in { max-width: none; padding: 18px 20px 24px; }
  .co-brand { justify-content: space-between; }
  .co-brand .co-logo { width: 52px; }
  .co-close-btn { display: inline-flex; }
  .co-item { grid-template-columns: 56px 1fr auto; gap: 14px; margin-top: 18px; }
  .co-item > img { width: 56px; }
  .co-item-name { font-size: 17px; }
  .co-item-desc { font-size: 15px; }
  .co-sums { margin-left: 70px; }
  .co-row { font-size: 15px; }
  .co-row .co-muted { font-size: 14px; text-align: right; }

  .co-right { box-shadow: none; border-radius: 18px 18px 0 0; }
  .co-right-in { max-width: none; padding: 28px 20px 40px; }
}

/* ---------- Thank-you page ---------- */
.done { min-height: 100vh; display: grid; place-items: center; background: var(--tan); padding: 24px; }
.done-card { background: #fff; border-radius: 18px; padding: 40px 36px; max-width: 520px; width: 100%; text-align: center; box-shadow: 0 30px 60px -30px rgba(0,0,0,.35); }
.done-card img { width: 84px; }
.done-card h1 { font-weight: 600; font-size: 30px; margin: 18px 0 6px; color: var(--ink); }
.done-card .co-ships { margin-bottom: 18px; }
.done-card p { color: var(--soft); line-height: 1.55; }
.done-card .co-btn { background: var(--mahogany); border-radius: 999px; margin-top: 22px; }
