/* Tablet flavor cards: 49px outer margins; 48px card padding, 24px list gaps. */
@media (min-width: 431px) and (max-width: 860px) ,  (width > 430px) and (max-width: 860px) {
  body.tablet-flow .sostav-page { width: 100%; min-width: 0; overflow: visible; }
  /* [58] headings keep their authored pretty wrapping; descriptions follow Figma's normal word flow. */
  body.tablet-flow .sostav-item__name,
  body.tablet-flow .sostav-allergens__text { text-wrap: pretty; }
  body.tablet-flow .sostav-section { width: 100%; padding: 100px 0 64px; }
  body.tablet-flow .sostav-section__inner { width: calc(100% - 98px); max-width: none; margin: 0 auto 0 49px; padding: 0; }
  body.tablet-flow .sostav-header { width: 100%; margin: 0 0 48px; gap: 14px; }
  body.tablet-flow .sostav-title { width: 100%; margin: 0; font-size: 50px; line-height: 58px; white-space: normal; }
  body.tablet-flow .sostav-allergens { width: 100%; gap: 20px; }
  body.tablet-flow .sostav-allergens__text { width: auto; min-width: 0; font-size: 15px; line-height: 18px; }
  body.tablet-flow .sostav-list { width: 100%; gap: 24px; }
  /* Figma 605:668 uses a ~212px photo column + 35px gap + 26px inset;
   * 245.667px pushed every text block about 34px too far right. */
  body.tablet-flow .sostav-item:nth-child(n) { --flavour-photo-width: 212px; display: grid; grid-template-columns: var(--flavour-photo-width) minmax(0,1fr); align-items: start; gap: 35px; width: 100%; height: auto; min-height: 0; padding: 48px 26px; border-radius: 40px; }
  /* The peanut card is the one visibly narrower photo column in 605:668. */
  body.tablet-flow .sostav-item:nth-child(2) { --flavour-photo-width: 203.856px; padding-left: 29px; }
  body.tablet-flow .sostav-item__photo { width: 100%; height: 81.667px; }
  body.tablet-flow .sostav-item__photo img { width: var(--flavour-photo-width); max-width: none; height: auto; position: static; transform: none; }
  body.tablet-flow .sostav-item__text { width: 100%; min-width: 0; gap: 10px; }
  body.tablet-flow .sostav-item__name { width: 100%; font-size: 34px; line-height: 39px; overflow-wrap: anywhere; }
  body.tablet-flow .sostav-item:nth-child(n+8) .sostav-item__name { font-size: 35px; line-height: 40px; }
  body.tablet-flow .sostav-item__desc { width: 100%; max-width: 426px; font-size: 14px; line-height: 16px; overflow-wrap: anywhere; text-wrap: wrap; }
  /* Figma's authored paragraph boxes vary slightly in width across the 28 cards. */
  body.tablet-flow .sostav-item:nth-child(2) .sostav-item__desc { max-width: 431px; }
  body.tablet-flow .sostav-item:nth-child(4) .sostav-item__desc { max-width: 421px; }
  body.tablet-flow .sostav-item:nth-child(5) .sostav-item__desc { max-width: 416px; }
  body.tablet-flow .sostav-item:nth-child(6) .sostav-item__desc { width: calc(100% + 1px); max-width: 427px; }
  body.tablet-flow .sostav-item:nth-child(12) .sostav-item__desc,
  body.tablet-flow .sostav-item:nth-child(15) .sostav-item__desc { max-width: 415px; }
  body.tablet-flow .sostav-item:nth-child(n+18):nth-child(-n+22) .sostav-item__desc { max-width: 424px; }
  body.tablet-flow .sostav-item:nth-child(25) .sostav-item__desc { width: calc(100% + 2px); max-width: 428px; }
  body.tablet-flow .sostav-tablet-line { display: block; }
}
@media (min-width: 431px) and (max-width: 860px),  (width > 430px) and (max-width: 860px){
  /* Figma 605:1136 / 605:1143: preserve the 212px slot and text origin while
     matching this authored photo's visible ink and shadow at tablet width. */
  body.tablet-flow .sostav-item:first-child .sostav-item__photo img { transform: scale(1.09); transform-origin: center; }
  /* At the narrow end of this two-column layout, the 394px max-content
     nutrition badge starts near x313 and extends up to 7px past the viewport.
     Ease that bleed back to zero as the available viewport clears its natural
     right edge, keeping the authored 20px text insets and one-line contents. */
  body.tablet-flow .sostav-item__kbzhu {
    margin-left: 0px;
  }
}
/* Снят подбрейкпоинт «@media (min-width: 431px) and (max-width: 699px)»: полоса 431–860 показывает один макет 860, разницу делает zoom. */


