/* Checkout page — homepage hero + full-width panel */

.checkout-page {
  padding: 0;
  margin: 0;
}

.checkout-page-wrap {
  width: 100%;
}

/* ── Hero (grid + spotlight, flush to top) ── */
.checkout-hero {
  position: relative;
  padding-block: calc(var(--header-h) + 48px) 44px;
  overflow: hidden;
  text-align: center;
}

.checkout-hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.checkout-hero__spotlight {
  position: absolute;
  left: 50%;
  top: 42%;
  width: min(960px, 130vw);
  height: min(480px, 70vh);
  transform: translate(-50%, -50%);
  background: radial-gradient(
    ellipse 50% 48% at 50% 50%,
    rgba(255, 196, 140, 0.14) 0%,
    rgba(255, 160, 100, 0.07) 32%,
    rgba(255, 255, 255, 0.035) 52%,
    transparent 72%
  );
  filter: blur(32px);
}

.checkout-hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
}

.checkout-hero__orb--1 {
  width: 420px;
  height: 420px;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
}

.checkout-hero__orb--2 {
  width: 320px;
  height: 320px;
  bottom: 5%;
  right: 8%;
  background: radial-gradient(circle, rgba(255, 180, 120, 0.05) 0%, transparent 70%);
}

.checkout-hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 38%, black 20%, transparent 72%);
}

.checkout-hero__center {
  position: relative;
  z-index: 1;
}

.checkout-hero__eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 12px;
}

.checkout-hero__title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 12px;
}

.checkout-hero__subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0;
}

/* ── Checkout body (full content width) ── */
.checkout-body {
  padding-bottom: 80px;
}

