/**
 * NMA Checkout — v4-homepage design system
 *
 * Loaded only on the WooCommerce checkout page (is_checkout()).
 * All rules scoped under body.woocommerce-checkout to prevent bleed.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

@font-face {
  font-family: 'Salzburg';
  src: url('../includes/fonts/SalzburgRR/SalzburgRR-Book.woff2') format('woff2'),
       url('../includes/fonts/SalzburgRR/SalzburgRR-Book.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Salzburg';
  src: url('../includes/fonts/SalzburgRR/salzburg-medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Salzburg';
  src: url('../includes/fonts/SalzburgRR/salzburg-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── Base styles ────────────────────────────────────────────────────────────── */
body.woocommerce-checkout {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #404040;
  background: #fff;
}

body.woocommerce-checkout #main {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

/* Page title ("Checkout") — actual class is h1.standard_checkout_title */
body.woocommerce-checkout .entry-title,
body.woocommerce-checkout #main > header h1,
body.woocommerce-checkout h1.standard_checkout_title {
  font-family: 'Salzburg', Georgia, serif;
  font-weight: 700;
  color: #042f2e;
  text-align: center;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  float: none;
  line-height: 1.3;
}

/* Hide safe-checkout seal badges (don't fit v4 design) */
body.woocommerce-checkout .seals {
  display: none;
}

/* Content area — normalize font */
body.woocommerce-checkout .entry {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ── Section headings (h3: numbered steps) ──────────────────────────────────── */
body.woocommerce-checkout h3#order_review_heading,
body.woocommerce-checkout h3#billing_information_heading,
body.woocommerce-checkout h3#payment_information_heading {
  font-family: 'Salzburg', Georgia, serif;
  font-weight: 500;
  font-size: 1.1em;
  color: #042f2e;
  margin: 1.75rem 0 1rem;
  padding: 0;
}

body.woocommerce-checkout .nma-order-summary h3#order_review_heading {
  margin-top: 0;
}

/* ── Order summary card ─────────────────────────────────────────────────────── */
body.woocommerce-checkout .nma-order-summary {
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 1.5rem;
  padding: 1.5rem;
}

/* Product name — the most prominent element */
body.woocommerce-checkout .nma-order-summary__product-name {
  font-family: 'Salzburg', Georgia, serif;
  font-weight: 700;
  color: #042f2e;
  font-size: 1.2em;
  margin-bottom: 0.75em;
}

body.woocommerce-checkout .nma-order-summary__product-desc {
  font-family: 'Inter', sans-serif;
  font-size: 0.85em;
  color: #737373;
  margin-top: 0.25em;
}

/* Hook tables (Bonus Tokens, etc.) — subordinate */
body.woocommerce-checkout .nma-order-summary__hook-table {
  font-size: 0.85em;
  color: #737373;
  margin: 0.25em 0 0.5em;
}

body.woocommerce-checkout .nma-order-summary__hook-table td,
body.woocommerce-checkout .nma-order-summary__hook-table th {
  padding: 0.2em 0;
  border: 0;
  color: #737373;
}

body.woocommerce-checkout .nma-order-summary__hook-table th {
  font-weight: 500;
}

/* Coupon line — small, teal accent */
body.woocommerce-checkout .nma-order-summary__coupon {
  color: #0d9488;
  font-size: 0.9em;
}

/* Today's charge — THE key number, visually separated */
body.woocommerce-checkout .nma-order-summary__today {
  font-weight: 700;
  font-size: 1.5em;
  color: #042f2e;
  border-top: 1px solid #e5e5e5;
  padding-top: 1em;
  margin-top: 0.75em;
}

body.woocommerce-checkout .nma-order-summary__trial-note {
  font-size: 0.85em;
  color: #a3a3a3;
  font-style: italic;
}

/* Divider between today and recurring */
body.woocommerce-checkout .nma-order-summary__divider {
  border-top: 1px dashed #d4d4d4;
  margin: 1.25em 0;
}

