/*
 * DHV Experience 13.78.101 — Feed Market Access Interaction Resilience.
 * Presentation only. Core Public Lead Intake owns retail/wholesale/distribution
 * eligibility, consent, persistence and routing. This layer keeps Commerce,
 * market access and Feed actions in one readable rhythm without inventing state.
 */

/* When Core exposes market access, Commerce and the bridge become one visual
 * cluster. The first track is shared so product identity and market intent read
 * on the same content axis instead of as two unrelated cards. */
:where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-commerce {
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 11px;
  padding-block: 9px;
}

:where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-commerce.has-product-media {
  grid-template-columns: 56px minmax(0, 1fr) auto;
}

:where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-commerce.has-product-media .dhvx-commerce__visual {
  width: 56px;
  height: 56px;
  border-radius: 10px;
}

:where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-commerce.has-market-access {
  padding-bottom: 7px;
  border-bottom-color: transparent;
}

:where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-commerce.has-market-access + .dhvx-market-access {
  margin-top: 0;
  border-top: 1px solid color-mix(in srgb, var(--dhvx-border) 52%, transparent);
}

/* Both navigation links remain visually text-led, but their actual boxes obey
 * the shared compact-control floor. */
:where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-commerce__cta {
  min-height: 40px;
  padding-inline: 6px;
  border-color: transparent;
  background: transparent;
  font-size: 11.75px;
}

:where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-commerce__cta:hover,
:where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-commerce__cta:focus-visible {
  border-color: transparent;
  background: transparent;
  color: var(--dhvx-feed-commerce-accent);
}

:where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access {
  min-height: 48px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 5px 0 6px;
  border-bottom: 1px solid color-mix(in srgb, var(--dhvx-border) 72%, transparent);
  color: var(--dhvx-text-secondary);
}

:where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access__glyph {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  justify-self: center;
  border-radius: 9px;
  background: color-mix(in srgb, var(--dhvx-surface-soft) 72%, transparent);
  color: var(--dhvx-text-muted);
}

:where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access__glyph .dhvx-icon {
  width: 18px;
  height: 18px;
  stroke-width: 1.55;
}

:where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access__copy {
  min-width: 0;
  display: grid;
  gap: 1px;
  align-content: center;
}

:where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access__copy small {
  color: var(--dhvx-text-muted);
  font-size: 9.75px;
  font-weight: 600;
  line-height: 1.25;
}

/* Intent labels are business meaning, not expendable metadata: never ellipsize
 * them. Narrow cards may wrap naturally to a second line. */
