/**
 * AIE PMP Checkout redesign – matches reference screenshot
 * 1. One white container max-width 980px
 * 2. Full-width Checkout header
 * 3. Two columns: Left (Customer Details + Payment with Billing) | Right (Order summary)
 * 4. Buy Now button last in Payment section
 */

/* Page background – dark outside container (legacy); AIE front checkout uses hero instead */
body.aie-pmpro-checkout-page:not(.aie-checkout-page) #page .site-content,
body.aie-pmpro-checkout-page:not(.aie-checkout-page) .site-content {
  background: #000 !important;
}

.pmpro-checkout .site-main > article {
  padding: 0 !important;
}

.aie-pmpro-checkout {
  padding: 0;
}

.aie-pmpro-checkout .pmpro_section {
  margin: 0;
}

/* 1. Single white container – max-width 980px */
.aie-checkout-container {
  max-width: 980px;
  margin: 0 auto;
}

.aie-checkout-inner {
  background: #fff;
  padding: 40px;
  margin-bottom: 38px;
}

.aie-checkout-footer-wrap {
  margin: 0 0 54px;
  text-align: center;
  font-size: 23px;
  line-height: 32px;
  color: #fff;
  font-family: var(--font-secondary, Arial, sans-serif);
}

.aie-hide {
  display: none !important;
}

/* 2. Checkout header – full width, left-aligned */
.aie-checkout-page-title {
  font-size: 32px;
  line-height: 40px;
  font-weight: 400;
  color: #868686;
  margin: 0 0 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  text-align: left;
  width: 100%;
  font-family: var(--font-helvetica-light, "Helvetica Neue", Helvetica, sans-serif);
}

/* 3. Two-column layout – Left (steps) | Right (order summary) */
.aie-checkout-columns {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  align-items: start;
}

.aie-checkout-left {
  min-width: 0;
  padding: 0;
}

.aie-checkout-step {
  margin-bottom: 0;
}

.aie-checkout-step1, .aie-checkout-step1-done {
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(0,0,0,0.3);
}

/* Step headings */
.aie-checkout-step-heading {
  font-size: 24px;
  line-height: 32px;
  font-weight: 400;
  color: #000;
  margin: 0;
  font-family: var(--font-helvetica-light, "Helvetica Neue", Helvetica, sans-serif);
  display: flex;
  align-items: center;
}

.aie-checkout-step-heading .aie-step-num, .aie-checkout-step-heading.aie-step-done .aie-step-icon {
  font-weight: 400;
  width: 36px;
  line-height: 0;
}

.aie-checkout-step-heading.aie-step-inactive {
  color: rgb(0,0,0,0.4);
}

.aie-checkout-step-heading .aie-edit-details, .aie-checkout-step-heading .aie-checkout-logout {
  margin-left: auto;
  font-weight: 400;
  color: #0073aa;
  text-decoration: underline;
  font-size: 14px;
  display: none;
}

.aie-checkout-step-heading .aie-checkout-logout  {
  display: block;
}

.aie-checkout-step-heading .aie-edit-details:hover {
  color: #005a87;
}

.aie-checkout-step1 .pmpro_card {
  padding: 0;
  margin: 20px 0 0;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

.aie-checkout-step1 .pmpro_card .pmpro_card_content {
  padding: 0 !important;
}

.aie-checkout-step1 .pmpro_card .pmpro_card_content .pmpro_card_actions {
  background: none;
  padding: 13px 0;
  border: none;
  color: #000;
  font-size: 14px;
  font-family: Madefor,Helvetica Neue,Helvetica,Arial,sans-serif;
  font-weight: 400;
  line-height: 20px;
}

.aie-checkout-display-email {
  margin: 20px 0 0 !important;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: #646464;
  font-family: var(--font-body, Assistant, sans-serif);
}

.aie-checkout-logout {
  font-size: 15px;
}

.aie-checkout-logout a {
  color: #0073aa;
  text-decoration: underline;
}

.aie-checkout-logout a:hover {
  color: #005a87;
}

/* Login prompt */
.aie-checkout-login-prompt {
  margin: 0 0 16px;
  font-size: 15px;
  color: #444;
}

.aie-checkout-login-prompt a {
  color: #000;
  text-decoration: underline;
}

.aie-checkout-signup-prompt {
  margin: 0;
  font-size: 14px;
  color: #000;
  font-family: Madefor,Helvetica Neue,Helvetica,Arial,sans-serif;
}

.aie-checkout-signup-prompt a {
  color: #000;
  text-decoration: underline;
}

.aie-checkout-guest-divider {
  display: flex;
  align-items: center;
  margin: 16px 0 20px;
  font-size: 14px;
  color: #868686;
}

.aie-checkout-guest-divider::before,
.aie-checkout-guest-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(0, 0, 0, 0.12);
}