/* Recurring section — clearly secondary */
body.woocommerce-checkout .nma-order-summary__recurring-amount {
  font-size: 0.95em;
  font-weight: 500;
  color: #404040;
}

body.woocommerce-checkout .nma-order-summary__next-date {
  font-size: 0.85em;
  color: #a3a3a3;
}

/* ── Form layout — single column ────────────────────────────────────────────── */
body.woocommerce-checkout .cols-1-3.row,
body.woocommerce-checkout .col2-set,
body.woocommerce-checkout .col2-set .col-1,
body.woocommerce-checkout .col2-set .col-2 {
  width: 100%;
  float: none;
}

body.woocommerce-checkout .form-row {
  width: 100%;
  float: none;
  margin-bottom: 1rem;
}

body.woocommerce-checkout .form-row-first {
  width: 48%;
  float: left;
  clear: left;
}

body.woocommerce-checkout .form-row-last {
  width: 48%;
  float: right;
}

body.woocommerce-checkout .form-row-wide {
  width: 100%;
  float: none;
  clear: both;
}

/* ── Form labels ────────────────────────────────────────────────────────────── */
body.woocommerce-checkout .form-row label {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.9em;
  color: #171717;
  margin-bottom: 0.35rem;
}

/* ── Form inputs ────────────────────────────────────────────────────────────── */
body.woocommerce-checkout .form-row .input-text,
body.woocommerce-checkout .form-row select,
body.woocommerce-checkout .form-row textarea {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  border: 1px solid #d4d4d4;
  border-radius: 0.375rem;
  padding: 0.65rem 0.85rem;
  background: #fff;
  color: #171717;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

body.woocommerce-checkout .form-row .input-text:focus,
body.woocommerce-checkout .form-row select:focus,
body.woocommerce-checkout .form-row textarea:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.25);
}

/* Validated / invalid states */
body.woocommerce-checkout .form-row.woocommerce-validated .input-text {
  border-color: #0d9488;
}

body.woocommerce-checkout .form-row.woocommerce-invalid .input-text {
  border-color: #e11d48;
}

/* ── Payment section ────────────────────────────────────────────────────────── */
body.woocommerce-checkout #payment {
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 1.5rem;
  padding: 1.5rem;
  margin-top: 1.25rem;
}

body.woocommerce-checkout #payment h3#payment_information_heading {
  margin-top: 0;
}

body.woocommerce-checkout .payment_methods {
  margin: 0 0 1rem !important;
  padding: 0 !important;
  list-style: none !important;
  border: 0 !important;
}

body.woocommerce-checkout .payment_methods li.wc_payment_method {
  background: #fff;
  border: 1px solid #e5e5e5 !important;
  border-radius: 0.375rem;
  padding: 0.85rem 1rem !important;
  margin-bottom: 0.5rem;
  list-style: none !important;
}

body.woocommerce-checkout .payment_methods li label {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  color: #171717;
  cursor: pointer;
}

/* Override custom.css legacy 17px/22px bold payment labels */
body.woocommerce-checkout form div#payment.woocommerce-checkout-payment ul.payment_methods li > label {
  font-family: 'Inter', sans-serif;
  font-size: 0.95em !important;
  font-weight: 500 !important;
  padding: 0 !important;
  color: #404040;
}

body.woocommerce-checkout form div#payment.woocommerce-checkout-payment ul.payment_methods li.gateway_active > label {
  font-size: 0.95em !important;
  font-weight: 600 !important;
  color: #171717;
}

/* Payment box — must match WC specificity: .woocommerce-checkout #payment div.payment_box */
body.woocommerce-checkout #payment div.payment_box {
  background-color: #fafafa;
  color: #404040;
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 0.75rem 0 0;
  font-size: 0.9em;
  line-height: 1.5;
}