/* [58] / КБЖУ: preserve the authored 20px horizontal text insets across
   all 28 cards, including the compact tablet band. */
@media (min-width: 431px) and (max-width: 860px) , (width > 430px) and (max-width: 860px){
  body.tablet-flow .sostav-item__kbzhu {
    box-sizing: border-box;
    /* Keep the no-wrap label within the card's right edge. */
    max-width: calc(100% + 26px);
    padding-left: 20px;
    padding-right: 20px;
  }
}
/* Снят подбрейкпоинт «@media (min-width: 431px) and (max-width: 444px)»: полоса 431–860 показывает один макет 860, разницу делает zoom. */

/* Native flow opt-in: retain the 860px tablet card origin while shrinking
   the photo column and allowing the copy/nutrition label to wrap at 431px. */
@media (min-width: 431px) and (max-width: 860px) , (width > 430px) and (max-width: 860px){
  body.fluid-flow .sostav-page { width: 100%; min-width: 0; overflow: visible; }
  body.fluid-flow .sostav-section { width: 100%; padding: 100px 0 64px; }
  body.fluid-flow .sostav-section__inner {
    width: min(725px, calc(80.23vw + 34.5px)); max-width: none;
    margin: 0 0 0 clamp(25px, calc(1px + 5.5814vw), 49px); padding: 0;
  }
  body.fluid-flow .sostav-section { padding-top: clamp(100px, calc(140px - 4.651vw), 120px); }
  body.fluid-flow .sostav-header { display: flex; flex-direction: column; gap: 14px; width: 100%; margin: 0 0 48px; }
  body.fluid-flow .sostav-title { width: 100%; margin: 0; font-size: clamp(37px, 5.814vw, 50px); line-height: 1.16; white-space: normal; }
  body.fluid-flow .sostav-allergens { width: 100%; gap: 20px; }
  body.fluid-flow .sostav-allergens__text { width: auto; min-width: 0; font-size: 15px; line-height: 18px; }
  body.fluid-flow .sostav-list { width: 100%; gap: 24px; }
  body.fluid-flow .sostav-item:nth-child(n) {
    --flavour-photo-width: clamp(193.333px, calc(174.6px + 4.35vw), 212px);
    display: grid; grid-template-columns: var(--flavour-photo-width) minmax(0, 1fr);
    align-items: start; gap: clamp(12px, 4.07vw, 35px); width: 100%; height: auto; min-height: 0;
    padding: 48px clamp(16px, 3.02vw, 26px); border-radius: 40px;
  }
  body.fluid-flow .sostav-item:nth-child(2) { --flavour-photo-width: clamp(193.333px, calc(174.6px + 4.35vw), 203.856px); padding-left: clamp(16px, 3.37vw, 29px); }
  body.fluid-flow .sostav-item__photo { width: 100%; height: 81.667px; }
  body.fluid-flow .sostav-item__photo img { width: var(--flavour-photo-width); max-width: none; height: auto; position: static; transform: none; }
  body.fluid-flow .sostav-item:first-child .sostav-item__photo img { transform: scale(1.09); transform-origin: center; }
  body.fluid-flow .sostav-item:nth-child(n) .sostav-item__text { position: static; left: 0; width: 100%; min-width: 0; gap: 10px; margin-top: 0; }
  body.fluid-flow .sostav-item__name { width: 100%; font-size: 34px; line-height: 1.15; overflow-wrap: anywhere; }
  body.fluid-flow .sostav-item__desc { width: 100%; max-width: 100%; font-size: clamp(14px, calc(18px - .466vw), 16px); line-height: clamp(16px, calc(20px - .466vw), 18px); overflow-wrap: anywhere; text-wrap: wrap; }
  body.fluid-flow .sostav-item__kbzhu { width: fit-content; max-width: 100%; height: auto; min-height: 36px; padding: 8px 12px; white-space: normal; box-sizing: border-box; }
  body.fluid-flow .sostav-item__kbzhu-label { display: block; }
  body.fluid-flow .sostav-tablet-line { display: block; }
}

