/* CSS Document */

/* ===== products_all_with_categories – base theme vars ===== */
.pkwy-products-all-with-categories{
  --pkwy-bg:        #ffffff;
  --pkwy-card-bg:   #ffffff;
  --pkwy-border:    #e5e7eb; /* slate-200 */
  --pkwy-muted:     #6b7280; /* gray-500 */
  --pkwy-text:      #0f172a; /* slate-900 */
  --pkwy-accent:    #0f3a6d; /* brandish blue */
  --pkwy-accent-2:  #2563eb; /* blue-600 */
  --pkwy-chip-bg:   #f1f5f9; /* slate-100 */
  --pkwy-shadow:    0 1px 2px rgba(0,0,0,.05);
  color: var(--pkwy-text);
}

/* ===== container & list layout ===== */
.pkwy-products-all-with-categories > ul{
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px){
  .pkwy-products-all-with-categories > ul{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1100px){
  .pkwy-products-all-with-categories > ul{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.pkwy-products-all-with-categories > ul > li{
  background: var(--pkwy-card-bg);
  border: 1px solid var(--pkwy-border);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: var(--pkwy-shadow);
}

/* ===== product title ===== */
.pkwy-products-all-with-categories .pkwy-title{
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.3;
  margin: 0 0 8px;
  color: var(--pkwy-accent);
}

.pkwy-products-all-with-categories .pkwy-title a{
  color: inherit;
  text-decoration: none;
}

/* ===== section labels ===== */
.pkwy-products-all-with-categories .pkwy-section-label{
  margin-top: 8px;
  margin-bottom: 6px;
  font-size: .8rem;
  letter-spacing: .02em;
  color: var(--pkwy-muted);
  text-transform: uppercase;
}

/* ===== category path lists (real + virtual) ===== */
.pkwy-products-all-with-categories .pkwy-catpaths,
.pkwy-products-all-with-categories .pkwy-virtualpaths{
  list-style: none;
  margin: 0 0 8px 0;
  padding: 0;
}

.pkwy-products-all-with-categories .pkwy-catpaths li,
.pkwy-products-all-with-categories .pkwy-virtualpaths li{
  position: relative;
  padding-left: 20px;
  margin: 6px 0;
  word-break: break-word;
  list-style: none;
}

.pkwy-products-all-with-categories .pkwy-catpaths li::before,
.pkwy-products-all-with-categories .pkwy-virtualpaths li::before{
  content: "⟶";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--pkwy-accent-2);
  line-height: 1.2;
}

/* subtle chip style if you prefer bullets to look like tags */
/*
.pkwy-products-all-with-categories .pkwy-catpaths li,
.pkwy-products-all-with-categories .pkwy-virtualpaths li{
  padding: 6px 10px;
  margin: 6px 0 0;
  background: var(--pkwy-chip-bg);
  border-radius: 8px;
}
.pkwy-products-all-with-categories .pkwy-catpaths li::before,
.pkwy-products-all-with-categories .pkwy-virtualpaths li::before{ content: none; }
*/

/* ===== empty states ===== */
.pkwy-products-all-with-categories .pkwy-cats,
.pkwy-products-all-with-categories .pkwy-virtualcats{
  color: var(--pkwy-muted);
  font-style: italic;
  margin-bottom: 8px;
}

/* ===== top-level presence line ===== */
.pkwy-products-all-with-categories .pkwy-topcounts{
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--pkwy-border);
  font-size: .9rem;
  color: var(--pkwy-muted);
}
.pkwy-products-all-with-categories .pkwy-topcounts strong{
  color: var(--pkwy-accent);
  font-weight: 700;
}

/* ===== footer total ===== */
.pkwy-products-all-with-categories .pkwy-total{
  margin-top: 18px;
  padding: 10px 12px;
  border: 1px solid var(--pkwy-border);
  border-radius: 10px;
  background: var(--pkwy-chip-bg);
  font-weight: 600;
  display: inline-block;
}

/* ===== dark mode polish ===== */
@media (prefers-color-scheme: dark){
  .pkwy-products-all-with-categories{
    --pkwy-bg:        #0b1220;
    --pkwy-card-bg:   #0f172a;
    --pkwy-border:    #263044;
    --pkwy-muted:     #9aa4b2;
    --pkwy-text:      #e5e7eb;
    --pkwy-accent:    #8cbcff;
    --pkwy-accent-2:  #7aa2ff;
    --pkwy-chip-bg:   #121a2d;
    --pkwy-shadow:    0 1px 2px rgba(0,0,0,.35);
  }
}

/* ===== products_all_with_categories – Improved footer list ===== */

.pkwy-products-all-with-categories .pkwy-topcounts{
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--pkwy-border, #e5e7eb);
}

.pkwy-products-all-with-categories .pkwy-topcounts-title{
  font-size: .92rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--pkwy-accent, #0f3a6d);
}

.pkwy-products-all-with-categories .pkwy-topcounts-list{
  list-style: none !important;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px){
  .pkwy-products-all-with-categories .pkwy-topcounts-list{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px){
  .pkwy-products-all-with-categories .pkwy-topcounts-list{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.pkwy-products-all-with-categories .pkwy-topcounts-list li{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--pkwy-border, #e5e7eb);
  border-radius: 10px;
  background: var(--pkwy-chip-bg, #f1f5f9);
}

/* name + badge */
.pkwy-products-all-with-categories .pkwy-topcounts-name{
  font-size: .9rem;
  line-height: 1.2;
}
.pkwy-products-all-with-categories .pkwy-topcounts-badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  color: #fff;
  background: #9aa4b2; /* default */
}

/* color-coding: present vs absent */
.pkwy-products-all-with-categories .pkwy-topcounts-list li.is-yes{
  border-color: #c7f0d2;
  background: #eefdf3;
}
.pkwy-products-all-with-categories .pkwy-topcounts-list li.is-yes .pkwy-topcounts-badge{
  background: #16a34a; /* green */
}

.pkwy-products-all-with-categories .pkwy-topcounts-list li.is-no{
  opacity: .85;
}
.pkwy-products-all-with-categories .pkwy-topcounts-list li.is-no .pkwy-topcounts-badge{
  background: #64748b; /* slate */
}

/* Dark mode polish */
@media (prefers-color-scheme: dark){
  .pkwy-products-all-with-categories .pkwy-topcounts-list li{
    border-color: #263044;
    background: #111a2b;
  }
  .pkwy-products-all-with-categories .pkwy-topcounts-list li.is-yes{
    border-color: #1f3f2b;
    background: #0e1f17;
  }
}

/* ===== Card state borders ===== */
.pkwy-products-all-with-categories > ul > li.pkwy-card{
  border: 1px solid var(--pkwy-border, #e5e7eb);
}
.pkwy-products-all-with-categories > ul > li.pkwy-card.is-problem{
  border-color: #ef4444;              /* red-500 */
  box-shadow: inset 0 0 0 2px rgba(239,68,68,.12);
  border-width: thick;    
}
.pkwy-products-all-with-categories > ul > li.pkwy-card.is-ok{
  border-color: var(--pkwy-border, #e5e7eb);
    list-style: none;
}

/* ===== Search bar ===== */
.pkwy-products-all-with-categories .pkwy-searchbar{
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px 0;
}
.pkwy-products-all-with-categories .pkwy-search-input{
  flex: 1 1 auto;
  min-width: 160px;
  max-width: 95%;
  padding: 8px 10px;
  border: 1px solid var(--pkwy-border, #e5e7eb);
  border-radius: 8px;
  font-size: .95rem;
  outline: none;
}
.pkwy-products-all-with-categories .pkwy-search-input:focus{
  border-color: var(--pkwy-accent-2, #2563eb);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.pkwy-products-all-with-categories .pkwy-search-clear{
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--pkwy-border, #e5e7eb);
  border-radius: 8px;
  background: var(--pkwy-chip-bg, #f1f5f9);
  font-size: 18px;
  line-height: 32px;
  text-align: center;
  cursor: pointer;
}
.pkwy-products-all-with-categories .pkwy-search-clear:hover{
  background: #e9eef6;
}

/* Dark mode polish */
@media (prefers-color-scheme: dark){
  .pkwy-products-all-with-categories > ul > li.pkwy-card{
    border-color: #263044;
  }
  .pkwy-products-all-with-categories > ul > li.pkwy-card.is-problem{
    border-color: #f87171; /* red-400 */
    box-shadow: inset 0 0 0 2px rgba(248,113,113,.18);
    border-weight: thick;
  }
  .pkwy-products-all-with-categories .pkwy-search-input{
    background:#8b8b8b; color:#e5e7eb; border-color:#263044;border-radius: 20px;
  }
  .pkwy-products-all-with-categories .pkwy-search-clear{
    background:#111a2b; border-color:#263044; color:#e5e7eb;
  }
  .pkwy-products-all-with-categories .pkwy-search-input:focus{
    box-shadow: 0 0 0 3px rgba(122,162,255,.18);
  }
}

/* Action buttons under the product title */
.pkwy-products-all-with-categories .pkwy-actions{
  display:flex; gap:8px; flex-wrap:wrap;
  margin: 6px 0 12px;
}

.pkwy-products-all-with-categories .pkwy-btn{
  display:inline-block;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
  border: 1px solid var(--pkwy-border, #e5e7eb);
  background: var(--pkwy-chip-bg, #f1f5f9);
  color: var(--pkwy-accent, #0f3a6d);
  line-height: 1.1;
}

.pkwy-products-all-with-categories .pkwy-btn:hover{
  background: #e9eef6;
}

.pkwy-products-all-with-categories .pkwy-btn--edit{
  background: var(--pkwy-accent, #0f3a6d);
  border-color: var(--pkwy-accent, #0f3a6d);
  color: #fff;
}

.pkwy-products-all-with-categories .pkwy-btn--edit:hover{
  filter: brightness(1.08);
}

/* dark mode polish */
@media (prefers-color-scheme: dark){
  .pkwy-products-all-with-categories .pkwy-btn{
    border-color:#263044; background:#111a2b; color:#e5e7eb;
  }
  .pkwy-products-all-with-categories .pkwy-btn:hover{
    background:#0f172a;
  }
}

/* Filter bar (top-level chips) */
.pkwy-products-all-with-categories .pkwy-filterbar{
  display:flex; flex-wrap:wrap; gap:8px; margin: 8px 0 14px;
}
.pkwy-products-all-with-categories .pkwy-topfilter{
  display:flex; flex-wrap:wrap; gap:8px;
}
.pkwy-products-all-with-categories .pkwy-chip{
  display:inline-block;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--pkwy-border, #e5e7eb);
  background: var(--pkwy-chip-bg, #f1f5f9);
  color: var(--pkwy-text, #0f172a);
  cursor:pointer;
  font-size:.85rem;
  line-height:1.1;
  user-select:none;
}
.pkwy-products-all-with-categories .pkwy-chip:hover{
  background:#e9eef6;
}
.pkwy-products-all-with-categories .pkwy-chip.is-active{
  border-color: var(--pkwy-accent-2, #2563eb);
  box-shadow: 0 0 0 2px rgba(37,99,235,.12) inset;
}

/* Keep the existing "problem" red border behavior */
.pkwy-products-all-with-categories > ul > li.pkwy-card.is-problem{
  border-color:#ef4444;
  box-shadow: inset 0 0 0 2px rgba(239,68,68,.12);
}

/* Dark mode polish */
@media (prefers-color-scheme: dark){
  .pkwy-products-all-with-categories .pkwy-chip{
    background:#111a2b; border-color:#263044; color:#e5e7eb;
  }
  .pkwy-products-all-with-categories .pkwy-chip:hover{
    background:#0f172a;
  }
}


/* Grey-out other top-level chips when one is selected */
.pkwy-products-all-with-categories .pkwy-chip.is-muted{
  opacity: .45;
  filter: grayscale(1);
  pointer-events: none;   /* make unclickable until "All" is chosen */
  cursor: not-allowed;
}

/* One-row, four-up layout for the Top-level footer list on desktop */
@media (min-width: 1024px){
  .pkwy-products-all-with-categories .pkwy-topcounts-list{
    display: grid;                     /* keep grid */
    grid-template-columns: repeat(4, minmax(0, 1fr));  /* 4 columns */
    gap: 8px;                          /* keep a small gap */
  }
  /* tighten items slightly so all four fit comfortably */
  .pkwy-products-all-with-categories .pkwy-topcounts-list li{
    padding: 6px 8px;
    min-width: 0;                      /* allow shrink inside grid cells */
  }
  /* prevent long names from forcing a wrap/overflow */
  .pkwy-products-all-with-categories .pkwy-topcounts-name{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .pkwy-products-all-with-categories .pkwy-topcounts-badge{
    flex: 0 0 auto;                    /* keep badge from shrinking */
  }
}

