/* Advertiser catalog with filters, offers grouped by blogger (catalog.js).
   Phone first; the desktop table look is at the bottom. */

/* ---- toolbar: search, dropdowns, filter toggle --------------------------------------- */
.cf-catalog, .cf-offers { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 4px; }
.cf-catalog > *, .cf-offers > *, .cf-offer-filters, .cf-offer-filters > *, .cf-preview > * { min-width: 0; }
.cf-offer-filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.cf-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cf-search {
  position: relative; display: flex; align-items: center; flex: 1 1 100%; min-width: 0; height: 46px; padding: 0 12px 0 40px;
  border: 1px solid var(--border-soft); border-radius: var(--radius-md); background: var(--surface);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.cf-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(42 140 255 / .16); }
.cf-search-icon { position: absolute; left: 13px; width: 18px; height: 18px; color: var(--subtle); }
.cf-search input { width: 100%; min-width: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 16px; outline: none; }
.cf-search input::-webkit-search-cancel-button { filter: invert(.6); }
.cf-select, .cf-filter-toggle {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 1px solid var(--border-soft);
  border-radius: 12px; background: var(--surface); color: var(--muted); font: 500 13px/1.2 inherit; cursor: pointer; white-space: nowrap;
}
.cf-select strong { color: var(--text); font-weight: 600; }
.cf-select-label { display: none; }
.cf-select-caret { width: 16px; height: 16px; color: var(--subtle); fill: none; stroke: currentColor; stroke-width: 1.8; }
.cf-filter-toggle { margin-left: auto; color: var(--text); }
.cf-filter-toggle .icon { width: 18px; height: 18px; color: var(--accent); }
.cf-filter-toggle[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-soft); }
.cf-select:hover, .cf-filter-toggle:hover { border-color: var(--border); }

/* ---- filters panel ------------------------------------------------------------------- */
.cf-filters { display: none; gap: 14px; padding: 14px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--surface); }
.cf-filters.is-open { display: grid; animation: cf-in 200ms cubic-bezier(.16,1,.3,1); }
.cf-filter { display: grid; gap: 8px; min-width: 0; }
.cf-filter-title { color: var(--subtle); font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.cf-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -2px; padding: 2px; }
.cf-chips::-webkit-scrollbar { display: none; }
.cf-filters .cf-chips { flex-wrap: wrap; overflow: visible; }
.cf-chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 34px; padding: 0 12px; border: 1px solid var(--border-soft);
  border-radius: 999px; background: transparent; color: var(--muted); font: 500 13px/1 inherit; cursor: pointer; white-space: nowrap;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.cf-chip .icon { width: 15px; height: 15px; }
.cf-chip:hover { border-color: var(--border); color: var(--text); }
.cf-chip.is-on { border-color: rgb(42 140 255 / .55); background: var(--accent-soft); color: #cfe5ff; }
.cf-status-row .cf-chip { min-height: 32px; }

.cf-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 24px; color: var(--subtle); font-size: 13px; }
.cf-reset { padding: 0; font-size: 13px; }

/* ---- catalog cards ------------------------------------------------------------------- */
.cf-results { display: grid; gap: 14px; }
.cf-grid { display: grid; gap: 10px; }
.cf-card {
  display: grid; align-content: start; gap: 10px; width: 100%; padding: 14px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); text-align: left; cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.cf-card:hover { border-color: var(--border); background: var(--surface-raised); }
