/* Full product card: one calm, bounded workspace with an independently
   scrolling body and stable header/footer. Loaded after the release CSS. */
.product-profile-modal-backdrop {
  box-sizing: border-box;
  padding: 18px;
  overflow: hidden;
}

.product-profile-modal {
  width: min(1080px, calc(100vw - 36px));
  height: min(860px, calc(100dvh - 36px));
  max-height: calc(100dvh - 36px);
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  overflow: hidden;
}

.product-profile-modal-head,
.product-profile-modal > footer {
  position: relative;
  z-index: 3;
  box-sizing: border-box;
  background: var(--surface);
}

.product-profile-modal-head {
  min-height: 70px;
  padding: 13px 18px;
}

.product-profile-modal-head h2 {
  max-width: 720px;
  overflow: hidden;
  font-size: 18px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-profile-modal-body {
  min-height: 0;
  padding: 14px 16px 18px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: color-mix(in srgb, var(--primary) 56%, var(--text-muted)) color-mix(in srgb, var(--surface-subtle) 82%, var(--border));
  align-content: start;
  grid-auto-rows: max-content;
  background: color-mix(in srgb, var(--surface-subtle) 36%, var(--surface));
}

.product-profile-modal-body:focus {
  outline: none;
}

.product-profile-modal-body::-webkit-scrollbar {
  display: block !important;
  width: 12px;
}

.product-profile-modal-body::-webkit-scrollbar-thumb {
  min-height: 52px;
  border: 3px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 56%, var(--text-muted));
  background-clip: padding-box;
}

.product-profile-modal-body::-webkit-scrollbar-track {
  border-left: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  background: color-mix(in srgb, var(--surface-subtle) 82%, var(--surface));
}

.product-profile-modal-hero {
  min-height: 124px;
  padding: 12px;
  grid-template-columns: 98px minmax(0, 1fr);
  gap: 16px;
}

.product-profile-modal-image {
  width: 98px;
  height: 98px;
}

.product-profile-modal-title {
  gap: 6px;
}

.product-profile-modal-title h3 {
  font-size: 19px;
}

.product-profile-modal-metrics {
  gap: 7px;
}

.product-profile-modal-metrics > div {
  min-height: 60px;
  padding: 9px 10px;
}

.product-profile-modal-card {
  padding: 12px;
  border-radius: 10px;
}

.product-profile-modal-card-head {
  min-height: 32px;
  margin-bottom: 8px;
}

.product-profile-identifiers dl {
  gap: 6px;
}

.product-profile-identifiers dl > div {
  min-height: 40px;
  padding: 6px 8px;
}

.product-profile-variants {
  grid-row: auto;
}

.product-profile-variant-groups > div {
  padding: 8px;
}

.product-profile-variant-groups > div > div > span {
  min-width: 104px;
  padding: 6px 7px;
}

.product-movement-ledger {
  min-height: max-content;
  margin-bottom: 2px;
}

.product-profile-modal > footer {
  min-height: 58px;
  padding: 9px 16px;
  box-shadow: 0 -8px 22px rgba(12, 18, 31, .035);
}

@media (max-width: 820px) {
  .product-profile-modal-backdrop { padding: 8px; }
  .product-profile-modal {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
  }
  .product-profile-modal-head h2 { white-space: normal; }
  .product-profile-modal-body { padding: 10px; }
  .product-profile-modal-hero { grid-template-columns: 78px minmax(0, 1fr); }
  .product-profile-modal-image { width: 78px; height: 78px; }
  .product-profile-modal-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
