/* Compatibility Feed — scoped styles. Aktiv nur bei ?newcomp.
   Nutzt die zentralen CSS-Variablen des Themes (default.css :root). */

#compfeed.compfeed[hidden] { display: none; }

.compfeed {
  --cf-req: #d83030;
  --cf-ok: #1aaa3a;
  --cf-line: var(--color-grey-light, #f4f4f4);
  --cf-font: var(--color-grey-font, #888);
  max-width: 1160px;
  margin: 0 auto;
}

/* ---------- Fixture sticky header ---------- */
.compfeed-fixturehead {
  position: sticky;
  top: 0;
  z-index: 12;
  background: #fff;
  padding: 12px 0;
}
.compfeed-fixturebar {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid var(--color-black, #000);
  border-radius: 12px;
  padding: 12px 15px;
  background: var(--color-grey-light, #f4f4f4);
}
.compfeed-fixture-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.compfeed-fixture-lbl {
  font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--cf-font); font-weight: 700;
}
.compfeed-fixture-val { font-size: 16px; font-weight: 700; line-height: 1.2; }
.compfeed-fixture-val.is-empty { color: var(--cf-font); font-weight: 500; }
.compfeed-fixture-change { white-space: nowrap; }

/* ---------- Connector between sections ---------- */
.compfeed-connector { display: flex; justify-content: center; color: #c9c9c9; padding: 2px 0; }

/* ---------- Category section ---------- */
.compfeed-sec { margin-bottom: 6px; }
.compfeed-sec[hidden] { display: none; }
.compfeed-sechead {
  position: sticky;
  top: 74px;
  z-index: 8;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 2px solid var(--color-black, #000);
  margin-bottom: 12px;
}
.compfeed-sec-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--color-black, #000); color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.compfeed-sec-title { font-size: 15px; font-weight: 700; }
.compfeed-sec-count { font-size: 12px; color: var(--cf-font); font-weight: 600; }
.compfeed-sec-flag { margin-left: auto; }
.compfeed-req {
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: var(--cf-req); padding: 3px 9px; border-radius: 5px;
}
.compfeed-opt {
  font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: #b7b7b7;
}
.compfeed-sec.is-required .compfeed-sechead { border-bottom-color: var(--cf-req); }
.compfeed-sec.is-required {
  background: color-mix(in srgb, var(--cf-req) 4%, transparent);
  border-radius: 12px; padding: 2px 6px; margin: 0 -6px 6px;
}

/* ---------- Carousel ---------- */
.compfeed-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.compfeed-carousel::-webkit-scrollbar { height: 6px; }
.compfeed-carousel::-webkit-scrollbar-thumb { background: var(--cf-line); border-radius: 6px; }

.compfeed-card {
  position: relative;
  flex: 0 0 168px;
  scroll-snap-align: start;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 13px 11px 12px;
  display: flex; flex-direction: column; gap: 9px;
  align-items: center; text-align: center;
  background: #fff; text-decoration: none; color: inherit;
  transition: border-color .13s, box-shadow .13s;
}
.compfeed-card:hover { border-color: var(--color-black, #000); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.compfeed-pic {
  width: 100%; aspect-ratio: 1/1; max-width: 96px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto;
}
.compfeed-pic img { max-width: 100%; max-height: 100%; width: auto; height: auto; transition: transform .2s; }
.compfeed-card:hover .compfeed-pic img { transform: scale(1.04); }
.compfeed-title {
  font-size: 14px; font-weight: 600; line-height: 1.15;
  text-wrap: balance; min-height: 32px;
  display: flex; align-items: center;
}
.compfeed-code { font-size: 11px; color: var(--cf-font); }
.compfeed-activetag {
  font-size: 9.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  color: #fff; background: var(--color-black, #000); padding: 2px 7px; border-radius: 4px;
}
.compfeed-card.active-product,
.compfeed-card[data-active] { border-color: var(--color-black, #000); box-shadow: 0 0 0 2px var(--color-black, #000); }

/* Pflicht-Adapter-Badge */
.compfeed-adapter {
  font-size: 10px; font-weight: 700; letter-spacing: .02em;
  padding: 3px 7px; border-radius: 5px; line-height: 1.2; text-align: center;
}
.compfeed-adapter.need { color: #fff; background: var(--cf-req); }
.compfeed-adapter.incl { color: var(--cf-ok); background: color-mix(in srgb, var(--cf-ok) 13%, transparent); }
.compfeed-adapter.direct { color: var(--cf-font); background: var(--color-grey-light, #f4f4f4); }

.compfeed-empty { color: var(--cf-font); font-size: 13px; padding: 10px 2px; }

/* ---------- Buy-Box dauerhaft sichtbar (Feed-Kontext, kein Hover) ----------
   Overrides der Hover-Gates aus default.css. body.shop-allowed .tree-info-bar
   (US-Gate) bleibt unangetastet -> Buy-Box nur fuer US-Besucher sichtbar.
   Loading-Skeleton (.tree-price:has(.status-loading)) bleibt intakt. */
.compfeed .tree-price-value { display: inline; }
.compfeed .tree-price-value.is-empty { display: none; }
.compfeed .tree-add-to-cart { display: flex; }
.compfeed .tree-price {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
/* Skeleton-Zustand nicht kaputtmachen: waehrend Laden bleibt Pille transparent */
.compfeed .tree-price:has(.tree-availability.status-loading) {
  background: transparent;
  box-shadow: none;
}

/* ---------- Fixture-Sheet (Picker) ---------- */
.compfeed-scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  opacity: 0; transition: opacity .22s; z-index: 9998;
}
.compfeed-scrim.open { opacity: 1; }
.compfeed-sheet {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: #fff; border-top-left-radius: 20px; border-top-right-radius: 20px;
  box-shadow: 0 -8px 30px rgba(0,0,0,.24);
  transform: translateY(101%); transition: transform .3s cubic-bezier(.2,.85,.25,1);
  z-index: 9999; max-height: 80%; display: flex; flex-direction: column;
}
.compfeed-sheet.open { transform: translateY(0); }
@media (min-width: 700px) {
  .compfeed-sheet {
    left: 50%; right: auto; bottom: auto; top: 50%;
    transform: translate(-50%, -46%); width: 440px; max-width: 92%;
    border-radius: 16px; opacity: 0; transition: opacity .2s, transform .2s;
  }
  .compfeed-sheet.open { transform: translate(-50%, -50%); opacity: 1; }
}
.compfeed-sheet-inner { display: flex; flex-direction: column; min-height: 0; padding: 16px; overflow: hidden; }
.compfeed-sheet-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.compfeed-sheet-head h4 { margin: 0; font-size: 16px; }
.compfeed-sheet-x { border: 0; background: transparent; font-size: 22px; color: var(--cf-font); cursor: pointer; line-height: 1; }
.compfeed-search { margin-bottom: 10px; }
.compfeed-search-input {
  width: 100%; border: 1px solid #e0e0e0; border-radius: 10px;
  padding: 10px 12px; font-family: inherit; font-size: 14px;
}
.compfeed-sheet-scroll { overflow-y: auto; flex: 1; min-height: 0; }
.compfeed-mfr-head {
  display: flex; justify-content: space-between;
  font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--cf-font); font-weight: 700; padding: 9px 2px 5px;
  border-bottom: 1px solid var(--color-grey-light, #f4f4f4);
  position: sticky; top: 0; background: #fff;
}
.compfeed-opt {
  display: flex; flex-direction: column; gap: 1px;
  padding: 10px 6px; cursor: pointer; border-radius: 9px;
}
.compfeed-opt:hover { background: var(--color-grey-light, #f4f4f4); }
.compfeed-opt.picked { background: color-mix(in srgb, var(--cf-ok) 10%, transparent); }
.compfeed-opt-title { font-size: 14px; font-weight: 600; }
.compfeed-opt-sub { font-size: 11.5px; color: var(--cf-font); }
.compfeed-opt-clear { border-bottom: 1px solid var(--color-grey-light, #f4f4f4); margin-bottom: 4px; }

/* ---------- old tool hidden when feed active ---------- */
#comp.compfeed-hidden-old { display: none !important; }
