/* ============================ Products Page Layout Start ============================ */
.products-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100%;
  min-height: 0;
}

.products-toolbar {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.products-toolbar h1 {
  margin: 0;
  color: var(--dark4txt);
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 500;
  line-height: 26px;
}

.products-toolbar h1 .products-count {
  font-family: var(--font-body);
  font-size: 14px;
}

.products-total {
  color: var(--grey4txt);
  font-size: 14px;
}

.products-total strong {
  color: var(--dark4txt);
  font-weight: 600;
}

.products-new-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  margin-left: auto;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-sm);
  color: var(--dark4txt);
  background: var(--button-bg);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.products-new-btn:hover {
  background-color: var(--white);
}

.products-new-btn .products-new-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 18px;
  line-height: 1;
}


/* ============================ Products Page Layout End ============================ */


/* ============================ Products Table Start ============================ */
.products-table-shell {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  scrollbar-width: none;
}

.products-table-shell::-webkit-scrollbar {
  display: none;
}

.products-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 2px 2px;
}

.products-table thead.products-table-head th {
  padding: 12px 24px;
  color: var(--dark4txt);
  background: var(--white);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  text-align: left;
  box-shadow: 2px 0 0 0 var(--white);
}

.products-table thead.products-table-head th:first-child {
  width: 96px;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.products-table thead.products-table-head th:nth-child(3) {
  width: 120px;
  text-align: center;
  padding-right: 20px;
}

.products-table thead.products-table-head th:last-child {
  width: 80px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.products-table-gap td {
  height: 10px;
  padding: 0;
  background: transparent !important;
  border-radius: 0 !important;
}

.products-row td {
  padding: 14px 24px;
  color: var(--dark4txt);
  background: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  font-weight: 500;
  vertical-align: middle;
}

.products-row.is-alt td {
  background: rgba(255, 255, 255, 0.3);
}

.products-row:hover td {
  background: var(--white);
}

.products-row td:first-child {
  width: 96px;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.products-row td:nth-child(3) {
  width: 120px;
  text-align: center;
  padding-right: 20px;
}

.products-row td:last-child {
  width: 80px;
  text-align: center;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.products-row .products-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.products-delete svg {
  width: 22px;
  height: 22px;
}

.products-delete svg path:hover {
  fill: var(--accent-green);
}

/* ============================ Products Edit / New Modal Start ============================ */
.products-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: var(--font-body);
}

.products-modal.is-open {
  display: flex;
}

.products-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 34, 0.38);
}

.products-modal.products-modal-instance {
  background: transparent;
  pointer-events: none;
}

.products-modal.products-modal-instance .products-modal-overlay {
  display: none;
}

.products-modal.products-modal-instance .products-modal-card {
  pointer-events: auto;
}

.products-modal.products-modal-instance .products-modal-head {
  cursor: move;
  -webkit-user-select: none;
  user-select: none;
}

@media (max-width: 600px) {
  .products-modal.products-modal-instance .products-modal-card {
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }
}

.products-modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(720px, 100vw - 48px);
  max-height: calc(100vh - 140px);
  padding: 24px 26px 22px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--dark4txt) url("../../assets/images/app-bg.png") center / cover no-repeat;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  top: 100px !important;
}

.products-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--white);
}

.products-modal-title-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.products-modal-eyebrow {
  font-size: 13px;
  opacity: 0.9;
}

.products-modal-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 28px;
  line-height: 30px;
  font-weight: 700;
}

.products-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  flex: 0 0 40px;
}

.products-modal-close img {
  width: 18px;
  height: 18px;
}

.products-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  background: var(--panel-bg);
}

.products-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.products-field>span {
  font-size: 14px;
  color: var(--dark4txt);
}

.products-input {
  width: 100%;
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--white);
  font: inherit;
  color: var(--dark4txt);
  outline: 0;
}

.products-textarea {
  height: 86px;
  padding: 12px 16px;
  resize: vertical;
  font-family: var(--font-body);
  line-height: 18px;
}

.products-input::placeholder,
.products-textarea::placeholder {
  color: var(--grey4txt);
}

.products-field-row {
  flex-direction: row;
  align-items: center;
  gap: 14px;
}

.products-field-row>span:first-child {
  flex: 0 0 auto;
}

.products-stepper {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  background: var(--white);
  border-radius: var(--radius-sm);
  overflow: hidden;
  padding: 0px 10px;
}

