/* =========================================================
   MOBILE/TABLET FIX: Services chips nav compact + Filter toggle
   - prevents chips covering half the screen
   - default shows ~2 rows, "Filter" expands with inner scroll
   Scope: .services-page only
========================================================= */

@media (max-width: 992px){

  /* sticky but compact */
  .services-page .services-nav{
    position: sticky;
    top: 64px;                 /* adjust if your header height differs */
    z-index: 60;
    background: rgba(244,248,253,0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(17,45,67,0.08);
    padding: 10px 0;
  }

  /* wrapper (we add data-svc-filters on .s-chips) */
  .services-page .services-nav .s-chips[data-svc-filters]{
    position: relative;
  }

  /* top bar injected by JS */
  .services-page .services-nav .svc-filterbar{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
  }

  .services-page .services-nav .svc-filterbar__title{
    font-weight: 900;
    color: var(--color-primary);
    font-size: 0.98rem;
  }

  /* Filter button */
  .services-page .services-nav .svc-filterbtn{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;

    background: rgba(95,147,204,0.16);
    border: 1px solid rgba(95,147,204,0.35);
    color: var(--color-primary);
    font-weight: 800;
    font-size: 0.85rem;

    cursor: pointer;
  }
  .services-page .services-nav .svc-filterbtn:hover{
    background: rgba(95,147,204,0.22);
  }

  /* collapsed by default (~2 rows) */
  .services-page .services-nav .svc-filterpanel{
    max-height: 132px;
    overflow: hidden;
    padding-bottom: 6px;
    position: relative;
  }

  /* subtle fade when collapsed */
  .services-page .services-nav .svc-filterpanel::after{
    content:"";
    position:absolute;
    left:0; right:0; bottom:0;
    height: 34px;
    background: linear-gradient(180deg, rgba(244,248,253,0), rgba(244,248,253,0.95));
    pointer-events:none;
  }

  /* open state: fixed height + internal scroll */
  .services-page .services-nav .s-chips[data-svc-filters].is-open .svc-filterpanel{
    max-height: 48vh;
    overflow: auto;
  }
  .services-page .services-nav .s-chips[data-svc-filters].is-open .svc-filterpanel::after{
    display:none;
  }

  /* chips look tighter on mobile */
  .services-page .services-nav .s-chip{
    border-radius: 999px;
    padding: 10px 12px;
    font-weight: 800;
    font-size: 0.9rem;
    white-space: nowrap;
  }
}
