/* Safe product/order UI v4.
   Presentation only: no API replacement, no product/order data interception. */

html.merchant-po-safe-product body,
html.merchant-po-safe-order body,
html.merchant-po-safe-product-detail body,
html.merchant-po-safe-order-detail body {
  background:
    radial-gradient(circle at 5% 5%, rgba(255, 219, 145, .16), transparent 28%),
    linear-gradient(135deg, #f7f5f0 0%, #f4f7fc 48%, #eaf2ff 100%) !important;
}

html.merchant-po-safe-product .merchant-safe-product-root {
  min-height: 100vh;
  padding: 16px 0 104px;
}

html.merchant-po-safe-product .merchant-safe-product-header,
html.merchant-po-safe-product .merchant-safe-product-main {
  width: min(1120px, calc(100% - 28px)) !important;
  margin-right: auto !important;
  margin-left: auto !important;
}

html.merchant-po-safe-product .merchant-safe-product-header {
  overflow: hidden;
  margin-top: 0 !important;
  padding: 18px 21px !important;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 20px !important;
  background:
    radial-gradient(circle at 88% 15%, rgba(255, 199, 83, .25), transparent 30%),
    linear-gradient(135deg, #121a29, #06080d 68%, #2b2415) !important;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .22);
}

html.merchant-po-safe-product .merchant-safe-product-header .merchant-safe-level-name {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  margin-top: 4px;
  padding: 3px 10px;
  border: 1px solid rgba(255, 205, 92, .35);
  border-radius: 999px;
  color: #ffe4a2;
  background: rgba(255, 201, 87, .12);
  font-size: 12px;
  font-weight: 700;
}

html.merchant-po-safe-product .merchant-safe-product-main {
  margin-top: 15px !important;
}

html.merchant-po-safe-product .merchant-safe-product-category,
html.merchant-po-safe-product .merchant-safe-product-hot {
  overflow: hidden;
  margin-top: 14px !important;
  border: 1px solid rgba(28, 39, 60, .07);
  border-radius: 20px !important;
  background: rgba(255, 255, 255, .96) !important;
  box-shadow: 0 15px 38px rgba(42, 58, 92, .08);
}

html.merchant-po-safe-product .merchant-safe-product-category {
  padding: 8px 8px 4px;
}

html.merchant-po-safe-product .merchant-safe-product-category > h5,
html.merchant-po-safe-product .merchant-safe-product-hot > h5 {
  margin: 0 !important;
  padding: 17px 17px 11px !important;
  color: #111827;
  font-size: 19px !important;
  line-height: 1.2;
}

html.merchant-po-safe-product .merchant-safe-product-category > div {
  margin: 5px 8px !important;
  padding: 14px 15px !important;
  border: 1px solid #edf0f4;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

html.merchant-po-safe-product .merchant-safe-product-category > div:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(40, 52, 82, .09);
}

html.merchant-po-safe-product .merchant-safe-product-hot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 8px 16px 20px;
}

html.merchant-po-safe-product .merchant-safe-product-hot > h5,
html.merchant-po-safe-product .merchant-safe-product-hot > .van-empty,
html.merchant-po-safe-product .merchant-safe-product-hot > .h-4 {
  grid-column: 1 / -1;
}

html.merchant-po-safe-product .merchant-safe-product-card {
  display: grid !important;
  grid-template-columns: 126px minmax(0, 1fr);
  min-width: 0;
  min-height: 158px;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid #edf0f4;
  border-radius: 17px !important;
  background: #fafbfc !important;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

html.merchant-po-safe-product .merchant-safe-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(42, 58, 92, .11);
}

html.merchant-po-safe-product .merchant-safe-product-card > div:first-child {
  display: grid;
  width: 126px !important;
  min-height: 158px;
  margin: 0 !important;
  padding: 10px;
  background: #fff;
  place-items: center;
}

html.merchant-po-safe-product .merchant-safe-product-card .van-image,
html.merchant-po-safe-product .merchant-safe-product-card img {
  width: 100% !important;
  height: 100% !important;
  max-height: 138px;
  object-fit: contain !important;
}

html.merchant-po-safe-product .merchant-safe-product-card > div:last-child {
  min-width: 0;
  padding: 14px !important;
}

html.merchant-po-safe-product .merchant-safe-product-card .line-clamp_2 {
  color: #1f2937;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
}

html.merchant-po-safe-product .merchant-safe-product-card .text-neutral-500 {
  display: inline-flex;
  margin: 4px 7px 0 0;
  padding: 4px 7px !important;
  border-radius: 7px;
  color: #6b7280 !important;
  background: #eef1f5;
  font-size: 10px !important;
}

html.merchant-po-safe-order #app {
  padding-bottom: 106px;
}

html.merchant-po-safe-order .merchant-safe-order-header,
html.merchant-po-safe-order .merchant-safe-order-main,
html.merchant-po-safe-order #app > .grid {
  width: min(1180px, calc(100% - 28px)) !important;
  margin-right: auto !important;
  margin-left: auto !important;
}