.products-stepper button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  background: #e9e9ed;
  cursor: pointer;
  font-size: 20px;
  font-weight: 500;
  color: var(--dark4txt);
  line-height: 1;
  width: 40px;
  height: 33px;
  border-radius: 50%;
  padding-top: 6px;
}

.products-stepper button:last-child {
  border-right: 0;
  border-left: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: 3px;
}

.products-stepper-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
  font: inherit;
  font-weight: 500;
  color: var(--dark4txt);
  outline: 0;
}

.products-image-area {
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
  border-radius: var(--radius-sm);
  background: var(--white);
  overflow: hidden;
}

.products-image-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 14px;
}

.products-image-preview img {
  max-width: 240px;
  max-height: 200px;
  object-fit: contain;
}

.products-image-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px 12px;
}

.products-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-sm);
  background: var(--button-bg-color);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  color: var(--dark4txt);
}

.products-file-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

.products-image-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.products-image-remove svg {
  width: 22px;
  height: 22px;
}

.products-image-remove svg path:hover {
  fill: var(--accent-green);
}

.products-modal-footer {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

.products-save-btn {
  min-width: 140px;
  padding: 10px 28px;
  border: 1px solid var(--white);
  border-radius: var(--radius-sm);
  color: var(--dark4txt);
  background: var(--button-bg);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.products-save-btn:hover {
  background: var(--white);
}

/* ============================ Products Edit / New Modal End ============================ */


.products-delete-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 16px 0 18px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

.products-delete-info-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
}

.products-delete-info-row dt {
  flex: 0 0 110px;
  color: var(--grey4txt);
}

.products-delete-info-row dd {
  margin: 0;
  color: var(--dark4txt);
  font-weight: 600;
  word-break: break-word;
}

/* ============================ Products Table End ============================ */


/* ============================ Products Responsive Start ============================ */
@media (max-width: 768px) {
  .products-toolbar h1 {
    font-size: 18px;
  }

  .products-total {
    font-size: 13px;
  }

  .products-new-btn {
    width: 40px;
    padding: 0;
    gap: 0;
  }

  .products-new-btn .products-new-text {
    display: none;
  }

  .products-table-gap {
    display: none;
  }

  .products-table,
  .products-table tbody,
  .products-table thead {
    display: block;
    width: 100%;
  }

  .products-table-head tr {
    display: grid !important;
    grid-template-columns: 64px minmax(0, 1fr) 88px 56px;
    gap: 0;
    margin-bottom: 8px;
  }

  .products-table-head th {
    padding: 10px 14px !important;
    width: auto !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .products-table-head th:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important;
  }

  .products-table-head th:nth-child(3) {
    text-align: right;
    padding-right: 14px !important;
  }

  .products-table-head th:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
  }

  .products-row {
    display: grid !important;
    grid-template-columns: 64px minmax(0, 1fr) 88px 56px;
    gap: 2px;
    margin-bottom: 8px;
    background: transparent;
  }

  .products-row td {
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.6) !important;
    border: 0;
    width: auto;
  }

  .products-row.is-alt td {
    background: rgba(255, 255, 255, 0.3) !important;
  }

  .products-row:hover td {
    background: var(--white) !important;
  }

  .products-row td:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important;
    width: 64px;
  }

  .products-row td:nth-child(3) {
    padding-right: 14px;
    width: 88px;
  }

  .products-row td:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
    width: 56px;
  }

  .products-row td:nth-child(2) {
    word-break: break-word;
  }
}

/* Modal full-screen at ≤600px */
@media (max-width: 600px) {
  .products-modal {
    padding: 0;
  }

  .products-modal-card {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    padding: 18px 16px 16px;
  }

  .products-modal-title {
    font-size: 22px;
    line-height: 26px;
  }

  .products-modal-body {
    padding: 16px 14px;
  }

  .products-field-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .products-modal-card {
    top: 0px !important;
  }
}

@media (max-width: 450px) {
  .products-row {
    grid-template-columns: 60px minmax(0, 1fr) 71px 53px;
  }

  .products-table-head tr {
    grid-template-columns: 64px minmax(0, 1fr) 115px 33px;
  }

  .products-row td:nth-child(3) {
    width: 71px;
  }

  .products-row td:last-child {
    width: 52px;
    padding: 12px 9px;
  }

  .products-row td:first-child {
    width: 60px;
    padding: 12px 9px;
  }
}

/* ============================ Products Responsive End ============================ */