/* ============================================================================
   Custom checkout — styled to resemble the old Allegory/Shopify checkout.
   Standalone page (no site chrome): logo header, form left, order summary right.
   ========================================================================== */
* { box-sizing: border-box; }
html { font-size: 62.5%; }
body.checkout-page {
  margin: 0;
  font-family: "Archivo", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.5rem;
  color: #0d0d0d;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
.button.button--primary { font-family: inherit; }

/* Header */
.checkout-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border-bottom: 1px solid #e7e7e7;
}
.checkout-header__logo img { display: block; height: auto; }

/* Mobile order-summary toggle (hidden on desktop) */
.checkout-summary-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1.4rem 2rem;
  background: #f6f6f6;
  border: 0;
  border-bottom: 1px solid #e7e7e7;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.4rem;
  color: #0d0d0d;
}
.checkout-summary-toggle__label { display: inline-flex; align-items: center; gap: 0.6rem; }
.checkout-summary-toggle__total { font-weight: 700; font-size: 1.8rem; }

/* Layout */
.checkout-grid { max-width: 112rem; margin: 0 auto; }

/* Sections */
.checkout-main { padding: 2.4rem 2rem 4rem; }
.checkout-section { margin-bottom: 2.8rem; }
.checkout-section__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.2rem; }
.checkout-section__head h2 { font-size: 1.9rem; font-weight: 700; margin: 0; }
.checkout-section__note { font-size: 1.3rem; color: #6b6b6b; margin: 0; }

/* Floating-label fields (Shopify-checkout style) */
.field { position: relative; margin-bottom: 1.2rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.field-row--3 { grid-template-columns: 1fr 1fr 1fr; }
.field-row .field { margin-bottom: 1.2rem; }
.field__input {
  width: 100%;
  height: 5.2rem;
  padding: 1.8rem 1.4rem 0.6rem;
  border: 1px solid #c9c9c9;
  border-radius: 0;
  font-family: inherit;
  font-size: 1.5rem;
  color: #0d0d0d;
  background: #fff;
  outline: none;
  appearance: none;
}
.field__input:focus { border-color: #0d0d0d; box-shadow: 0 0 0 1px #0d0d0d; }
.field__select { padding-top: 1.8rem; background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7l4 4 4-4' stroke='%230d0d0d' stroke-width='1.4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1.4rem center; }
.field__label {
  position: absolute; left: 1.4rem; top: 1.6rem;
  font-size: 1.5rem; color: #6b6b6b; pointer-events: none;
  transition: transform 0.12s ease, font-size 0.12s ease;
}
.field__input:focus + .field__label,
.field__input:not(:placeholder-shown) + .field__label,
.field__label--float { transform: translateY(-0.9rem); font-size: 1.1rem; }

/* Shipping method */
.ship-option {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.6rem; border: 1px solid #0d0d0d; font-size: 1.4rem;
}
.ship-option__price { font-weight: 600; }

/* Payment element */
#payment-element { min-height: 4rem; }
.checkout-loading { color: #6b6b6b; font-size: 1.4rem; padding: 1.6rem 0; }
.checkout-error { color: #b31f1f; font-size: 1.3rem; margin-top: 1rem; }

/* Pay button */
.checkout-pay {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 5.4rem; margin-top: 2rem;
  background: #0d0d0d; color: #fff; border: 0; cursor: pointer;
  font-family: inherit; font-size: 1.5rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase;
}
.checkout-pay[disabled] { opacity: 0.45; cursor: default; }
.checkout-foot-links { margin-top: 2rem; font-size: 1.3rem; }
.checkout-foot-links a { color: #6b6b6b; }

/* Order summary */
.checkout-summary { background: #f6f6f6; padding: 2.4rem 2rem; }
.checkout-summary__items { list-style: none; margin: 0 0 1.6rem; padding: 0; }
.csum-item { display: flex; align-items: center; gap: 1.2rem; margin-bottom: 1.4rem; }
.csum-item__media { position: relative; flex: 0 0 5.6rem; width: 5.6rem; height: 6.4rem; }
.csum-item__media img { width: 100%; height: 100%; object-fit: cover; border: 1px solid #e0e0e0; background: #fff; }
.csum-item__qty { position: absolute; top: -0.8rem; right: -0.8rem; min-width: 2rem; height: 2rem; padding: 0 0.5rem; border-radius: 1rem; background: #0d0d0d; color: #fff; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; }
.csum-item__info { flex: 1 1 auto; min-width: 0; }
.csum-item__title { font-size: 1.3rem; font-weight: 600; }
.csum-item__variant { font-size: 1.2rem; color: #6b6b6b; }
.csum-item__price { font-size: 1.3rem; font-weight: 600; }
.checkout-summary__totals { border-top: 1px solid #e0e0e0; padding-top: 1.4rem; }
.checkout-summary__row { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.4rem; margin-bottom: 0.8rem; }
.checkout-summary__row--total { font-size: 1.9rem; font-weight: 700; margin-top: 0.6rem; }
.checkout-summary__cur { font-size: 1.2rem; color: #6b6b6b; font-weight: 400; }

/* Empty cart */
.checkout-empty { text-align: center; padding: 6rem 2rem; max-width: 52rem; margin: 0 auto; }
.checkout-empty .button--primary { display: inline-flex; align-items: center; justify-content: center; min-height: 5rem; padding: 0 3rem; margin-top: 2rem; background: #0d0d0d; color: #fff; text-decoration: none; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }

/* Order confirmation (success page) */
.confirm-head { display: flex; align-items: center; gap: 1.4rem; margin-bottom: 2rem; }
.confirm-ref { font-size: 1.2rem; color: #6b6b6b; margin: 0 0 0.2rem; }
.confirm-title { font-size: 2.4rem; font-weight: 700; margin: 0; }
.confirm-box { border: 1px solid #e0e0e0; padding: 1.8rem; margin-bottom: 2rem; }
.confirm-box__title { font-size: 1.6rem; font-weight: 700; margin: 0 0 0.4rem; }
.confirm-box__msg { color: #4a4a4a; margin: 0; font-size: 1.4rem; }
.confirm-details { border: 1px solid #e0e0e0; padding: 1.8rem; margin-bottom: 2rem; }
.confirm-details__title { font-size: 1.6rem; font-weight: 700; margin: 0 0 1.2rem; }
.confirm-details__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; }
.confirm-details h3 { font-size: 1.2rem; font-weight: 700; margin: 1.2rem 0 0.3rem; }
.confirm-details h3:first-child { margin-top: 0; }
.confirm-details p { font-size: 1.3rem; color: #4a4a4a; margin: 0; line-height: 1.5; }
.confirm-help { font-size: 1.4rem; margin: 2rem 0 1.2rem; }
@media screen and (max-width: 749px) { .confirm-details__grid { grid-template-columns: 1fr; } }

/* Mobile: summary collapses under the toggle */
@media screen and (max-width: 749px) {
  .checkout-summary { display: none; }
  body.summary-open .checkout-summary { display: block; }
}

/* Desktop: two columns, summary on the right with a divider */
@media screen and (min-width: 750px) {
  .checkout-summary-toggle { display: none; }
  .checkout-grid { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 8rem); }
  .checkout-main { padding: 4rem 4rem 4rem 0; order: 1; max-width: 56rem; justify-self: end; width: 100%; }
  .checkout-summary { order: 2; border-left: 1px solid #e7e7e7; padding: 4rem; position: sticky; top: 0; align-self: start; min-height: calc(100vh - 8rem); }
}