body.woocommerce-checkout #payment div.payment_box::before {
  border-bottom-color: #fafafa;
  border-right-color: transparent;
  border-left-color: transparent;
  border-top-color: transparent;
}

/* ── Place Order button ─────────────────────────────────────────────────────── */
body.woocommerce-checkout #place_order {
  background: #e11d48;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  border-radius: 0.375rem;
  padding: 0.75rem 1.5rem;
  width: 100%;
  cursor: pointer;
  transition: background-color 0.15s ease;
  text-shadow: none;
  float: none;
}

body.woocommerce-checkout #place_order:hover {
  background: #f43f5e;
}

/* GoDaddy site seal — subtle alignment */
body.woocommerce-checkout .submit_area {
  text-align: center;
}

body.woocommerce-checkout .submit_area #siteseal {
  display: block;
  margin-bottom: 0.75rem;
}

/* ── Coupon toggle bar ──────────────────────────────────────────────────────── */
body.woocommerce-checkout .woocommerce-form-coupon-toggle .woocommerce-info {
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 0.375rem;
  font-size: 0.9em;
  color: #404040;
}

body.woocommerce-checkout .woocommerce-form-coupon-toggle .woocommerce-info a {
  color: #0d9488;
  font-weight: 500;
}

body.woocommerce-checkout .woocommerce-form-coupon-toggle .woocommerce-info a:hover {
  color: #042f2e;
}

/* Coupon form styling */
body.woocommerce-checkout .checkout_coupon {
  border: 1px solid #e5e5e5 !important;
  border-radius: 0.375rem;
  padding: 1rem !important;
  margin-bottom: 1.5rem !important;
}

/* ── Stripe "Pay with Link" — hidden ────────────────────────────────────────── */
body.woocommerce-checkout #wc-stripe-link-button-wrapper,
body.woocommerce-checkout .wc-stripe-link-button-wrapper {
  display: none;
}

/* ── Billing section card ───────────────────────────────────────────────────── */
body.woocommerce-checkout .woocommerce-billing-fields {
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 1.5rem;
  padding: 1.5rem;
  margin-top: 1.25rem;
}

body.woocommerce-checkout .woocommerce-billing-fields h3#billing_information_heading {
  margin-top: 0;
}

/* ── WooCommerce notices — v4 teal/rose palette ────────────────────────────── */
body.woocommerce-checkout .woocommerce-message,
body.woocommerce-checkout .woocommerce-error,
body.woocommerce-checkout .woocommerce-info {
  border-radius: 0.375rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.9em;
}

body.woocommerce-checkout .woocommerce-message {
  background-color: #f0fdfa;
  border-top-color: #14b8a6;
  color: #042f2e;
}
body.woocommerce-checkout .woocommerce-message::before {
  color: #0d9488;
}

body.woocommerce-checkout .woocommerce-error {
  background-color: #fff1f2;
  border-top-color: #e11d48;
}
body.woocommerce-checkout .woocommerce-error::before {
  color: #e11d48;
}

body.woocommerce-checkout .woocommerce-info {
  background-color: #fafafa;
  border-top-color: #d4d4d4;
}
body.woocommerce-checkout .woocommerce-info::before {
  color: #a3a3a3;
}

/* ── Account fields for guest checkout ──────────────────────────────────────── */
body.woocommerce-checkout .woocommerce-account-fields {
  margin-top: 1rem;
}

