:root {
  --ink: #21151b;
  --muted: #6f6268;
  --rose: #a63d69;
  --rose-dark: #742544;
  --soft: #fff6f9;
  --line: #eadde3;
  --success: #1f6b4f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a { color: inherit; }

.checkout-topbar {
  padding: 9px 20px;
  color: #fff;
  background: var(--rose-dark);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.checkout-header {
  min-height: 78px;
  padding: 12px max(24px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.checkout-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.checkout-brand img {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
}

.checkout-brand span { display: grid; }
.checkout-brand strong { font-family: Georgia, serif; font-size: 21px; }
.checkout-brand small { color: var(--rose); font-size: 12px; font-weight: 800; text-transform: uppercase; }

.back-shop {
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.checkout-shell { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 44px 0 72px; }

.checkout-heading { max-width: 690px; margin-bottom: 30px; }
.checkout-heading p { margin: 0 0 6px; color: var(--rose); font-size: 13px; font-weight: 800; text-transform: uppercase; }
.checkout-heading h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(34px, 5vw, 54px); line-height: 1.05; font-weight: 500; }
.checkout-heading span { display: block; margin-top: 12px; color: var(--muted); }

.checkout-alert {
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid #d99aa8;
  border-radius: 8px;
  color: #7c213a;
  background: #fff3f5;
  font-weight: 700;
}

.checkout-layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 28px; align-items: start; }
.checkout-form { display: grid; gap: 18px; }

.checkout-section,
.order-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.checkout-section { padding: 24px; }
.section-heading { display: flex; gap: 13px; align-items: flex-start; margin-bottom: 22px; }
.section-heading > span {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--rose-dark);
  font-size: 12px;
  font-weight: 800;
}
.section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 23px; font-weight: 500; }
.section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-wide { grid-column: 1 / -1; }
.field-grid label { display: grid; gap: 7px; font-size: 14px; font-weight: 700; }
.field-grid label small { color: var(--muted); font-weight: 500; }
.field-grid input {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid #cfc2c8;
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  outline: none;
}
.field-grid input:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(166, 61, 105, .12); }
.field-grid input:user-invalid { border-color: #b22f4a; }

.phone-input { display: flex; min-height: 48px; border: 1px solid #cfc2c8; border-radius: 6px; overflow: hidden; }
.phone-input:focus-within { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(166, 61, 105, .12); }
.phone-input span { padding: 12px; color: var(--muted); background: var(--soft); border-right: 1px solid var(--line); }
.phone-input input { min-height: 46px; border: 0; border-radius: 0; box-shadow: none !important; }

.payment-option {
  min-height: 76px;
  padding: 14px 16px;
  border: 2px solid var(--rose);
  border-radius: 8px;
  background: var(--soft);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  cursor: pointer;
}
.payment-option input { width: 18px; height: 18px; accent-color: var(--rose-dark); }
.payment-option span { display: grid; gap: 2px; }
.payment-option small { color: var(--muted); font-weight: 500; }
.payment-option b { padding: 5px 9px; border-radius: 999px; color: #fff; background: var(--rose-dark); font-size: 12px; }

.terms-row { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: 14px; }
.terms-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--rose-dark); }
.terms-row a { color: var(--rose-dark); font-weight: 700; }
.website-field { position: absolute; left: -10000px; }

.place-order {
  min-height: 54px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--rose-dark);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.place-order:hover { background: #5e1733; }
.place-order:disabled { cursor: wait; opacity: .65; }
.submit-note { margin: -8px 0 0; color: var(--muted); text-align: center; font-size: 13px; }

.order-summary { position: sticky; top: 20px; overflow: hidden; }
.summary-heading { padding: 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; }
.summary-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 25px; font-weight: 500; }
.summary-heading span { color: var(--muted); font-size: 13px; }
.summary-items { max-height: 440px; overflow: auto; }
.summary-loading, .summary-empty { padding: 28px 20px; color: var(--muted); text-align: center; }

.summary-item { padding: 16px 20px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 68px 1fr auto; gap: 12px; align-items: center; }
.summary-item img { width: 68px; height: 68px; border-radius: 6px; object-fit: contain; background: var(--soft); }
.summary-item-copy { min-width: 0; display: grid; gap: 3px; }
.summary-item-copy strong { font-size: 14px; line-height: 1.3; }
.summary-item-copy small { color: var(--muted); font-size: 12px; }
.quantity-control { display: inline-grid; grid-template-columns: 30px 30px 30px; margin-top: 5px; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.quantity-control button { height: 29px; border: 0; background: #fff; cursor: pointer; font-size: 17px; }
.quantity-control span { display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.summary-item-price { display: grid; justify-items: end; gap: 6px; font-size: 14px; }
.summary-item-price button { padding: 0; border: 0; color: var(--rose-dark); background: none; font-size: 12px; cursor: pointer; }

.summary-totals { padding: 17px 20px; display: grid; gap: 10px; }
.summary-totals > div { display: flex; justify-content: space-between; gap: 18px; color: var(--muted); }
.summary-totals strong { color: var(--ink); }
.summary-total { margin-top: 4px; padding-top: 13px; border-top: 1px solid var(--line); font-size: 18px; }
.summary-total span, .summary-total strong { color: var(--ink) !important; }
.summary-promises { padding: 16px 20px; background: var(--soft); display: grid; gap: 9px; color: var(--muted); font-size: 13px; }
.summary-promises span { display: flex; gap: 9px; align-items: center; }
.summary-promises b { width: 34px; color: var(--rose-dark); }

.order-success { max-width: 720px; margin: 40px auto; padding: 48px 36px; border: 1px solid #b9d5c9; border-radius: 8px; text-align: center; background: #f5fbf8; }
.success-mark { width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--success); font-size: 28px; }
.order-success > p:first-of-type { color: var(--success); font-weight: 800; text-transform: uppercase; }
.order-success h2 { margin: 8px 0; font-family: Georgia, serif; font-size: 32px; font-weight: 500; }
.order-success p { color: var(--muted); }
.success-id { margin: 22px auto; padding: 13px 16px; border: 1px dashed #78a691; border-radius: 6px; background: #fff; }
.order-success > div:last-child { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.order-success a { padding: 10px 15px; border: 1px solid #78a691; border-radius: 999px; text-decoration: none; font-weight: 700; }

.checkout-footer { padding: 24px; border-top: 1px solid var(--line); display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.checkout-footer a { color: var(--rose-dark); font-weight: 700; }

@media (max-width: 900px) {
  .checkout-layout { grid-template-columns: 1fr; }
  .order-summary { position: static; order: -1; }
  .summary-items { max-height: none; }
}

@media (max-width: 620px) {
  .checkout-topbar { font-size: 12px; }
  .checkout-header { min-height: 68px; padding: 10px 16px; }
  .checkout-brand img { width: 42px; height: 42px; }
  .checkout-brand strong { font-size: 18px; }
  .checkout-brand small { font-size: 10px; }
  .back-shop { padding: 8px 11px; font-size: 12px; }
  .checkout-shell { width: min(100% - 24px, 1240px); padding: 30px 0 54px; }
  .checkout-heading h1 { font-size: 36px; }
  .checkout-section { padding: 18px 16px; }
  .field-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .summary-item { padding: 14px; grid-template-columns: 60px minmax(0, 1fr); }
  .summary-item img { width: 60px; height: 60px; }
  .summary-item-price { grid-column: 2; grid-row: 2; justify-items: start; grid-auto-flow: column; align-items: center; }
  .order-success { padding: 36px 20px; }
}
