/* pw-catalog.css — static case-studies catalog (porting the Tilda Store to static markup).
   We don't load the Store engine (tilda-catalog/products.js); the cards are embedded statically
   from the live site's rendered DOM. We hide the non-functional sort/filter panel, but KEEP the
   search box (re-injected as static markup + wired by pw-catalog-search.js as a client-side
   filter over the static cards — matches the live search visually and functionally). */
.uc-case-list .t-catalog__filter-wrapper,
.uc-case-list .t-catalog__filter {
  display: none !important;
}
/* without the sidebar filter — the grid takes the full container width */
.uc-case-list .t-catalog__products-part-wrapper,
.uc-case-list .js-catalog-cont-w-filter {
  width: 100% !important;
}

/* --- search box (re-injected) — single row above the grid, aligned with the card
   grid container (t-container: max-width 1200, 20px inner pad); a 400px input left-aligned. --- */
/* the row sits on live's grey panel: 1160 wide at x=60 (1280 viewport), 20px 35px inside */
.uc-case-list .t-catalog__filter__search-and-sort {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center;
  width: calc(100% - 40px) !important;
  max-width: 1160px;
  margin: 0 auto 30px;
  padding: 20px 35px;
  background: #f4f4f4;
  box-sizing: border-box;
  text-align: left;
}
.uc-case-list .t-catalog__filter__search-and-sort .t-catalog__filter__search {
  display: block !important;
  width: 400px !important;
  max-width: 100% !important;
  margin: 0 0 0 10px !important; /* + the panel's 35px padding = live's x=105 */
  float: none !important;
}
.uc-case-list .t-catalog__search-wrapper {
  display: block !important;
  position: relative;
  width: 100%;
}
.uc-case-list .t-catalog__filter__search-and-sort .t-catalog__filter__input {
  width: 100% !important;
  height: 45px !important;
  box-sizing: border-box !important;
  padding: 2px 40px 2px 50px !important; /* magnifier on the LEFT (like live), clear icon on the right */
  font-family: inherit !important; /* an <input> would otherwise fall back to Arial, not Roboto */
  font-size: 16px !important;
  line-height: 41px !important;
  border: none !important; /* live relies on the grey panel for contrast */
  border-radius: 8px !important;
  background: #fff !important;
  color: #000 !important;
  outline: none !important;
}
.uc-case-list .t-catalog__search-icon {
  position: absolute !important;
  top: 50%; left: 20px; right: auto !important;
  transform: translateY(-50%);
  margin: 0 !important;
  width: 16px; height: 16px;
}
.uc-case-list .t-catalog__search-close-icon {
  position: absolute !important;
  top: 50%; right: 16px; left: auto !important;
  transform: translateY(-50%);
  width: 12px; height: 12px;
  cursor: pointer;
  display: none;
  z-index: 2;
}

/* --- Industry dropdown (re-injected) — sits to the right of the search, like live --- */
.uc-case-list .pw-industry {
  position: relative;
  margin-left: 50px;
  flex: 0 0 auto;
}
/* live styles this as a white pill on the grey panel, 136 wide, icon inside the left padding */
.uc-case-list .pw-industry__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 45px;
  padding: 3px 15px 3px 50px;
  box-sizing: border-box;
  position: relative;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #77787b;
  font-family: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}