/* The tablet photo/text split needs enough room for the copy column. Keep the
   phone's stacked card through 600px; the side-by-side version starts at 601. */
@media (min-width: 431px) and (max-width: 600px) ,  (width > 430px) and (max-width: 600px) {
  body.fluid-flow .sostav-item:nth-child(n) {
    grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 48px 24px 36px;
  }
  body.fluid-flow .sostav-item__photo { height: 81.667px; justify-content: flex-start; }
  body.fluid-flow .sostav-item__photo img { width: clamp(193.333px, calc(174.6px + 4.35vw), 212px); }
  body.fluid-flow .sostav-item:nth-child(n) .sostav-item__text { width: 100%; max-width: none; }
}

/* Keep the tablet-to-desktop interval in the same live two-column card flow;
   image slots and text widths grow to the existing 1200px desktop geometry. */
@media (min-width: 861px) and (max-width: 1199px) ,  (width > 860px) and (max-width: 1199px) ,  (min-width: 861px) and (width < 1200px) {
  body.fluid-flow .sostav-page { width: 100%; min-width: 0; overflow: visible; }
  body.fluid-flow .sostav-section { width: 100%; padding: clamp(100px, calc(17.65vw - 52px), 160px) 0 64px; }
  body.fluid-flow .sostav-section__inner {
    width: clamp(725px, calc(93.2vw - 77px), 1040px); max-width: none;
    margin: 0 0 0 clamp(49px, calc(9.12vw - 29.5px), 80px); padding: 0;
  }
  body.fluid-flow .sostav-header { width: 100%; gap: clamp(24px, 7.25vw - 38px, 87px); margin: 0 0 56px; }
  body.fluid-flow .sostav-title { width: auto; min-width: 0; flex: 1 1 350px; font-size: 50px; white-space: normal; }
  body.fluid-flow .sostav-allergens { width: auto; min-width: 0; flex: 1 1 330px; gap: clamp(20px, 4.42vw - 18px, 53px); }
  body.fluid-flow .sostav-allergens__text { width: auto; min-width: 0; }
  body.fluid-flow .sostav-list { width: 100%; gap: clamp(24px, calc(13.83px + 1.18vw), 28px); }
  body.fluid-flow .sostav-item:nth-child(n) {
    --flavour-photo-width: clamp(212px, calc(44.4vw - 170px), 363.333px);
    display: grid; grid-template-columns: var(--flavour-photo-width) minmax(0, 1fr);
    align-items: start; gap: clamp(35px, calc(2.06vw + 17.3px), 42px); width: 100%; height: auto; min-height: 202px;
    padding: clamp(24px, calc(108.7px - 7.06vw), 48px) clamp(26px, calc(3.24vw - 1.9px), 37px);
    border-radius: clamp(30px, calc(65.3px - 2.94vw), 40px);
  }
  body.fluid-flow .sostav-item:nth-child(2) { --flavour-photo-width: clamp(203.856px, calc(42vw - 157.6px), 342.4px); }
  body.fluid-flow .sostav-item__photo { width: 100%; height: 114.667px; }
  body.fluid-flow .sostav-item__photo img { width: var(--flavour-photo-width); max-width: none; height: auto; position: static; transform: none; }
  body.fluid-flow .sostav-item:first-child .sostav-item__photo img { transform: scale(1.09); transform-origin: center; }
  body.fluid-flow .sostav-item:nth-child(n) .sostav-item__text { position: relative; left: 0; align-self: flex-start; width: 100%; min-width: 0; max-width: 100%; margin-top: 0; }
  body.fluid-flow .sostav-item:nth-child(n) .sostav-item__desc { width: 100%; max-width: 100%; }
  body.fluid-flow .sostav-item__kbzhu { max-width: 100%; white-space: nowrap; }
}

