body.pos-pro-active {
  overflow-x: hidden;
}

body.pos-pro-active .max-w-7xl {
  max-width: min(1680px, calc(100vw - 28px)) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

body.pos-pro-active .pos-pro-main-grid {
  display: block !important;
}

body.pos-pro-active .pos-pro-products-column {
  width: 100% !important;
}

body.pos-pro-active .pos-pro-products-grid {
  max-height: calc(100vh - 190px) !important;
  min-height: calc(100vh - 220px);
  padding: 8px !important;
  gap: 10px !important;
}

@media (min-width: 1280px) {
  body.pos-pro-active .pos-pro-products-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1536px) {
  body.pos-pro-active .pos-pro-products-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1780px) {
  body.pos-pro-active .pos-pro-products-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }
}

body.pos-pro-active .pos-pro-products-grid > div {
  padding: 10px !important;
  border-radius: 8px !important;
  transform: none !important;
}

body.pos-pro-active .pos-pro-products-grid > div:hover {
  transform: translateY(-2px) !important;
}

body.pos-pro-active .pos-pro-products-grid > div > div > div:first-child {
  height: 86px !important;
  margin-bottom: 8px !important;
}

body.pos-pro-active .pos-pro-products-grid img {
  height: 86px !important;
}

body.pos-pro-active .pos-pro-products-grid h3 {
  font-size: 15px !important;
  line-height: 1.25 !important;
  margin-bottom: 6px !important;
}

body.pos-pro-active .pos-pro-products-grid button {
  min-height: 36px !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
}

body.pos-pro-active .pos-pro-products-column button.bg-green-600,
body.pos-pro-active .pos-pro-products-column button.hover\:bg-green-700 {
  width: auto !important;
  min-width: 150px;
  min-height: 34px;
  padding: 7px 14px !important;
  border-radius: 8px !important;
}

.pos-pro-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

body.pos-cart-open .pos-pro-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.pos-pro-cart-panel {
  position: fixed !important;
  top: 50%;
  bottom: auto;
  left: 50% !important;
  right: auto !important;
  z-index: 80;
  width: min(1320px, calc(100vw - 96px));
  max-width: min(1320px, calc(100vw - 96px));
  max-height: min(860px, calc(100vh - 64px));
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px !important;
  background: #111827;
  border: 1px solid rgba(96, 165, 250, 0.42) !important;
  border-radius: 14px !important;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.48);
  transform: translate(-50%, -48%) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: transform 220ms ease, opacity 180ms ease;
}

html[dir="rtl"] .pos-pro-cart-panel {
  left: 50% !important;
  right: auto !important;
  transform: translate(-50%, -48%) scale(0.98);
}

html:not([dir="rtl"]) .pos-pro-cart-panel {
  right: auto !important;
  left: 50% !important;
  transform: translate(-50%, -48%) scale(0.98);
}

body.pos-cart-open .pos-pro-cart-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.pos-pro-cart-toggle {
  position: fixed;
  z-index: 85;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(96, 165, 250, 0.45);
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #0f766e);
  color: white;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 16px 45px rgba(37, 99, 235, 0.35);
}

html[dir="rtl"] .pos-pro-cart-toggle {
  left: 18px;
}

html:not([dir="rtl"]) .pos-pro-cart-toggle {
  right: 18px;
}

.pos-pro-cart-toggle-count {
  min-width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  color: #bfdbfe;
  font-size: 12px;
}

.pos-pro-close {
  position: static !important;
  top: auto !important;
  z-index: 1;
  width: 100%;
  flex: 0 0 auto;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(71, 85, 105, 0.7);
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.94);
  color: #e2e8f0;
  font-weight: 700;
}

.pos-pro-invoice-title {
  position: static !important;
  top: auto !important;
  z-index: 1;
  flex: 0 0 auto;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.96);
  color: #dbeafe;
  font-weight: 900;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pos-pro-cart-panel .pos-pro-invoice-info {
  order: 1;
}

.pos-pro-cart-panel .pos-pro-cart-section {
  order: 2;
  position: relative !important;
  flex: 0 0 auto;
  clear: both;
  margin-top: 0 !important;
}

.pos-pro-cart-panel .pos-pro-summary-section {
  order: 4;
  flex: 0 0 auto;
}

.pos-pro-cart-panel.pos-pro-review-ready {
  display: flex !important;
  flex-direction: column;
  gap: 14px;
}

.pos-pro-cart-panel.pos-pro-review-ready > .pos-pro-close {
  order: 0;
}

.pos-pro-cart-panel .pos-pro-cart-section > div,
.pos-pro-cart-panel .pos-pro-invoice-info,
.pos-pro-cart-panel .pos-pro-summary-section {
  position: relative !important;
  top: auto !important;
  transform: none !important;
  width: 100% !important;
  box-sizing: border-box !important;
  border-radius: 10px !important;
}

.pos-pro-cart-panel .pos-pro-cart-section .space-y-3 {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.pos-pro-invoice-items-header,
.pos-pro-cart-panel .pos-pro-cart-section .space-y-3 > div {
  display: grid !important;
  grid-template-columns: minmax(320px, 2fr) minmax(120px, 0.55fr) minmax(120px, 0.55fr) minmax(150px, 0.75fr) minmax(170px, 0.9fr);
  align-items: center !important;
  gap: 10px !important;
}

.pos-pro-cart-panel .pos-pro-cart-section .space-y-3 > div {
  margin: 0 !important;
  padding: 10px 12px !important;
  border-radius: 8px !important;
}

.pos-pro-invoice-items-header {
  margin: 0 0 8px;
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.96);
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 900;
}

