/* Precium · site design · the sections' heads on a phone and a tablet (v17-cabeceras, 18-11-2026). Every rule scoped to
   [data-site-design="nuevo"], no colour and no size of its own: only how a head breaks its row. Linked by DesignScope right
   after the base sheet (lib/site-design/cabeceras.ts), so the base sheet keeps its name and no cached page is left behind.

   The base draws a head (.sd-section__head) as one row: the heading on the left and .sd-section__right («Ver …», the rail's
   arrows, a sort menu, a note, chips) on the right, rigid (flex: none), its link on one line (nowrap). With a long link
   («Ver las 218 chaquetas, cazadoras y chubasqueros Nike» on /marca/<x>) the right part was wider than the page on a phone:
   the title squeezed into a column of four or five lines under the link and the page scrolling sideways (439 px of 390); on
   a tablet the title was squeezed into three or four lines beside it.

   Below 1024 px a head may break its row: the right part goes under the title only when the two do not fit side by side
   AND it needs more than about 45 % of the row. When the row is cut the heading counts as min(its own width, 55 %)
   (flex-basis 55 % capped by max-width: max-content), and alone on its row it grows to the whole width. So what fits side
   by side today stays exactly as today (a short «Ver todo» beside a title in two lines, as the category's head asks), and
   from 1024 px nothing changes. Under the title the right part keeps to the right edge: on a tablet the rail's arrows stay
   above the rail's end with the link beside them, as in the heads that fit in one row (right after a dropped link they
   jumped sideways from one section to the next). On a phone, where the arrows are hidden, a right part with a link starts
   at the left instead and the link wraps, whole, in balanced lines like the title above it, its chevron after the last word
   (not «… chubasqueros» over a lone «Nike ›»); a right part without a link (a note, a sort menu, chips) keeps to the right.
   A group's own rule for its heads still wins: its sheet comes later, and the heading's rule here weighs only the scope. */
@media (max-width: 1023.98px) {
  [data-site-design="nuevo"] .sd-section__head { flex-wrap: wrap; row-gap: var(--sd-s-6); }
  [data-site-design="nuevo"] :where(.sd-section__head:has(> .sd-section__right) > :first-child:not(.sd-section__right)) { flex: 1 1 55%; max-width: max-content; }
  [data-site-design="nuevo"] .sd-section__right { flex: 0 1 auto; min-width: 0; max-width: 100%; margin-left: auto; }
}
@media (max-width: 767.98px) {
  [data-site-design="nuevo"] .sd-section__right:has(> .sd-more-link) { margin-left: 0; }
  [data-site-design="nuevo"] .sd-section__right > .sd-more-link { display: block; white-space: normal; text-wrap: balance; }
  [data-site-design="nuevo"] .sd-section__right > .sd-more-link > .sd-i { margin-left: 2px; }
}
