/* Brand-directory cards: keep logos, origin chips and footers inside the card. */
#brand-grid a.group.block.h-full[href^="/marcas/"] div.flex.min-h-8.items-start.justify-between.gap-3 {
  flex-direction: column;
  align-items: flex-start;
  flex-wrap: nowrap;
  min-width: 0;
  gap: 0.75rem;
}

#brand-grid a.group.block.h-full[href^="/marcas/"] div.flex.min-h-8.items-start.justify-between.gap-3 > img {
  flex: 0 0 auto;
  align-self: flex-start;
  min-width: 0;
  object-fit: contain;
}

#brand-grid a.group.block.h-full[href^="/marcas/"] div.flex.min-h-8.items-start.justify-between.gap-3 > span.tplab-mono.shrink-0 {
  flex: 0 0 auto;
  width: fit-content;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  text-wrap: balance;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

/* Two-column cards have room for the full R&S origin on one line. */
@media (min-width: 1024px) and (max-width: 1279.98px) {
  #brand-grid a.group.block.h-full[href^="/marcas/"] div.flex.min-h-8.items-start.justify-between.gap-3 > img[src*="/media/logos/brands/rohde-schwarz.webp"] + span.tplab-mono.shrink-0 {
    letter-spacing: 0.05em;
    white-space: nowrap;
  }
}

#brand-grid a.group.block.h-full[href^="/marcas/"] div.flex.min-h-8.items-start.justify-between.gap-3 > img[src*="/media/logos/brands/rohde-schwarz.webp"] {
  height: 2.5rem;
  max-width: min(100%, 11.5rem);
}

#brand-grid a.group.block.h-full[href^="/marcas/"] div.flex.items-center.justify-between.border-t {
  flex-wrap: wrap;
  min-width: 0;
  gap: 0.5rem 0.75rem;
}

#brand-grid a.group.block.h-full[href^="/marcas/"] div.flex.items-center.justify-between.border-t > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Retsch's current compact list is in Escala, a sibling of #productos. */
:is(#productos, .tplab-page-content[data-route="/marcas/retsch"] .retsch-detail section[data-scrollnav="Escala"]) :is(
  a.group.block:has(> .grid .sm\:truncate),
  a.group.block:has(> .grid[class~="sm:grid-cols-[minmax(8rem,11rem)_1fr_minmax(7rem,auto)]"]),
  .grid:has(> * > .sm\:truncate),
  .grid[class~="sm:grid-cols-[minmax(8rem,11rem)_1fr_minmax(7rem,auto)]"],
  .grid:has(> * > .sm\:truncate) > *,
  .grid[class~="sm:grid-cols-[minmax(8rem,11rem)_1fr_minmax(7rem,auto)]"] > *
) {
  min-width: 0;
}

:is(#productos, .tplab-page-content[data-route="/marcas/retsch"] .retsch-detail section[data-scrollnav="Escala"]) .sm\:truncate {
  min-width: 0;
}

@media (min-width: 640px) {
  :is(#productos, .tplab-page-content[data-route="/marcas/retsch"] .retsch-detail section[data-scrollnav="Escala"]) :has(> .sm\:truncate) {
    min-width: 0;
    overflow: hidden;
  }

  :is(#productos, .tplab-page-content[data-route="/marcas/retsch"] .retsch-detail section[data-scrollnav="Escala"]) .sm\:truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 639.98px) {
  :is(#productos, .tplab-page-content[data-route="/marcas/retsch"] .retsch-detail section[data-scrollnav="Escala"]) :is(
    .grid:has(> * > .sm\:truncate),
    .grid[class~="sm:grid-cols-[minmax(8rem,11rem)_1fr_minmax(7rem,auto)]"]
  ) {
    grid-template-columns: minmax(0, 1fr);
  }

  :is(#productos, .tplab-page-content[data-route="/marcas/retsch"] .retsch-detail section[data-scrollnav="Escala"]) :is(
    .sm\:truncate,
    .grid:has(> * > .sm\:truncate) > *,
    .grid[class~="sm:grid-cols-[minmax(8rem,11rem)_1fr_minmax(7rem,auto)]"] > *
  ) {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
