.te-order-launcher {
  display: inline-flex;
  align-items: stretch;
  gap: 8px;
  margin: 8px 0 0 8px;
  vertical-align: middle;
}

.te-order-quantity {
  display: inline-flex;
  align-items: stretch;
  height: 34px;
  overflow: hidden;
  border: 1px solid #d2d8de;
  border-radius: 4px;
  background: #fff;
}

.te-order-quantity button {
  width: 32px;
  padding: 0;
  border: 0;
  background: #f3f5f7;
  color: #314558;
  font-size: 18px;
  line-height: 32px;
}

.te-order-quantity input {
  width: 38px;
  padding: 0;
  border: 0;
  border-right: 1px solid #d2d8de;
  border-left: 1px solid #d2d8de;
  text-align: center;
  font-weight: 600;
  -moz-appearance: textfield;
}

.te-order-quantity input::-webkit-inner-spin-button,
.te-order-quantity input::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.te-order-modal[hidden] {
  display: none !important;
}

.te-order-modal {
  position: fixed;
  z-index: 10050;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(18, 31, 43, .72);
}

.te-order-dialog {
  position: relative;
  width: min(680px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 18px 54px rgba(0, 0, 0, .3);
}

.te-order-head,
.te-order-body,
.te-order-footer {
  padding: 20px 24px;
}

.te-order-head {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  padding-right: 58px;
  border-bottom: 1px solid #e6e9ec;
}

.te-order-head h3 {
  margin: 0;
  font-size: 22px;
  white-space: nowrap;
}

.te-order-summary {
  color: #627182;
  white-space: nowrap;
}

.te-order-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #526170;
  font-size: 29px;
  line-height: 32px;
}

.te-order-payment {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.te-order-payment label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #d8dfe5;
  border-radius: 4px;
  cursor: pointer;
  min-width: 0;
}

.te-order-payment-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 4px;
  background: #eef3f8;
  color: #174a78;
  font-size: 20px;
}

.te-order-payment-title {
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.te-order-payment label:has(input:checked) {
  border-color: #e5a100;
  box-shadow: inset 0 0 0 1px #e5a100;
}

.te-order-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.te-order-field-wide {
  grid-column: 1 / -1;
}

.te-order-body .form-control {
  height: 42px;
}

.te-order-body textarea.form-control {
  height: 74px;
  resize: vertical;
}

.te-order-body .te-order-floating {
  position: relative;
  min-width: 0;
  margin-bottom: 0;
}

.te-order-body .te-order-floating .form-control {
  /* The Joomla order stylesheet forces dimensions on every form-control. */
  height: 52px !important;
  padding: 20px 12px 6px !important;
  font-size: 16px;
  line-height: 24px;
  text-align: left;
}

.te-order-body .te-order-floating textarea.form-control {
  min-height: 64px;
  height: 64px !important;
}

.te-order-body .te-order-floating > label {
  position: absolute;
  top: 14px;
  left: 12px;
  right: 42px;
  z-index: 1;
  margin: 0;
  overflow: hidden;
  color: #627182;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: left;
  cursor: text;
  transition: top .15s ease, font-size .15s ease;
}

.te-order-floating .form-control:focus ~ label,
.te-order-floating .form-control:not(:placeholder-shown) ~ label {
  top: 3px;
  font-size: 11px;
}

.te-order-floating .form-control:-webkit-autofill ~ label {
  top: 3px;
  font-size: 11px;
}

@media (prefers-reduced-motion: reduce) {
  .te-order-body .te-order-floating > label { transition: none; }
}

.te-order-body .form-control.is-valid,
.te-order-body .form-control.is-invalid {
  padding-right: 42px;
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 18px 18px;
}

.te-order-body .te-order-floating .form-control.is-valid,
.te-order-body .te-order-floating .form-control.is-invalid {
  padding-right: 42px !important;
}

.te-order-body .te-order-floating .form-control.is-valid {
  border-color: #2f8f46 !important;
}

.te-order-body .te-order-floating .form-control.is-invalid {
  border-color: #c43a31 !important;
}

.te-order-kpp-note {
  display: block;
  margin-top: 4px;
  color: #627182;
  font-size: 12px;
  line-height: 1.3;
  text-align: left;
}

.te-order-kpp-note[hidden] { display: none; }

.te-order-body .te-order-floating .form-control:disabled {
  background-color: #eceff1 !important;
  color: #78838c;
  cursor: not-allowed;
  box-shadow: none;
}

.te-order-body .te-order-floating.is-disabled > label {
  color: #78838c;
  cursor: not-allowed;
}

.te-order-body .form-control.is-valid {
  border-color: #2f8f46;
  box-shadow: 0 0 0 1px rgba(47, 143, 70, .12);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='9' fill='%232f8f46'/%3E%3Cpath d='M5.5 10.1 8.4 13l6.2-6.2' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.te-order-body .form-control.is-invalid {
  border-color: #c43a31;
  box-shadow: 0 0 0 1px rgba(196, 58, 49, .12);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='9' fill='%23c43a31'/%3E%3Cpath d='M10 5.2v6.1M10 14.4v.4' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.te-order-validation-message {
  display: none;
  margin-top: 5px;
  color: #a92f27;
  font-size: 12px;
  line-height: 1.35;
}

.form-control.is-invalid + .te-order-validation-message {
  display: block;
}

.te-order-company[hidden] {
  display: none;
}

.te-order-company {
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid #e6e9ec;
}

.te-order-company .te-order-grid {
  grid-template-columns: 2fr 1fr 1fr;
}

.te-order-edo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 13px 0 22px;
  font-weight: 400;
}

.te-order-company + .form-group {
  margin-top: 4px;
}

.te-order-legal {
  margin: 14px 0 0;
  color: #6d7780;
  font-size: 12px;
  line-height: 1.45;
}

.te-order-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #e6e9ec;
  background: #f7f8f9;
}

.te-order-total {
  font-size: 17px;
}

.te-order-error,
.te-order-success {
  margin: 0 24px 18px;
  padding: 11px 13px;
  border-radius: 4px;
}

.te-order-result-dialog {
  width: min(560px, 100%);
}

.te-order-result-body {
  padding: 28px 24px 24px;
  text-align: center;
}

.te-order-result-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: #e7f5ea;
  color: #2f8f46;
  font-size: 28px;
}

