.loader-wrapper {
  position: fixed;
  top: 50%;
  left: 10%;
  right: 10%;
  text-align: center;
  margin-top: -128px;
  opacity: 0.1;
  z-index: 999999;
}
#box-checkout-cart {
  margin-top: 0;
}
#box-checkout-cart .row {
  margin-bottom: 0;
}
#box-checkout-cart [class*="col-"] {
  align-self: center;
}
#box-checkout-cart .headings {
  font-weight: 600;
  padding: 0.5em var(--gutter-x);
  border-bottom: 1px solid var(--default-border-color);
}
#box-checkout-cart .item {
  padding: var(--gutter-y) var(--gutter-x);
  border-top: 1px solid #e0e0e0;
}
#box-checkout-cart .item:nth-child(odd) {
  background: var(--table-striped-row-background-odd);
}
#box-checkout-cart .item:nth-child(even) {
  background: var(--table-striped-row-background-even);
}
#box-checkout-cart .name {
  font-weight: 600;
}
#box-checkout-cart .btn {
  padding-left: 1em;
  padding-right: 1em;
}
#box-checkout-cart .error {
  color: #f00;
}
#box-checkout-cart .unit-price,
#box-checkout-cart .total-price {
  font-size: 1.1em;
}
#box-checkout-cart .subtotal {
  font-size: 1.5em;
}
#box-checkout-customer fieldset {
  border: none;
  padding: 0;
}
#box-checkout-customer button[type=submit]:not([disabled]) {
  font-weight: bold;
  color: #ff0000;
  animation: flasher 1s linear infinite;
}
#box-checkout-shipping .thumbnail,
#box-checkout-payment .thumbnail {
  padding: 0.5em;
  overflow: hidden;
}
#box-checkout-shipping .option,
#box-checkout-payment .option {
  position: relative;
  background: var(--card-background-color);
  transition: all 250ms ease;
}
#box-checkout-shipping .option.btn,
#box-checkout-payment .option.btn {
  padding: 1em;
}
#box-checkout-shipping .option.btn:first-child,
#box-checkout-payment .option.btn:first-child {
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}
#box-checkout-shipping .option.btn:last-child,
#box-checkout-payment .option.btn:last-child {
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  color: inherit;
}
#box-checkout-shipping .option.active,
#box-checkout-payment .option.active {
  background: #eaebef;
  color: inherit;
}
#box-checkout-shipping .option:not(.active) .content,
#box-checkout-payment .option:not(.active) .content {
  max-height: 0;
  overflow-y: hidden;
}
#box-checkout-shipping .option .thumbnail,
#box-checkout-payment .option .thumbnail {
  padding: 0 !important;
}
#box-checkout-shipping .option .error,
#box-checkout-payment .option .error {
  color: #c00;
}
#box-checkout-shipping .option .content,
#box-checkout-payment .option .content {
  max-height: 200px;
  overflow-x: hidden;
  overflow-y: auto;
  text-align: start;
  transition: all 0.25s ease;
}
#box-checkout-shipping .option .description,
#box-checkout-payment .option .description {
  margin-bottom: 1em;
}
#box-checkout-shipping .option hr,
#box-checkout-payment .option hr {
  margin: 1em 0;
  border-color: #ddd;
}
@media (min-width: 480px) {
  #box-checkout-shipping .price,
  #box-checkout-payment .price {
    position: absolute;
    display: inline-block;
    top: var(--gutter-y);
    right: var(--gutter-x);
  }
}
#box-checkout-summary table {
  margin-bottom: 0;
}
#box-checkout-summary .error {
  align-self: center;
  font-size: 1.25em;
  color: #ff0000;
  text-align: center;
}
#box-checkout-summary input[type=checkbox][required]:not(:checked) {
  animation: flasher 1s linear infinite;
}

/* Checkout refresh — visual only; order logic and field structure stay untouched */
#main:has(#box-checkout) {
  background:
    radial-gradient(circle at 10% 0, rgba(38, 153, 214, 0.08), transparent 32rem),
    #f6f8fb;
}

#content:has(#box-checkout) {
  max-width: 1240px;
  padding-top: 2rem;
  padding-bottom: 3rem;
}

#box-checkout > .cart.wrapper {
  margin-bottom: 1.25rem;
}

#box-checkout > .row {
  align-items: flex-start;
  margin-right: -0.625rem;
  margin-left: -0.625rem;
}

#box-checkout > .row > [class*="col-"] {
  padding-right: 0.625rem;
  padding-left: 0.625rem;
}

#box-checkout .wrapper {
  margin-bottom: 1.25rem;
}

