/* Base Styles */
:root {
  --primary-color: #0f172a;
  --primary-hover: #1e293b;
  --error-color: #ef4444;
  --border-color: #eaeaea;
  --background-color: #f8fafc;
  --card-background: #ffffff;
  --text-color: #0f172a;
  --text-muted: #64748b;
  --radius: 0rem;
  --shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.06), 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

.woocommerce #order_review, .woocommerce-page #order_review {
  background: none !important;
  border: none !important;
}
.woocommerce-additional-fields,
.woocommerce-additional-fields__field-wrapper,
.checkout-card-title:contains('Additional information') {
  display: none !important;
}
.woocommerce-billing-fields h3 {
  display: none !important;
}
.woocommerce-form-coupon-toggle {
  display: none;
}
.checkout-container button[type="submit"], .checkout-container .button {
  margin-top: 0 !important;
}
.payment_box.payment_method_stripe {
  display: block !important;
}
.checkbox input[type="checkbox"] {
  margin-left: 0rem !important;
}
.label {
  font-size: 14px !important;
}
#billing_address_2_field {
  margin-top: 22px !important;
}
.small-notice {
  font-size: 12px;
  /* color: var(--text-muted); */
  margin: 0 20px 20px;
}
/* Style the variation definition list for inline dt and dd */
dl.variation {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

dl.variation dt,
dl.variation dd {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0.25em 0;
}

dl.variation dt {
  width: 120px; /* or whatever width fits your labels */
  font-weight: 600;
  color: var(--primary-color, #0f172a);
  flex-shrink: 0;
}

dl.variation dd {
  width: calc(100% - 120px);
  margin-left: 0;
  padding-left: 1em;
  flex-shrink: 1;
}

dl.variation dd p {
  margin: 0;
}

/* Layout */
.checkout-container {
  margin: 0 auto;
  font-family: Arial, sans-serif;
  font-size: 14px !important;
}

.checkout-container * {
  box-sizing: border-box;
}


.checkout-title {
  margin-top: 0;

  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
}

.checkout-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .checkout-columns {
    grid-template-columns: 1fr 1fr;
  }
}

.checkout-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

#checkout-left-column .button, .wpo365-mssignin-button {
  background-color: var(--fl-global-616161-dark-gray-subheading-gray-button-bg) !important;
  border-color: var(--fl-global-616161-dark-gray-subheading-gray-button-bg) !important;
  color: #FDFCF9 !important;
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  font-size: 16px !important;
  line-height: 1;
  text-transform: uppercase;
  border-style: solid;
  border-width: 4px !important;
  border-radius: 0px !important;
}
#checkout-left-column .button:hover, .wpo365-mssignin-button:hover {
  background-color: #ede6cc !important;
  border-color: var(--fl-global-616161-dark-gray-subheading-gray-button-bg) !important;
  color: #434a4d !important;
}
.wpo365-mssignin-label {
  color: #FDFCF9 !important;
  font-family: "Rajdhani", sans-serif !important;
  font-weight: 700 !important;
  font-size: 16px !important;
}
.wpo365-mssignin-button:hover .wpo365-mssignin-label {
  color: #434a4d !important;
}

/* Card Styling */
.checkout-card {
  border: 1px solid var(--border-color);
  background: var(--card-background);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 1.5rem;
}


.checkout-card-header {
  padding: 1.5rem 1.5rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.checkout-card-title {
  font-size: 14px !important;
  font-weight: 600;
  color: var(--text-color);
}

.checkout-card-content {
  padding: 1.5rem;
}

/* Form Elements */
.checkout-container .form-row,
.checkout-container .woocommerce-billing-fields .form-row,
.checkout-container .woocommerce-shipping-fields .form-row {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
}

.checkout-container #billing_city_field,
.checkout-container #billing_state_field,
.checkout-container #billing_postcode_field {
  clear: none !important;
  padding-left: 5px !important;
  padding-right: 5px !important;
}
 
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .form-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.required-field::after {
  content: "*";
  color: var(--error-color);
  margin-left: 0.25rem;
}

