/* Redesign: product pages. Shared pieces live in components.css. Prefix: .ffp- */

.ffp { padding-inline: var(--ff-pad-x); padding-bottom: 64px; }

/* ---- Layout: content column + 300px sidebar (desktop only) ------------- */
.ffp-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(24px, 5vw, 48px); }
.ffp-main { min-width: 0; }
.ffp-main > .ff-card, .ffp-main > section.ffp-ncard { margin-top: 20px; }
.ffp-aside { display: none; }
@media (min-width: 992px) {
    /* Second column only when the sidebar slot is configured (ad_slot renders nothing otherwise). */
    .ffp-grid:has(.ffp-aside .ff-ad) { grid-template-columns: minmax(0, 1fr) 300px; }
    .ffp-aside:has(.ff-ad) { display: block; }
    /* Only the ad is sticky; the aside stretches the full column height. */
    .ffp-aside .ff-ad { position: sticky; top: 88px; margin: 0; }
}

/* ---- Header -------------------------------------------------------------- */
.ffp-brand { font-size: 15px; color: var(--ff-primary); font-weight: 600; margin-bottom: 8px; }
.ffp-meta { display: flex; flex-wrap: wrap; gap: 0 8px; font-size: 16px; color: var(--ff-muted); margin: 0 0 18px; }
.ffp-meta span + span::before { content: "·"; margin-inline-end: 8px; }
.ffp-meta a { color: var(--ff-primary); }
.ffp-img { display: block; width: 100%; max-width: 220px; height: auto; aspect-ratio: 1; object-fit: contain; background: var(--ff-card); border: 1px solid var(--ff-border); border-radius: var(--ff-radius); margin: 0 0 18px; }
.ffp-quick {
    margin: 0 0 20px; font-size: 18px; line-height: 1.6; color: var(--ff-ink); text-wrap: pretty;
    background: var(--ff-card); border: 1px solid var(--ff-border); border-radius: var(--ff-radius); padding: 16px 18px;
}
.ffp-desc { font-size: 16.5px; color: var(--ff-ink-2); line-height: 1.6; margin: 0 0 20px; }
.ffp-labels { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 20px; }
.ffp-labels-title { font-size: 14px; color: var(--ff-muted); }
.ffp-redlabel { margin-bottom: 8px; }
.ffp-redlabel p { margin: 0 0 6px; }
.ffp-redlabel ul { margin: 0 0 6px; padding-inline-start: 20px; }
.ffp-redlabel a { color: var(--ff-primary); font-weight: 600; }

.ffp-muted { color: var(--ff-muted); font-size: 14px; }
.ffp-sub { margin: 0 0 24px; }
.ffp-foot { display: block; margin-top: 10px; }

/* ---- Nutrition card + serving switcher ----------------------------------- */
.ffp-ncard { background: var(--ff-card); border: 1px solid var(--ff-border); border-radius: var(--ff-radius-lg); overflow: hidden; }
.ffp-ncard-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: clamp(16px, 4vw, 20px) clamp(16px, 4vw, 24px); border-bottom: 1px solid var(--ff-divider); }
.ffp-ncard-head .ff-card-title { margin: 0; }
.ffp-ncard-body { padding: clamp(16px, 4vw, 24px); }
.ffp-seg { display: flex; flex-wrap: wrap; gap: 4px; background: var(--ff-surface); border-radius: 9px; padding: 3px; }
.ffp-seg button { background: transparent; border: 0; border-radius: 7px; padding: 6px 12px; font-size: 14px; color: var(--ff-ink); cursor: pointer; }
.ffp-seg button[aria-pressed="true"] { background: var(--ff-card); font-weight: 700; box-shadow: 0 1px 2px rgba(16, 30, 43, .12); }
.ffp-seg button:focus-visible { outline: 2px solid var(--ff-primary); }
.ffp-other { display: grid; gap: 10px; background: var(--ff-input); border: 1px solid var(--ff-divider); border-radius: var(--ff-radius); padding: 14px 16px; margin-bottom: 18px; }
.ffp-other[hidden] { display: none; }
.ffp-other-row { display: flex; align-items: center; gap: 10px; }
.ffp-other-row input[type="range"] { flex: 1; min-width: 0; accent-color: var(--ff-primary); }
.ffp-other-num { width: 96px; flex: none; }
.ffp-measures .ff-pill { cursor: pointer; font-size: 13.5px; padding: 5px 12px; }
.ffp-measures .ff-pill.is-active { background: var(--ff-primary); border-color: var(--ff-primary); color: #fff; }
.ffp-kcal { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; padding-bottom: 22px; border-bottom: 2px solid var(--ff-ink); }
.ffp-kcal-num { font-family: var(--ff-font-head); font-size: 58px; font-weight: 900; line-height: 1; color: var(--ff-primary); }
.ffp-kcal-text { font-size: 17px; color: var(--ff-muted); }
.ffp-nrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--ff-divider); font-size: 16.5px; }
.ffp-nrow:last-child { border-bottom: 0; }
.ffp-nrow > span:last-child { font-weight: 700; text-align: left; }
.ffp-nrow.is-sub > span:first-child { padding-inline-start: 18px; color: var(--ff-ink-2); }
.ffp-nrow small { color: var(--ff-muted); font-weight: 400; }