.checkout-panel {
  width: 100%;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.checkout-panel__layout {
  grid-template-columns: 1fr minmax(300px, 380px);
  min-height: 480px;
}

.checkout-panel__items {
  min-height: 360px;
}

.checkout-panel__sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.checkout-panel__sidebar .checkout-order-review {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.checkout-panel__sidebar .checkout-payment {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.checkout-panel__title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.checkout-panel__edit {
  margin-top: 24px;
  font-size: 13px;
}

.checkout-panel__edit a {
  color: var(--text-muted);
  transition: color var(--transition);
}

.checkout-panel__edit a:hover {
  color: var(--text-primary);
}

.checkout-guest-note {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* Hide stray WP / WC page titles (hero has the title) */
.checkout-page > h1,
.checkout-page .entry-header,
.checkout-page .entry-title,
.checkout-page .page-title,
.checkout-page .wp-block-post-title,
.checkout-body > h1,
.checkout-body > .wp-block-post-title,
.checkout-body > .entry-header,
.checkout-page-wrap + h1 {
  display: none !important;
}

.checkout-body .woocommerce-notices-wrapper {
  margin-bottom: 20px;
}

.checkout-review-order-table {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.checkout-order-review {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.wc_payment_methods--native {
  position: fixed;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.checkout-payment .payment_box {
  margin: 12px 0 16px;
  padding: 14px;
  font-size: 13px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.checkout-place-order {
  margin-top: auto;
  padding: 16px 0 0;
}

/* Always show theme checkout button (WC may hide it for PayPal custom button) */
form.thenine-checkout.has-custom-place-order-button #place_order,
form.thenine-checkout #place_order.cart-drawer__checkout-btn {
  display: block !important;
  width: 100%;
}

form.thenine-checkout .wc-custom-place-order-button {
  display: none !important;
}

.checkout-place-order .woocommerce-terms-and-conditions-wrapper {
  margin-bottom: 16px;
}

.checkout-place-order .woocommerce-form__label-for-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
  cursor: pointer;
}

.checkout-place-order .woocommerce-form__label-for-checkbox input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.checkout-place-order .woocommerce-form__label-for-checkbox a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.checkout-place-order__btn {
  margin-top: 0;
}

#place_order.cart-drawer__checkout-btn.is-paypal {
  background: #0070ba;
}

#place_order.cart-drawer__checkout-btn.is-paypal:hover:not(:disabled) {
  background: #008cee;
}

/* Woo notices */
.checkout-page .woocommerce-error,
.checkout-page .woocommerce-info,
.checkout-page .woocommerce-message {
  max-width: var(--container-max);
  margin: 0 auto 20px;
  padding: 12px var(--gutter);
  font-size: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  list-style: none;
}

.checkout-page .woocommerce-error {
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.checkout-page .woocommerce-info {
  color: var(--text-secondary);
}

.checkout-page .woocommerce-message {
  color: var(--text-primary);
}

/* ── Thank you / order received ── */
.thankyou-page {
  padding: 0;
}

.thankyou-page-wrap {
  width: 100%;
}

.thankyou-order {
  width: 100%;
}

.thankyou-panel {
  padding: 0;
}

.thankyou-panel--downloads {
  padding: 0;
  max-width: 960px;
  margin-inline: auto;
}

.thankyou-panel--failed {
  padding: 32px;
  text-align: center;
}

.thankyou-panel--failed .woocommerce-thankyou-order-failed-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.thankyou-panel__empty {
  margin: 0;
  padding: 32px 24px;
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
}

/* Downloads table */
.thankyou-downloads {
  width: 100%;
}

.thankyou-downloads__table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.thankyou-downloads__table thead th {
  padding: 14px 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
}

.thankyou-downloads__th--download-product {
  width: 44%;
}

.thankyou-downloads__th--download-remaining,
.thankyou-downloads__th--download-expires {
  width: 18%;
  text-align: center;
}

.thankyou-downloads__th--download-file {
  width: 72px;
  text-align: center;
}

.thankyou-downloads__table tbody td {
  padding: 18px 20px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-subtle);
}

.thankyou-downloads__table tbody tr:last-child td {
  border-bottom: none;
}

.thankyou-downloads__table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.thankyou-downloads__td--download-remaining,
.thankyou-downloads__td--download-expires {
  text-align: center;
}

.thankyou-downloads__td--download-file {
  text-align: center;
}

.thankyou-downloads__product {
  display: block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.thankyou-downloads__product:hover {
  color: #fff;
}

.thankyou-downloads__meta {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.thankyou-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-inline: auto;
  color: var(--accent-on);
  background: var(--accent);
  border-radius: var(--radius-md);
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
}

.thankyou-download-btn:hover {
  opacity: 0.94;
  color: var(--accent-on);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.08);
}

.thankyou-page .entry-header,
.thankyou-page .entry-title,
.thankyou-page .wp-block-post-title,
.thankyou-page-wrap + h1 {
  display: none !important;
}

.thankyou-page .woocommerce-notices-wrapper {
  margin-bottom: 20px;
}

.thankyou-page .woocommerce-error,
.thankyou-page .woocommerce-info,
.thankyou-page .woocommerce-message {
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 768px) {
  .thankyou-downloads__table thead {
    display: none;
  }

  .thankyou-downloads__table,
  .thankyou-downloads__table tbody,
  .thankyou-downloads__table tr,
  .thankyou-downloads__table td {
    display: block;
    width: 100%;
  }

  .thankyou-downloads__table tbody {
    padding: 16px;
  }

  .thankyou-downloads__table tbody tr {
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.02);
  }

  .thankyou-downloads__table tbody tr:last-child {
    margin-bottom: 0;
  }

  .thankyou-downloads__table tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
    border: none;
    text-align: right;
  }

  .thankyou-downloads__table tbody td::before {
    content: attr(data-label);
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    text-align: left;
  }

  .thankyou-downloads__td--download-product {
    padding-top: 0;
  }

  .thankyou-downloads__td--download-product::before {
    display: none;
  }

  .thankyou-downloads__td--download-product .thankyou-downloads__product {
    width: 100%;
    white-space: normal;
    font-size: 16px;
  }

  .thankyou-downloads__td--download-file {
    justify-content: flex-end;
    padding-bottom: 0;
  }

  .thankyou-downloads__td--download-file::before {
    content: attr(data-label);
  }
}

@media (max-width: 768px) {
  .checkout-hero {
    padding-block: calc(var(--header-h) + 40px) 36px;
  }

  .checkout-body {
    padding-bottom: 48px;
  }

  .checkout-panel__layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .checkout-panel__sidebar {
    border-left: none;
    border-top: 1px solid var(--border-subtle);
  }

  .checkout-panel__items {
    min-height: 0;
  }

  .cart-drawer__pay-methods {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Cart page sidebar CTA */
.cart-page__checkout {
  display: block;
  margin-top: auto;
  text-align: center;
  text-decoration: none;
}

.cart-page__browse {
  display: block;
  width: 100%;
  margin-top: auto;
  text-align: center;
}

.cart-page .woocommerce > .woocommerce-notices-wrapper {
  display: none;
}

/* Empty cart — single centered column, no sidebar */
.checkout-panel--empty {
  min-height: 360px;
}

.cart-page__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  padding: 48px 24px;
}

.cart-page__empty-inner {
  min-height: 0;
}
