.hpos-product {
  position: relative;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 88px;
  padding: 13px;
  border: 1px solid #dfe7f0;
  border-radius: 16px;
  background: #fff;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.hpos-product:hover {
  border-color: #2d75ca;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px #145aa318;
}

.hpos-product-image {
  position: relative;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 0;
  border-radius: 13px;
  overflow: hidden;
  cursor: zoom-in;
}

button.hpos-product-image::after {
  content: "Preview";
  position: absolute;
  inset: auto 3px 3px;
  padding: 2px 3px;
  border-radius: 5px;
  background: rgba(4, 20, 40, 0.76);
  color: #fff;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.03em;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 150ms ease, transform 150ms ease;
}

button.hpos-product-image:hover::after,
button.hpos-product-image:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.hpos-product-image i {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  color: #0d3970;
  font-size: 13px;
  font-style: normal;
  box-shadow: 0 2px 7px rgba(5, 26, 53, 0.18);
}

.hpos-product-select {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.hpos-product-select strong,
.hpos-product-select small,
.hpos-product-select b {
  display: block;
}

.hpos-product-select strong {
  padding-right: 34px;
  color: #10233d;
}

.hpos-product-select small {
  margin-top: 3px;
  color: #77879b;
  font-size: 10px;
}

.hpos-product-select > b {
  grid-column: auto;
  margin-top: 1px;
  color: #087354;
}

.hpos-product-image:focus-visible,
.hpos-product-select:focus-visible {
  outline: 3px solid rgba(32, 112, 208, 0.25);
  outline-offset: 3px;
}

.hpos-modal:has(.hpos-preview) > section {
  width: min(900px, 100%);
  overflow: hidden;
}

.hpos-preview {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(250px, 0.75fr);
  min-height: 520px;
}

.hpos-preview-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  overflow: auto;
  padding: 28px;
  background:
    linear-gradient(45deg, #e8edf3 25%, transparent 25%),
    linear-gradient(-45deg, #e8edf3 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e8edf3 75%),
    linear-gradient(-45deg, transparent 75%, #e8edf3 75%),
    #f7f9fc;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.hpos-preview-stage > img {
  display: block;
  max-width: 100%;
  max-height: 64vh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 18px 55px rgba(7, 24, 45, 0.2);
  transform-origin: center;
  transition: transform 180ms ease;
}

.hpos-preview-controls {
  position: absolute;
  left: 50%;
  bottom: 18px;
  display: flex;
  gap: 5px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  background: rgba(7, 25, 48, 0.88);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.22);
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}

.hpos-preview-controls button {
  min-width: 34px;
  height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.hpos-preview-details {
  display: flex;
  flex-direction: column;
  padding: 52px 30px 30px;
  background: #fff;
}

.hpos-preview-details > small {
  color: #087ad7;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.hpos-preview-details h2 {
  margin: 9px 0 5px;
  color: #10233d;
  font-size: 25px;
  line-height: 1.18;
}

.hpos-preview-details p {
  margin: 0;
  color: #738298;
}

.hpos-preview-details > strong {
  margin: 20px 0 12px;
  color: #087354;
  font-size: 27px;
}

.hpos-preview-details > span {
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eaf8f1;
  color: #087354;
  font-size: 10px;
  font-weight: 900;
}

.hpos-preview-details > span.is-low {
  background: #fff1e7;
  color: #b54708;
}

.hpos-preview-details .hpos-preview-help {
  margin-top: 22px;
  line-height: 1.55;
}

.hpos-preview-details > button {
  width: 100%;
  margin-top: auto;
  padding: 14px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(115deg, #0a315f, #1a67b7);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 720px) {
  .hpos-preview {
    grid-template-columns: 1fr;
  }

  .hpos-preview-stage {
    min-height: 48vh;
  }

  .hpos-preview-details {
    padding: 24px 22px;
  }

  .hpos-preview-details > button {
    margin-top: 24px;
  }
}