html.merchant-po-safe-order .merchant-safe-order-header {
  position: sticky !important;
  top: 0;
  z-index: 30 !important;
  margin-top: 14px;
  overflow: hidden;
  padding-top: 8px !important;
  border: 1px solid rgba(28, 39, 60, .07);
  border-radius: 18px;
  background: rgba(255, 255, 255, .97) !important;
  box-shadow: 0 12px 30px rgba(42, 58, 92, .1);
  backdrop-filter: blur(12px);
}

html.merchant-po-safe-order .merchant-safe-order-header .van-search {
  margin: 2px 8px 8px;
  border-radius: 12px;
  background: #f4f6f9;
}

html.merchant-po-safe-order #app > .grid {
  margin-top: 14px !important;
  padding: 4px;
  overflow: hidden;
  border: 1px solid rgba(28, 39, 60, .07);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(42, 58, 92, .07);
}

html.merchant-po-safe-order .merchant-safe-order-main {
  padding-top: 14px;
}

html.merchant-po-safe-order .merchant-safe-order-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
}

html.merchant-po-safe-order .merchant-safe-order-card {
  min-width: 0;
  margin: 0 !important;
  overflow: hidden;
  border: 1px solid rgba(28, 39, 60, .08);
  border-radius: 18px !important;
  background: rgba(255, 255, 255, .98) !important;
  box-shadow: 0 14px 32px rgba(42, 58, 92, .09);
}

html.merchant-po-safe-order .merchant-safe-order-card > div:first-child {
  min-height: 44px;
  padding: 10px 14px !important;
  border-bottom: 1px solid #edf0f4;
}

html.merchant-po-safe-order .merchant-safe-order-card > div:nth-child(2) {
  gap: 13px;
  margin: 0 !important;
  padding: 14px;
}

html.merchant-po-safe-order .merchant-safe-order-card .merchant-safe-order-image,
html.merchant-po-safe-order .merchant-safe-order-card .van-image {
  width: 112px !important;
  height: 112px !important;
  overflow: hidden;
  border: 1px solid #edf0f4;
  border-radius: 14px !important;
  background: #f8fafc;
}

html.merchant-po-safe-order .merchant-safe-order-card .van-image img {
  width: 100% !important;
  height: 100% !important;
  padding: 6px;
  object-fit: contain !important;
}

html.merchant-po-safe-order .merchant-safe-order-card .font-bold .line-clamp_2 {
  color: #1f2937;
  font-size: 14px;
  line-height: 1.45;
}

html.merchant-po-safe-order .merchant-safe-order-card > div:last-child {
  min-height: 47px;
  padding: 8px 13px 12px !important;
  border-top: 1px solid #f0f2f5;
}

html.merchant-po-safe-order .merchant-safe-order-card > div:last-child > span:first-child {
  color: #667085;
  font-size: 12px;
  font-weight: 600;
}

html.merchant-po-safe-order .merchant-safe-order-card > div:last-child > span:last-child {
  padding: 8px 15px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: #151c2a !important;
  box-shadow: 0 7px 16px rgba(21, 28, 42, .16);
  font-weight: 700;
}

html.merchant-po-safe-product-detail #app > header,
html.merchant-po-safe-order-detail #app > header,
html.merchant-po-safe-product-detail #app > main,
html.merchant-po-safe-order-detail #app > main {
  width: min(1120px, calc(100% - 28px)) !important;
  margin-right: auto !important;
  margin-left: auto !important;
}

html.dark.merchant-po-safe-product .merchant-safe-product-category,
html.dark.merchant-po-safe-product .merchant-safe-product-hot,
html.dark.merchant-po-safe-product .merchant-safe-product-category > div,
html.dark.merchant-po-safe-product .merchant-safe-product-card,
html.dark.merchant-po-safe-order .merchant-safe-order-header,
html.dark.merchant-po-safe-order .merchant-safe-order-card {
  border-color: #293243;
  color: #e8edf5;
  background: #171d27 !important;
}

@media (max-width: 760px) {
  html.merchant-po-safe-product .merchant-safe-product-root {
    padding-top: 10px;
  }

  html.merchant-po-safe-product .merchant-safe-product-header,
  html.merchant-po-safe-product .merchant-safe-product-main,
  html.merchant-po-safe-order .merchant-safe-order-header,
  html.merchant-po-safe-order .merchant-safe-order-main,
  html.merchant-po-safe-order #app > .grid {
    width: calc(100% - 20px) !important;
  }

  html.merchant-po-safe-product .merchant-safe-product-header,
  html.merchant-po-safe-product .merchant-safe-product-category,
  html.merchant-po-safe-product .merchant-safe-product-hot,
  html.merchant-po-safe-order .merchant-safe-order-header,
  html.merchant-po-safe-order .merchant-safe-order-card {
    border-radius: 16px !important;
  }

  html.merchant-po-safe-product .merchant-safe-product-hot,
  html.merchant-po-safe-order .merchant-safe-order-grid {
    grid-template-columns: 1fr;
  }

  html.merchant-po-safe-product .merchant-safe-product-card {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  html.merchant-po-safe-product .merchant-safe-product-card > div:first-child {
    width: 112px !important;
  }

  html.merchant-po-safe-order .merchant-safe-order-card .merchant-safe-order-image,
  html.merchant-po-safe-order .merchant-safe-order-card .van-image {
    width: 98px !important;
    height: 98px !important;
  }
}