.checkout-container input[type="text"],
.checkout-container input[type="email"],
.checkout-container input[type="tel"],
.checkout-container input[type="password"],
.checkout-container input[type="number"],
.checkout-container input[type="search"],
.checkout-container select,
.checkout-container textarea,
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background-color: var(--card-background);
  color: var(--text-color);
  font-size: 14px;
  transition: border-color 0.15s ease;
  margin-bottom: 0;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.1);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-error {
  color: var(--error-color);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* Checkbox and Radio */
.form-checkbox-wrapper,
.form-radio-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.form-checkbox,
.form-radio {
  width: 1rem;
  height: 1rem;
  margin-top: 0.25rem;
}

.form-checkbox-label,
.form-radio-label {
  font-size: 0.875rem;
  color: var(--text-color);
}

/* Payment Section */
.payment-method {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.payment-info {
  padding: 1rem;
  background-color: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.payment-test-mode {
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.card-fields {
  background-color: var(--card-background);
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

/* Order Summary */
.checkout-container .woocommerce-checkout-review-order-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: none;
  font-size: 12px !important;
}
.checkout-container .woocommerce-checkout-review-order-table th,
.checkout-container .woocommerce-checkout-review-order-table td {
  border: none;
  padding: 0.5rem 0.5rem 0.5rem 0;
  background: none;
  color: var(--text-color);
}
.checkout-container .woocommerce-checkout-review-order-table tfoot th,
.checkout-container .woocommerce-checkout-review-order-table tfoot td {
  font-weight: 600;
  font-size: 12px !important;
  border-top: 1px solid var(--border-color);
}
.checkout-container .woocommerce-checkout-review-order-table .order-total th,
.checkout-container .woocommerce-checkout-review-order-table .order-total td {
  font-size: 12px !important;
  font-weight: 700;
  color: var(--primary-color);
}

.checkout-container .woocommerce-checkout-payment {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

.checkout-container .payment_box {
  background: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1rem 0 0;
}

.checkout-container .woocommerce-checkout-payment label {
  font-size: 14px !important;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.checkout-container .woocommerce-checkout-payment input[type="radio"] {
  margin-right: 0.5rem;
}

.checkout-container .woocommerce-checkout-payment .payment_method {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 1rem 0 0 0;
  border: none;
}

.checkout-container .woocommerce-terms-and-conditions-wrapper {
  margin: 1.5rem 0 1rem 0;
  font-size: 0.95rem;
}

.checkout-container .woocommerce-terms-and-conditions-wrapper label {
  font-size: 1rem;
  font-weight: 400;
}

.checkout-container .woocommerce-terms-and-conditions-wrapper input[type="checkbox"] {
  margin-right: 0.5rem;
}

.checkout-container .form-row.place-order {
  margin-top: 1.5rem;
  margin-bottom: 0;
  padding: 0;
}

.checkout-container .woocommerce-error,
.checkout-container .woocommerce-message {
  background: var(--error-color);
  color: #fff;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.order-summary-header {
  display: flex;
  justify-content: space-between;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.order-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.order-item-details {
  flex: 1;
}

.order-item-title {
  font-weight: 500;
}

.order-item-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.order-totals {
  margin-top: 1rem;
}

.order-total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.order-total-separator {
  height: 1px;
  background-color: var(--border-color);
  margin: 0.5rem 0;
}

.order-total-final {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.125rem;
  margin-top: 0.5rem;
}

/* Button */
.checkout-button,
.checkout-container button[type="submit"],
.checkout-container .button {
  display: block;
  width: 100%;
  padding: 0.95rem 1.5rem;
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1rem;
  text-align: center;
  transition: background-color 0.15s ease;
  margin-top: 1rem;
  letter-spacing: 0.01em;
}

.checkout-button:hover,
.checkout-container button[type="submit"]:hover,
.checkout-container .button:hover {
  background-color: var(--primary-hover);
}

.checkout-button:disabled,
.checkout-container button[type="submit"]:disabled,
.checkout-container .button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.checkout-button:hover {
  background-color: var(--primary-hover);
}

.checkout-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Terms and Conditions */
.terms-checkbox-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1rem;
}

.terms-link {
  color: var(--primary-color);
  text-decoration: underline;
}

/* Utility Classes */
.checkout-container .form-row label {
  font-size: 12px !important;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--text-color);
}

.checkout-container .form-row .required {
  color: var(--error-color);
  margin-left: 0.25rem;
}

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

.hidden {
  display: none;
}

@media (min-width: 1024px) {
  .hidden-desktop {
    display: none;
  }
  
  .visible-desktop {
    display: block;
  }
}

@media (max-width: 1023px) {
  .hidden-mobile {
    display: none;
  }
  
  .visible-mobile {
    display: block;
  }
}

.nols-spc-column {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  padding: 2rem;
}

.nols-spc-column-left {
  flex: 2;
  min-width: 340px;
}

.nols-spc-column-right {
  flex: 1.2;
  min-width: 320px;
}

#customer_details {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.woocommerce form .form-row input,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 0.75rem 1rem;
  background: #fafafa;
  font-size: 1rem;
  margin-bottom: 1rem;
  box-shadow: none;
  transition: border 0.2s;
}
.woocommerce form .form-row input:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus {
  border-color: #f37021;
  outline: none;
}

.woocommerce-checkout-review-order,
.woocommerce-checkout-payment {
  background: #fcfcfc;
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid #f0f0f0;
}

#order_review_heading {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.woocommerce-checkout-payment h3 {
  margin-top: 0;
  font-size: 1.1rem;
}

button, .button, input[type="submit"] {
  background: #f37021;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
button:hover, .button:hover, input[type="submit"]:hover {
  background: #d85a10;
}

/* Remove extra backgrounds and borders from WooCommerce */
.woocommerce-billing-fields__field-wrapper,
.woocommerce-shipping-fields__field-wrapper {
  background: none;
  border: none;
  padding: 0;
}

/* Minimal spacing for order notes */
#order_comments_field {
  margin-top: 2rem;
}

/* Hide coupon field if not needed */
.woocommerce-form-coupon {
  margin-bottom: 2rem;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .nols-spc-columns {
    flex-direction: column;
    gap: 2rem;
    max-width: 98vw;
  }
  .nols-spc-column {
    padding: 1.25rem;
  }
}



/* Order Details */
/* Base styles for the checkout review order table */
.woocommerce-checkout-review-order-table {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #333;
  background-color: white;
  border-radius: 8px;
  border: 1px solid #f0e9d3;
  padding: 0;
  margin-bottom: 30px;
  overflow: hidden;
}

/* Product header */
.woocommerce-checkout-review-order-table h3 {
  /* font-size: 18px;
  font-weight: 600;
  padding: 16px 20px;
  margin: 0;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef; */
  display: none;
}

/* Shop table container */
.woocommerce-checkout-review-order-table .shop_table {
  padding: 0;
}

/* Cart item */
.woocommerce-checkout-review-order-table .cart_item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  align-items: start;
}

/* Product remove section */
.woocommerce-checkout-review-order-table .product-remove {
  grid-column: 1;
}

.woocommerce-checkout-review-order-table .product-remove a.remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #f1f1f1;
  color: #666;
  text-decoration: none;
  font-size: 18px;
  line-height: 1;
  transition: all 0.2s ease;
}

.woocommerce-checkout-review-order-table .product-remove a.remove:hover {
  background-color: #ff6b6b;
  color: white;
}

/* Product name section */
.woocommerce-checkout-review-order-table .product-name {
  grid-column: 2;
  padding-right: 10px;
}

/* Hide the duplicate remove button in the product name */
.woocommerce-checkout-review-order-table .product-name a.remove {
  display: none;
}

.woocommerce-checkout-review-order-table .product-name a:not(.remove) {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.woocommerce-checkout-review-order-table .product-name a:not(.remove):hover {
  color: #4a6cf7;
}

/* Product quantity */
.woocommerce-checkout-review-order-table .product-quantity {
  font-weight: normal;
  color: #666;
  background-color: #f8f9fa;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
  margin-left: 8px;
}

/* Variation list */
.woocommerce-checkout-review-order-table .variation {
  display: grid;
  grid-template-columns: max-content 1fr;
  row-gap: 2px;
  column-gap: 18px;
  margin: 10px 0 0 0;
  background: none;
  border: none;
  padding: 0;
}

.woocommerce-checkout-review-order-table .variation dt {
  font-weight: 600;
  color: #222;
  text-align: right;
  padding-right: 8px;
  white-space: nowrap;
  margin: 0;
}

.woocommerce-checkout-review-order-table .variation dd {
  color: #444;
  margin: 0 0 0 0;
  white-space: normal;
}

.woocommerce-checkout-review-order-table .variation p {
  display: inline;
  margin: 0;
}

/* Price formatting */
.woocommerce-checkout-review-order-table .woocommerce-Price-amount {
  white-space: nowrap;
}

/* Summary rows (subtotal, fee, total) */
.woocommerce-checkout-review-order-table .cart-subtotal,
.woocommerce-checkout-review-order-table .fee,
.woocommerce-checkout-review-order-table .order-total,
.woocommerce-checkout-review-order-table .cart-discount {
  display: flex;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.woocommerce-checkout-review-order-table .cart-subtotal {
  color: #333;
}

.woocommerce-checkout-review-order-table .fee {
  color: #333;
}

/* Total row styling */
.woocommerce-checkout-review-order-table .order-total {
  background-color: #fcfaf5;
  font-weight: 500;
  border-bottom: none;  
}

.woocommerce-checkout-review-order-table .order-total strong {
  font-weight: 600;
  font-size: 18px;
  color: #333;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .woocommerce-checkout-review-order-table .cart_item {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }
  
  .woocommerce-checkout-review-order-table .product-remove {
    grid-column: 1;
    grid-row: 1;
  }
  
  .woocommerce-checkout-review-order-table .product-name {
    grid-column: 2;
    grid-row: 1;
  }
  
  .woocommerce-checkout-review-order-table .product-total {
    grid-column: 1 / span 2;
    grid-row: 2;
    text-align: right;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #f0f0f0;
  }
  
  .woocommerce-checkout-review-order-table .variation dt {
    float: none;
    width: auto;
  }
  
  .woocommerce-checkout-review-order-table .variation dd {
    margin-left: 0;
    margin-bottom: 8px;
  }
}

/* Currency symbol */
.woocommerce-checkout-review-order-table .woocommerce-Price-currencySymbol {
  margin-right: 1px;
}


/* Thank You Page */
.checkout-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin-bottom: 24px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.nols-spc-card-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.7);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  color: #333;
  pointer-events: all;
  border-radius: 8px;
}

.checkout-card-header {
  /* background: var(--background-color, #f8fafc); */
  padding: 20px 32px 10px 32px;
  border-bottom: 1px solid var(--border-color, #eaeaea);
}

.checkout-card-title {
  font-size: 1.35rem;
  margin: 0;
  color: var(--primary-color, #0f172a);
}

/* .checkout-card-content {
  padding: 24px 32px 0 32px;
} */

.woocommerce-order {
  padding: 20px;
}

.woocommerce-column__title {
  display: none !important;
}

/* Processing Overlay Styles - Deprecated, using button loading state instead */
#nols-spc-processing-overlay {
  display: none !important;
}

/* Hide WooCommerce blockUI overlay - using button loading state instead */
.blockUI.blockOverlay {
  display: none !important;
}

.blockUI.blockMsg {
  display: none !important;
}

form.checkout.processing {
  opacity: 1 !important;
}

/* Hide Stripe card detector loading messages - using button loading state instead */
.stripe-card-type-checkout-message {
  display: none !important;
}

.stripe-card-type-checkout-error {
  display: none !important;
}

/* Place Order Button Loading State */
#place_order.nols-loading {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
  cursor: not-allowed;
}

#place_order.nols-loading::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: nols-button-spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes nols-button-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Cart Discount */
.nols-spc-coupon-form form.checkout_coupon {
  display: flex !important;
}
.woocommerce-page form.checkout_coupon {
  border: none !important;
}
.woocommerce-page form.checkout_coupon input {
  display: block;
    height: 34px;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.428571429;
    color: #2b2b2b;
    vertical-align: middle;
    background-color: #fcfaf5;
    background-image: none;
    border: 1px solid #f0e9d3;  
    border-radius: 4px;
}

/* Existing payment box styles */
.payment_box.payment_method_stripe {
    padding: 15px;
    background-color: #f8f8f8;
    border-radius: 4px;
}

/* Surcharge notice styling */
.surcharge-notice {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 0.9em;
}

.surcharge-notice.credit-card-notice {
    background-color: #fff8f7;
    border-left: 3px solid #e25a4c;
    color: #c43827;
}

.surcharge-notice.debit-card-notice {
    background-color: #f7fff8;
    border-left: 3px solid #5a9a68;
    color: #2e6339;
}

.surcharge-notice.detecting-notice {
    background-color: #f7f9ff;
    border-left: 3px solid #6b7280;
    color: #4b5563;
}

.surcharge-notice p {
    margin: 0;
    padding: 0;
}

/* Thank you page surcharge styling */

/* Button Loading State */
.button.loading,
button.loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
  cursor: wait !important;
}

