/* public/css/catalog-builder.css */
/* Catalog builder selection, budget panel and mobile cards. */

/* Budget / selection panel */
.ffcat-builder-panel {
  display: grid;
  gap: 12px;
  margin: 14px 0 16px;
  padding: 14px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.045), rgba(255, 255, 255, 0.94));
}

.ffcat-builder-main {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.ffcat-builder-stats {
  display: contents;
}

.ffcat-builder-card,
.ffcat-builder-budget,
.ffcat-builder-stats > div {
  display: grid;
  grid-template-rows: 18px 1fr;
  gap: 6px;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  align-content: start;
}

.ffcat-builder-budget span,
.ffcat-builder-stats span {
  align-self: start;
  color: #64748b;
  font-size: 12px;
  line-height: 18px;
  font-weight: 600;
}

.ffcat-builder-budget input,
.ffcat-builder-stats b {
  align-self: start;
  min-width: 0;
  color: #0f172a;
  font: inherit;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 700;
}

.ffcat-builder-budget input {
  width: 100%;
  min-height: 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  outline: none;
}

.ffcat-builder-budget input::placeholder {
  color: #94a3b8;
  font-weight: 600;
}

.ffcat-builder-stats .is-over {
  color: #dc2626;
}

.ffcat-builder-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.ffcat-builder-actions .btn:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.ffcat-builder-hint,
.ffcat-builder-msg {
  color: #64748b;
  font-size: 12.5px;
  line-height: 1.35;
}

.ffcat-builder-msg.is-ok {
  color: #047857;
  font-weight: 600;
}

.ffcat-builder-msg.is-error {
  color: #dc2626;
  font-weight: 600;
}

/* Desktop table selection */
.ffcat-builder-select-head,
.ffcat-builder-select-cell {
  width: 44px;
  text-align: center;
}

.ffcat-builder-check-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ffcat-builder-check,
#ffcat-builder-check-all {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
}

/* Mobile-only UI */
.ffcat-mobile-filter-toggle,
.ffcat-mobile-list {
  display: none;
}

.ffcat-mobile-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ffcat-simple .ffcat-mobile-extra {
  display: none;
}

@media (max-width: 720px) {
  .ffcat-builder-panel {
    gap: 10px;
    margin: 12px 0;
    padding: 12px;
    border-radius: 18px;
  }

  .ffcat-builder-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .ffcat-builder-card,
  .ffcat-builder-budget,
  .ffcat-builder-stats > div {
    min-height: 64px;
    padding: 9px 10px;
    border-radius: 14px;
    grid-template-rows: 16px 1fr;
  }

  .ffcat-builder-budget span,
  .ffcat-builder-stats span {
    font-size: 11px;
    line-height: 16px;
  }

  .ffcat-builder-budget input,
  .ffcat-builder-stats b {
    font-size: 15px;
    line-height: 1.15;
  }

  .ffcat-builder-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .ffcat-builder-actions .btn {
    width: 100%;
    min-height: 40px;
    border-radius: 13px;
    font-size: 14px;
  }

  .ffcat-builder-hint {
    font-size: 12px;
  }

  .ffcat-mobile-filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 40px;
    margin: 10px 0 8px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 14px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
  }

  .ffcat-page.ffcat-mobile-filters-collapsed:not(.is-mobile-filters-open) .ffcat-filters,
  .ffcat-page.ffcat-mobile-filters-collapsed:not(.is-mobile-filters-open) details,
  .ffcat-page.ffcat-mobile-filters-collapsed:not(.is-mobile-filters-open) .ffcat-actions {
    display: none;
  }

  .ffcat-mobile-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
  }

  .ffcat-mobile-card {
    display: grid;
    gap: 9px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
  }

  .ffcat-mobile-top {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: start;
  }

  .ffcat-mobile-check {
    width: 18px;
    height: 18px;
    margin-top: 4px;
    accent-color: #2563eb;
  }

  .ffcat-mobile-company {
    min-width: 0;
    color: #0f172a;
    font-size: 15px;
    line-height: 1.2;
    font-weight: 700;
  }

  .ffcat-mobile-company a {
    color: #1d4ed8;
    text-decoration: none;
  }

  .ffcat-mobile-company small,
  .ffcat-mobile-company .muted {
    color: #64748b;
    font-weight: 500;
  }

  .ffcat-mobile-price {
    display: grid;
    justify-items: end;
    gap: 2px;
    white-space: nowrap;
  }

  .ffcat-mobile-price span,
  .ffcat-mobile-scoreline span,
  .ffcat-mobile-extra span {
    color: #64748b;
    font-size: 11px;
    line-height: 1.15;
    font-weight: 600;
  }

  .ffcat-mobile-price b {
    color: #0f172a;
    font-size: 15px;
    line-height: 1.15;
    font-weight: 700;
  }

  .ffcat-mobile-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.2;
  }

  .ffcat-mobile-meta b {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
  }

  .ffcat-mobile-scoreline {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .ffcat-mobile-scoreline span,
  .ffcat-mobile-extra span {
    padding: 6px 8px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 12px;
    background: #f8fafc;
  }

  .ffcat-mobile-scoreline b,
  .ffcat-mobile-extra b {
    color: #0f172a;
    font-weight: 700;
  }

  .ffcat-mobile-portfolio {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 64px;
    gap: 8px;
    align-items: center;
    min-width: 0;
    width: auto;
  }

  .ffcat-mobile-qty {
    display: grid;
    grid-template-columns: 36px minmax(42px, 1fr) 36px;
    height: 40px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 14px;
    background: #fff;
  }

  .ffcat-qty-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: #f8fafc;
    color: #0f172a;
    font: inherit;
    font-size: 18px;
    line-height: 1;
    font-weight: 600;
    cursor: pointer;
  }

  .ffcat-mobile-qty .ffcat-pf-qty {
    width: 100%;
    height: 40px;
    min-height: 40px;
    border: 0;
    border-radius: 0;
    background: #fff;
    color: #0f172a;
    text-align: center;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    outline: none;
  }

  .ffcat-mobile-portfolio .ffcat-pf-btn {
    width: 64px;
    height: 40px;
    min-height: 40px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
  }

  .ffcat-mobile-portfolio .ffcat-pf-state {
    grid-column: 1 / -1;
    min-height: 0;
    font-size: 12px;
  }
}