.uc-case-list .pw-industry__btn .pw-industry__ico {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
}
.uc-case-list .pw-industry__ico { flex: 0 0 auto; }
.uc-case-list .pw-industry__arrow { flex: 0 0 auto; transition: transform .15s ease; }
.uc-case-list .pw-industry_open .pw-industry__arrow { transform: rotate(180deg); }
.uc-case-list .pw-industry__panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  width: 250px;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
  padding: 6px 0;
}
.uc-case-list .pw-industry__panel[hidden] { display: none; }
.uc-case-list .pw-industry__opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  cursor: pointer;
  color: #77787b;
  font-size: 14px;
}
.uc-case-list .pw-industry__opt:hover { background: #f6f6f6; }
.uc-case-list .pw-industry__opt input { position: absolute; opacity: 0; width: 0; height: 0; }
/* live: the box stays white with a 2px black border and a RED tick inside */
.uc-case-list .pw-industry__box {
  flex: 0 0 auto;
  width: 18px; height: 18px;
  border: 2px solid #000;
  border-radius: 3px;
  background: #fff;
  position: relative;
}
.uc-case-list .pw-industry__opt input:checked + .pw-industry__box::after {
  content: "";
  position: absolute;
  left: 4px; top: 0;
  width: 5px; height: 10px;
  border: solid #d12026;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.uc-case-list .pw-industry__txt { line-height: 1.2; }

/* filtered-out cards — class beats Tilda's grid `display:flex !important` */
.uc-case-list .js-product.pw-hidden { display: none !important; }

/* --- active-filter bar: "Found: N  × chip  × chip  Reset all" (markup ships in the fragment,
   wired by pw-catalog-filter.js). Live puts the count first, then chips, then the reset link. --- */
.uc-case-list .t-catalog__filter__chosen-bar {
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 22px 0;
  padding: 0 20px;
}
.uc-case-list .t-catalog__filter__chosen-bar .t-catalog__filter__prods-number {
  order: 0;
  margin: 0;
  color: #757575;
  font-size: 20px;
  white-space: nowrap;
}
.uc-case-list .t-catalog__filter__chosen-wrapper {
  order: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.uc-case-list .pw-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 60px;
  background: #f5f5f5;
  color: #000;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
}
.uc-case-list .pw-chip__x { color: #757575; }
.uc-case-list .t-catalog__filter__reset {
  margin: 0;
  color: #757575;
  font-size: 16px;
  text-decoration: underline;
  cursor: pointer;
}

/* desktop: live has no clear-× in the field — the search chip removes the query instead */
@media (min-width: 641px) {
  .uc-case-list .t-catalog__search-close-icon { display: none !important; }
}

/* --- mobile (≤640): mirror live — a 280px strip "⚙ Filters … 🔍" centred above the grid,
   Filters opens a bottom sheet with the Industry list, the magnifier reveals the field.
   Strip and sheet are built by pw-catalog-filter.js. --- */
.uc-case-list .pw-mfilter { display: none; }
@media (max-width: 640px) {
  .uc-case-list .pw-mfilter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 280px;
    height: 52px;
    margin: 0 auto;
    padding: 0 0 20px;
    box-sizing: border-box;
  }
  .uc-case-list .pw-mfilter__btn,
  .uc-case-list .pw-mfilter__search {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: none;
    color: #000;
    font-family: inherit;
    font-size: 15px;
    cursor: pointer;
  }
  /* the full row is hidden until the magnifier is tapped */
  .uc-case-list .t-catalog__filter__search-and-sort {
    display: none !important;
  }
  .uc-case-list .t-catalog__filter__search-and-sort.pw-msearch-open {
    display: flex !important;
    width: 280px !important;
    margin: 0 auto 16px;
    padding: 0;
    background: transparent;
  }
  .uc-case-list .pw-msearch-open .t-catalog__filter__search { margin: 0 !important; width: 100% !important; }
  .uc-case-list .pw-msearch-open .pw-industry { display: none; }
  .uc-case-list .pw-msearch-open .t-catalog__search-close-icon { display: block; }
  .uc-case-list .t-catalog__filter__chosen-bar { justify-content: center; }

  .uc-case-list .pw-sheet {
    position: fixed;
    inset: 0;
    /* above the cookie banner (.t657 sits at 100001) — otherwise the sheet is unusable
       until the banner is accepted */
    z-index: 100002;
  }
  .uc-case-list .pw-sheet[hidden] { display: none; }
  .uc-case-list .pw-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .4);
  }
  .uc-case-list .pw-sheet__content {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    min-height: 284px; /* live's sheet height at 390×844 */
    max-height: 70vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px 12px 0 0;
    padding: 20px 20px 24px;
    box-sizing: border-box;
  }
  .uc-case-list .pw-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 17px;
    padding-bottom: 10px;
  }
  .uc-case-list .pw-sheet__x {
    border: 0; background: none; font-size: 26px; line-height: 1; color: #757575; cursor: pointer;
  }
  .uc-case-list .pw-sheet__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 0;
    border: 0;
    border-top: 1px solid #ececec;
    background: none;
    color: #000;
    font-family: inherit;
    font-size: 16px;
    cursor: pointer;
  }
  .uc-case-list .pw-sheet__chev { color: #757575; transition: transform .15s ease; }
  .uc-case-list .pw-sheet_expanded .pw-sheet__chev { transform: rotate(90deg); }
  .uc-case-list .pw-sheet__slot { display: none; }
  .uc-case-list .pw-sheet_expanded .pw-sheet__slot { display: block; }
  /* inside the sheet the dropdown is a plain list, not a floating panel */
  .uc-case-list .pw-sheet__slot .pw-industry__panel {
    position: static;
    width: auto;
    border: 0;
    box-shadow: none;
    padding: 0 0 6px;
  }
  .uc-case-list .pw-sheet__slot .pw-industry__opt { padding: 10px 0; font-size: 16px; }
}