.button.loading::after,
button.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Overflow guards.
 * These are not phone-specific: `.checkout-columns` is single-column from 0 up
 * to 1023px (the two-column rule is gated at `min-width: 1024px`), so a `1fr`
 * track is floored at its min-content width across that whole range. Scoping
 * these to `max-width: 1023px` keeps the >=1024px desktop layout untouched
 * while closing the 769-1023px tablet gap. Layout decisions that really are
 * phone-only live in the `max-width: 768px` blocks below. */
@media (max-width: 1023px) {
  .checkout-container,
  .checkout-columns,
  .checkout-column,
  .checkout-card,
  .checkout-card-content,
  #customer_details {
    min-width: 0;
    max-width: 100%;
  }

  .checkout-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Keep long product names and variation details inside the order card. */
  .checkout-container .woocommerce-checkout-review-order-table,
  .checkout-container .woocommerce-checkout-review-order-table .product-name,
  .checkout-container .woocommerce-checkout-review-order-table .variation dd {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .checkout-container .woocommerce-checkout-review-order-table .variation {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Mobile checkout layout */
@media (max-width: 768px) {
  .checkout-columns {
    gap: 1rem;
  }

  /* The card header and content provide their own spacing. */
  .checkout-container .checkout-card {
    padding: 0;
  }

  .checkout-container .checkout-card-header,
  .checkout-container .checkout-card-content {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Reset desktop field widths and floats configured on the checkout page.
   * The `!important` here is load-bearing: the city/state/postcode padding it
   * overrides is itself `!important` at identical specificity (see the
   * `.checkout-container #billing_postcode_field` rule above), so this only
   * wins by being later in the file. */
  .checkout-container #billing_address_1_field,
  .checkout-container #billing_address_2_field,
  .checkout-container #billing_city_field,
  .checkout-container #billing_state_field,
  .checkout-container #billing_postcode_field,
  .checkout-container .form-row-first,
  .checkout-container .form-row-last {
    width: 100% !important;
    float: none !important;
    clear: both !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .checkout-container #billing_address_2_field {
    margin-top: 0 !important;
  }

  .checkout-container .woocommerce-checkout-review-order-table .variation dt {
    float: none;
    width: auto;
    white-space: normal;
    text-align: left;
  }
}

/* Mobile order-received layout */
@media (max-width: 768px) {
  .woocommerce-order,
  .woocommerce-order * {
    box-sizing: border-box;
  }

  .woocommerce-order {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 16px;
    overflow-wrap: anywhere;
  }

  .woocommerce-order > h3 {
    max-width: 100%;
    font-size: 2rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .woocommerce-order > p {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .woocommerce-order .checkout-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0;
  }

  .woocommerce-order .checkout-card-header,
  .woocommerce-order .checkout-card-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-left: 16px;
    padding-right: 16px;
  }

  .woocommerce-order .woocommerce-order-overview.order_details {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
  }

  .woocommerce-order .woocommerce-order-overview.order_details li {
    display: block;
    float: none;
    width: 100%;
    max-width: 100%;
    margin: 0 !important;
    padding: 12px 0 !important;
    border-right: 0;
    border-bottom: 1px solid var(--border-color);
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .woocommerce-order .woocommerce-order-overview.order_details li:last-child {
    border-bottom: 0;
  }

  .woocommerce-order .woocommerce-table--order-details {
    width: 100% !important;
    max-width: 100%;
    table-layout: fixed;
  }

  .woocommerce-order .woocommerce-table--order-details th,
  .woocommerce-order .woocommerce-table--order-details td {
    min-width: 0;
    padding: 10px 6px !important;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .woocommerce-order .woocommerce-table--order-details th:first-child,
  .woocommerce-order .woocommerce-table--order-details td:first-child {
    width: 56%;
  }

  .woocommerce-order .woocommerce-table--order-details th:nth-child(2),
  .woocommerce-order .woocommerce-table--order-details td:nth-child(2),
  .woocommerce-order .woocommerce-table--order-details th:nth-child(3),
  .woocommerce-order .woocommerce-table--order-details td:nth-child(3) {
    width: 22%;
  }

  .woocommerce-order .woocommerce-table--order-details .order-item-details-row td {
    width: auto;
  }

  /* Overrides the `min-width: 220px; white-space: nowrap` in the inline
   * <style> block in templates/checkout/thankyou.php, which is the actual
   * source of the order-received overflow. Wins on specificity (2 classes
   * vs 1); the durable fix is to move that block into this stylesheet. */
  .woocommerce-order .order-details-box,
  .woocommerce-order .admin-details-box,
  .woocommerce-order .order-item-details-grid,
  .woocommerce-order .order-item-meta-col {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .woocommerce-order .order-item-details-grid {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .woocommerce-order .order-item-meta-col {
    flex-wrap: wrap;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .woocommerce-order .woocommerce-customer-details,
  .woocommerce-order .woocommerce-customer-details address {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
  }
}
