/* ============================================================
   SuppTrend Frontend Styles
   Applies to: product detail, category listing, price hub
   ============================================================ */

/* ----- Layout ----- */
.fit-page-wrap        { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.fit-page-wrap--wide  { max-width: 1400px; }

/* ----- Breadcrumb ----- */
.fit-breadcrumb       { font-size: .85rem; color: #666; margin-bottom: 16px; }
.fit-breadcrumb a     { color: var(--fit-color-primary); text-decoration: none; }
.fit-breadcrumb a:hover { text-decoration: underline; }
.fit-breadcrumb span  { margin: 0 6px; }

/* ----- Product header ----- */
.fit-product-header   { display: flex; gap: 32px; margin-bottom: 32px; flex-wrap: wrap; }
.fit-product-image    { flex: 0 0 260px; aspect-ratio: 1 / 1; }
.fit-product-image img { width: 100%; border-radius: 8px; object-fit: contain; max-height: 260px; }
.fit-product-image--placeholder { background: var(--fit-bg-subtle); display: flex; align-items: center; justify-content: center; height: 200px; border-radius: 8px; color: var(--fit-color-text-muted); font-size: .85rem; }
.fit-product-info     { flex: 1; min-width: 260px; }
.fit-product-name     { font-size: 1.75rem; font-weight: 700; margin: 0 0 4px; }
.fit-product-brand    { font-size: 1rem; color: var(--fit-color-text-muted); margin-bottom: 12px; }
.fit-product-brand a  { color: inherit; text-decoration: none; }
.fit-product-brand a:hover, .fit-product-brand a:focus-visible { color: var(--fit-color-primary); text-decoration: underline; }
.fit-product-meta     { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.fit-tag              { background: var(--fit-color-border); padding: 2px 10px; border-radius: 12px; font-size: .78rem; }
.fit-tag--vegan       { background: var(--fit-green-50); color: #065f46; }
.fit-tag--lactose     { background: #dbeafe; color: var(--fit-color-primary-hover); }
.fit-tag--gluten      { background: #fef3c7; color: #92400e; }

/* ----- Best price headline ----- */
.fit-best-price-headline { margin-bottom: 24px; }
.fit-ppkg-primary     { font-size: 2.5rem; font-weight: 800; color: var(--fit-color-price); }
.fit-ppkg-label       { font-size: .85rem; color: var(--fit-color-text-muted); margin-left: 4px; }
.fit-price-secondary  { font-size: 1.1rem; color: var(--fit-color-text-muted); }
.fit-shop-count       { font-size: .85rem; color: var(--fit-color-text-muted); }

/* ----- Variant selector ----- */
.fit-variant-selector { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.fit-variant-selector label { font-size: .85rem; font-weight: 600; color: var(--fit-color-text-muted); display: block; margin-bottom: 4px; }
.fit-variant-selector select { padding: 8px 12px; border: 1px solid var(--fit-color-border); border-radius: 6px; font-size: .95rem; background: #fff; cursor: pointer; min-width: 140px; }
.fit-variant-selector select:focus { outline: 2px solid var(--fit-color-primary); border-color: transparent; }

/* ----- Price comparison table ----- */
.fit-price-section    { margin-bottom: 40px; }
.fit-section-title    { font-size: 1.25rem; font-weight: 700; margin-bottom: 12px; }
.fit-price-table      { width: 100%; border-collapse: collapse; }
.fit-price-table th   { text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--fit-color-border); font-size: .85rem; color: var(--fit-color-text-muted); font-weight: 600; }
.fit-price-table td   { padding: 12px; border-bottom: 1px solid var(--fit-bg-subtle); vertical-align: middle; }
.fit-price-row:hover td { background: var(--fit-bg-subtle); }
.fit-best-price td    { background: var(--fit-green-50); }
.fit-best-price td:first-child { border-left: 3px solid var(--fit-color-price); }
.fit-price-per-kg     { font-size: 1.1rem; font-weight: 700; color: var(--fit-color-text); }
.fit-price-abs        { color: var(--fit-color-text-muted); font-size: .9rem; }
.fit-shop-name        { font-weight: 500; }
.fit-oos              { background: #fee2e2; color: #991b1b; padding: 2px 8px; border-radius: 4px; font-size: .78rem; }
.fit-stale            { color: var(--fit-color-text-muted); font-size: .78rem; }
.fit-row-oos          { background: var(--fit-bg-subtle); opacity: 0.8; }
.fit-row-oos td       { color: var(--fit-color-text-muted); }
.fit-updated          { font-size: .78rem; color: var(--fit-color-text-muted); }
/* .fit-btn--shop: PHP renders CTA anchors with this class (price table,
   sticky bar, shop pages) — F2 fix (2026-07-16) styles it as the same green
   button as .fit-buy-btn. Later, more specific rules (mobile card override,
   .fit-btn--cta) still win via cascade order. */
.fit-buy-btn,
.fit-btn--shop        { display: inline-block; padding: 8px 18px; background: var(--fit-color-price); color: #fff; border-radius: 6px; text-decoration: none; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.fit-buy-btn:hover,
.fit-btn--shop:hover  { background: var(--fit-green-700); color: #fff; }
.fit-no-prices        { color: var(--fit-color-text-muted); padding: 24px 0; text-align: center; }

/* ----- Price history chart ----- */
.fit-history-section  { margin-bottom: 40px; }
.fit-chart-wrap       { position: relative; height: 280px; }

/* ----- Sticky CTA bar (Track A C5) -----
 * Default display:none so the bar is invisible to users AND headless
 * full-page screenshots (where position:fixed gets rendered as inline
 * trailing content). JS toggles fit-sticky-cta--visible to show it
 * after the user scrolls past the price section.
 *
 * BEM naming: HTML uses fit-sticky-cta__inner / __info / __name /
 * __price / __shops; modifier is --visible. Single-dash selectors below
 * are kept as legacy fallbacks. */
.fit-sticky-cta       { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--fit-color-border); padding: 12px 24px; align-items: center; justify-content: space-between; gap: 16px; z-index: 999; transform: translateY(100%); transition: transform .2s ease; box-shadow: 0 -2px 8px rgba(0,0,0,.08); }
.fit-sticky-cta.fit-sticky-cta--visible,
.fit-sticky-cta.fit-sticky-visible { display: flex; transform: translateY(0); }
.fit-sticky-cta__inner { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 16px; }
.fit-sticky-cta__info  { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fit-sticky-cta__name  { font-size: .9rem; font-weight: 600; color: var(--fit-color-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fit-sticky-cta__price { font-size: 1.05rem; color: var(--fit-color-price); }
.fit-sticky-cta__price strong { font-weight: 700; }
.fit-sticky-cta__shops { font-size: .78rem; color: var(--fit-color-text-muted); font-weight: 400; }
.fit-sticky-cta-label { font-size: .78rem; color: var(--fit-color-text-muted); }
.fit-sticky-cta-amount { font-size: 1.25rem; font-weight: 700; color: var(--fit-color-price); }
.fit-sticky-cta-shops { font-size: .78rem; color: var(--fit-color-text-muted); }
.fit-sticky-cta-btn   { padding: 10px 20px; background: var(--fit-color-price); color: #fff; border-radius: 6px; text-decoration: none; font-weight: 600; flex-shrink: 0; }
.fit-sticky-cta-btn:hover { background: var(--fit-green-700); }

/* ----- Variant selector single-option static (Track B M5) -----
 * Replacement for one-option dropdowns: visual weight similar to a
 * disabled select but without the affordance of "click to choose". */
.fit-variant-selector__static { display: inline-block; padding: 8px 12px; background: var(--fit-bg-subtle); border: 1px solid var(--fit-color-border); border-radius: 4px; color: var(--fit-color-text-muted); font-size: .9rem; font-weight: 500; }

/* ----- Custom footer (Track A H6) -----
 * Replaces the WP-default <div id="footer">. Layout: brand strap +
 * trust-link nav + affiliate disclaimer + copyright, stacked on mobile,
 * grid on desktop. Conservative palette to match existing fit-* tokens. */
.fit-footer { background: var(--fit-bg-subtle); border-top: 1px solid var(--fit-color-border); margin-top: 60px; padding: 40px 24px 32px; color: var(--fit-color-text-muted); font-size: .9rem; line-height: 1.6; }
.fit-footer__inner { max-width: 1200px; margin: 0 auto; display: grid; gap: 24px; grid-template-columns: 1fr; }
.fit-footer__brand { display: flex; flex-direction: column; gap: 6px; }
.fit-footer__name { font-size: 1.15rem; font-weight: 700; color: var(--fit-color-text); }
.fit-footer__tagline { font-size: .85rem; color: var(--fit-color-text-muted); }
.fit-footer__nav { }
.fit-footer__nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.fit-footer__nav li { display: inline; }
.fit-footer__nav a { color: var(--fit-color-primary); text-decoration: none; font-weight: 500; }
.fit-footer__nav a:hover { text-decoration: underline; }
.fit-footer__cookie { margin: 14px 0 0; font-size: .85rem; }
.fit-footer__cookie .fit-cookie-reopen { color: var(--fit-color-text-muted); text-decoration: underline; cursor: pointer; }
.fit-footer__disclaimer { background: #fff; border: 1px solid var(--fit-color-border); border-radius: 6px; padding: 14px 18px; margin: 0; font-size: .85rem; color: #4b5563; }
.fit-footer__disclaimer strong { color: var(--fit-color-text); }
.fit-footer__copyright { margin: 0; padding-top: 12px; border-top: 1px solid var(--fit-color-border); font-size: .8rem; color: var(--fit-color-text-muted); }
.fit-footer__copyright a { color: var(--fit-color-text-muted); text-decoration: underline; }
@media (min-width: 768px) {
  .fit-footer__inner { grid-template-columns: minmax(220px, 1fr) 2fr; gap: 32px 48px; }
  .fit-footer__disclaimer,
  .fit-footer__copyright { grid-column: 1 / -1; }
}

/* ----- Category listing ----- */
.fit-listing-layout   { display: flex; gap: 32px; }
.fit-filter-sidebar   { flex: 0 0 220px; }
.fit-filter-sidebar h3 { font-size: .95rem; font-weight: 700; margin-bottom: 12px; color: var(--fit-color-text-muted); }
.fit-filter-group     { margin-bottom: 20px; }
.fit-filter-group label { font-size: .85rem; display: block; margin-bottom: 8px; }
.fit-filter-group input[type=number] { width: 80px; padding: 4px 8px; border: 1px solid var(--fit-color-border); border-radius: 4px; }
.fit-filter-group input[type=checkbox] { margin-right: 6px; }
.fit-filter-group select { width: 100%; padding: 6px 8px; border: 1px solid var(--fit-color-border); border-radius: 4px; }
.fit-filter-apply     { padding: 8px 16px; background: var(--fit-color-primary); color: #fff; border: none; border-radius: 6px; font-size: .9rem; cursor: pointer; width: 100%; }
.fit-listing-main     { flex: 1; min-width: 0; }
.fit-listing-sort     { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-size: .85rem; }
.fit-listing-sort select { padding: 6px 10px; border: 1px solid var(--fit-color-border); border-radius: 4px; }
.fit-product-grid     { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.fit-product-card     { border: 1px solid var(--fit-color-border); border-radius: 8px; overflow: hidden; background: #fff; transition: box-shadow .15s; }
.fit-product-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
/* FIXED height, not aspect-ratio:1 — with auto-fill/minmax grids the row
 * height is computed against the 200px column floor, the final column is
 * wider (~227px), so an aspect-ratio image ends up ~27px taller than the
 * row budgeted and overflow:hidden clips the card's last text line. A
 * width-independent height removes the feedback loop entirely. */
.fit-card-image       { height: 200px; overflow: hidden; background: var(--fit-bg-subtle); display: flex; align-items: center; justify-content: center; position: relative; }
/* Attribution renders BELOW .fit-card-image (templates emit it after the
 * closing div) — overlaying it inside the square put the label on top of
 * the product photo (User-Report 2026-07-30). */
.fit-card-image + .fit-image-attribution { padding: 0 8px; }
/* <picture> must be pinned to the container box — left auto-sized it takes
 * the chosen srcset candidate's layout size, which can exceed the card
 * (img's 100% resolves against <picture>, not .fit-card-image). */
.fit-card-image picture { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.fit-card-image img   { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.fit-card-image--placeholder { color: var(--fit-color-text-muted); font-size: .8rem; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; padding: 8px; text-align: center; }

/* Track B M6: branded placeholder shown when scraped image is missing
 * but we still know the brand. Plays nice in both card and thumb
 * placeholder wrappers via the modifier class. */
.fit-placeholder--branded { background: linear-gradient(135deg, var(--fit-bg-subtle) 0%, var(--fit-bg-subtle) 100%); border: 1px solid var(--fit-color-border); border-radius: 4px; }
.fit-placeholder__brand { font-weight: 700; color: var(--fit-color-text-muted); font-size: .9rem; line-height: 1.2; }
.fit-placeholder__hint  { font-size: .7rem; color: var(--fit-color-text-muted); text-transform: uppercase; letter-spacing: .05em; }
.fit-card-body        { padding: 12px; }
.fit-card-brand       { font-size: .75rem; color: var(--fit-color-text-muted); margin-bottom: 2px; }
.fit-card-brand a     { color: inherit; text-decoration: none; }
.fit-card-brand a:hover { color: var(--fit-color-primary); text-decoration: underline; }
.fit-card-name        { font-size: .9rem; font-weight: 600; margin-bottom: 8px; line-height: 1.3; }
.fit-card-name a      { color: inherit; text-decoration: none; }
.fit-card-name a:hover { color: var(--fit-color-primary); }
.fit-card-ppkg        { font-size: 1.15rem; font-weight: 700; color: var(--fit-color-price); }
.fit-card-price       { font-size: .8rem; color: var(--fit-color-text-muted); }
.fit-card-shops       { font-size: .75rem; color: var(--fit-color-text-muted); }
.fit-listing-empty    { text-align: center; padding: 48px 0; color: var(--fit-color-text-muted); }
/* Markup is <nav class="fit-pagination"><ul><li><a> — the flex row must sit
   on the ul (nav-level flex left the ul as a default vertical bullet list,
   the 2026-07-14 "82 bullets" bug). Current page marker is li.current. */
.fit-pagination       { margin-top: 32px; }
.fit-pagination ul    { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; list-style: none; margin: 0; padding: 0; }
.fit-pagination a     { display: block; padding: 6px 12px; border: 1px solid var(--fit-color-border); border-radius: 4px; text-decoration: none; color: var(--fit-color-text-muted); font-size: .9rem; }
.fit-pagination a:hover, .fit-pagination li.current a { background: var(--fit-color-primary); color: #fff; border-color: var(--fit-color-primary); }
.fit-pagination__gap span { display: block; padding: 6px 2px; color: var(--fit-color-text-muted); font-size: .9rem; }

/* ----- Hub page ----- */
.fit-hub-categories   { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-bottom: 40px; }
.fit-hub-cat-card     { border: 1px solid var(--fit-color-border); border-radius: 8px; padding: 20px; background: #fff; text-decoration: none; color: inherit; transition: box-shadow .15s; }
.fit-hub-cat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.fit-hub-cat-name     { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.fit-hub-cat-count    { font-size: .85rem; color: var(--fit-color-text-muted); }

/* ----- Brand pages ----- */
.fit-brand-grid           { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-top: 24px; }
.fit-brand-card           { border: 1px solid var(--fit-color-border); border-radius: 8px; overflow: hidden; background: #fff; transition: box-shadow .15s; }
.fit-brand-card:hover     { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.fit-brand-card__logo     { aspect-ratio: 1; background: var(--fit-bg-subtle); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.fit-brand-card__logo img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.fit-brand-card__logo-placeholder { font-size: 2rem; font-weight: 700; color: var(--fit-color-border); }
.fit-brand-card__body     { padding: 12px; }
.fit-brand-card__name     { font-size: .9rem; font-weight: 600; margin-bottom: 4px; }
.fit-brand-card__name a   { color: inherit; text-decoration: none; }
.fit-brand-card__name a:hover { color: var(--fit-color-primary); }
.fit-brand-card__meta     { font-size: .75rem; color: var(--fit-color-text-muted); margin-bottom: 4px; }
.fit-brand-card__ppkg     { font-size: .85rem; font-weight: 700; color: var(--fit-color-price); }
.fit-brand-detail__count  { color: var(--fit-color-text-muted); margin-bottom: 24px; }

/* ----- Shop pages ----- */
.fit-shop-index__hero     { background: var(--fit-navy-50, #eef2f9); border: 1px solid var(--fit-color-border); border-radius: 12px; padding: 28px 24px; margin-bottom: 28px; }
.fit-shop-index__title    { font-size: 1.8rem; font-weight: 700; line-height: 1.2; color: var(--fit-navy-900, #0a1d3a); margin: 0 0 8px; }
.fit-shop-index__lead     { font-size: 1.05rem; font-weight: 600; color: var(--fit-color-text); margin: 0 0 4px; }
.fit-shop-index__sub      { color: var(--fit-color-text-muted); margin: 0; max-width: 62ch; }
.fit-shop-grid            { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 24px; }
.fit-shop-card            { border: 1px solid var(--fit-color-border); border-radius: 8px; padding: 16px; background: #fff; transition: box-shadow .15s; }
.fit-shop-card:hover      { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.fit-shop-card__header    { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.fit-shop-card__name      { font-size: 1rem; font-weight: 600; }
.fit-shop-card__name a    { color: inherit; text-decoration: none; }
.fit-shop-card__name a:hover { color: var(--fit-color-primary); }
.fit-shop-card__country   { font-size: .8rem; color: var(--fit-color-text-muted); }
.fit-shop-card__meta      { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; font-size: .8rem; color: var(--fit-color-text-muted); }
.fit-shop-card__scraped   { background: var(--fit-green-50); color: #065f46; padding: 2px 8px; border-radius: 12px; font-size: .75rem; }
.fit-shop-card__inactive  { background: var(--fit-bg-subtle); color: var(--fit-color-text-muted); padding: 2px 8px; border-radius: 12px; font-size: .75rem; }
.fit-shop-card__link      { display: inline-block; font-size: .85rem; color: var(--fit-color-primary); text-decoration: none; }
.fit-shop-card__link:hover { text-decoration: underline; }
.fit-shop-detail__header  { background: var(--fit-navy-50, #eef2f9); border: 1px solid var(--fit-color-border); border-radius: 12px; padding: 24px; margin-bottom: 28px; display: flex; gap: 20px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.fit-shop-detail__head-main { flex: 1 1 320px; min-width: 0; }
.fit-shop-detail__name    { font-size: 1.7rem; font-weight: 700; line-height: 1.2; margin: 0 0 10px; color: var(--fit-navy-900, #0a1d3a); }
.fit-shop-detail__meta    { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fit-shop-detail__country { font-size: .85rem; color: var(--fit-color-text-muted); }
.fit-shop-detail__count-badge { background: #fff; border: 1px solid var(--fit-color-border); color: var(--fit-color-text-muted); padding: 2px 10px; border-radius: 12px; font-size: .75rem; }
.fit-shop-detail__tagline { color: var(--fit-color-text-muted); font-size: .95rem; line-height: 1.55; margin: 12px 0 0; max-width: 62ch; }
.fit-shop-detail__cta     { flex: 0 0 auto; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 20px; font-weight: 600; color: #fff; background: var(--fit-green-600, #16a34a); border: 0; border-radius: 8px; text-decoration: none; transition: background .15s; }
.fit-shop-detail__cta:hover, .fit-shop-detail__cta:focus { background: var(--fit-green-700, #15803d); color: #fff; }
.fit-shop-detail__count   { color: var(--fit-color-text-muted); margin-bottom: 24px; }

/* ----- Search page ----- */
.fit-search-form          { display: flex; gap: 8px; margin-bottom: 32px; max-width: 600px; }
.fit-search-input         { flex: 1; padding: 10px 14px; border: 1px solid var(--fit-color-border); border-radius: 6px; font-size: 1rem; }
.fit-search-input:focus   { outline: 2px solid var(--fit-color-primary); border-color: transparent; }
.fit-search-btn           { padding: 10px 20px; background: var(--fit-color-primary); color: #fff; border: none; border-radius: 6px; font-size: .95rem; cursor: pointer; font-weight: 600; }
.fit-search-btn:hover     { background: var(--fit-color-primary-hover); }
.fit-search-section       { margin-bottom: 32px; }
.fit-search-section h2    { font-size: 1.15rem; font-weight: 700; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--fit-color-border); }
.fit-search-prompt        { text-align: center; padding: 48px 0; color: var(--fit-color-text-muted); }
.fit-search-cat-links     { display: flex; gap: 8px; flex-wrap: wrap; }
.fit-search-cat-link      { padding: 4px 14px; border: 1px solid var(--fit-color-border); border-radius: 20px; font-size: .85rem; text-decoration: none; color: var(--fit-color-text-muted); }
.fit-search-cat-link:hover { background: var(--fit-color-primary); color: #fff; border-color: var(--fit-color-primary); }
.fit-search-brand-list    { display: flex; gap: 12px; flex-wrap: wrap; }
.fit-search-brand-chip    { padding: 6px 14px; border: 1px solid var(--fit-color-border); border-radius: 6px; font-size: .85rem; text-decoration: none; color: var(--fit-color-text-muted); background: #fff; }
.fit-search-brand-chip:hover { border-color: var(--fit-color-primary); color: var(--fit-color-primary); }

/* ----- Autocomplete dropdown ----- */
.fit-search-wrap          { position: relative; display: inline-block; width: 100%; }
.fit-search-autocomplete  { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--fit-color-border); border-top: none; border-radius: 0 0 6px 6px; box-shadow: 0 4px 16px rgba(0,0,0,.1); z-index: 1000; max-height: 320px; overflow-y: auto; }
.fit-ac-item              { display: flex; align-items: center; gap: 10px; padding: 10px 14px; text-decoration: none; color: var(--fit-color-text); border-bottom: 1px solid var(--fit-bg-subtle); }
.fit-ac-item:last-child   { border-bottom: none; }
.fit-ac-item:hover, .fit-ac-item.fit-ac-active { background: #f0f9ff; }
.fit-ac-label             { flex: 1; font-size: .9rem; font-weight: 500; }
.fit-ac-meta              { font-size: .75rem; color: var(--fit-color-text-muted); }
.fit-ac-badge             { font-size: .7rem; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.fit-ac-badge--product    { background: #dbeafe; color: var(--fit-color-primary-hover); }
.fit-ac-badge--brand      { background: #fef3c7; color: #92400e; }
.fit-ac-badge--category   { background: var(--fit-green-50); color: #065f46; }

/* ----- Responsive ----- */
@media (max-width: 768px) {
    .fit-product-header { flex-direction: column; }
    .fit-product-image  { flex: none; max-width: 200px; }
    .fit-listing-layout { flex-direction: column; }
    .fit-filter-sidebar { flex: none; width: 100%; }
    .fit-price-table th:nth-child(4),
    .fit-price-table td:nth-child(4) { display: none; }  /* hide "last updated" on mobile */
    .fit-ppkg-primary   { font-size: 2rem; }
}

/* ============================================================
   Phase 10: Toolbar + Homepage + Mobile (FRNT-01/02/03/05/06)
   ============================================================ */

/* ----- Sticky global toolbar ----- */
.fit-toolbar {
    position: sticky; top: 0; z-index: 1000;
    display: flex; align-items: center; gap: 12px;
    padding: 8px 16px;
    background: #fff; border-bottom: 1px solid var(--fit-color-border);
    font-family: inherit;
}
.fit-toolbar__logo {
    font-weight: 700; text-decoration: none; color: var(--fit-color-text);
    min-height: 44px; display: inline-flex; align-items: center;
}
.fit-toolbar__hamburger {
    display: none;                    /* shown on mobile only */
    min-width: 44px; min-height: 44px;
    background: transparent; border: 0; font-size: 24px; cursor: pointer;
}
.fit-toolbar__menu {
    display: flex; flex: 1; gap: 12px; align-items: center; justify-content: flex-end;
}
.fit-toolbar__search { display: flex; flex: 1; max-width: 480px; gap: 6px; }
.fit-toolbar__search input {
    flex: 1; min-height: 44px; padding: 6px 10px;
    border: 1px solid var(--fit-color-border); border-radius: 4px;
}
.fit-toolbar__search button,
.fit-toolbar__user,
.fit-toolbar__nav-link {
    min-width: 44px; min-height: 44px;
    padding: 0 12px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--fit-color-border); background: var(--fit-bg-subtle); color: var(--fit-color-text);
    text-decoration: none; border-radius: 4px; cursor: pointer;
}
.fit-toolbar__nav-link { font-size: .9rem; font-weight: 600; white-space: nowrap; }
.fit-toolbar__nav-link:hover, .fit-toolbar__nav-link:focus-visible { color: var(--fit-color-primary); border-color: var(--fit-color-primary); }
.fit-toolbar__lang {
    min-width: 44px; min-height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--fit-color-text-muted);
}

/* ----- Screen-reader-only utility ----- */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ----- Homepage hero ----- */
.fit-hero { background: #0f172a; color: #fff; padding: 48px 16px; }
.fit-hero__inner { max-width: 960px; margin: 0 auto; }
.fit-hero__title { font-size: 2rem; margin: 0 0 12px; }
.fit-hero__subtitle { margin: 0 0 24px; opacity: 0.85; }
.fit-hero__search { display: flex; gap: 8px; margin-bottom: 16px; }
.fit-hero__search input {
    flex: 1; min-height: 44px; padding: 8px 12px; border-radius: 4px; border: 0;
}
.fit-hero__search button {
    min-width: 44px; min-height: 44px; padding: 0 18px;
    background: var(--fit-green-700); color: #fff; border: 0; border-radius: 4px; cursor: pointer;
}
.fit-hero__categories { display: flex; flex-wrap: wrap; gap: 8px; }
.fit-hero__categories a {
    min-height: 44px; padding: 8px 14px; border-radius: 999px;
    background: rgba(255,255,255,0.1); color: #fff; text-decoration: none;
    display: inline-flex; align-items: center;
}

/* ----- Homepage sections ----- */
.fit-homepage section { padding: 32px 16px; max-width: 1200px; margin: 0 auto; }
.fit-homepage h2 { font-size: 1.5rem; margin: 0 0 16px; }

.fit-product-grid {
    list-style: none; padding: 0; margin: 0;
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
/* The li (.fit-product-card) already draws border+radius; the inner <a>
 * drawing its own border produced a second, content-height box — cards in
 * the same grid row looked unequal. The <a> now fills the stretched li
 * as a flex column so price/shops align along the bottom edge. */
/* column, not default row: homepage cards wrap everything in one <a>, but
 * listing cards (fit_cl_render_product_card) have image, attribution and
 * body as DIRECT children — row direction put them side by side. */
.fit-product-card { display: flex; flex-direction: column; }
/* NO height:100% here — the li's default align-items:stretch already
 * equalises heights per row, and a percentage height only re-introduces
 * sizing feedback with the card image (see .fit-card-image note). */
.fit-product-card a {
    display: flex; flex-direction: column; width: 100%;
    /* border-box: with content-box, width:100% + 12px padding = 249px nominal;
     * flex-shrink hid it on most cards, but a long unbreakable product name
     * (min-content) blocked shrinking and the card overflowed 24px right. */
    box-sizing: border-box; min-width: 0;
    min-height: 44px; padding: 12px;
    background: #fff; border: none; border-radius: 0;
    color: var(--fit-color-text); text-decoration: none;
}
/* hyphens for long German compound names (Magnesiumbisglycinat) — an
 * unbreakable word wider than the column otherwise clips at the card edge. */
.fit-product-card__name  { display: block; font-weight: 600; margin-bottom: 6px; flex-grow: 1; overflow-wrap: break-word; hyphens: auto; }
.fit-product-card__price { display: block; color: #059669; font-weight: 700; }
.fit-product-card__shops { display: block; color: var(--fit-color-text-muted); font-size: 0.85rem; }

.fit-deal-list { list-style: none; padding: 0; margin: 0; }
/* 4 children: thumb, text-stack (name + "bei {shop}" meta), price, savings.
 * The former dedicated 150px shop column repeated the same shop name down
 * the whole list (only one shop delivers original_price so far) — the shop
 * is a detail of the deal, not a column (User-Report 2026-07-30). */
.fit-deal-row a {
    display: grid; gap: 8px 12px; padding: 12px; min-height: 44px; align-items: center;
    grid-template-columns: 80px 1fr auto auto;
    border-bottom: 1px solid var(--fit-color-border); color: var(--fit-color-text); text-decoration: none;
}
.fit-deal-row__name { display: block; font-weight: 600; }
.fit-deal-row__meta { display: block; color: var(--fit-color-text-muted); font-size: .85rem; margin-top: 2px; }
.fit-deal-row__savings { color: #dc2626; font-weight: 700; }

/* F3 (2026-07-16): multi-shop comparison strip — the cross-shop value prop */
.fit-comparisons__sub { color: var(--fit-color-text-muted); margin: 4px 0 12px; }
.fit-comparison-list { list-style: none; padding: 0; margin: 0; }
.fit-comparison-row a {
    display: grid; gap: 10px; padding: 12px; min-height: 44px; align-items: center;
    grid-template-columns: auto 2fr auto auto;
    border-bottom: 1px solid var(--fit-color-border); color: var(--fit-color-text); text-decoration: none;
}
.fit-comparison-row a:hover .fit-comparison-row__name { text-decoration: underline; }
/* min-width:0 overrides the grid item's auto minimum — without it long
 * product names force the 1fr track past the viewport on <=600px
 * (392px page width on a 375px phone, whole page pans horizontally). */
.fit-comparison-row__name, .fit-comparison-row__shops { min-width: 0; overflow-wrap: break-word; }
.fit-comparison-row__badge {
    background: var(--fit-green-700, #15803d); color: #fff; font-weight: 700;
    border-radius: 6px; padding: 4px 8px; font-size: .9rem; white-space: nowrap;
}
.fit-comparison-row__name  { font-weight: 600; }
.fit-comparison-row__prices { color: #059669; font-weight: 700; white-space: nowrap; }
.fit-comparison-row__max { color: var(--fit-color-text-muted); font-weight: 400; text-decoration: line-through; }
.fit-comparison-row__shops { color: var(--fit-color-text-muted); font-size: .85rem; white-space: nowrap; }

.fit-social-proof {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    text-align: center;
}
.fit-stat strong { display: block; font-size: 1.75rem; }
.fit-stat span   { color: var(--fit-color-text-muted); }
.fit-empty       { color: var(--fit-color-text-muted); font-style: italic; }

/* ----- Mobile: below 768px switch to hamburger ----- */
@media (max-width: 768px) {
    .fit-toolbar__hamburger { display: inline-flex; }
    .fit-toolbar__menu {
        display: none;
        position: absolute; top: 56px; left: 0; right: 0;
        flex-direction: column; align-items: stretch;
        background: #fff; border-bottom: 1px solid var(--fit-color-border); padding: 12px;
    }
    .fit-toolbar__menu.is-open { display: flex; }
    .fit-hero { padding: 32px 12px; }
    .fit-hero__title { font-size: 1.5rem; }
    .fit-deal-row a { grid-template-columns: 1fr 1fr; }
    .fit-comparison-row a { grid-template-columns: auto 1fr; }
}

/* ===========================================================================
   Phase 11 — Language switcher dropdown (.fit-toolbar__lang-switcher)
   D-05: <details>-based switcher in header toolbar.
   Constraint: 44x44 px touch target on the summary element (Plan 10-02 regression).
   =========================================================================== */

.fit-toolbar__lang-switcher {
  position: relative;
  display: inline-block;
  margin: 0 .5rem;
}

.fit-toolbar__lang-switcher > summary {
  list-style: none;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: 0 .6rem;
  border-radius: 4px;
  user-select: none;
}

.fit-toolbar__lang-switcher > summary::-webkit-details-marker {
  display: none;
}

.fit-toolbar__lang-switcher > summary:hover,
.fit-toolbar__lang-switcher > summary:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.fit-toolbar__lang-switcher .fit-lang-flag {
  font-size: 1.1em;
  line-height: 1;
}

.fit-toolbar__lang-switcher .fit-lang-code {
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .02em;
}

.fit-toolbar__lang-menu {
  position: absolute;
  top: calc(100% + 2px);
  right: 0;
  min-width: 160px;
  margin: 0;
  padding: .25rem 0;
  list-style: none;
  background: #fff;
  color: #222;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1100;
}

.fit-toolbar__lang-menu li {
  margin: 0;
  padding: 0;
}

.fit-toolbar__lang-menu a {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
  padding: 0 .85rem;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.fit-toolbar__lang-menu a:hover,
.fit-toolbar__lang-menu a:focus-visible {
  background: #f2f2f2;
  outline: none;
}

/* Mobile: inside hamburger menu, switcher becomes a full-width section */
@media (max-width: 600px) {
  .fit-toolbar__lang-switcher {
    width: 100%;
    margin: 0;
  }
  .fit-toolbar__lang-switcher > summary {
    width: 100%;
    justify-content: flex-start;
  }
  .fit-toolbar__lang-menu {
    position: static;
    width: 100%;
    box-shadow: none;
    background: transparent;
    color: inherit;
  }
  .fit-toolbar__lang-menu a {
    color: inherit;
  }
}

/* ===========================================================================
   Phase 11 — Language fallback banner (.fit-lang-fallback-banner)
   D-06: shown when requested lang has no translation for current page.
   Dormant in Phase 11 (no 3rd lang). Styled for 11.1 go-live.
   =========================================================================== */

.fit-lang-fallback-banner {
  background: #fff7e0;
  border-bottom: 1px solid #e8d088;
  color: #403000;
  padding: .6rem 1rem;
  font-size: .95rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.fit-lang-fallback-banner__icon {
  font-size: 1.2em;
  line-height: 1;
}

.fit-lang-fallback-banner__text {
  flex: 1 1 auto;
  min-width: 0;
}

.fit-lang-fallback-banner__switch {
  color: #553300;
  text-decoration: underline;
  white-space: nowrap;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.fit-lang-fallback-banner__switch:hover,
.fit-lang-fallback-banner__switch:focus-visible {
  color: #222;
  outline: 2px solid #222;
  outline-offset: 2px;
}

/* ===========================================================================
   Phase 18 IMGWEB-06: bestenlisten thumbnail column (60x60).
   =========================================================================== */

.fit-bl-thumb {
    width: 60px;
    height: 60px;
    aspect-ratio: 1 / 1;
    padding: 4px;
    vertical-align: middle;
}

.fit-bl-thumb img,
.fit-bl-thumb picture,
.fit-bl-thumb picture > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.fit-bl-thumb--placeholder {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    border-radius: 4px;
}

/* ===========================================================================
   Phase 19 IMGOPS-04 -- UrhG §63 Quellenangabe ("Foto: {shop.name}").
   Renders adjacent to scraped <picture> only; never on manual uploads.
   OQ-3 default: omit on tiny thumbnails (linked PDP carries primary Quellenangabe).
   Counsel-signoff in Plan 19-04 confirms or requires backport (DOM kept for reversibility).
   =========================================================================== */
.fit-image-attribution {
    display: block;
    font-size: 0.7rem;
    color: rgba(0, 0, 0, 0.55);
    text-align: right;
    margin-top: 0.15rem;
    line-height: 1.2;
}
.fit-product-header .fit-image-attribution,
.fit-product-image .fit-image-attribution { font-size: 0.75rem; }
/* OQ-3 default: omit attribution on tiny thumbnails (deals 80px, bestenlisten 60px). */
.fit-deal-thumb .fit-image-attribution,
.fit-bl-thumb .fit-image-attribution,
.fit-bestenliste-row .fit-image-attribution {
    display: none;
}

/* ===========================================================================
   Track B HIGH H2 — Mobile-Card-Layout fuer fit-price-table
   Audit 2026-05-07: 6-spaltige Tabelle quetscht auf 375px Mobile, "Verfuegbar"
   kollabiert auf 0px, Cell-Texte brechen 2-3 Zeilen, "Zum Shop"-Button kaum
   klickbar. Fix: ab max-width 600px wird jede <tr> zu einer Card mit klarer
   Typo-Hierarchie + full-width CTA. Tabellen-Semantik bleibt im DOM erhalten,
   nur visuelles Mapping ueber display:block. Idealo-Pattern.
   =========================================================================== */
@media (max-width: 600px) {
    /* Bestehender 768px-Hide auf nth-child(4) wuerde Verfuegbar verstecken;
       hier wieder einblenden weil im Card-Layout genug Platz ist. */
    .fit-price-table th:nth-child(4),
    .fit-price-table td:nth-child(4) { display: block; }

    /* Header-Row visuell ausblenden, Daten bleiben semantisch in der Tabelle. */
    .fit-price-table thead { display: none; }

    /* Table-Skelett zu Block-Layout konvertieren. */
    .fit-price-table,
    .fit-price-table tbody,
    .fit-price-table tr,
    .fit-price-table td {
        display: block;
        width: 100%;
    }

    /* Jede Zeile = eine Card. */
    .fit-price-table tr {
        margin-bottom: 12px;
        padding: 16px;
        border: 1px solid var(--fit-color-border);
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    }

    /* Best-Price-Card hervorheben (Desktop-Behavior 1:1 ueberschreiben). */
    .fit-price-table tr.fit-best-price {
        border-color: var(--fit-color-price);
        border-width: 2px;
        background: var(--fit-green-50);
    }
    .fit-price-table tr.fit-best-price td:first-child {
        border-left: none; /* Desktop-Stripe-Border zuruecksetzen */
    }

    /* OOS-Card weiterhin gedimmt. */
    .fit-price-table tr.fit-row-oos {
        opacity: 0.75;
    }

    /* Td-Reset: keine Tabellen-Borders, vertikal stacken. */
    .fit-price-table td {
        padding: 4px 0;
        border: none;
    }

    /* Shop-Name als Card-Title. */
    .fit-shop-name {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--fit-color-text);
        margin-bottom: 8px;
    }

    /* Hauptpreis-Zeile prominent. */
    .fit-price-per-kg {
        font-size: 1.4rem;
        font-weight: 800;
        color: var(--fit-color-price);
    }
    .fit-price-per-kg strong { font-weight: inherit; }

    /* Absoluter Preis sekundaer. */
    .fit-price {
        font-size: 1rem;
        color: var(--fit-color-text-muted);
    }

    /* Stand-Datum dezent. */
    .fit-date {
        font-size: 0.8rem;
        color: var(--fit-color-text-muted);
    }

    /* Verfuegbar-Badge inline statt block. */
    .fit-availability { padding: 2px 0; }

    /* CTA full-width Button am Ende der Card. */
    .fit-action {
        margin-top: 12px;
    }
    .fit-action .fit-btn--shop {
        display: block;
        width: 100%;
        padding: 12px 16px;
        text-align: center;
        font-size: 1rem;
        font-weight: 600;
        min-height: 44px; /* Touch-Target nach WCAG */
        box-sizing: border-box;
        /* .fit-btn--shop hat im Plugin keine globale Style-Regel (pre-existing
           Mismatch zwischen PHP class und CSS class .fit-buy-btn). Fuer die
           Mobile-Card explizit visuell als Button rendern; Desktop-Fix folgt
           separat. */
        background: var(--fit-color-price);
        color: #fff;
        border-radius: 6px;
        text-decoration: none;
    }
    .fit-action .fit-btn--shop:hover,
    .fit-action .fit-btn--shop:focus {
        background: var(--fit-green-700);
        color: #fff;
    }
}

/* Track C L1: affiliate disclosure click/hover tooltip on Zum-Shop CTAs */
.fit-cta-wrap{position:relative;display:inline-flex;align-items:center;gap:6px;}
.fit-aff-tip-btn{border:0;background:none;cursor:pointer;color:var(--fit-color-text-muted);font-size:1rem;line-height:1;padding:2px;}
.fit-aff-tip{position:absolute;bottom:calc(100% + 6px);right:0;z-index:20;width:220px;background:var(--fit-navy-900);color:#fff;font-size:.8rem;line-height:1.35;padding:8px 10px;border-radius:var(--fit-radius-sm);box-shadow:var(--fit-shadow-card);opacity:0;visibility:hidden;transition:opacity .12s ease;}
.fit-cta-wrap:hover .fit-aff-tip,.fit-cta-wrap:focus-within .fit-aff-tip{opacity:1;visibility:visible;}

/* ===========================================================================
   Trust/legal pages (.fit-legal / .fit-trust) — 2026-07-30
   These plugin-routed pages (/methodik/, /ueber-uns/, /datenschutz/, ...)
   rendered with ZERO container styling: full browser width, theme defaults.
   =========================================================================== */
.fit-legal { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; line-height: 1.65; }
.fit-legal h1 { font-size: 1.7rem; margin: 8px 0 16px; }
.fit-legal h2 { font-size: 1.2rem; margin: 28px 0 8px; }
.fit-legal p, .fit-legal ul, .fit-legal ol { margin: 0 0 14px; }
.fit-legal a { color: var(--fit-color-primary); }
.fit-legal code { background: var(--fit-bg-subtle); padding: 1px 5px; border-radius: 3px; font-size: .9em; }

/* Hide the block-theme theme-compat fallback header (classic #header/#headerimg
   markup + trailing <hr>) that get_header() emits on every plugin-routed page —
   the fit-toolbar carries branding, search and nav. DOM stays for a11y-neutral
   removal; display:none only. */
#page > #header, #page > #header + hr { display: none; }

/* --------------------------------------------------------------------------
   Cross-link blocks (brand <-> shop)
   -------------------------------------------------------------------------- */
.fit-crosslink {
    margin: 32px 0 0;
    padding: 20px;
    border: 1px solid var(--fit-border, #e2e8f0);
    border-radius: 8px;
    background: var(--fit-bg-subtle, #f8fafc);
}

.fit-crosslink h2 {
    margin: 0 0 12px;
    font-size: 1.1rem;
}

.fit-crosslink__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.fit-crosslink__list li {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.fit-crosslink__count {
    font-size: 0.85rem;
    color: var(--fit-ink-muted, #64748b);
}

/* --------------------------------------------------------------------------
   Brand A-Z register
   -------------------------------------------------------------------------- */
.fit-brand-az { margin-top: 40px; }

.fit-brand-az__jumps {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 24px;
    position: sticky;
    top: 0;
    background: var(--fit-bg, #fff);
    padding: 8px 0;
    z-index: 1;
}

.fit-brand-az__jumps a {
    display: inline-block;
    min-width: 32px;
    min-height: 32px;
    line-height: 32px;
    text-align: center;
    border: 1px solid var(--fit-border, #e2e8f0);
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
}

.fit-brand-az__group { margin-bottom: 24px; scroll-margin-top: 56px; }

.fit-brand-az__letter {
    margin: 0 0 8px;
    font-size: 1.25rem;
    border-bottom: 2px solid var(--fit-border, #e2e8f0);
}

.fit-brand-az__list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.fit-brand-az__count { color: var(--fit-ink-muted, #64748b); font-size: 0.85rem; }

.fit-brand-az__item--thin a { color: var(--fit-ink-muted, #64748b); }

/* --------------------------------------------------------------------------
   Homepage hub sections (brands / shops)
   -------------------------------------------------------------------------- */
.fit-hub-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.fit-hub-list li { display: flex; align-items: baseline; gap: 6px; }
.fit-hub-list__count { color: var(--fit-ink-muted, #64748b); font-size: 0.85rem; }
.fit-hub-more { font-weight: 600; }

/* Brand card hero image (stands in for a missing brand logo) */
.fit-brand-card__hero {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}
