/* OPC / checkout address form — stacked labels, full-width fields */
.opc .ship-to-same-address {
  text-align: start;
  margin: 0 0 16px;
}

.opc .ship-to-same-address .selector {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 0;
}

.opc .opc-select-address-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
  max-width: 720px;
}

.opc .opc-select-address-container .address-select,
.opc #billing-address-select,
.opc #shipping-address-select {
  display: block;
  width: 100% !important;
  max-width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  background: #f0f0e9;
  border: 1px solid #e8e8e0;
  color: #696763;
  padding: 10px 12px;
  margin: 0;
}

.opc .opc-address-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.opc .opc-address-actions .button-1,
.opc .opc-address-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  min-height: 38px;
  margin: 0;
  padding: 8px 18px;
  float: none;
  width: auto;
  box-sizing: border-box;
}

/* ---------- All OPC step button bars ---------- */
.opc .panel-body {
  overflow-x: hidden;
}

.opc .buttons,
.opc #billing-buttons-container,
.opc #shipping-buttons-container,
.opc #shipping-method-buttons-container,
.opc #payment-method-buttons-container,
.opc #payment-info-buttons-container,
.opc #confirm-order-buttons-container {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 16px;
  clear: both;
  float: none !important;
  text-align: start;
  overflow: visible;
}

/* Billing: Continue only — align end */
.opc #billing-buttons-container {
  justify-content: flex-end;
}

/* Legacy Bootstrap row/col inside OPC buttons (fallback if old markup still served) */
.opc .buttons > .row {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  margin: 0 !important;
  float: none;
}

.opc .buttons > .row::before,
.opc .buttons > .row::after {
  display: none !important;
  content: none !important;
}

.opc .buttons > .row > [class*="col-"],
.opc .buttons > .row > .pull-left,
.opc .buttons > .row > .pull-right {
  float: none !important;
  width: auto !important;
  max-width: 100%;
  padding-left: 0 !important;
  padding-right: 0 !important;
  position: static !important;
}

.opc .buttons .back-link {
  margin: 0;
  float: none !important;
  flex: 0 0 auto;
}

.opc .buttons .opc-btn-next,
.opc .buttons .pull-text-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  margin-inline-start: auto;
  text-align: end;
  float: none !important;
  flex: 0 1 auto;
  max-width: 100%;
}

.opc .buttons .back-link .btn,
.opc .buttons .button-1,
.opc .buttons input.button-1,
.opc .buttons .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  min-height: 40px;
  margin: 0 !important;
  float: none !important;
  box-sizing: border-box;
  max-width: 100%;
}

.opc .buttons .please-wait {
  display: inline-block;
  margin: 0;
  white-space: nowrap;
}

/* ---------- Payment information: credit card form ---------- */
.eshopper-opc-payment-info table:has(#CardNumber) {
  display: block;
  max-width: 560px;
  margin: 4px 0 8px;
  padding: 20px;
  background: #fff;
  border: 1px solid #e8e8e0;
  border-radius: 4px;
  box-sizing: border-box;
}

.eshopper-opc-payment-info table:has(#CardNumber) tbody {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.eshopper-opc-payment-info table:has(#CardNumber) tr {
  display: flex;
  flex-direction: column;
  gap: 6px;
  grid-column: 1 / -1;
}

.eshopper-opc-payment-info table:has(#CardNumber) tr:has(#ExpireMonth),
.eshopper-opc-payment-info table:has(#CardNumber) tr:has(#CardCode) {
  grid-column: auto;
}

.eshopper-opc-payment-info table:has(#CardNumber) td {
  display: block;
  padding: 0;
}

.eshopper-opc-payment-info table:has(#CardNumber) label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #555;
}

.eshopper-opc-payment-info select#CreditCardType,
.eshopper-opc-payment-info input#CardholderName,
.eshopper-opc-payment-info input#CardNumber,
.eshopper-opc-payment-info input#CardCode,
.eshopper-opc-payment-info select#ExpireMonth,
.eshopper-opc-payment-info select#ExpireYear {
  display: block;
  width: 100% !important;
  height: 44px;
  margin: 0;
  padding: 10px 12px;
  box-sizing: border-box;
  background: #f0f0e9;
  border: 1px solid #e8e8e0;
  border-radius: 0;
  color: #696763;
  font-size: 14px;
  font-weight: 400;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.eshopper-opc-payment-info select#CreditCardType:focus,
.eshopper-opc-payment-info input#CardholderName:focus,
.eshopper-opc-payment-info input#CardNumber:focus,
.eshopper-opc-payment-info input#CardCode:focus,
.eshopper-opc-payment-info select#ExpireMonth:focus,
.eshopper-opc-payment-info select#ExpireYear:focus {
  background: #fff;
  border-color: #fe980f;
}