/* ── Logged-in account summary bar ────────────────────────────────────────── */
body.woocommerce-checkout .nma-checkout-account-summary {
  font-family: 'Inter', sans-serif;
  font-size: 0.85em;
  color: #737373;
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-top: 1.25rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

body.woocommerce-checkout .nma-checkout-account-summary strong {
  color: #171717;
  font-weight: 600;
}

body.woocommerce-checkout .nma-checkout-account-summary__signout {
  color: #0d9488;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

body.woocommerce-checkout .nma-checkout-account-summary__signout:hover {
  color: #042f2e;
  text-decoration: underline;
}

/* Sign-in prompt for logged-out users */
body.woocommerce-checkout .nma-checkout-signin-prompt {
  font-family: 'Inter', sans-serif;
  font-size: 0.9em;
  color: #737373;
  margin: -0.25rem 0 1rem;
}

body.woocommerce-checkout .nma-checkout-signin-prompt a {
  color: #0d9488;
  font-weight: 500;
  text-decoration: none;
}

body.woocommerce-checkout .nma-checkout-signin-prompt a:hover {
  color: #042f2e;
  text-decoration: underline;
}

/* ── Password show/hide toggle ─────────────────────────────────────────────── */
body.woocommerce-checkout #main .show-password-input {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

body.woocommerce-checkout #main .show-password-input:focus {
  outline: 2px solid #14b8a6;
  outline-offset: 2px;
  box-shadow: none !important;
}

/* Teal-colored eye icon (override WC default black) */
body.woocommerce-checkout #main .show-password-input::after {
  color: #0d9488 !important;
}

/* ── Terms and conditions checkbox ──────────────────────────────────────────── */
body.woocommerce-checkout .form-row.place-order.checkboxes {
  margin-bottom: 0;
}

body.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper {
  font-size: 0.85em;
  color: #737373;
  margin-bottom: 1rem;
}

body.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper a {
  color: #0d9488;
}

/* ── Suppress WooCommerce blockUI overlay ─────────────────────────────────── */
/* WC checkout.js calls $form.block() on submit, creating a white semi-transparent
   overlay. The custom theme already provides its own full-screen overlay (#overlay)
   and spinner, so the WC blockUI is redundant. */
body.woocommerce-checkout form.checkout .blockUI.blockOverlay {
  display: none !important;
}

/* ── Checkout processing spinner — enhanced ───────────────────────────────── */
body.woocommerce-checkout .spinner.loading.float-banner {
  width: 260px;
  height: auto;
  min-height: 200px;
  margin-left: -130px;
  margin-top: -110px;
  padding: 1.5rem 1rem;
  box-sizing: border-box;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  border-radius: 0.75rem;
}

body.woocommerce-checkout .spinner.loading i.fa {
  position: relative;
  display: block;
  margin: 0 auto;
  font-size: 2.5em;
  color: #0d9488;
  top: auto;
  left: auto;
  margin-top: 0;
  margin-left: 0;
}

body.woocommerce-checkout .spinner.loading::before {
  position: relative;
  display: block;
  margin: 0 auto 0.75rem;
  top: auto;
  left: auto;
  width: 80px;
  height: 80px;
  border-color: #0d9488 #ccc #ccc;
}

body.woocommerce-checkout .spinner-message {
  font-size: 0.95rem;
  font-weight: 500;
  color: #171717;
  line-height: 1.5;
  margin: 0.75rem 0 0;
  padding: 0;
}

body.woocommerce-checkout .spinner-message small {
  font-size: 0.8rem;
  font-weight: 400;
  color: #737373;
  display: block;
  margin-top: 0.35rem;
}

/* ── Responsive adjustments ─────────────────────────────────────────────────── */
@media only screen and (max-width: 480px) {
  body.woocommerce-checkout #main {
    padding: 1rem 0 2rem;
  }

  body.woocommerce-checkout .nma-order-summary,
  body.woocommerce-checkout #payment,
  body.woocommerce-checkout .woocommerce-billing-fields {
    padding: 1rem;
    border-radius: 1rem;
  }

  body.woocommerce-checkout .form-row-first,
  body.woocommerce-checkout .form-row-last {
    width: 100%;
    float: none;
  }

  body.woocommerce-checkout .entry-title,
  body.woocommerce-checkout #main > header h1,
  body.woocommerce-checkout h1.standard_checkout_title {
    font-size: 1.6rem;
  }
}
