/* Shared Cube/Cotton checkout usability layer. Existing typography is inherited unchanged. */

.checkout-header,
.checkout-shell,
.checkout-shell * {
  box-sizing: border-box;
}

.checkout-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--cream) 94%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.checkout-shell {
  width: min(1320px, 100%);
  margin-inline: auto;
  grid-template-columns: minmax(0, 1.12fr) minmax(400px, .88fr);
}

.checkout-form-panel,
.order-summary,
.checkout-form-panel > *,
.order-summary > * {
  min-width: 0;
}

.checkout-form-panel h1 {
  text-wrap: balance;
}

.back-link,
.checkout-header a,
.pay-button {
  min-height: 44px;
}

.back-link,
.checkout-header a {
  display: inline-flex;
  align-items: center;
}

fieldset,
label {
  min-width: 0;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  border-color: color-mix(in srgb, var(--line) 82%, var(--green));
  background: #fff;
  color: var(--ink);
  color-scheme: light;
  font-size: 15px;
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 72%, white);
  opacity: 1;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #91aa9a;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  outline: none;
  box-shadow: 0 0 0 4px rgba(83, 103, 90, .14);
}

input:user-invalid,
select:user-invalid,
textarea:user-invalid {
  border-color: #b85d55;
  box-shadow: 0 0 0 3px rgba(184, 93, 85, .1);
}

.agreement {
  min-height: 44px;
}

.agreement input {
  flex: 0 0 auto;
  min-width: 20px;
  min-height: 20px;
}

.pay-button {
  display: grid;
  min-height: 56px;
  place-items: center;
  padding-inline: 20px;
  text-align: center;
}

.order-summary {
  position: sticky;
  top: 80px;
  align-self: start;
  min-height: calc(100vh - 80px);
  overflow: hidden;
}

.summary-item {
  align-items: center;
}

.summary-item > * {
  min-width: 0;
}

.summary-item strong,
.summary-item small {
  overflow-wrap: anywhere;
}

.summary-totals strong,
.summary-item > span {
  font-variant-numeric: tabular-nums;
}

.summary-help {
  text-wrap: pretty;
}

@media (max-width: 1180px) {
  .checkout-shell {
    grid-template-columns: minmax(0, 1fr);
    width: min(820px, 100%);
  }

  .order-summary {
    position: static;
    grid-row: 1;
    min-height: 0;
  }

  .checkout-form-panel {
    grid-row: 2;
  }
}

@media (max-width: 640px) {
  .checkout-header {
    min-height: 68px;
    padding: 10px 14px;
  }

  .checkout-header a {
    min-width: 0;
  }

  .checkout-header a span,
  .checkout-header p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .checkout-form-panel,
  .order-summary {
    padding: 30px 16px;
  }

  .checkout-form-panel > .eyebrow {
    margin-top: 34px;
  }

  .checkout-form-panel h1 {
    margin-bottom: 30px;
    font-size: clamp(34px, 10vw, 42px);
    line-height: 1.18;
  }

  form {
    gap: 30px;
  }

  fieldset {
    gap: 15px;
    padding-bottom: 30px;
  }

  .field-row {
    grid-template-columns: minmax(0, 1fr);
  }

  input,
  select,
  textarea {
    min-height: 54px;
    font-size: 16px;
  }

  .order-summary h2 {
    margin-bottom: 22px;
  }

  .summary-item {
    grid-template-columns: 62px minmax(0, 1fr) auto;
    gap: 11px;
  }

  .summary-item img {
    width: 62px;
    height: 78px;
  }

  .summary-totals .summary-total {
    align-items: flex-end;
  }

  .pay-button {
    min-height: 58px;
  }
}

@media (max-width: 390px) {
  .summary-item {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .summary-item img {
    width: 56px;
    height: 70px;
  }

  .summary-item > span {
    grid-column: 2;
  }

  .summary-totals p {
    gap: 12px;
  }
}

/* Higher-specificity fallbacks when this file is loaded via checkout.css @import. */
body .checkout-shell {
  width: min(1320px, 100%);
  margin-inline: auto;
  grid-template-columns: minmax(0, 1.12fr) minmax(400px, .88fr);
}

body input,
body select,
body textarea {
  min-height: 52px;
  border-color: color-mix(in srgb, var(--line) 82%, var(--green));
  background: #fff;
  color: var(--ink);
  color-scheme: light;
  font-size: 15px;
}

body input:focus,
body select:focus,
body textarea:focus {
  border-color: var(--green);
  outline: none;
  box-shadow: 0 0 0 4px rgba(83, 103, 90, .14);
}

body .pay-button {
  min-height: 56px;
}

body .order-summary {
  position: sticky;
  top: 80px;
  align-self: start;
  min-height: calc(100vh - 80px);
}

@media (max-width: 1180px) {
  body .checkout-shell {
    grid-template-columns: minmax(0, 1fr);
    width: min(820px, 100%);
  }

  body .order-summary {
    position: static;
    grid-row: 1;
    min-height: 0;
  }

  body .checkout-form-panel {
    grid-row: 2;
  }
}

@media (max-width: 640px) {
  body .checkout-form-panel,
  body .order-summary {
    padding: 30px 16px;
  }

  body .field-row {
    grid-template-columns: minmax(0, 1fr);
  }

  body input,
  body select,
  body textarea {
    min-height: 54px;
    font-size: 16px;
  }

  body .summary-item {
    grid-template-columns: 62px minmax(0, 1fr) auto;
    gap: 11px;
  }

  body .summary-item img {
    width: 62px;
    height: 78px;
  }
}