/* ---- Prices -------------------------------------------------------------- */
.ffp-prices { min-height: 120px; }
.ffp-price-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; padding: 12px 0; border-bottom: 1px solid var(--ff-divider); }
.ffp-price-store { display: flex; align-items: center; gap: 10px; font-size: 16px; color: var(--ff-ink); }
.ffp-price-logo { width: 60px; height: 30px; object-fit: contain; }
.ffp-price-val { display: flex; align-items: center; gap: 8px; }
.ffp-price-val b { font-family: var(--ff-font-head); font-size: 18px; font-weight: 700; }
.ffp-cheapest { font-size: 12px; font-weight: 600; color: var(--ff-tint-text); background: var(--ff-tint); border-radius: 999px; padding: 2px 8px; }
.ffp-price-link { font-size: 14px; }
.ffp-price-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 12px 0 0; }
.ffp-price-foot a { color: var(--ff-primary); }

/* ---- Ingredients --------------------------------------------------------- */
.ffp-ing-list { margin: 0 0 18px; font-size: 16.5px; line-height: 1.65; color: var(--ff-ink-2); }
.ffp-ing-list a { color: var(--ff-primary); text-decoration: underline; text-underline-offset: 3px; }
.ffp-ing-list a.is-allergen { color: var(--ff-allergen-title); font-weight: 600; }
.ffp-ing-list a.is-controversial { text-decoration-style: dashed; }
.ff-allergen-box p { margin: 0; font-size: 15.5px; }

/* ---- FAQ ----------------------------------------------------------------- */
.ffp-faq { padding-block: 8px 4px; }
.ffp-faq .ff-card-title { margin: 14px 0 2px; }
.ffp-faq ul { margin: 6px 0 0; padding-inline-start: 20px; }
.ffp-faq small { color: var(--ff-muted); }

/* ---- Reviews ------------------------------------------------------------- */
.ffp-reviews-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 8px; }
.ffp-reviews-head .ff-card-title { margin: 0; }
.ffp-avg { display: flex; align-items: baseline; gap: 10px; }
.ffp-avg-num { font-family: var(--ff-font-head); font-size: 34px; font-weight: 900; line-height: 1; }
.ffp-avg-meta { display: grid; gap: 2px; font-size: 13.5px; color: var(--ff-muted); }
.ffp-stars { color: #B7791F; letter-spacing: 2px; font-size: 17px; }
.ffp-review { border-top: 1px solid var(--ff-divider); padding: 14px 0; }
.ffp-review-top { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-bottom: 6px; }
.ffp-review-top .ffp-stars { font-size: 14px; letter-spacing: 1px; }
.ffp-review p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--ff-ink-2); }
.ffp-review-form { display: grid; gap: 14px; border-top: 1px solid var(--ff-divider); padding-top: 18px; margin-top: 4px; }
.ffp-form-title { font-family: var(--ff-font-head); font-size: 18px; font-weight: 700; margin: 0; }
.ffp-form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.ffp-form-foot { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }

/* ---- Actions & internal links -------------------------------------------- */
.ffp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.ffp-actions-main { flex: 1 1 220px; }
.ffp-more { margin-top: 28px; }
.ffp-more-title { font-size: 15px; font-weight: 600; color: var(--ff-ink); }
.ffp-extras { margin-top: clamp(40px, 7vw, 56px); }
.ffp-extra p { margin: 0 0 12px; }
.ffp-linklist { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 0; }
.ffp-linklist li { border-bottom: 1px solid var(--ff-divider); }
.ffp-linklist li:last-child { border-bottom: 0; }
.ffp-linklist a { display: block; padding: 10px 0; color: var(--ff-primary); }
.ffp-linklist-cols { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); column-gap: 20px; }

/* ---- Extras: processing, charts, US label -------------------------------- */
.ffp-proc { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.ffp-proc-score { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-family: var(--ff-font-head); font-size: 24px; font-weight: 700; color: #fff; }
.ffp-proc-label { font-size: 18px; font-weight: 700; }
.ffp-proc-1, .ffp-proc-2 { background: var(--ff-primary); }
.ffp-proc-3 { background: var(--ff-amber); color: var(--ff-ink); }
.ffp-proc-4, .ffp-proc-5 { background: var(--ff-ink); }
.ffp-proc-bar { height: 8px; background: var(--ff-surface); border-radius: 999px; overflow: hidden; }
.ffp-proc-bar span { display: block; height: 100%; border-radius: 999px; }
.ffp-proc-scale { display: flex; justify-content: space-between; margin-top: 4px; color: var(--ff-muted); }
.ffp-charts { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.ffp-chart { margin: 0; text-align: center; }
.ffp-chart-title { font-size: 14.5px; font-weight: 600; color: var(--ff-muted); margin: 0 0 10px; font-family: var(--ff-font-body); }
.ffp-chart-canvas { position: relative; height: 170px; } /* fixed height: no CLS */
.ffp-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-top: 8px; font-size: 13.5px; }
.ffp-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-inline-end: 4px; }
.ffp-uslabel { margin-inline: auto; background: #fff; color: #000; }

/* Values like "11 g" / "520 mg" sit in RTL rows; let each value pick its own
   direction so Latin units stay after the number (Hebrew units unaffected). */
.ffp-nrow .calculated-value { unicode-bidi: plaintext; }
