/* Additive model details: retain hover reading while exposing touch/keyboard access. */
#customerApp .ms-card-details-ready { cursor: pointer; }
#customerApp .ms-card-details-ready > .ms-id { padding-right: 64px; }
#customerApp .ms-card-details-ready:focus-visible,
#customerApp .ms-details-trigger:focus-visible,
.ms-details-dialog :focus-visible {
  outline: 3px solid #8b6eed;
  outline-offset: 3px;
}
#customerApp .ms-card-details-ready > :is(.ms-desc-full, .ms-media-desc-full-media) {
  padding-bottom: 16px;
}
#customerApp .ms-card-details-ready > :is(.ms-desc-full, .ms-media-desc-full-media) .ms-hover-desc { padding-right: 64px; }
#customerApp .ms-details-trigger {
  position: absolute;
  top: 46px;
  right: 16px;
  z-index: 10;
  min-width: 52px;
  min-height: 32px;
  margin: 0;
  padding: 4px 11px;
  color: var(--ui-primary, #6239e8);
  background: #f4f0ff;
  border: 1px solid #e4dafb;
  border-radius: 7px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  box-shadow: none;
  transition: background 160ms ease, border-color 160ms ease;
}
#customerApp .ms-details-trigger:hover { background: #ece5ff; border-color: #cbbaf5; transform: none; }
body.ms-details-open { overflow: hidden; }
.ms-details-dialog {
  box-sizing: border-box;
  width: min(620px, calc(100vw - 40px));
  max-width: none;
  max-height: min(780px, calc(100vh - 64px));
  max-height: min(780px, calc(100dvh - 64px));
  margin: auto;
  padding: 0;
  color: var(--ui-ink, #202538);
  background: #fff;
  border: 1px solid #e5e2ee;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(24, 22, 46, .22);
  overflow: hidden;
  overscroll-behavior: contain;
}
.ms-details-dialog:not([open]) { display: none; }
.ms-details-dialog[open] { display: flex; flex-direction: column; animation: ms-details-appear 160ms ease-out; }
.ms-details-dialog::backdrop { background: rgba(23, 24, 43, .46); backdrop-filter: blur(3px); }
.ms-details-header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding: 24px 26px 20px;
  background: #faf9fd;
  border-bottom: 1px solid #eeebf4;
}
.ms-details-header > div { min-width: 0; }
.ms-details-eyebrow { margin: 0 0 8px; color: #756c89; font-size: 11px; font-weight: 600; letter-spacing: .06em; }
.ms-details-title { margin: 0; font-size: 22px; font-weight: 650; line-height: 1.35; letter-spacing: -.015em; overflow-wrap: anywhere; }
.ms-details-close {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 40px;
  padding: 8px 12px;
  color: #625b72;
  background: #fff;
  border: 1px solid #e2ddea;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  box-shadow: none;
}
.ms-details-close:hover { color: #6239e8; background: #f4f0ff; border-color: #cbbaf5; }
.ms-details-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  padding: 24px 26px 28px;
  overflow: auto;
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.8;
  scrollbar-gutter: stable;
}
.ms-details-body:focus-visible { outline-offset: -4px; }
.ms-details-description { margin: 0; color: #555e70; white-space: pre-wrap; }
.ms-details-feature-group { display: flex; flex-direction: column; gap: 8px; }
.ms-details-label { color: #746d81; font-size: 12px; font-weight: 600; }
.ms-details-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.ms-details-chip { padding: 3px 9px; color: #665486; background: #f3effa; border-radius: 6px; font-size: 12px; }
.ms-details-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: #747b89; font-size: 12px; }
.ms-details-reference { color: #645482; font-weight: 600; }
.ms-details-price {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 17px 18px;
  color: #3d3550;
  background: #f8f6fc;
  border: 1px solid #e9e3f2;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.ms-details-price em { color: #767084; font-style: normal; font-size: 12px; font-weight: 400; }
.ms-details-price > span { color: #6f667e; font-size: 13px; font-weight: 500; }
.ms-details-backdrop { position: fixed; inset: 0; z-index: 1199; background: rgba(23, 24, 43, .46); }
.ms-details-backdrop[hidden] { display: none; }
.ms-details-dialog.ms-details-fallback { position: fixed; inset: 0; z-index: 1200; height: fit-content; }
@keyframes ms-details-appear { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Touch must not inherit a sticky hover overlay that competes with the dialog. */
@media (hover: none), (pointer: coarse) {
  #customerApp .ms-card-details-ready > :is(.ms-desc-full, .ms-media-desc-full-media) { display: none !important; }
  #customerApp .ms-details-trigger { min-height: 32px; min-width: 52px; }
}
@media (max-width: 600px) {
  .ms-details-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    border-radius: 13px;
  }
  .ms-details-header { gap: 14px; padding: 20px 18px 16px; }
  .ms-details-title { font-size: 19px; }
  .ms-details-close { min-height: 44px; }
  .ms-details-body { gap: 16px; padding: 20px 18px 24px; }
  .ms-details-price { padding: 14px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  #customerApp .ms-card-details-ready,
  #customerApp .ms-details-trigger,
  .ms-details-dialog,
  .ms-details-dialog * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  #customerApp .ms-card-details-ready:hover { transform: none; }
}