.aie-checkout-guest-divider span {
  padding: 0 12px;
}

/* Form fields – clean minimal style */
.aie-checkout-left .pmpro_form_label {
  font-size: 14px;
  font-weight: 400 !important;
  color: #000;
  margin-bottom: 8px;
  font-family: Madefor,Helvetica Neue,Helvetica,Arial,sans-serif;
  display: block;
}

.aie-checkout-left .pmpro_form_input,
.aie-checkout-left input[type="text"],
.aie-checkout-left input[type="email"],
.aie-checkout-left input[type="password"],
.aie-checkout-left select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #000 !important;
  border-radius: 0;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  font-family: var(--font-body, Assistant, sans-serif);
  margin-bottom: 0;
  color: #000;
  box-shadow: none !important;
}

.aie-checkout-left .pmpro_form_field {
  margin-bottom: 16px;
  width: 100%;
}

#pmpro_payment_information_fields .pmpro_card {
  margin-top: 20px;
  box-shadow: none;
  border-color: #000;
  border-radius: 4px;
}

#pmpro_payment_information_fields .pmpro_card .pmpro_card_content {
  padding: 10px 30px 20px;
}

#pmpro_payment_information_fields .pmpro_card .pmpro_card_content .pmpro_form_legend, #pmpro_billing_address_fields .pmpro_card .pmpro_card_content .pmpro_form_legend {
  display: none;
}

#pmpro_billing_address_fields .pmpro_card {
  margin-top: 10px;
  box-shadow: none;
  border: none;
  border-radius: 0;
}

#pmpro_billing_address_fields .pmpro_card .pmpro_card_content {
  padding: 0;
}

#pmpro_billing_address_fields .pmpro_form_field {
  margin-bottom: 0;
  gap: 0;
}

/* Continue button */
.aie-checkout-continue-btn {
  display: block;
  width: 100%;
  max-width: 100%;
  background: #000 !important;
  color: #fff !important;
  border: none;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  margin-top: 24px;
}

.aie-checkout-continue-btn:hover {
  background: #333 !important;
  color: #fff !important;
}

/* 4. Buy Now button – last option in Payment section */
.aie-buy-now-btn,
#pmpro_btn-submit.aie-buy-now-btn,
.aie-checkout-left .pmpro_form_submit .pmpro_btn-submit-checkout {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  background: #000 !important;
  color: #fff !important;
  border: none !important;
  padding: 12px 24px !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  cursor: pointer !important;
  border-radius: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  font-family: var(--font-helvetica-light, "Helvetica Neue", Helvetica, sans-serif);
  text-decoration: none;
}

span#pmpro_submit_span {
  width: 100%;
}

.aie-buy-now-btn:hover {
  background: #333 !important;
  color: #fff !important;
}

.aie-checkout-left .pmpro_form_submit {
  width: 100%;
  margin: 0;
}

input#pmpro_btn-submit:hover {
  text-decoration: underline;
}

#pmpro_processing_message {
  display: none;
}

/* Order summary – right column, boxed */
.aie-checkout-sidebar {
  position: sticky;
  top: 24px;
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 16px;
}

.aie-checkout-sidebar .secure-checkout-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-direction: row;
  justify-content: center;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: var(--aie-black);
  font-family: var(--font-helvetica-light), sans-serif;
}

.aie-order-summary {
  background: #fff;
  border: 1px solid rgba(0,0,0,.3);
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 30px;
  align-items: stretch;
}

