/*
 * cart-checkout.css — Cart, Mini-Cart Drawer & Checkout Styles
 * Retail Store Theme
 *
 * Covers:
 *   1.  Checkout progress indicator (shared: cart, checkout, confirmation)
 *   2.  Cart page table (.rst-cart-table)
 *   3.  Quantity stepper (.rst-qty-stepper)
 *   4.  Cart coupon field (.rst-cart-coupon)
 *   5.  Cart collaterals wrapper (.rst-cart-collaterals)
 *   6.  Cart empty state (.rst-cart-empty)
 *   7.  Mini-cart drawer (.rst-cart-drawer + backdrop)
 *   8.  Mini-cart content (.rst-mini-cart-wrap)
 *   9.  Checkout two-column layout (.rst-checkout-columns)
 *   10. Checkout form field validation states
 *   11. Checkout order review table (.rst-order-review)
 *   12. Trust signals (.rst-checkout-trust)
 *   13. Order confirmation (.rst-thankyou)
 *   14. Responsive breakpoints
 *
 * Architecture:
 *   - Zero hardcoded color/spacing values — all via var(--token)
 *   - Zero !important declarations
 *   - BEM naming throughout
 *   - Specificity: body.woocommerce-cart / body.woocommerce-checkout prefixes
 *     beat Storefront's (0,2,X) rules without !important
 *   - Load order (functions.php): tokens.css → components.css → cart-checkout.css
 *
 * @package RetailStoreTheme
 * @version 1.0.0
 */


/* =============================================================================
   1. CHECKOUT PROGRESS INDICATOR
   Shared across: cart page, checkout page, order confirmation page.
   Steps: Cart → Details → Payment → Confirm
   Active step gets aria-current="step" and .is-active class from PHP.
   ============================================================================= */

.rst-progress-indicator {
  margin-block-end: var(--space-xl);
  padding-block: var(--space-md);
}

.rst-progress-indicator__list {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: progress-step;
}

.rst-progress-indicator__item {
  display: flex;
  align-items: center;
  flex: 1;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  position: relative;
  counter-increment: progress-step;
}

/* Connecting line between steps */
.rst-progress-indicator__item::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--color-border);
  margin-inline: var(--space-xs);
  transition: background var(--duration-normal) var(--easing-standard);
}

.rst-progress-indicator__item:last-child::after {
  display: none; /* No line after the last step */
}

/* Step bubble */
.rst-progress-indicator__step {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  white-space: nowrap;
}

.rst-progress-indicator__num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  background: var(--color-surface);
  transition:
    background var(--duration-normal) var(--easing-standard),
    border-color var(--duration-normal) var(--easing-standard),
    color var(--duration-normal) var(--easing-standard);
}

/* Active step */
.rst-progress-indicator__item.is-active {
  color: var(--color-primary);
}

.rst-progress-indicator__item.is-active .rst-progress-indicator__num {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-text-inverse);
}

/* Completed step — shows checkmark, filled in accent color */
.rst-progress-indicator__item.is-complete {
  color: var(--color-text-muted);
}

.rst-progress-indicator__item.is-complete .rst-progress-indicator__num {
  background: var(--color-success, oklch(52% 0.14 150));
  border-color: var(--color-success, oklch(52% 0.14 150));
  color: var(--color-text-inverse);
}

/* Line after complete step is filled */
.rst-progress-indicator__item.is-complete::after {
  background: var(--color-success, oklch(52% 0.14 150));
}

/* On mobile: hide step labels, show numbers only */
@media (max-width: 600px) {
  .rst-progress-indicator__label {
    display: none;
  }
}


/* =============================================================================
   2. CART PAGE TABLE
   body.woocommerce-cart prefix: beats Storefront (0,2,X) with (0,3,X).
   ============================================================================= */

body.woocommerce-cart .rst-cart-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden; /* Clips border-radius on table cells */
  background: var(--color-surface-raised);
}

body.woocommerce-cart .rst-cart-table__head tr {
  background: var(--color-surface-alt);
  border-bottom: 1px solid var(--color-border);
}

body.woocommerce-cart .rst-cart-table th {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Cart row */
body.woocommerce-cart .rst-cart-row {
  border-bottom: 1px solid var(--color-border);
  transition: background var(--duration-fast) var(--easing-standard);
}

body.woocommerce-cart .rst-cart-row:last-of-type {
  border-bottom: none;
}

body.woocommerce-cart .rst-cart-row:hover {
  background: var(--color-surface-alt);
}

body.woocommerce-cart .rst-cart-row td {
  padding: var(--space-md);
  vertical-align: middle;
}

/* Thumbnail cell */
body.woocommerce-cart .rst-cart-row__thumb {
  width: 80px;
}

body.woocommerce-cart .rst-cart-row__thumb img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
}