#box-checkout .card {
  overflow: hidden;
  margin: 0;
  border: 1px solid #e4e9f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(25, 44, 66, 0.07);
}

#box-checkout .card-header {
  min-height: 62px;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #edf0f4;
  background: linear-gradient(135deg, #fff, #f8fafc);
}

#box-checkout .card-header .card-title,
#box-checkout .card > h2.title {
  margin: 0;
  color: #263746;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.35;
}

#box-checkout .card > h2.title {
  padding: 0 0 0.9rem;
  border-bottom: 1px solid #edf0f4;
}

#box-checkout .card-body {
  padding: 1.25rem;
}

#box-checkout-customer .form-group {
  margin-bottom: 1rem;
}

#box-checkout-customer label,
#box-checkout-summary label {
  display: inline-block;
  margin-bottom: 0.4rem;
  color: #536271;
  font-size: 0.88rem;
  font-weight: 600;
}

#box-checkout input:not([type="radio"]):not([type="checkbox"]),
#box-checkout select,
#box-checkout textarea {
  min-height: 44px;
  border: 1px solid #dce2e9;
  border-radius: 8px;
  background-color: #fbfcfd;
  box-shadow: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

#box-checkout textarea {
  min-height: 96px;
  resize: vertical;
}

#box-checkout input:not([type="radio"]):not([type="checkbox"]):focus,
#box-checkout select:focus,
#box-checkout textarea:focus {
  border-color: #2699d6;
  outline: 0;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(38, 153, 214, 0.13);
}

#box-checkout-customer .shipping-address,
#box-checkout-customer .account {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #edf0f4;
}

#box-checkout-customer h3 {
  margin: 0.65rem 0;
  color: #344657;
  font-size: 1rem;
  font-weight: 650;
}

#box-checkout-customer button[name="save_customer_details"] {
  min-height: 44px;
  margin-top: 0.5rem;
  border-radius: 8px;
}

#box-checkout-shipping,
#box-checkout-payment,
#box-checkout-summary {
  padding: 1.25rem;
}

#box-checkout-shipping .options,
#box-checkout-payment .options {
  display: grid;
  width: 100%;
  gap: 0.75rem;
  margin-top: 1rem;
}

#box-checkout-shipping .option.btn,
#box-checkout-payment .option.btn {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #dfe5eb;
  border-radius: 10px !important;
  background: #fff;
  box-shadow: 0 2px 7px rgba(25, 44, 66, 0.04);
  white-space: normal;
}

#box-checkout-shipping .option:not(.disabled):hover,
#box-checkout-payment .option:not(.disabled):hover {
  border-color: #9dcfe9;
  background: #f9fcfe;
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(38, 153, 214, 0.1);
}

#box-checkout-shipping .option.active,
#box-checkout-payment .option.active {
  border-color: #2699d6;
  background: #f2faff;
  box-shadow: 0 0 0 3px rgba(38, 153, 214, 0.12);
}

#box-checkout-shipping .option .header,
#box-checkout-payment .option .header {
  min-height: 66px;
  align-items: center;
}

#box-checkout-shipping .option .thumbnail,
#box-checkout-payment .option .thumbnail {
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  background: #fff;
}

#box-checkout-shipping .option .thumbnail img,
#box-checkout-payment .option .thumbnail img {
  width: 100%;
  max-width: 140px;
  height: 60px;
  object-fit: contain;
}

#box-checkout-shipping .option .title,
#box-checkout-payment .option .title {
  padding-right: 4rem;
  color: #263746;
  font-weight: 700;
}

#box-checkout-shipping .option .name,
#box-checkout-payment .option .name {
  padding-right: 4rem;
  color: #647382;
  font-size: 0.9rem;
  line-height: 1.4;
}

#box-checkout-shipping .option .price,
#box-checkout-payment .option .price {
  top: 50%;
  right: 0.9rem;
  color: #263746;
  font-weight: 700;
  transform: translateY(-50%);
}

#box-checkout-cart .headings {
  color: #72808d;
  background: #f8fafc;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#box-checkout-cart .item {
  padding: 1rem 1.25rem;
  border-color: #edf0f4;
  background: #fff !important;
}

#box-checkout-cart .item:hover {
  background: #fbfdff !important;
}

#box-checkout-cart .thumbnail {
  overflow: hidden;
  border: 1px solid #edf0f4;
  border-radius: 9px;
  background: #fff;
}

#box-checkout-cart .name {
  color: #263746;
  line-height: 1.4;
}

#box-checkout-cart .unit-price,
#box-checkout-cart .total-price {
  color: #344657;
  font-weight: 650;
}