.aie-order-summary-title {
  font-size: 24px;
  font-weight: 400;
  color: #000;
  margin: 0;
  line-height: 28px;
  font-family: var(--font-helvetica-light, "Helvetica Neue", Helvetica, sans-serif);
}

.aie-order-summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.aie-order-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2px;
}

.aie-order-summary-name {
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: #000;
  font-family: var(--font-helvetica-light, "Helvetica Neue", Helvetica, sans-serif);
}

.aie-order-summary-price {
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: #000;
  font-family: var(--font-helvetica-light, "Helvetica Neue", Helvetica, sans-serif);
}

.aie-order-summary-duration {
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: #646464;
  margin: 0 !important;
  font-family: var(--font-helvetica-light, "Helvetica Neue", Helvetica, sans-serif);
}

hr.aie-order-summary-divider {
  margin: 0;
  background: rgba(0, 0, 0, 0.3);
}

.aie-order-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 20px;
  line-height: 28px;
  font-weight: 400;
  color: #000;
  font-family: var(--font-helvetica-light, "Helvetica Neue", Helvetica, sans-serif);
}

.aie-order-summary-secure {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #868686;
  margin: 16px 0 0;
}

.aie-order-summary-secure svg {
  flex-shrink: 0;
}

/* Payment section – card icons / payment methods */
.aie-checkout-step2 .pmpro_form_legend h2 {
  font-size: 16px !important;
  font-weight: 600 !important;
  margin-bottom: 16px !important;
}

/* Billing Address */
.aie-checkout-step2 .pmpro_cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.aie-checkout-step2 .pmpro_form_field-baddress1,
.aie-checkout-step2 .pmpro_form_field-baddress2,
.aie-checkout-step2 .pmpro_form_field-bfirstname,
.aie-checkout-step2 .pmpro_form_field-blastname,
.aie-checkout-step2 .pmpro_form_field-bcity {
  grid-column: 1 / -1;
}

.aie-checkout-sidebar .pmpro_form_submit {
  display: none;
}

/* Responsive */
@media (max-width: 767px) {
  .aie-checkout-inner {
    padding: 24px;
  }

  .aie-checkout-page-title {
    padding-bottom: 24px;
  }

  .aie-checkout-columns {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .aie-checkout-sidebar {
    position: static;
  }

  .aie-checkout-step2 .pmpro_cols-2 {
    grid-template-columns: 1fr;
  }

  .aie-checkout-left .pmpro_form_submit {
    display: none;
  }

  .aie-checkout-sidebar .pmpro_form_submit {
    display: flex;
  }
}

/* AIE front checkout (loads after global.css) – align tokens with child theme */
body.aie-checkout-page .aie-checkout-step1,
body.aie-checkout-page .aie-checkout-step1-done {
  border-bottom: 1px solid #eaeaea;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
}

body.aie-checkout-page .aie-checkout-step-heading {
  font-family: "Anton", system-ui, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.25;
  color: var(--text, #171717);
}

body.aie-checkout-page .aie-checkout-step-heading.aie-step-inactive {
  color: var(--text-subtle, #737373);
}

body.aie-checkout-page .aie-checkout-step-heading .aie-step-num,
body.aie-checkout-page .aie-checkout-step-heading.aie-step-done .aie-step-icon {
  width: auto;
  min-width: 1.75rem;
  line-height: 1;
}

body.aie-checkout-page .aie-checkout-left .pmpro_form_input,
body.aie-checkout-page .aie-checkout-left input[type="text"],
body.aie-checkout-page .aie-checkout-left input[type="email"],
body.aie-checkout-page .aie-checkout-left input[type="password"],
body.aie-checkout-page .aie-checkout-left select {
  border: 1px solid #d4d4d4 !important;
  border-radius: 0.75rem !important;
}

body.aie-checkout-page .aie-checkout-continue-btn,
body.aie-checkout-page .aie-buy-now-btn {
  border-radius: 999px !important;
}

body.aie-checkout-page .aie-order-summary {
  border-color: #e5e5e5 !important;
}