/* Product name */
body.woocommerce-cart .rst-cart-row__name a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  transition: color var(--duration-fast) var(--easing-standard);
}

body.woocommerce-cart .rst-cart-row__name a:hover {
  color: var(--color-primary);
}

/* Price / subtotal */
body.woocommerce-cart .rst-cart-row__price,
body.woocommerce-cart .rst-cart-row__subtotal {
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

body.woocommerce-cart .rst-cart-row__subtotal strong {
  color: var(--color-price);
}

/* Remove button */
body.woocommerce-cart .rst-cart-row__remove {
  width: 48px;
  text-align: center;
}

body.woocommerce-cart .rst-cart-row__remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition:
    background var(--duration-fast) var(--easing-standard),
    color var(--duration-fast) var(--easing-standard);
}

body.woocommerce-cart .rst-cart-row__remove-btn:hover {
  background: var(--color-error-bg, oklch(97% 0.02 30));
  color: var(--color-error, oklch(45% 0.2 30));
}

/* Cart actions row */
body.woocommerce-cart .rst-cart-actions__cell {
  padding: var(--space-md);
  background: var(--color-surface-alt);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* Update cart button */
body.woocommerce-cart .rst-cart-update {
  margin-inline-start: auto;
}


/* =============================================================================
   3. QUANTITY STEPPER
   Replaces WooCommerce's default number input with +/- buttons.
   Specificity: .rst-qty-stepper is inside the cart table — no body prefix needed.
   ============================================================================= */

.rst-qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface-raised);
}

.rst-qty-stepper__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  transition:
    background var(--duration-fast) var(--easing-standard),
    color var(--duration-fast) var(--easing-standard);
}

.rst-qty-stepper__btn:hover:not(:disabled) {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.rst-qty-stepper__btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.rst-qty-stepper__input {
  width: 48px;
  height: 36px;
  border: none;
  border-inline: 1px solid var(--color-border);
  text-align: center;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  background: var(--color-surface-raised);
  appearance: textfield; /* Hide spinner arrows on number input */
  -moz-appearance: textfield;
}

.rst-qty-stepper__input::-webkit-outer-spin-button,
.rst-qty-stepper__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.rst-qty-stepper__input:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
  z-index: 1;
  position: relative;
}


/* =============================================================================
   4. COUPON FIELD
   Collapsible coupon input. Toggle handled by cart-checkout.js.
   ============================================================================= */

.rst-cart-coupon {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.rst-cart-coupon__toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background: none;
  border: none;
  padding: 0;
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.rst-cart-coupon__field {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.rst-cart-coupon__input {
  flex: 1 1 200px;
  min-width: 0;
}

/* [hidden] attribute hides the field — toggle removes it */
.rst-cart-coupon__field[hidden] {
  display: none;
}


/* =============================================================================
   5. CART COLLATERALS WRAPPER
   Container for cart totals + cross-sell products.
   ============================================================================= */

.rst-cart-collaterals {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  margin-block-start: var(--space-xl);
}

@media (min-width: 768px) {
  .rst-cart-collaterals {
    grid-template-columns: 1fr 400px;
    align-items: start;
  }

  /* Cart totals floated to the right in WC default — we use grid instead */
  body.woocommerce-cart .cart_totals {
    float: none;
    width: auto;
  }
}

/* Cart totals table */
body.woocommerce-cart .cart_totals table.shop_table {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-raised);
  overflow: hidden;
}

body.woocommerce-cart .cart_totals table.shop_table th,
body.woocommerce-cart .cart_totals table.shop_table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

body.woocommerce-cart .cart_totals table.shop_table tr:last-child th,
body.woocommerce-cart .cart_totals table.shop_table tr:last-child td {
  border-bottom: none;
}

/* Order total row — larger, bolder */
body.woocommerce-cart .cart_totals .order-total th,
body.woocommerce-cart .cart_totals .order-total td {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  background: var(--color-surface-alt);
}

body.woocommerce-cart .cart_totals .order-total strong {
  color: var(--color-price);
}

/* Proceed to checkout button */
body.woocommerce-cart .wc-proceed-to-checkout .checkout-button {
  display: block;
  width: 100%;
  text-align: center;
  margin-block-start: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
}


/* =============================================================================
   6. CART EMPTY STATE
   ============================================================================= */

.rst-cart-empty {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
}

.rst-cart-empty__icon {
  margin-block-end: var(--space-lg);
  opacity: 0.6;
}

.rst-cart-empty__message {
  font-size: var(--font-size-lg);
  color: var(--color-text-muted);
  margin-block-end: var(--space-lg);
}

.rst-cart-empty__actions {
  margin-block-end: var(--space-2xl);
}

.rst-cart-empty__recently-viewed {
  text-align: left;
  margin-block-start: var(--space-2xl);
  padding-block-start: var(--space-2xl);
  border-top: 1px solid var(--color-border);
}

.rst-cart-empty__recently-viewed-title {
  text-align: center;
  margin-block-end: var(--space-lg);
}

.rst-cart-empty__product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-md);
  list-style: none;
  padding: 0;
  margin: 0;
}

