/* =========================================================
START: НОВА ФОРМА ЗА ПОРЪЧКА И ДОСТАВКА С ЕКОНТ
========================================================= */

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

.new-order-modal {
  position: fixed; inset: 0; z-index: 10000; display: none;
  align-items: center; justify-content: center; padding: 16px;
  background: rgba(20, 24, 28, .72);
}
.new-order-modal.is-open { display: flex; }
.new-order-dialog {
  width: min(760px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
  background: #fff; border-radius: 12px; box-shadow: 0 16px 50px rgba(0,0,0,.3);
  color: #222;
}
.new-order-header {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; padding: 16px 20px;
  border-bottom: 1px solid #e4e4e4; background: #fff; border-radius: 12px 12px 0 0;
}
.new-order-title { margin: 0; font-size: 24px; line-height: 1.2; }
.new-order-close {
  width: 40px; height: 40px; border: 0; border-radius: 50%; cursor: pointer;
  background: #f1f1f1; color: #333; font-size: 25px; line-height: 1;
}
.new-order-body { padding: 20px; }
.new-order-section { margin: 0 0 22px; padding: 0; border: 0; }
.new-order-section legend { margin-bottom: 12px; font-size: 18px; font-weight: 700; }
.new-order-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.new-order-field { display: flex; flex-direction: column; gap: 6px; }
.new-order-field.full { grid-column: 1 / -1; }
.new-order-field label, .new-order-label { font-weight: 600; }
.new-order-field input, .new-order-field select, .new-order-field textarea {
  width: 100%; box-sizing: border-box; min-height: 46px; padding: 10px 12px;
  border: 1px solid #b9b9b9; border-radius: 7px; background: #fff; color: #222;
  font: inherit;
}
.new-order-field textarea { min-height: 90px; resize: vertical; }
.new-order-city-field { position: relative; }
.new-order-city-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  display: none; max-height: 260px; overflow-y: auto; padding: 5px;
  border: 1px solid #bbb; border-radius: 7px; background: #fff;
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
}
.new-order-city-results.opens-up {
  top: auto;
  bottom: calc(100% + 6px);
}
.new-order-city-results.is-open { display: block; }
.new-order-city-option {
  width: 100%; padding: 10px 11px; border: 0; border-radius: 5px;
  background: #fff; color: #222; cursor: pointer; text-align: left; font: inherit;
}
.new-order-city-option:hover, .new-order-city-option.is-active { background: #fff0e3; }
.new-order-city-empty { padding: 11px; color: #666; }
.new-order-field-help { margin: 2px 0 0; color: #666; font-size: 12px; }
.new-order-field input:focus, .new-order-field select:focus, .new-order-field textarea:focus {
  outline: 2px solid rgba(238, 116, 0, .25); border-color: #ee7400;
}
.new-order-options { display: flex; flex-wrap: wrap; gap: 18px; }
.new-order-options label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.new-order-options input { width: 18px; height: 18px; accent-color: #ee7400; }
.new-order-invoice-section { padding: 15px; border: 1px solid #ddd; border-radius: 9px; }
.new-order-invoice-section legend { padding: 0 6px; }
.new-order-invoice-toggle {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-size: 16px; font-weight: 700;
}
.new-order-invoice-toggle input { width: 20px; height: 20px; accent-color: #ee7400; }
.new-order-invoice-fields { margin-top: 16px; padding-top: 16px; border-top: 1px solid #e2e2e2; }
.new-order-invoice-options {
  padding: 11px 12px; border: 1px solid #d7d7d7; border-radius: 7px; background: #fafafa;
}
.new-order-invoice-options label { font-weight: 500; }
#invoice-vat[readonly] { background: #f3f5f6; color: #333; }
.new-order-summary { border: 1px solid #ddd; border-radius: 8px; overflow: hidden; }
.new-order-empty { margin: 0; padding: 14px; color: #666; }
.new-order-item {
  display: grid; grid-template-columns: minmax(0, 1fr) 86px 92px 38px;
  gap: 10px; align-items: center; padding: 12px; border-bottom: 1px solid #e5e5e5;
}
.new-order-item:last-child { border-bottom: 0; }
.new-order-item-title { min-width: 0; font-weight: 600; }
.new-order-item-code { display: block; margin-top: 3px; color: #666; font-size: 13px; }
.new-order-qty { width: 78px; min-height: 40px; box-sizing: border-box; padding: 7px; border: 1px solid #bbb; border-radius: 6px; }
.new-order-item-price { text-align: right; white-space: nowrap; font-weight: 700; }
.new-order-remove { border: 0; background: transparent; color: #b00020; cursor: pointer; font-size: 19px; }
.new-order-total { padding: 12px; border-top: 2px solid #ddd; text-align: right; font-size: 18px; font-weight: 700; }
.new-order-note { margin: 8px 0 0; color: #666; font-size: 13px; }
.new-order-status { display: none; margin: 0 0 16px; padding: 12px; border-radius: 7px; }
.new-order-status.is-visible { display: block; }
.new-order-status.success { background: #e8f7ec; color: #176b2c; }
.new-order-status.error { background: #fdebed; color: #9b1c2c; }
.new-order-submit {
  width: 100%; min-height: 50px; border: 0; border-radius: 8px; cursor: pointer;
  background: #ee7400; color: #fff; font-family: inherit; font-size: 17px;
  font-weight: 700; line-height: 1.2;
}
.new-order-submit:hover { background: #d86800; }
.new-order-submit:disabled { opacity: .65; cursor: wait; }
.new-order-success {
  display: none; min-height: 360px; box-sizing: border-box; padding: 36px 20px;
  flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.new-order-success.is-visible { display: flex; }
.new-order-success-icon { margin-bottom: 18px; color: #23a455; font-size: 82px; line-height: 1; }
.new-order-success h3 { margin: 0 0 14px; color: #176b2c; font-size: 27px; line-height: 1.25; }
.new-order-success p { max-width: 570px; margin: 0; color: #555; font-size: 15px; line-height: 1.55; }
.new-order-success p strong { color: #333; }
.new-order-success-close {
  min-width: 150px; margin-top: 25px; padding: 12px 22px; border: 0;
  border-radius: 8px; background: #23a455; color: #fff; cursor: pointer;
  font-family: inherit; font-size: 16px; font-weight: 700; line-height: 1.2;
}
.new-order-success-close:hover { background: #1b8745; }
.new-order-floating {
  position: fixed; right: 20px; bottom: 20px; z-index: 9990; padding: 14px 21px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; background: #ee7400; color: #fff;
  box-shadow: 0 7px 22px rgba(0,0,0,.25); cursor: pointer; font-size: 17px; font-weight: 700;
}
.new-order-cart-icon { color: #fff; font-size: 15px; line-height: 1; }
.new-order-hidden { display: none !important; }
.new-order-honeypot { position: absolute !important; left: -9999px !important; }
.new-order-terms {
  display: flex; align-items: flex-start; gap: 10px; margin: 0 0 16px;
  padding: 12px 13px; border: 1px solid #ddd; border-radius: 7px;
  background: #fafafa; color: #333; font-size: 14px; line-height: 1.45;
}
.new-order-terms input {
  flex: 0 0 auto; width: 19px; height: 19px; margin: 1px 0 0; accent-color: #ee7400;
}
.new-order-terms a { color: #c75f00; font-weight: 700; text-decoration: underline; }
.new-order-terms a:hover { color: #994900; }

@media (max-width: 640px) {
  .new-order-modal { padding: 0; align-items: stretch; }
  .new-order-dialog { max-height: 100vh; border-radius: 0; }
  .new-order-header { border-radius: 0; padding: 13px 14px; }
  .new-order-body { padding: 15px; }
  .new-order-grid { grid-template-columns: 1fr; }
  .new-order-field.full { grid-column: auto; }
  .new-order-item { grid-template-columns: minmax(0, 1fr) 72px 34px; }
  .new-order-item-price { grid-column: 1 / 2; text-align: left; }
  .new-order-qty { grid-column: 2 / 3; grid-row: 1 / 3; width: 68px; }
  .new-order-remove { grid-column: 3 / 4; grid-row: 1 / 3; }
  .new-order-floating { right: 12px; bottom: 12px; }
  .new-order-success { min-height: calc(100vh - 115px); padding: 28px 10px; }
  .new-order-success-icon { font-size: 72px; }
  .new-order-success h3 { font-size: 23px; }
}

/* =========================================================
END: НОВА ФОРМА ЗА ПОРЪЧКА И ДОСТАВКА С ЕКОНТ
========================================================= */