#box-checkout-cart .card-footer.subtotal {
  padding: 1rem 1.25rem;
  border-top: 1px solid #e7ebf0;
  background: #f8fafc;
  color: #344657;
  font-size: 1.2rem;
}

#box-checkout-summary table {
  overflow: hidden;
  border: 1px solid #e5eaf0;
  border-radius: 9px;
  background: #fff;
}

#box-checkout-summary table td {
  padding: 0.75rem;
  border-color: #edf0f4;
}

#box-checkout-summary table tbody tr {
  background: #fff;
}

#box-checkout-summary table tfoot tr {
  background: #f2faff;
}

#box-checkout-summary table tfoot td {
  color: #1e6f9b;
  font-size: 1.12rem;
}

#box-checkout-summary .consent {
  padding: 0.8rem;
  border-radius: 8px;
  background: #f8fafc;
}

#box-checkout-summary button[name="confirm_order"] {
  min-height: 50px;
  margin-top: 0.9rem;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(135deg, #299f68, #218455);
  box-shadow: 0 8px 18px rgba(33, 132, 85, 0.2);
  font-weight: 700;
}

#box-checkout-summary button[name="confirm_order"]:hover {
  background: linear-gradient(135deg, #218d5c, #197247);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(33, 132, 85, 0.26);
}

@media (max-width: 767px) {
  #content:has(#box-checkout) {
    padding: 0.75rem;
  }

  #box-checkout .card {
    border-radius: 11px;
  }

  #box-checkout .card-header,
  #box-checkout .card-body,
  #box-checkout-shipping,
  #box-checkout-payment,
  #box-checkout-summary {
    padding: 1rem;
  }

  #box-checkout-customer .form-group[class*="col-"] {
    width: 100%;
  }

  #box-checkout-shipping .option .title,
  #box-checkout-payment .option .title,
  #box-checkout-shipping .option .name,
  #box-checkout-payment .option .name {
    padding-right: 0;
  }

  #box-checkout-shipping .option .price,
  #box-checkout-payment .option .price {
    position: static;
    display: block;
    margin-top: 0.35rem;
    color: #1e6f9b;
    transform: none;
  }

  #box-checkout-cart .item {
    padding: 0.9rem;
  }
}

/* Buyer type + RS lookup */
.checkout-buyer-type {
  margin-bottom: 1.1rem;
}
.checkout-buyer-type-label {
  display: block;
  margin-bottom: 0.45rem;
  color: #536271;
  font-size: 0.88rem;
  font-weight: 600;
}
.checkout-buyer-type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}
.checkout-buyer-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid #dfe5eb;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  color: #344657;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.checkout-buyer-option input {
  margin: 0;
}
.checkout-buyer-option.is-active {
  border-color: #2699d6;
  background: #f2faff;
  box-shadow: 0 0 0 3px rgba(38, 153, 214, 0.12);
}
.checkout-company-rs {
  margin-bottom: 0.75rem;
  padding: 0.85rem 0.9rem 0.35rem;
  border: 1px solid #e4e9f0;
  border-radius: 10px;
  background: #f8fafc;
}
.checkout-company-rs #rs_company_name[readonly] {
  background: #eef3f7;
  color: #263746;
  font-weight: 600;
  cursor: default;
}
.checkout-rs-status {
  min-height: 1.25rem;
  margin: 0 0 0.75rem;
  font-size: 0.86rem;
}
.checkout-rs-status.is-loading {
  color: #5a6b7a;
}
.checkout-rs-status.is-ok {
  color: #1f7a4d;
  font-weight: 600;
}
.checkout-rs-status.is-error {
  color: #c0392b;
  font-weight: 600;
}

/* Future payment integrations */
.payment-coming-soon {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid #e4e9ef;
}
.payment-coming-soon-heading {
  margin-bottom: 0.65rem;
  color: #6a7784;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.payment-coming-soon-option {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.55rem;
  padding: 0.65rem 0.8rem;
  border: 1px dashed #d6dde5;
  border-radius: 10px;
  background: #fafbfc;
  opacity: 0.78;
  cursor: not-allowed;
}
.payment-coming-soon-icon img {
  display: block;
  width: 84px;
  height: 42px;
  object-fit: contain;
}
.payment-coming-soon-details .title {
  color: #334758;
  font-weight: 700;
}
.payment-coming-soon-details .name {
  color: #73808c;
  font-size: 0.82rem;
}
.payment-coming-soon-badge {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #edf1f5;
  color: #687582;
  font-size: 0.7rem;
  font-weight: 700;
}
@media (max-width: 575px) {
  .checkout-buyer-type-toggle {
    grid-template-columns: 1fr;
  }
}