.eshopper-opc-payment-info input#CardNumber {
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

.eshopper-opc-payment-info table:has(#CardNumber) td:has(> #ExpireMonth) {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #999;
}

.eshopper-opc-payment-info select#ExpireMonth,
.eshopper-opc-payment-info select#ExpireYear {
  flex: 1 1 0;
  min-width: 0;
}

.eshopper-opc-payment-info table:has(#CardNumber) .field-validation-error {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #d9534f;
}

#checkout-payment-info-load .alert {
  margin: 0;
  padding: 0;
}

@media (max-width: 575px) {
  .eshopper-opc-payment-info table:has(#CardNumber) {
    padding: 16px;
  }

  .eshopper-opc-payment-info table:has(#CardNumber) tbody {
    grid-template-columns: 1fr;
  }

  .eshopper-opc-payment-info input#CardCode {
    max-width: 140px;
  }
}

.opc .enter-address,
.checkout-page .enter-address {
  max-width: 720px;
}

.opc .enter-address .form-horizontal .form-group,
.opc .enter-address .form-horizontal .form-group.inputs,
.checkout-page .enter-address .form-horizontal .form-group,
.checkout-page .enter-address .form-horizontal .form-group.inputs {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  float: none;
  clear: both;
  margin: 0 0 14px;
  padding: 0;
}

.opc .enter-address .form-horizontal .form-group::before,
.opc .enter-address .form-horizontal .form-group::after,
.checkout-page .enter-address .form-horizontal .form-group::before,
.checkout-page .enter-address .form-horizontal .form-group::after {
  display: none;
  content: none;
}

.opc .enter-address .form-horizontal .form-group > [class*="col-"],
.checkout-page .enter-address .form-horizontal .form-group > [class*="col-"] {
  float: none !important;
  width: 100% !important;
  max-width: 100% !important;
  padding-left: 0;
  padding-right: 0;
  margin: 0;
  position: static;
}

.opc .enter-address label,
.checkout-page .enter-address label {
  display: inline-block;
  margin: 0 0 6px;
  font-weight: 600;
  color: #555;
}

.opc .enter-address .gray-input,
.opc .enter-address .gray-dropdown,
.opc .enter-address input[type="text"],
.opc .enter-address input[type="email"],
.opc .enter-address select,
.checkout-page .enter-address .gray-input,
.checkout-page .enter-address .gray-dropdown,
.checkout-page .enter-address input[type="text"],
.checkout-page .enter-address select {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 42px;
  box-sizing: border-box;
  margin: 0;
  padding: 10px 12px;
  background: #f0f0e9;
  border: 1px solid #e8e8e0;
  color: #696763;
}

@media (min-width: 768px) {
  .opc .enter-address .form-horizontal,
  .checkout-page .enter-address .form-horizontal {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 20px;
  }

  .opc .enter-address .form-horizontal > .form-group:nth-child(n + 3),
  .checkout-page .enter-address .form-horizontal > .form-group:nth-child(n + 3) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  .opc .enter-address,
  .opc .opc-select-address-container,
  .checkout-page .enter-address {
    max-width: 100%;
  }

  .opc .opc-address-actions {
    width: 100%;
  }

  .opc .opc-address-actions .button-1,
  .opc .opc-address-actions .btn {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
  }

  .opc .buttons,
  .opc #billing-buttons-container,
  .opc #shipping-buttons-container,
  .opc #shipping-method-buttons-container,
  .opc #payment-method-buttons-container,
  .opc #payment-info-buttons-container,
  .opc #confirm-order-buttons-container {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .opc .buttons > .row {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .opc .buttons > .row > [class*="col-"] {
    width: 100% !important;
  }

  .opc .buttons .back-link,
  .opc .buttons .opc-btn-next,
  .opc .buttons .pull-text-right {
    width: 100%;
    margin-inline-start: 0;
  }

  .opc .buttons .back-link .btn,
  .opc .buttons .button-1,
  .opc .buttons input.button-1,
  .opc .buttons .btn {
    width: 100%;
    min-width: 0;
  }
}