.pos-pro-invoice-items-header span {
  white-space: nowrap;
}

.pos-pro-cart-panel .pos-pro-cart-section .space-y-3 > div > div {
  min-width: 0;
}

.pos-pro-cart-panel .pos-pro-cart-section .space-y-3 > div > div:nth-child(n+2) {
  justify-self: stretch;
}

.pos-pro-cart-panel .pos-pro-cart-section h3,
.pos-pro-cart-panel .pos-pro-cart-section p {
  margin-top: 0 !important;
  margin-bottom: 2px !important;
}

.pos-pro-cart-panel .pos-pro-cart-section .space-y-3 input,
.pos-pro-cart-panel .pos-pro-cart-section .space-y-3 select {
  max-width: 140px !important;
}

.pos-pro-cart-panel .pos-pro-cart-section .space-y-3 button {
  min-width: 38px !important;
  min-height: 36px !important;
  padding: 8px !important;
}

.pos-pro-cart-panel .pos-pro-cart-section input,
.pos-pro-cart-panel .pos-pro-cart-section select,
.pos-pro-cart-panel .pos-pro-summary-section input,
.pos-pro-cart-panel .pos-pro-summary-section select,
.pos-pro-cart-panel .pos-pro-invoice-info input,
.pos-pro-cart-panel .pos-pro-invoice-info select {
  min-height: 38px !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

.pos-pro-cart-panel .pos-pro-invoice-info::before {
  content: "\0628\064A\0627\0646\0627\062A \0627\0644\0639\0645\064A\0644 \0028\0645\0637\0644\0648\0628\0029";
  display: block;
  margin-bottom: 10px;
  color: #dbeafe;
  font-size: 18px;
  font-weight: 900;
}

.pos-pro-customer-required-note {
  margin: 8px 0 12px;
  padding: 8px 10px;
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 8px;
  background: rgba(120, 53, 15, 0.22);
  color: #fde68a;
  font-weight: 700;
  font-size: 13px;
}

.pos-pro-cart-panel .pos-pro-invoice-info button {
  min-height: 36px !important;
  border-radius: 8px !important;
}

.pos-pro-cart-panel .pos-pro-summary-section::before {
  content: "\0627\0644\062F\0641\0639 \0648\0627\0644\0625\0635\062F\0627\0631";
  display: block;
  margin-bottom: 10px;
  color: #d1fae5;
  font-size: 18px;
  font-weight: 900;
}

.pos-pro-template-panel {
  order: 3;
  flex: 0 0 auto;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid rgba(14, 165, 233, 0.32);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(8, 47, 73, 0.48), rgba(15, 23, 42, 0.72));
}

.pos-pro-template-head,
.pos-pro-template-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pos-pro-template-head strong {
  display: block;
  color: #e0f2fe;
  font-size: 17px;
  font-weight: 900;
}

.pos-pro-template-head span {
  display: block;
  margin-top: 3px;
  color: #93c5fd;
  font-size: 12px;
}

.pos-pro-template-grid,
.pos-pro-template-fields {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.pos-pro-template-grid {
  grid-template-columns: minmax(260px, 0.85fr) minmax(320px, 1.15fr);
}

.pos-pro-template-fields {
  grid-template-columns: 1fr;
}

.pos-pro-template-panel label {
  display: block;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 800;
}

.pos-pro-template-panel select,
.pos-pro-template-panel input,
.pos-pro-template-panel textarea {
  width: 100%;
  margin-top: 7px;
  border: 1px solid rgba(71, 85, 105, 0.9);
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.78);
  color: #f8fafc;
  outline: none;
  font-size: 14px;
}

.pos-pro-template-panel textarea {
  min-height: 104px;
  resize: vertical;
  line-height: 1.6;
}

.pos-pro-template-save,
.pos-pro-template-clear,
.pos-pro-template-delete {
  min-height: 38px !important;
  border: 0;
  border-radius: 9px;
  padding: 8px 14px !important;
  color: #fff;
  font-size: 12px !important;
  font-weight: 900;
}

.pos-pro-template-save {
  background: linear-gradient(135deg, #0891b2, #2563eb);
}

.pos-pro-template-clear {
  background: rgba(71, 85, 105, 0.9);
}

.pos-pro-template-delete {
  background: rgba(185, 28, 28, 0.9);
}

.pos-pro-template-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.pos-pro-cart-panel .pos-pro-cart-section {
  min-height: 210px;
  overflow: hidden !important;
  padding-top: 0 !important;
}

.pos-pro-cart-panel .pos-pro-cart-section > div {
  overflow: hidden !important;
}

.pos-pro-cart-panel .pos-pro-cart-section .space-y-3 {
  margin-top: 0 !important;
}

@media (max-width: 767px) {
  body.pos-pro-active {
    padding-bottom: 96px;
  }

  body.pos-pro-active .pos-pro-products-column {
    padding-bottom: 110px !important;
  }

  body.pos-pro-active .pos-pro-products-grid {
    max-height: none !important;
    min-height: 0;
    padding-bottom: 18px !important;
  }

  .pos-pro-cart-toggle {
    left: 18px !important;
    right: 18px !important;
    bottom: 74px !important;
    justify-content: center;
    min-height: 46px;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.5), 0 0 0 1px rgba(125, 211, 252, 0.25);
  }

  .pos-pro-cart-panel {
    top: 50%;
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .pos-pro-invoice-items-header,
  .pos-pro-cart-panel .pos-pro-cart-section .space-y-3 > div {
    grid-template-columns: 1fr !important;
  }

  .pos-pro-template-grid,
  .pos-pro-template-fields {
    grid-template-columns: 1fr;
  }
}