.cf-card:active { transform: scale(.99); }
.cf-card-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cf-card-avatar { width: 44px; height: 44px; flex: none; border-radius: 14px; }
.cf-card-name { display: grid; gap: 2px; min-width: 0; }
.cf-card-name strong { overflow: hidden; font-size: 15px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.cf-card-name small { overflow: hidden; color: var(--subtle); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.cf-card-about { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 13px; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cf-card-facts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cf-platforms { display: inline-flex; gap: 4px; }
.cf-platform {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: rgb(255 255 255 / .05);
  color: var(--muted); font-size: 10px; font-weight: 700;
}
.cf-platform .icon { width: 15px; height: 15px; }
.cf-fact { color: var(--text); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cf-card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cf-tag { padding: 4px 8px; border-radius: 8px; background: rgb(255 255 255 / .05); color: var(--muted); font-size: 11.5px; font-weight: 550; }
.cf-tag.is-good { background: rgb(32 201 151 / .12); color: #6be0bd; }
.cf-tag.is-muted { background: none; padding-left: 0; color: var(--subtle); }

/* ---- grouped lists: bloggers and offers ---------------------------------------------- */
.cf-preview { display: grid; gap: 10px; margin-top: 12px; }
.cf-list { display: grid; gap: 8px; }
.cf-group, .cf-offer {
  display: grid; align-items: center; gap: 4px 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--border-soft);
  border-radius: var(--radius-md); background: var(--surface); color: var(--text); text-align: left; cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.cf-group:hover, .cf-offer:hover { border-color: var(--border); background: var(--surface-raised); }
.cf-group { grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "avatar copy side" "avatar states states"; }
.cf-group-avatar { grid-area: avatar; width: 44px; height: 44px; border-radius: 14px; align-self: start; }
.cf-group-copy, .cf-offer-copy { display: grid; gap: 2px; min-width: 0; }
.cf-group-copy { grid-area: copy; }
.cf-group-copy strong, .cf-offer-copy strong { overflow: hidden; font-size: 15px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.cf-group-copy small, .cf-offer-copy small { overflow: hidden; color: var(--subtle); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.cf-group-states { grid-area: states; display: flex; flex-wrap: wrap; gap: 6px; }
.cf-state { padding: 3px 8px; border-radius: 8px; background: rgb(255 255 255 / .05); color: var(--muted); font-size: 11.5px; font-weight: 600; }
.cf-state.is-warn { background: #3a2b13; color: #f6bf64; }
.cf-state.is-good { background: #0e382e; color: #5ee0b7; }
.cf-state.is-done { color: var(--subtle); }
.cf-group-side { grid-area: side; display: grid; justify-items: end; gap: 4px; }
.cf-group-date, .cf-offer-date { color: var(--subtle); font-size: 12px; white-space: nowrap; }
.cf-unread { padding: 2px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; }
.cf-chevron { display: none; width: 18px; height: 18px; color: var(--subtle); fill: none; stroke: currentColor; stroke-width: 1.8; }

.cf-offer { grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "avatar copy amount" "avatar status date"; }
.cf-offer-avatar { grid-area: avatar; width: 40px; height: 40px; border-radius: 12px; align-self: start; }
.cf-offer-copy { grid-area: copy; }
.cf-offer-amount { grid-area: amount; justify-self: end; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cf-offer-status { grid-area: status; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cf-offer-date { grid-area: date; justify-self: end; }

.cf-creator-head { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 4px 14px; align-items: center; margin: 4px 0 8px; }
.cf-creator-avatar { width: 56px; height: 56px; border-radius: 18px; }
.cf-creator-copy { display: grid; gap: 2px; min-width: 0; }
.cf-creator-copy h1 { margin: 0; font-size: 24px; line-height: 1.15; letter-spacing: -.02em; overflow-wrap: anywhere; }
.cf-creator-copy .eyebrow, .cf-creator-copy .lead { margin: 0; }
.cf-creator-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.cf-creator-actions > button { min-height: 44px; }

.ov2-head { position: relative; }
.ov2-head .icon-button { margin-left: auto; flex: none; }
.ov2-head-copy { min-width: 0; }
.rename-hint { margin: -4px 0 4px; color: var(--muted); font-size: 14px; line-height: 1.45; }

@keyframes cf-in { from { opacity: 0; transform: translateY(-4px); } }

/* ---- tablet --------------------------------------------------------------------------- */
@media (min-width: 600px) {
  .cf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cf-search { flex: 1 1 260px; }
}

/* ---- desktop website: dense tables, filters always in view ------------------------------ */
@media (min-width: 1024px) {
  html.is-web .cf-search { height: 40px; flex: 1 1 320px; max-width: 420px; }
  html.is-web .cf-search input { font-size: 14px; }
  html.is-web .cf-select-label { display: inline; color: var(--subtle); }
  html.is-web .cf-filter-toggle { display: none; }
  html.is-web .cf-filters { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 28px; padding: 14px 16px; }
  html.is-web .cf-filter { gap: 6px; }
  html.is-web .cf-chip { min-height: 30px; padding: 0 11px; font-size: 12.5px; }
  html.is-web .cf-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
  html.is-web .cf-card { padding: 16px; border-radius: 16px; }

  /* Lists become tables: one bordered block, rows split by hairlines. */
  html.is-web .cf-list { gap: 0; overflow: hidden; border: 1px solid var(--border-soft); border-radius: 16px; background: var(--surface); }
  html.is-web .cf-group, html.is-web .cf-offer {
    border: 0; border-radius: 0; border-bottom: 1px solid var(--border-soft); padding: 12px 16px; background: transparent;
  }
  html.is-web .cf-list > :last-child { border-bottom: 0; }
  html.is-web .cf-group:hover, html.is-web .cf-offer:hover { background: rgb(255 255 255 / .025); }
  html.is-web .cf-chevron { display: block; grid-area: chevron; justify-self: end; }
  html.is-web .cf-group {
    grid-template-columns: 36px minmax(200px, 1.2fr) minmax(0, 2fr) 120px 18px; grid-template-areas: "avatar copy states side chevron";
    min-height: 64px;
  }
  html.is-web .cf-group-avatar { width: 36px; height: 36px; border-radius: 11px; align-self: center; font-size: 13px; }
  html.is-web .cf-group-side { grid-auto-flow: column; align-items: center; gap: 10px; }
  html.is-web .cf-group-states { justify-content: flex-start; }
  html.is-web .cf-offer {
    grid-template-columns: 32px minmax(0, 2fr) 120px 200px 90px 18px; grid-template-areas: "avatar copy amount status date chevron";
    min-height: 58px;
  }
  html.is-web .cf-offer-avatar { width: 32px; height: 32px; border-radius: 10px; align-self: center; font-size: 12px; }
  html.is-web .cf-offer-amount { justify-self: end; }
  html.is-web .cf-offer-status { justify-self: start; }
  html.is-web .cf-group-copy strong, html.is-web .cf-offer-copy strong { font-size: 14px; }
  html.is-web .cf-creator-head { grid-template-columns: 64px minmax(0, 1fr) auto; margin: 8px 0 16px; }
  html.is-web .cf-creator-avatar { width: 64px; height: 64px; }
  html.is-web .cf-creator-copy h1 { font-size: 28px; }
  html.is-web .cf-creator-actions { grid-column: auto; display: flex; margin: 0; }
  html.is-web .cf-creator-actions > button { min-height: 38px; padding: 0 16px; }
  html.is-web .cf-preview .cf-list { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cf-filters.is-open { animation: none; }
  .cf-card, .cf-group, .cf-offer, .cf-chip { transition: none; }
}