:where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access__copy strong {
  overflow: visible;
  color: var(--dhvx-text-secondary);
  font-size: 11.75px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

:where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access__link {
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  padding-left: 6px;
  color: var(--dhvx-text-secondary);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

:where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access__link .dhvx-icon {
  width: 15px;
  height: 15px;
  transition: transform var(--dhvx-motion-fast) var(--dhvx-ease-standard);
}

:where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access__link:hover,
:where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access__link:focus-visible {
  color: var(--dhvx-brand-strong);
}

:where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access__link:hover .dhvx-icon,
:where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access__link:focus-visible .dhvx-icon {
  transform: translateX(2px);
}

:where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access__link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--dhvx-brand) 68%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* The bridge already owns the separator before actions. Avoid a doubled rule
 * while preserving the normal action divider on stories without market access.
 * These selectors intentionally match/exceed the public presentation contract. */
.dhvx-app[data-dhv-experience="feed"] .dhvx-market-access + .dhvx-post__actions,
.dhvx-site-app.is-listing .dhvx-market-access + .dhvx-post__actions,
.dhvx-site-app.is-entity .dhvx-market-access + .dhvx-post__actions,
.dhvx-listing-feed .dhvx-market-access + .dhvx-post__actions {
  padding-top: 4px !important;
  border-top: 0 !important;
}

@media (max-width: 767px) {
  :where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-commerce,
  :where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-commerce.has-product-media {
    grid-template-columns: 52px minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 2px 10px;
    padding-block: 9px 7px;
  }

  :where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-commerce__visual,
  :where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-commerce.has-product-media .dhvx-commerce__visual {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 52px;
    height: 52px;
    border-radius: 9px;
  }

  :where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-commerce__copy {
    grid-column: 2;
    grid-row: 1;
  }

  :where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-commerce__copy small {
    display: none;
  }

  :where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-commerce__cta {
    grid-column: 2;
    grid-row: 2;
    width: auto;
    min-height: 44px;
    margin: 0;
    padding: 0 4px 0 0;
    justify-self: start;
    justify-content: flex-start;
    border: 0;
    background: transparent;
    font-size: 11.5px;
  }

  :where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access {
    min-height: 52px;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 10px;
    padding-block: 4px 5px;
  }

  :where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access__glyph {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }

  :where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access__copy small {
    font-size: 9.25px;
  }

  :where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access__copy strong {
    font-size: 11.25px;
  }

  :where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access__link {
    min-width: 44px;
    min-height: 44px;
    padding-left: 4px;
    font-size: 11px;
  }
}

@media (max-width: 359px) {
  :where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access {
    grid-template-columns: 52px minmax(0, 1fr) 44px;
    gap: 8px;
  }

  :where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access__link {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    justify-content: center;
  }

  :where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access__link > span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  :where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access__link .dhvx-icon {
    transition: none;
  }

  :where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access__link:hover .dhvx-icon,
  :where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access__link:focus-visible .dhvx-icon {
    transform: none;
  }
}



/* Commerce itself also has older breakpoint-specific geometry with higher
 * specificity than :where(). Repeat only the converged geometry here so the
 * shared content axis is deterministic at every Feed/listing surface. */
.dhvx-app[data-dhv-experience="feed"] .dhvx-commerce,
.dhvx-site-app.is-listing .dhvx-commerce,
.dhvx-site-app.is-entity .dhvx-commerce,
.dhvx-listing-feed .dhvx-commerce {
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 11px;
  padding-block: 9px;
}

.dhvx-app[data-dhv-experience="feed"] .dhvx-commerce.has-product-media,
.dhvx-site-app.is-listing .dhvx-commerce.has-product-media,
.dhvx-site-app.is-entity .dhvx-commerce.has-product-media,
.dhvx-listing-feed .dhvx-commerce.has-product-media {
  grid-template-columns: 56px minmax(0, 1fr) auto;
}

.dhvx-app[data-dhv-experience="feed"] .dhvx-commerce.has-product-media .dhvx-commerce__visual,
.dhvx-site-app.is-listing .dhvx-commerce.has-product-media .dhvx-commerce__visual,
.dhvx-site-app.is-entity .dhvx-commerce.has-product-media .dhvx-commerce__visual,
.dhvx-listing-feed .dhvx-commerce.has-product-media .dhvx-commerce__visual {
  width: 56px;
  height: 56px;
  border-radius: 10px;
}

.dhvx-app[data-dhv-experience="feed"] .dhvx-commerce.has-market-access,
.dhvx-site-app.is-listing .dhvx-commerce.has-market-access,
.dhvx-site-app.is-entity .dhvx-commerce.has-market-access,
.dhvx-listing-feed .dhvx-commerce.has-market-access {
  padding-bottom: 7px;
  border-bottom-color: transparent;
}

@media (max-width: 767px) {
  .dhvx-app[data-dhv-experience="feed"] .dhvx-commerce,
  .dhvx-app[data-dhv-experience="feed"] .dhvx-commerce.has-product-media,
  .dhvx-site-app.is-listing .dhvx-commerce,
  .dhvx-site-app.is-listing .dhvx-commerce.has-product-media,
  .dhvx-site-app.is-entity .dhvx-commerce,
  .dhvx-site-app.is-entity .dhvx-commerce.has-product-media,
  .dhvx-listing-feed .dhvx-commerce,
  .dhvx-listing-feed .dhvx-commerce.has-product-media {
    grid-template-columns: 52px minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 2px 10px;
    padding-block: 9px 7px;
  }

  .dhvx-app[data-dhv-experience="feed"] .dhvx-commerce__visual,
  .dhvx-app[data-dhv-experience="feed"] .dhvx-commerce.has-product-media .dhvx-commerce__visual,
  .dhvx-site-app.is-listing .dhvx-commerce__visual,
  .dhvx-site-app.is-listing .dhvx-commerce.has-product-media .dhvx-commerce__visual,
  .dhvx-site-app.is-entity .dhvx-commerce__visual,
  .dhvx-site-app.is-entity .dhvx-commerce.has-product-media .dhvx-commerce__visual,
  .dhvx-listing-feed .dhvx-commerce__visual,
  .dhvx-listing-feed .dhvx-commerce.has-product-media .dhvx-commerce__visual {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 52px;
    height: 52px;
    border-radius: 9px;
  }

  .dhvx-app[data-dhv-experience="feed"] .dhvx-commerce__copy,
  .dhvx-site-app.is-listing .dhvx-commerce__copy,
  .dhvx-site-app.is-entity .dhvx-commerce__copy,
  .dhvx-listing-feed .dhvx-commerce__copy {
    grid-column: 2;
    grid-row: 1;
  }

  .dhvx-app[data-dhv-experience="feed"] .dhvx-commerce__copy small,
  .dhvx-site-app.is-listing .dhvx-commerce__copy small,
  .dhvx-site-app.is-entity .dhvx-commerce__copy small,
  .dhvx-listing-feed .dhvx-commerce__copy small {
    display: none;
  }
}

/* Late specificity owner: older Commerce styles contain breakpoint-specific
 * button geometry. Keep this block last so the shared compact/touch floors are
 * deterministic without changing Commerce destination authority. */
.dhvx-app .dhvx-commerce__cta,
.dhvx-listing-feed .dhvx-commerce__cta {
  min-height: 40px;
  padding-inline: 6px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.dhvx-app .dhvx-commerce__cta:hover,
.dhvx-app .dhvx-commerce__cta:focus-visible,
.dhvx-listing-feed .dhvx-commerce__cta:hover,
.dhvx-listing-feed .dhvx-commerce__cta:focus-visible {
  border-color: transparent;
  background: transparent;
  color: var(--dhvx-feed-commerce-accent);
}

@media (max-width: 767px) {
  .dhvx-app .dhvx-commerce__cta,
  .dhvx-listing-feed .dhvx-commerce__cta {
    grid-column: 2;
    grid-row: 2;
    width: auto;
    min-height: 44px;
    margin: 0;
    padding: 0 4px 0 0;
    justify-self: start;
    justify-content: flex-start;
    border: 0;
    background: transparent;
  }
}

/* Keep high-contrast ownership last so late Commerce geometry/hover rules cannot
 * weaken system link colors or deterministic keyboard focus. */
@media (forced-colors: active) {
  :where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-commerce.has-market-access {
    border-bottom-color: transparent;
  }

  :where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access {
    border-top-color: CanvasText;
    border-bottom-color: CanvasText;
  }

  :where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access__glyph {
    border: 1px solid CanvasText;
    background: Canvas;
    color: CanvasText;
  }

  :where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access__link,
  .dhvx-app .dhvx-commerce__cta,
  .dhvx-listing-feed .dhvx-commerce__cta {
    color: LinkText;
    text-decoration: underline;
  }

  :where(.dhvx-app[data-dhv-experience="feed"], .dhvx-site-app.is-listing, .dhvx-site-app.is-entity, .dhvx-listing-feed) .dhvx-market-access__link:focus-visible,
  .dhvx-app .dhvx-commerce__cta:focus-visible,
  .dhvx-listing-feed .dhvx-commerce__cta:focus-visible {
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }
}
