/* ============================================================
   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: #2563eb; 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; }
.fit-product-image img { width: 100%; border-radius: 8px; object-fit: contain; max-height: 260px; }
.fit-product-image--placeholder { background: #f3f4f6; display: flex; align-items: center; justify-content: center; height: 200px; border-radius: 8px; color: #9ca3af; 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: #6b7280; margin-bottom: 12px; }
.fit-product-meta     { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.fit-tag              { background: #e5e7eb; padding: 2px 10px; border-radius: 12px; font-size: .78rem; }
.fit-tag--vegan       { background: #d1fae5; color: #065f46; }
.fit-tag--lactose     { background: #dbeafe; color: #1e40af; }
.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: #16a34a; }
.fit-ppkg-label       { font-size: .85rem; color: #6b7280; margin-left: 4px; }
.fit-price-secondary  { font-size: 1.1rem; color: #374151; }
.fit-shop-count       { font-size: .85rem; color: #6b7280; }

/* ----- 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: #374151; display: block; margin-bottom: 4px; }
.fit-variant-selector select { padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: .95rem; background: #fff; cursor: pointer; min-width: 140px; }
.fit-variant-selector select:focus { outline: 2px solid #2563eb; 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 #e5e7eb; font-size: .85rem; color: #6b7280; font-weight: 600; }
.fit-price-table td   { padding: 12px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
.fit-price-row:hover td { background: #f9fafb; }
.fit-best-price td    { background: #f0fdf4; }
.fit-best-price td:first-child { border-left: 3px solid #16a34a; }
.fit-price-per-kg     { font-size: 1.1rem; font-weight: 700; color: #111827; }
.fit-price-abs        { color: #6b7280; 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: #9ca3af; font-size: .78rem; }
.fit-updated          { font-size: .78rem; color: #9ca3af; }
.fit-buy-btn          { display: inline-block; padding: 8px 18px; background: #16a34a; color: #fff; border-radius: 6px; text-decoration: none; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.fit-buy-btn:hover    { background: #15803d; color: #fff; }
.fit-no-prices        { color: #6b7280; 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 ----- */
.fit-sticky-cta       { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid #e5e7eb; padding: 12px 24px; display: flex; 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-visible { transform: translateY(0); }
.fit-sticky-cta-label { font-size: .78rem; color: #6b7280; }
.fit-sticky-cta-amount { font-size: 1.25rem; font-weight: 700; color: #16a34a; }
.fit-sticky-cta-shops { font-size: .78rem; color: #6b7280; }
.fit-sticky-cta-btn   { padding: 10px 20px; background: #16a34a; color: #fff; border-radius: 6px; text-decoration: none; font-weight: 600; flex-shrink: 0; }
.fit-sticky-cta-btn:hover { background: #15803d; }

/* ----- 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: #374151; }
.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 #d1d5db; border-radius: 4px; }
.fit-filter-group input[type=checkbox] { margin-right: 6px; }
.fit-filter-group select { width: 100%; padding: 6px 8px; border: 1px solid #d1d5db; border-radius: 4px; }
.fit-filter-apply     { padding: 8px 16px; background: #2563eb; 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 #d1d5db; 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 #e5e7eb; 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); }
.fit-card-image       { aspect-ratio: 1; overflow: hidden; background: #f9fafb; 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: #9ca3af; font-size: .8rem; }
.fit-card-body        { padding: 12px; }
.fit-card-brand       { font-size: .75rem; color: #6b7280; margin-bottom: 2px; }
.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: #2563eb; }
.fit-card-ppkg        { font-size: 1.15rem; font-weight: 700; color: #16a34a; }
.fit-card-price       { font-size: .8rem; color: #6b7280; }
.fit-card-shops       { font-size: .75rem; color: #9ca3af; }
.fit-listing-empty    { text-align: center; padding: 48px 0; color: #6b7280; }
.fit-pagination       { display: flex; gap: 8px; justify-content: center; margin-top: 32px; }
.fit-pagination a     { padding: 6px 12px; border: 1px solid #d1d5db; border-radius: 4px; text-decoration: none; color: #374151; font-size: .9rem; }
.fit-pagination a:hover, .fit-pagination a.fit-current { background: #2563eb; color: #fff; border-color: #2563eb; }

/* ----- 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 #e5e7eb; 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: #6b7280; }

/* ----- 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 #e5e7eb; 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: #f9fafb; 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: #d1d5db; }
.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: #2563eb; }
.fit-brand-card__meta     { font-size: .75rem; color: #6b7280; margin-bottom: 4px; }
.fit-brand-card__ppkg     { font-size: .85rem; font-weight: 700; color: #16a34a; }
.fit-brand-detail__count  { color: #6b7280; margin-bottom: 24px; }

/* ----- Shop pages ----- */
.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 #e5e7eb; 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: #2563eb; }
.fit-shop-card__country   { font-size: .8rem; color: #6b7280; }
.fit-shop-card__meta      { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; font-size: .8rem; color: #6b7280; }
.fit-shop-card__scraped   { background: #d1fae5; color: #065f46; padding: 2px 8px; border-radius: 12px; font-size: .75rem; }
.fit-shop-card__inactive  { background: #f3f4f6; color: #9ca3af; padding: 2px 8px; border-radius: 12px; font-size: .75rem; }
.fit-shop-card__link      { display: inline-block; font-size: .85rem; color: #2563eb; text-decoration: none; }
.fit-shop-card__link:hover { text-decoration: underline; }
.fit-shop-detail__header  { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; padding: 20px; margin-bottom: 24px; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.fit-shop-detail__count   { color: #6b7280; 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 #d1d5db; border-radius: 6px; font-size: 1rem; }
.fit-search-input:focus   { outline: 2px solid #2563eb; border-color: transparent; }
.fit-search-btn           { padding: 10px 20px; background: #2563eb; color: #fff; border: none; border-radius: 6px; font-size: .95rem; cursor: pointer; font-weight: 600; }
.fit-search-btn:hover     { background: #1d4ed8; }
.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 #e5e7eb; }
.fit-search-prompt        { text-align: center; padding: 48px 0; color: #6b7280; }
.fit-search-cat-links     { display: flex; gap: 8px; flex-wrap: wrap; }
.fit-search-cat-link      { padding: 4px 14px; border: 1px solid #d1d5db; border-radius: 20px; font-size: .85rem; text-decoration: none; color: #374151; }
.fit-search-cat-link:hover { background: #2563eb; color: #fff; border-color: #2563eb; }
.fit-search-brand-list    { display: flex; gap: 12px; flex-wrap: wrap; }
.fit-search-brand-chip    { padding: 6px 14px; border: 1px solid #e5e7eb; border-radius: 6px; font-size: .85rem; text-decoration: none; color: #374151; background: #fff; }
.fit-search-brand-chip:hover { border-color: #2563eb; color: #2563eb; }

/* ----- 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 #d1d5db; 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: #111827; border-bottom: 1px solid #f3f4f6; }
.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: #6b7280; }
.fit-ac-badge             { font-size: .7rem; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.fit-ac-badge--product    { background: #dbeafe; color: #1e40af; }
.fit-ac-badge--brand      { background: #fef3c7; color: #92400e; }
.fit-ac-badge--category   { background: #d1fae5; 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 #e5e7eb;
    font-family: inherit;
}
.fit-toolbar__logo {
    font-weight: 700; text-decoration: none; color: #111;
    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 #d1d5db; border-radius: 4px;
}
.fit-toolbar__search button,
.fit-toolbar__user {
    min-width: 44px; min-height: 44px;
    padding: 0 12px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid #d1d5db; background: #f9fafb; color: #111;
    text-decoration: none; border-radius: 4px; cursor: pointer;
}
.fit-toolbar__lang {
    min-width: 44px; min-height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #6b7280;
}

/* ----- 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: #10b981; 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));
}
.fit-product-card a {
    display: block; min-height: 44px; padding: 12px;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 6px;
    color: #111; text-decoration: none;
}
.fit-product-card__name  { display: block; font-weight: 600; margin-bottom: 6px; }
.fit-product-card__price { display: block; color: #059669; font-weight: 700; }
.fit-product-card__shops { display: block; color: #6b7280; font-size: 0.85rem; }

.fit-deal-list { list-style: none; padding: 0; margin: 0; }
.fit-deal-row a {
    display: grid; gap: 8px; padding: 12px; min-height: 44px;
    grid-template-columns: 1fr 2fr auto auto;
    border-bottom: 1px solid #e5e7eb; color: #111; text-decoration: none;
}
.fit-deal-row__savings { color: #dc2626; font-weight: 700; }

.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: #6b7280; }
.fit-empty       { color: #6b7280; 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 #e5e7eb; 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; }
}

/* ===========================================================================
   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;
}
