.checkout-dialog {
  width: min(880px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  border: 0;
  border-radius: 26px;
  background: transparent;
  color: var(--ink);
  overflow: auto;
}

.checkout-dialog::backdrop {
  background: rgba(32, 22, 16, 0.72);
  backdrop-filter: blur(5px);
}

.checkout-dialog__panel {
  position: relative;
  border: 1px solid rgba(93, 61, 36, 0.14);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: 0 28px 90px rgba(31, 20, 12, 0.34);
  overflow: hidden;
}

.checkout-dialog__head {
  padding: 28px 32px 20px;
  padding-right: 92px;
  border-bottom: 1px solid rgba(159, 119, 82, 0.14);
}

.checkout-dialog__eyebrow {
  margin: 0 0 7px;
  color: var(--gold-deep);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.checkout-dialog__panel h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 38px);
  line-height: 1.14;
  letter-spacing: -0.035em;
}

.checkout-dialog__summary {
  margin: 9px 0 0;
  color: #5f5149;
  font-size: 16px;
  font-weight: 850;
}

.checkout-dialog__lead {
  margin: 7px 0 0;
  color: #786a61;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.6;
}

.checkout-dialog__close {
  position: absolute;
  right: 24px;
  top: 22px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdf8;
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.checkout-dialog__close:hover,
.checkout-dialog__close:focus-visible,
.checkout-contact-done:hover,
.checkout-contact-done:focus-visible,
.checkout-contact-summary button:hover,
.checkout-contact-summary button:focus-visible {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 4px rgba(183, 128, 56, 0.12);
}

.checkout-dialog__body {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: 26px;
  padding: 24px 32px 30px;
}

.checkout-section-title {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.035em;
}

.checkout-contact-summary,
.checkout-contact-editor,
.checkout-coupon,
.checkout-totals,
.checkout-method,
.checkout-dialog__fineprint {
  border: 1px solid #e3d5c8;
  background: rgba(255, 255, 255, 0.62);
}

.checkout-contact-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-height: 90px;
  padding: 14px 16px;
  border-radius: 15px;
}

.checkout-contact-summary[hidden],
.checkout-contact-editor[hidden] {
  display: none !important;
}

.checkout-contact-summary strong,
.checkout-contact-summary span {
  display: block;
}

.checkout-contact-summary strong {
  font-size: 14px;
}

.checkout-contact-summary span {
  margin-top: 3px;
  color: #786a61;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.checkout-contact-summary button {
  padding: 3px 5px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--wine);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.checkout-contact-editor {
  padding: 15px;
  border-radius: 15px;
}

.checkout-contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 11px;
}

.checkout-contact-grid label {
  gap: 5px;
  font-size: 12px;
}

.checkout-contact-grid input {
  min-height: 43px;
  padding: 9px 11px;
  border-radius: 10px;
}

.checkout-contact-done {
  width: 100%;
  min-height: 40px;
  margin-top: 11px;
  border: 1px solid rgba(111, 41, 39, 0.28);
  border-radius: 10px;
  background: #fff9f0;
  color: var(--wine);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.checkout-coupon {
  margin-top: 11px;
  border-radius: 15px;
}

.checkout-coupon summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 0 15px;
  cursor: pointer;
  list-style: none;
}

.checkout-coupon summary::-webkit-details-marker {
  display: none;
}

.checkout-coupon summary::after {
  content: "+";
  color: var(--wine);
  font-size: 18px;
  font-weight: 700;
}

.checkout-coupon[open] summary::after {
  content: "−";
}

.checkout-coupon summary strong {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 850;
}

.checkout-coupon summary span {
  margin-left: auto;
  color: #82746a;
  font-size: 10px;
}

.checkout-coupon__body {
  padding: 0 14px 12px;
}

.checkout-coupon__controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.checkout-coupon__controls input {
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid #d8cabb;
  border-radius: 10px;
  background: #fff;
  text-transform: uppercase;
}

.checkout-coupon__controls button {
  min-width: 68px;
  border: 1px solid #83232b;
  border-radius: 10px;
  background: #83232b;
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.checkout-coupon__controls button[data-coupon-remove] {
  grid-column: 2;
  border-color: #d4c5b6;
  background: #fff;
  color: #5d4d44;
}

.checkout-coupon__body > p {
  min-height: 17px;
  margin: 6px 0 0;
  color: #2f7341;
  font-size: 11px;
}

.checkout-coupon__body > p.is-error {
  color: #b32630;
}

.checkout-totals {
  display: grid;
  gap: 0;
  margin: 11px 0 0;
  padding: 10px 15px;
  border-radius: 15px;
}

.checkout-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
  align-items: center;
}

.checkout-totals > div + div {
  border-top: 1px solid #eadfd4;
}

.checkout-totals dt,
.checkout-totals dd {
  margin: 0;
  color: #74675f;
  font-size: 12px;
}

.checkout-totals dd {
  font-weight: 850;
}

.checkout-totals > div:last-child {
  min-height: 38px;
}

.checkout-totals > div:last-child dt,
.checkout-totals > div:last-child dd {
  color: var(--wine);
  font-size: 15px;
  font-weight: 950;
}

.checkout-methods {
  display: grid;
  gap: 12px;
}

