.checkout {
  --checkout-panel: #191919;
  --checkout-border: #333;
  --checkout-error: #ff7d7d;
}

.checkout [hidden] { display: none !important; }
.checkout .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.checkout-main {
  padding-block: clamp(70px, 6.8vw, 132px) clamp(100px, 13vw, 250px);
}

.checkout-main h1 {
  font-size: clamp(30px, 3.4vw, 52px);
  margin-block: 18px clamp(48px, 4vw, 74px);
}

.checkout-eyebrow { color: var(--accent); font-weight: 700; }
.checkout h2 { font-size: 20px; font-weight: 500; }
.checkout h2:focus { outline: none; }
.checkout h3 { font-size: 18px; }

.checkout-product {
  display: grid;
  grid-template-columns: minmax(0, 500px) minmax(0, 1fr);
  gap: clamp(28px, 2.6vw, 50px);
  align-items: start;
  margin-block-end: clamp(70px, 5.2vw, 100px);
}

.checkout-product figure {
  display: grid;
  place-items: center;
  border-radius: 24px;
  aspect-ratio: 1;
  background: var(--checkout-panel);
}

.checkout-product figure img { width: 100%; height: auto; }
.checkout-product figure [data-checkout-image="beyonsense-1"] { width: 69%; }
.checkout-product-details { padding-block-start: 32px; }
.checkout-product-details h2 { font-size: clamp(24px, 1.6vw, 30px); font-weight: 700; }
.checkout-heading-line { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.checkout-unit-price { color: var(--muted); margin-block: 8px 38px; font-size: 24px; }
.checkout-quantity { display: inline-flex; align-items: center; border: 1px solid #777; border-radius: 9px; }
.checkout-quantity button { width: 48px; min-height: 58px; font-size: 25px; background: none; border: 0; color: inherit; }
.checkout-quantity button:disabled { color: var(--muted); }
.checkout-quantity output { min-width: 46px; text-align: center; font-weight: 700; }
.checkout-note { color: var(--muted); line-height: 1.5; font-size: 15px; overflow-wrap: anywhere; }
.checkout-quantity + .checkout-note { margin-block-start: 16px; }

.checkout-total {
  border-top: 1px solid var(--checkout-border);
  margin-block-start: 36px;
  padding-block-start: 28px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
  font-weight: 700;
}

.checkout-total output { color: var(--accent); font-size: clamp(24px, 3vw, 40px); white-space: nowrap; }
.checkout-total small { font-size: 14px; font-weight: 500; }
.checkout-estimate { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.checkout-estimate b { margin-inline-start: 0.35em; }
.checkout-freight { color: var(--accent); }
.checkout-discount { color: #f2cd45; }
.checkout-actions { display: grid; justify-items: end; gap: 12px; margin-block-start: 36px; }
.checkout-button { justify-content: center; min-inline-size: min(200px, 100%); }
.checkout-button:disabled { background: #353535; color: #c8c8c8; }
.checkout-edit { background: none; border: 0; color: var(--accent); padding: 8px 0; }
.checkout-edit:hover, .checkout-legal a:hover { text-decoration: underline; }

.checkout-step + .checkout-step { margin-block-start: 20px; }
.checkout-step-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
  padding: 18px 34px;
  border-radius: 20px;
  background: var(--checkout-panel);
}

.checkout-step-body { padding: 32px 30px clamp(54px, 5vw, 96px); }
.checkout-step-body fieldset { min-inline-size: 0; border: 0; margin: 0 0 26px; padding: 0; }
.checkout-step-body legend { padding: 0; font-weight: 700; margin-block-end: 12px; }
.checkout-step-body label {
  display: grid;
  gap: 7px;
  color: #d8d8d8;
  font-size: 15px;
  margin-block-end: 15px;
}

.checkout-step-body input:not([type="checkbox"]),
.checkout-step-body select,
.checkout-card-field {
  width: 100%;
  min-width: 0;
  min-height: 58px;
  border: 1px solid var(--checkout-border);
  border-radius: 16px;
  padding: 13px 20px;
  background: var(--background);
  color: var(--foreground);
  font: inherit;
  font-size: 16px;
}

.checkout-card-field { padding-block: 19px; }
.checkout-card-field.StripeElement--focus { outline: 2px solid var(--accent); }
.checkout-step-body [aria-invalid="true"] { border-color: var(--checkout-error); }
.checkout-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.checkout-step-body .checkout-check { display: flex; gap: 10px; align-items: center; }
.checkout-check input { accent-color: var(--accent); inline-size: 20px; block-size: 20px; }
.checkout-delivery-note { padding-inline-start: 18px; }
.checkout-delivery-note li + li { margin-block-start: 5px; }
.checkout-promo { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: end; max-width: 900px; }
.checkout-promo label { margin: 0; }
.checkout-promo-button { border: 0; border-radius: 999px; min-height: 50px; background: #fff; color: #000; }
.checkout-promo-button:disabled { background: #353535; color: #c8c8c8; }
#promo-status { margin-block-start: 12px; }
.checkout-error { color: var(--checkout-error); margin-block-start: 8px; font-size: 15px; }
.checkout-snapshot p { color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; line-height: 1.55; margin-block: 12px 24px; }
.checkout-snapshot p:last-child { margin-block-end: 0; }

.checkout-breakdown { margin-block: 22px 0; }
.checkout-breakdown div { display: flex; justify-content: space-between; gap: 16px; padding-block: 10px; font-weight: 500; }
.checkout-breakdown dd { margin: 0; }
.checkout-breakdown [data-money="shipping"], .checkout-breakdown div:has([data-money="shipping"]) dt { color: var(--accent); }
.checkout-breakdown div:has([data-money="discount"]) { color: #f2cd45; }
.checkout-placement-actions { justify-items: center; }
.checkout-placement-actions .checkout-button { width: min(500px, 100%); }
.checkout-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 24px; list-style: none; padding: 0; color: var(--muted); }
.checkout-legal a { text-decoration: none; }

.checkout-result {
  width: min(700px, 100% - 36px);
  max-height: calc(100% - 36px);
  background: #000;
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: 20px;
  text-align: center;
  padding: clamp(34px, 5vw, 76px) 24px;
}

.checkout-result::backdrop { background: rgb(0 0 0 / 70%); }
.checkout:has(.checkout-result[open]) { overflow: hidden; }
.checkout-result-close { position: absolute; inset: 12px 20px auto auto; text-decoration: none; font-size: 28px; }
.checkout-checkmark { display: grid; place-items: center; border: 5px solid; border-radius: 50%; color: var(--accent); width: 70px; height: 70px; font-size: 42px; margin: 0 auto 30px; }
.checkout-result h2 { font-size: clamp(28px, 4vw, 52px); font-weight: 700; margin-block-end: 14px; }
.checkout-result p { color: #d0d0d0; line-height: 1.5; }
.checkout-result .checkout-button { margin-block-start: 30px; }

@media (max-width: 1000px) {
  .checkout-product { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
}

@media (max-width: 767px) {
  .checkout-main { padding-block-start: 110px; }
  .checkout-product { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .checkout-product-details { padding: 0; }
  .checkout-product figure { border-radius: 20px; }
  .checkout-unit-price { margin-block: 8px 26px; }
  .checkout-actions { justify-items: center; text-align: center; margin-block-start: 30px; }
  .checkout-step-heading { padding-inline: 20px; border-radius: 10px; }
  .checkout-step-body { padding-inline: 0; }
  .checkout-step-body .checkout-total { flex-direction: column; align-items: stretch; }
  .checkout-step-body .checkout-total output { align-self: end; }
  .checkout-estimate { flex-direction: column; }
  .checkout-row { grid-template-columns: minmax(0, 1fr); }
  .checkout-promo { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .checkout-promo-button { justify-self: start; min-inline-size: 120px; }
  .checkout-legal { flex-direction: column; }
}
