/* Checkout only (linked from checkout.html).
   Layout and Spreedly host rules follow SC.ddhd/01-atelier/css/base.css,
   mapped onto this site's tokens (--ink, --paper, --accent, --line, --muted). */

#checkoutFormWrap,
#emptyCheckout,
#successScreen {
  padding: 28px 0 72px;
}

#checkoutFormWrap[hidden],
#emptyCheckout[hidden],
#successScreen[hidden],
#cardFields[hidden],
#paypalFields[hidden],
#adyenPanel[hidden],
#adyenDirectWrap[hidden],
#adyenDropinWrap[hidden],
#spreedlyWrap[hidden],
#placeWrap[hidden] {
  display: none !important;
}

.crumbs {
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 18px;
}
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { margin: 0 0.4rem; opacity: 0.7; }

.co-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(24px, 3vw, 40px);
  align-items: start;
}
@media (max-width: 880px) {
  .co-grid { grid-template-columns: 1fr; gap: 24px; }
}

.co-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: clamp(18px, 2.4vw, 28px);
  margin-bottom: 16px;
}
.co-card h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.co-grid > .co-card {
  position: sticky;
  top: 88px;
  margin-bottom: 0;
}
@media (max-width: 880px) {
  .co-grid > .co-card { position: static; }
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.field label .req,
.agree .req { color: var(--accent); }
.field input,
.field select,
.field textarea {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 15px;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--muted); opacity: 0.7; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-2);
}
.field input[aria-invalid="true"],
.field select[aria-invalid="true"] {
  border-color: #b8493b;
  box-shadow: 0 0 0 3px rgba(184, 73, 59, 0.08);
}
.field-err {
  font-size: 12px;
  color: #b8493b;
  min-height: 0;
}
.field-err:empty { display: none; }
@media (max-width: 540px) {
  .row { grid-template-columns: 1fr; }
}

.pay-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.pay-method {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.pay-method:hover { border-color: var(--ink); color: var(--ink); }
.pay-method.active {
  border-color: var(--ink);
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 5%, var(--paper));
  box-shadow: inset 0 0 0 1px var(--ink);
}
.pay-method svg { width: 18px; height: 18px; flex-shrink: 0; }
.pay-method .pp-mark { width: 72px; height: 20px; }

.paypal-hint {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 16px;
}
.paypal-box { min-height: 48px; position: relative; }
.paypal-msg {
  margin-top: 12px;
  font-size: 13px;
  color: #b8493b;
  min-height: 18px;
}

#spreedlyWrap[hidden] { display: none !important; }
.spreedly-card-form .spreedly-iframe-host,
[data-pmdot-iframe="1"] #pmdot-spreedly-number,
[data-pmdot-iframe="1"] #pmdot-spreedly-cvv {
  position: relative;
  width: 100%;
  height: 48px;
  min-height: 48px;
  box-sizing: border-box;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  overflow: hidden;
}
.spreedly-card-form .spreedly-iframe-host.is-focused,
[data-pmdot-iframe="1"] #pmdot-spreedly-number.is-focused,
[data-pmdot-iframe="1"] #pmdot-spreedly-cvv.is-focused {
  border-color: var(--ink);
}
.spreedly-card-form .spreedly-iframe-host.is-error,
[data-pmdot-iframe="1"] #pmdot-spreedly-number.is-error,
[data-pmdot-iframe="1"] #pmdot-spreedly-cvv.is-error {
  border-color: #b8493b;
}
.spreedly-card-form .spreedly-iframe-host iframe,
[data-pmdot-iframe="1"] #pmdot-spreedly-number iframe,
[data-pmdot-iframe="1"] #pmdot-spreedly-cvv iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  border: 0;
}

.adyen-card-host { display: flex; flex-direction: column; gap: 12px; }
#adyen-dropin { min-height: 48px; }

.agree {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.6;
  cursor: pointer;
  margin: 18px 0;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--ink) 4%, var(--paper));
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  user-select: none;
}
.agree input {
  appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  background: #fff;
  position: relative;
  cursor: pointer;
  margin-top: 2px;
  flex-shrink: 0;
}
.agree input:checked { background: var(--accent); border-color: var(--accent); }
.agree input:checked::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  line-height: 1;
}
.agree a {
  color: var(--accent);
  border-bottom: 1px solid currentColor;
  font-weight: 500;
}
.agree.invalid {
  border-color: #b8493b;
  background: rgba(184, 73, 59, 0.06);
}

#placeBtn.place {
  width: 100%;
  padding: 16px 18px;
}
#placeBtn.place:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sum-line {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: center;
}
.sum-line img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  background: color-mix(in srgb, var(--ink) 5%, var(--paper));
}
.sum-line .t { font-size: 0.95rem; line-height: 1.35; }
.sum-line .p { font-weight: 600; white-space: nowrap; }
.sum-sub,
.sum-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  font-size: 0.92rem;
}
.sum-sub span:first-child,
.sum-total span:first-child { color: var(--muted); }
.sum-total {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1.5px solid var(--ink);
  font-weight: 700;
  font-size: 1.05rem;
}
.sum-total span:first-child { color: var(--ink); }
#successRecap .sum-total { justify-content: center; gap: 16px; border-top: 0; }