.checkout-method {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 13px;
  min-height: 126px;
  padding: 15px;
  border-radius: 18px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.checkout-method__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 48px;
  border: 1px solid rgba(73, 49, 31, 0.12);
  border-radius: 12px;
  background: #fff;
}

.checkout-method__logo--stripe {
  color: #635bff;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.05em;
  text-transform: lowercase;
}

.checkout-method__logo--ecpay img {
  display: block;
  width: 58px;
  height: auto;
  max-height: 25px;
  object-fit: contain;
}

.checkout-method__content {
  display: block;
  min-width: 0;
}

.checkout-method strong {
  display: block;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.checkout-method__desc {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
}

.checkout-method__brands {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.checkout-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 25px;
  padding: 2px 7px;
  border: 1px solid #e4d9cf;
  border-radius: 7px;
  background: #fff;
}

.checkout-brand img {
  display: block;
  width: auto;
  max-width: 31px;
  height: auto;
  max-height: 17px;
}

.checkout-brand--apple {
  color: #24201e;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}

.checkout-method__eligibility {
  display: block;
  margin-top: 6px;
  color: #8a786c;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
}

.checkout-method__arrow {
  color: var(--wine);
  font-size: 23px;
  font-weight: 700;
  text-align: right;
}

.checkout-method:hover,
.checkout-method:focus-visible {
  border-color: var(--wine);
  outline: none;
  background: #fffdf8;
  box-shadow: 0 14px 28px rgba(111, 41, 39, 0.1);
  transform: translateY(-1px);
}

.checkout-method:active {
  transform: translateY(0);
}

.checkout-method:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.checkout-dialog__fineprint {
  display: flex;
  gap: 9px;
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 14px;
  color: #796b62;
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1.55;
}

.checkout-dialog__message {
  min-height: 20px;
  margin: 9px 0 0;
  color: #725323;
  font-size: 12px;
  font-weight: 750;
}

.checkout-dialog__message:empty {
  min-height: 0;
  margin-top: 0;
}

.checkout-dialog__message.is-error {
  color: #922c29;
}

.payment-status-card {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid rgba(111, 41, 39, 0.18);
  border-radius: 20px;
  background: #fff8ec;
}

.payment-status-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 25px;
}

.payment-status-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.payment-status-card dl {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
}

.payment-status-card dl div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
}

.payment-status-card dt {
  color: var(--muted);
  font-size: 12px;
}

.payment-status-card dd {
  margin: 0;
  font-weight: 800;
  word-break: break-all;
}

.payment-status-card__note {
  color: var(--wine) !important;
  font-weight: 750;
}

.checkout-dialog button,
.checkout-dialog a {
  text-decoration: none;
}

.checkout-dialog button:disabled {
  transform: none;
}

.form-actions [hidden] {
  display: none !important;
}

@media (max-width: 680px) {
  .checkout-dialog {
    width: calc(100vw - 14px);
    max-height: calc(100dvh - 14px);
    border-radius: 22px;
  }

  .checkout-dialog__panel {
    border-radius: 22px;
  }

  .checkout-dialog__head {
    padding: 20px 18px 15px;
    padding-right: 64px;
  }

  .checkout-dialog__close {
    right: 15px;
    top: 14px;
    width: 38px;
    height: 38px;
    font-size: 24px;
  }

  .checkout-dialog__panel h2 {
    font-size: 27px;
  }

  .checkout-dialog__summary {
    margin-top: 6px;
    font-size: 14px;
  }

  .checkout-dialog__lead {
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.5;
  }

  .checkout-dialog__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 18px 22px;
  }

  .checkout-dialog__body.is-contact-compact .checkout-payment {
    order: 1;
  }

  .checkout-dialog__body.is-contact-compact .checkout-details {
    order: 2;
  }

  .checkout-section-title {
    margin-bottom: 9px;
  }

  .checkout-method {
    grid-template-columns: 62px minmax(0, 1fr) 18px;
    gap: 10px;
    min-height: 108px;
    padding: 13px;
  }

  .checkout-method__logo {
    width: 62px;
    height: 42px;
  }

  .checkout-method__logo--stripe {
    font-size: 18px;
  }

  .checkout-method__logo--ecpay img {
    width: 50px;
  }

  .checkout-method strong {
    font-size: 18px;
  }

  .checkout-method__desc {
    margin-top: 3px;
    font-size: 11px;
  }

  .checkout-method__brands {
    gap: 5px;
    margin-top: 6px;
  }

  .checkout-brand {
    min-width: 37px;
    height: 22px;
    padding: 2px 5px;
  }

  .checkout-brand img {
    max-width: 27px;
    max-height: 14px;
  }

  .checkout-brand--apple {
    font-size: 8px;
  }

  .checkout-method__eligibility {
    margin-top: 5px;
    font-size: 9.5px;
  }

  .checkout-contact-summary {
    min-height: 86px;
    padding: 13px 14px;
  }

  .checkout-coupon,
  .checkout-totals {
    margin-top: 9px;
  }

  .checkout-coupon summary span {
    display: none;
  }

  .checkout-dialog__fineprint {
    font-size: 10px;
  }

  .payment-status-card dl div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