.rst-cart-empty__product-link {
  display: block;
  text-decoration: none;
  color: var(--color-text);
}

.rst-cart-empty__product-image img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
  margin-block-end: var(--space-sm);
}

.rst-cart-empty__product-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  margin-block-end: var(--space-xs);
}

.rst-cart-empty__product-price {
  font-size: var(--font-size-sm);
  color: var(--color-price);
}


/* =============================================================================
   7. MINI-CART DRAWER SHELL
   The outer drawer structure output by rst_cart_drawer_markup() in functions.php.
   ============================================================================= */

/* Backdrop — full-screen overlay behind drawer */
.rst-cart-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: oklch(0% 0 0 / 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--easing-standard);
  z-index: calc(var(--z-modal, 900) - 1);
}

.rst-cart-drawer-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Drawer panel */
.rst-cart-drawer {
  position: fixed;
  inset-block: 0;
  inset-inline-end: 0;
  width: min(420px, 100vw);
  background: var(--color-surface-raised);
  box-shadow: -4px 0 32px oklch(0% 0 0 / 0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--duration-normal) var(--easing-standard);
  z-index: var(--z-modal, 900);
  overflow: hidden;
}

.rst-cart-drawer.is-open {
  transform: translateX(0);
}

/* Prevent body scroll when drawer open */
body.rst-drawer-open {
  overflow: hidden;
}

/* Drawer header bar */
.rst-cart-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.rst-cart-drawer__title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  margin: 0;
}

.rst-cart-drawer__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: none;
  border: 1px solid var(--color-border);
  cursor: pointer;
  color: var(--color-text);
  transition:
    background var(--duration-fast) var(--easing-standard),
    color var(--duration-fast) var(--easing-standard);
}

.rst-cart-drawer__close:hover {
  background: var(--color-surface-alt);
}

/* Drawer scrollable body */
.rst-cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md) var(--space-lg);
}


/* =============================================================================
   8. MINI-CART CONTENT (.rst-mini-cart-wrap — WC fragment target)
   ============================================================================= */

.rst-mini-cart-wrap {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Empty state */
.rst-mini-cart__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  text-align: center;
  padding: var(--space-2xl) 0;
  flex: 1;
}

.rst-mini-cart__empty-icon {
  opacity: 0.5;
}

.rst-mini-cart__empty-text {
  color: var(--color-text-muted);
  font-size: var(--font-size-base);
}

/* Count line */
.rst-mini-cart__count {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-block-end: var(--space-md);
  border-bottom: 1px solid var(--color-border);
  padding-block-end: var(--space-sm);
}

/* Product list */
.rst-mini-cart__items {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
}

.rst-mini-cart__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding-block: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

.rst-mini-cart__item:last-child {
  border-bottom: none;
}

.rst-mini-cart__item-thumb img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
  flex-shrink: 0;
}

.rst-mini-cart__item-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.rst-mini-cart__item-name a {
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  line-height: 1.3;
}

.rst-mini-cart__item-name a:hover {
  color: var(--color-primary);
}

.rst-mini-cart__item-qty-price {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.rst-mini-cart__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-xs);
  color: var(--color-text-muted);
  text-decoration: none;
  flex-shrink: 0;
  transition:
    background var(--duration-fast) var(--easing-standard),
    color var(--duration-fast) var(--easing-standard);
}

.rst-mini-cart__remove:hover {
  background: var(--color-error-bg, oklch(97% 0.02 30));
  color: var(--color-error, oklch(45% 0.2 30));
}

