:root {
  color-scheme: light;
  --ink: #191817;
  --muted: #6f6b67;
  --line: #e6e0d9;
  --brand: #158e89;
  --brand-dark: #0b6966;
  --brand-soft: #e9f6f4;
  --cream: #f7f4ef;
  --white: #ffffff;
  --shadow: 0 18px 50px rgba(38, 31, 24, 0.08);
  font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--cream); }
body { margin: 0; color: var(--ink); background: var(--cream); }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 28px 22px;
}

.brand { display: grid; gap: 2px; color: var(--ink); text-decoration: none; font-family: "Playfair Display", Georgia, serif; font-size: 22px; font-weight: 700; }
.brand-mark { color: var(--brand); font-family: "DM Sans", sans-serif; font-size: 10px; font-weight: 800; letter-spacing: .2em; }
.secure { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.66); color: #4b4946; font-size: 13px; font-weight: 700; }
.secure span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); }

.page { max-width: 1180px; min-height: calc(100vh - 160px); margin: 0 auto; padding: 26px 28px 64px; }
.checkout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(340px, .75fr); gap: 32px; align-items: start; }
.intro { margin-bottom: 26px; }
.eyebrow { margin: 0 0 8px; color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
h1 { margin: 0 0 8px; font-family: "Playfair Display", Georgia, serif; font-size: clamp(34px, 5vw, 52px); line-height: 1.05; letter-spacing: -.035em; }
.intro > p:last-child { margin: 0; color: var(--muted); font-size: 16px; }

#checkout-form { display: grid; gap: 18px; }
.form-card, .summary-card { border: 1px solid var(--line); border-radius: 22px; background: var(--white); box-shadow: var(--shadow); }
.form-card { display: grid; gap: 18px; margin: 0; padding: 26px; }
.form-card legend { display: flex; align-items: center; gap: 10px; padding: 0 8px 0 0; font-family: "Playfair Display", Georgia, serif; font-size: 22px; font-weight: 700; }
.form-card legend span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: white; font-family: "DM Sans", sans-serif; font-size: 13px; }
.field-grid { display: grid; gap: 16px; }
.field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 8px; color: #3c3936; font-size: 13px; font-weight: 700; }
label em { color: var(--muted); font-style: normal; font-weight: 400; }
input, textarea { width: 100%; border: 1px solid #dcd6cf; border-radius: 12px; outline: none; background: #fff; color: var(--ink); font-size: 15px; font-weight: 500; transition: border-color .18s, box-shadow .18s; }
input { height: 50px; padding: 0 14px; }
textarea { min-height: 88px; padding: 13px 14px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }

.delivery-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.choice { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; min-height: 92px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; }
.choice.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #f3efea; color: var(--brand-dark); font-size: 19px; }
.choice.selected .choice-icon { background: #fff; }
.choice strong, .choice small { display: block; }
.choice strong { margin-bottom: 3px; color: var(--ink); font-size: 13px; }
.choice small { color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.35; }

.summary-card { position: sticky; top: 20px; overflow: hidden; padding: 24px; }
.summary-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.summary-heading h2 { margin: 0; font-family: "Playfair Display", Georgia, serif; font-size: 26px; }
.summary-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.summary-heading a { color: var(--brand-dark); font-size: 13px; font-weight: 700; }
.items { display: grid; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.item { display: grid; grid-template-columns: 66px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.item img, .item-placeholder { width: 66px; height: 66px; border-radius: 13px; object-fit: cover; background: #f2eee9; }
.item-placeholder { display: grid; place-items: center; font-size: 28px; }
.item-copy { min-width: 0; }
.item h3 { display: -webkit-box; overflow: hidden; margin: 0 0 5px; font-size: 13px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.item p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.item p.item-detail { margin-top: 5px; color: #4f4b47; line-height: 1.35; }
.item > strong { font-size: 13px; white-space: nowrap; }
.totals { display: grid; gap: 11px; padding: 20px 0 0; }
.totals > div { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 14px; }
.totals strong { color: var(--ink); }
.totals .grand-total { align-items: baseline; margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink); font-size: 17px; font-weight: 700; }
.grand-total strong { font-family: "Playfair Display", Georgia, serif; font-size: 27px; }
.trust-box { display: flex; gap: 10px; margin-top: 20px; padding: 13px; border-radius: 13px; background: var(--brand-soft); color: #365956; }
.trust-box > span { display: grid; place-items: center; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: white; font-size: 12px; }
.trust-box p { margin: 0; font-size: 11px; line-height: 1.45; }

.pay-button, .primary-link { display: flex; justify-content: center; align-items: center; gap: 18px; min-height: 56px; border: 0; border-radius: 14px; background: var(--brand); color: #fff; font-weight: 800; text-decoration: none; cursor: pointer; transition: transform .18s, background .18s; }
.pay-button { justify-content: space-between; width: 100%; padding: 0 20px; font-size: 15px; }
.pay-button:hover, .primary-link:hover { background: var(--brand-dark); transform: translateY(-1px); }
.payment-note { margin: -7px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.form-message { padding: 15px 17px; border-radius: 13px; font-size: 13px; line-height: 1.5; }
.form-message.success { border: 1px solid #a8d9cd; background: #eaf7f3; color: #275e54; }

.state-card { max-width: 620px; margin: 60px auto; padding: 48px 28px; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.state-card h1 { font-size: clamp(30px, 6vw, 42px); }
.state-card p { max-width: 450px; margin: 0 auto 24px; color: var(--muted); line-height: 1.6; }
.state-icon { display: block; margin-bottom: 16px; font-size: 42px; }
.primary-link { width: max-content; min-width: 170px; margin: 0 auto; padding: 0 22px; }
.spinner { display: block; width: 34px; height: 34px; margin: 0 auto 20px; border: 3px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

footer { display: flex; justify-content: space-between; gap: 20px; max-width: 1180px; margin: 0 auto; padding: 0 28px 32px; color: var(--muted); font-size: 12px; }
footer a { color: var(--brand-dark); font-weight: 700; }

@media (max-width: 900px) {
  .checkout { grid-template-columns: 1fr; }
  .summary-card { position: static; order: -1; }
  .delivery-options { grid-template-columns: 1fr; }
  .choice { min-height: 76px; }
}

@media (max-width: 600px) {
  .topbar { padding: 20px 18px 14px; }
  .secure { display: none; }
  .page { padding: 20px 14px 44px; }
  .intro { padding: 0 4px; }
  .intro > p:last-child { font-size: 14px; }
  .field-grid.two { grid-template-columns: 1fr; }
  .form-card, .summary-card { border-radius: 18px; }
  .form-card { padding: 20px 16px; }
  .summary-card { padding: 18px 16px; }
  .item { grid-template-columns: 58px minmax(0, 1fr) auto; }
  .item img, .item-placeholder { width: 58px; height: 58px; }
  footer { padding: 0 18px 24px; }
}