.te-order-result-body h3 {
  margin: 0 0 10px;
  font-size: 23px;
}

.te-order-result-body p {
  margin: 0;
  color: #596875;
  line-height: 1.55;
}

.te-order-result-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0 24px 24px;
}

.te-order-processing[hidden] {
  display: none !important;
}

.te-order-processing {
  padding: 44px 24px 38px;
  text-align: center;
}

.te-order-processing-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: #eef3f8;
  color: #174a78;
  font-size: 25px;
}

.te-order-processing h3 {
  margin: 0 0 8px;
  font-size: 23px;
}

.te-order-processing p {
  margin: 0 auto;
  max-width: 440px;
  color: #637080;
  line-height: 1.5;
}

.te-order-progress {
  height: 8px;
  margin: 24px auto 0;
  overflow: hidden;
  border-radius: 4px;
  background: #e3e8ed;
}

.te-order-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #efad22;
}

.te-order-progress-bar.is-running {
  animation: te-order-progress 40s cubic-bezier(.16, .72, .3, 1) forwards;
}

.te-order-progress-bar.is-complete {
  width: 100%;
  animation: none;
  transition: width .25s ease;
}

@keyframes te-order-progress {
  0% { width: 4%; }
  35% { width: 52%; }
  70% { width: 76%; }
  100% { width: 90%; }
}

.te-order-error {
  color: #8b1f18;
  background: #fbe9e7;
}

.te-order-success {
  color: #245d31;
  background: #e7f5ea;
}

body.te-order-open {
  overflow: hidden;
}

body.te-order-open jdiv {
  display: none !important;
}

@media (max-width: 400px) {
  .te-order-payment label {
    display: grid;
    grid-template-columns: 14px 28px minmax(0, 1fr);
    align-content: center;
  }

  .te-order-payment-title { grid-column: 1 / -1; }
}

@media (max-width: 767px) {
  .te-order-launcher {
    display: flex;
    width: 100%;
    margin: 8px 0 0;
  }

  .te-order-launcher > .btn {
    flex: 1;
  }

  .te-order-modal {
    align-items: flex-end;
    padding: 0;
  }

  .te-order-dialog {
    width: 100%;
    max-height: 94vh;
    border-radius: 5px 5px 0 0;
  }

  .te-order-head,
  .te-order-body,
  .te-order-footer {
    padding: 12px 16px;
  }

  .te-order-head h3 {
    font-size: 16px;
    white-space: nowrap;
  }

  .te-order-head { gap: 6px; padding-right: 42px; }
  .te-order-summary { font-size: 12px; }

  .te-order-grid { gap: 10px; }

  .te-order-payment { margin-bottom: 12px; }

  .te-order-payment label { gap: 5px; padding: 8px; }

  .te-order-payment-icon {
    flex-basis: 28px;
    width: 28px;
    height: 32px;
    font-size: 18px;
  }

  .te-order-payment-title { font-size: 14px; text-align: left; }

  .te-order-company { margin-top: 10px; padding-top: 10px; }

  .te-order-edo { margin: 10px 0 14px; }

  .te-order-grid,
  .te-order-company .te-order-grid {
    grid-template-columns: 1fr;
  }

  .te-order-field-wide {
    grid-column: auto;
  }

  .te-order-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .te-order-result-actions {
    align-items: stretch;
    flex-direction: column;
    padding: 0 16px 20px;
  }

  .te-order-processing {
    padding: 38px 16px 34px;
  }
}

@media (max-width: 400px) {
  .te-order-head h3 { font-size: 13px; }
  .te-order-summary { font-size: 11px; }
}