/* Subtotal */
.rst-mini-cart__subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: var(--space-md);
  border-top: 2px solid var(--color-border);
  font-size: var(--font-size-base);
  margin-block-start: var(--space-sm);
}

.rst-mini-cart__subtotal-label {
  font-weight: var(--font-weight-medium);
}

.rst-mini-cart__subtotal-amount {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-price);
}

/* Action buttons */
.rst-mini-cart__actions {
  display: flex;
  gap: var(--space-sm);
  padding-block-start: var(--space-md);
  flex-wrap: wrap;
}

.rst-mini-cart__view-cart {
  flex: 1;
  text-align: center;
}

.rst-mini-cart__checkout {
  flex: 2;
  text-align: center;
}


/* =============================================================================
   9. CHECKOUT TWO-COLUMN LAYOUT
   Left: customer details | Right: order summary + payment
   body.woocommerce-checkout prefix for specificity.
   ============================================================================= */

body.woocommerce-checkout .rst-checkout-form {
  max-width: 1200px;
  margin-inline: auto;
}

body.woocommerce-checkout .rst-checkout-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  align-items: start;
}

@media (min-width: 900px) {
  body.woocommerce-checkout .rst-checkout-columns {
    grid-template-columns: 1fr 400px;
  }
}

/* Section titles within checkout */
body.woocommerce-checkout .rst-checkout-section-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin-block: 0 var(--space-md);
  padding-block-end: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

/* Sidebar sticky positioning on wide screens */
@media (min-width: 900px) {
  body.woocommerce-checkout .rst-checkout-columns__sidebar {
    position: sticky;
    top: calc(var(--header-height, 80px) + var(--space-md));
  }
}

body.woocommerce-checkout .rst-checkout-sidebar__review,
body.woocommerce-checkout .rst-checkout-sidebar__payment {
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

body.woocommerce-checkout .rst-checkout-sidebar__review {
  margin-block-end: var(--space-md);
}

/* WooCommerce checkout login notice */
body.woocommerce-checkout .rst-checkout-login-notice {
  margin-block-end: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
  border-left: 4px solid var(--color-primary);
}


/* =============================================================================
   10. CHECKOUT FORM FIELD VALIDATION STATES
   WooCommerce adds woocommerce-validated / woocommerce-invalid to .form-row.
   We add visual styling to these states.
   ============================================================================= */

body.woocommerce-checkout .form-row.woocommerce-validated input,
body.woocommerce-checkout .form-row.woocommerce-validated select {
  border-color: var(--color-success, oklch(52% 0.14 150));
  background-color: var(--color-success-bg, oklch(97% 0.02 150));
}

body.woocommerce-checkout .form-row.woocommerce-invalid input,
body.woocommerce-checkout .form-row.woocommerce-invalid select {
  border-color: var(--color-error, oklch(45% 0.2 30));
  background-color: var(--color-error-bg, oklch(97% 0.02 30));
}

/* Error message text (WC outputs .woocommerce-error on form rows) */
body.woocommerce-checkout .form-row.woocommerce-invalid label {
  color: var(--color-error, oklch(45% 0.2 30));
}


/* =============================================================================
   11. CHECKOUT ORDER REVIEW TABLE (.rst-order-review)
   ============================================================================= */

body.woocommerce-checkout .rst-order-review {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

body.woocommerce-checkout .rst-order-review thead th {
  padding: var(--space-xs) var(--space-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  font-size: var(--font-size-xs);
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-border);
}

body.woocommerce-checkout .rst-order-review__row td {
  padding: var(--space-sm) var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

/* Product cell: thumbnail + details side by side */
body.woocommerce-checkout .rst-order-review__product {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

body.woocommerce-checkout .rst-order-review__thumb {
  flex-shrink: 0;
}

body.woocommerce-checkout .rst-order-review__thumb img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
}

body.woocommerce-checkout .rst-order-review__item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

body.woocommerce-checkout .rst-order-review__name {
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  line-height: 1.3;
}

body.woocommerce-checkout .rst-order-review__qty-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-alt);
  border-radius: var(--radius-xs);
  padding: 1px var(--space-xs);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
}

/* Tfoot rows */
body.woocommerce-checkout .rst-order-review__tfoot-row th,
body.woocommerce-checkout .rst-order-review__tfoot-row td {
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-size-sm);
}

/* Total row — highlighted */
body.woocommerce-checkout .rst-order-review__tfoot-row--total th,
body.woocommerce-checkout .rst-order-review__tfoot-row--total td {
  border-top: 2px solid var(--color-border);
  border-bottom: none;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  padding-block: var(--space-sm);
}

body.woocommerce-checkout .rst-order-review__total-amount {
  color: var(--color-price);
  font-size: var(--font-size-lg);
}


/* =============================================================================
   12. TRUST SIGNALS
   Injected above Place Order button via woocommerce_review_order_before_submit.
   ============================================================================= */

.rst-checkout-trust {
  margin-block-end: var(--space-md);
}

.rst-checkout-trust__secure {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-block-end: var(--space-sm);
}

.rst-checkout-trust__secure svg {
  flex-shrink: 0;
  color: var(--color-success, oklch(52% 0.14 150));
}

.rst-checkout-trust__payment-icons {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

/* Payment icon pill wrapper */
.rst-payment-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding-inline: var(--space-xs);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  background: var(--color-surface-raised);
}

.rst-payment-icon svg {
  height: 16px;
  width: auto;
}


/* =============================================================================
   13. ORDER CONFIRMATION / THANK YOU PAGE
   ============================================================================= */

.rst-thankyou {
  max-width: 800px;
  margin-inline: auto;
  padding-block: var(--space-xl);
}

/* Confirmation header */
.rst-thankyou__header {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  margin-block-end: var(--space-xl);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
}

.rst-thankyou__header--success {
  border-color: var(--color-success, oklch(52% 0.14 150));
  background: var(--color-success-bg, oklch(97% 0.02 150));
}

.rst-thankyou__icon {
  margin-block-end: var(--space-md);
}

.rst-thankyou__heading {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  margin-block-end: var(--space-sm);
}

.rst-thankyou__subheading {
  color: var(--color-text-muted);
  max-width: 540px;
  margin-inline: auto;
}

/* Order meta strip */
.rst-thankyou__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-xl);
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-xl);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--color-surface-raised);
}

.rst-thankyou__meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rst-thankyou__meta-label {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.rst-thankyou__meta-value {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
}

/* Section titles */
.rst-thankyou__section-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin-block: var(--space-xl) var(--space-md);
  padding-block-end: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

/* Next steps list */
.rst-thankyou__steps-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.rst-thankyou__step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-raised);
}

.rst-thankyou__step-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}

.rst-thankyou__step-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.rst-thankyou__step-content strong {
  font-weight: var(--font-weight-semibold);
}

.rst-thankyou__step-content span {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Support line */
.rst-thankyou__support {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-block-end: var(--space-xl);
}

.rst-thankyou__support a {
  color: var(--color-primary);
}

/* CTA */
.rst-thankyou__cta {
  text-align: center;
  margin-block-start: var(--space-xl);
  padding-block-start: var(--space-xl);
  border-top: 1px solid var(--color-border);
}


/* =============================================================================
   14. RESPONSIVE — MOBILE CART TABLE
   On narrow screens, the cart table switches to a stacked card layout.
   Each <td> uses data-title attribute to show column headers inline.
   ============================================================================= */

@media (max-width: 720px) {

  body.woocommerce-cart .rst-cart-table,
  body.woocommerce-cart .rst-cart-table thead,
  body.woocommerce-cart .rst-cart-table tbody,
  body.woocommerce-cart .rst-cart-table tfoot,
  body.woocommerce-cart .rst-cart-table tr,
  body.woocommerce-cart .rst-cart-table td,
  body.woocommerce-cart .rst-cart-table th {
    display: block;
  }

  /* Hide table headers — labels come from data-title */
  body.woocommerce-cart .rst-cart-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  body.woocommerce-cart .rst-cart-row {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    grid-template-areas:
      "thumb name remove"
      "thumb price qty"
      "thumb subtotal subtotal";
    gap: var(--space-xs) var(--space-sm);
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border);
  }

  body.woocommerce-cart .rst-cart-row__thumb   { grid-area: thumb;    padding: 0; }
  body.woocommerce-cart .rst-cart-row__name    { grid-area: name;     padding: 0; align-self: start; }
  body.woocommerce-cart .rst-cart-row__price   { grid-area: price;    padding: 0; }
  body.woocommerce-cart .rst-cart-row__qty     { grid-area: qty;      padding: 0; }
  body.woocommerce-cart .rst-cart-row__subtotal{ grid-area: subtotal; padding: 0; }
  body.woocommerce-cart .rst-cart-row__remove  { grid-area: remove;   padding: 0; width: auto; text-align: right; }

}
