/* category page */
/* =================================================================
     CATEGORY / SHOP PAGE
  ==================================================================*/

  .cat-hero{
    max-width:var(--container);
    margin:10px auto 0;
    padding:0 12px;
  }
  .cat-hero-inner{
    position:relative;
    overflow:hidden;
    border-radius:14px;
    padding:20px 18px;
    color:#fff;
    background:
      radial-gradient(220px 160px at 100% 0%, rgba(255,255,255,0.18), transparent 70%),
      linear-gradient(135deg, var(--brand-light), var(--brand) 55%, var(--brand-dark));
  }
  .cat-hero-inner::after{
    content:"";
    position:absolute;
    right:-30px; bottom:-40px;
    width:140px; height:140px;
    border-radius:50%;
    border:18px solid rgba(255,255,255,0.08);
  }
  .cat-hero h1{ margin:0 0 4px; font-size:22px; font-weight:700; }
  .cat-hero p{ margin:0; font-size:12.5px; line-height:1.5; color:rgba(255,255,255,0.85); max-width:420px; }
  .cat-hero .cat-count{
    display:inline-block;
    margin-top:12px;
    font-size:11px;
    font-weight:700;
    letter-spacing:.04em;
    text-transform:uppercase;
    background:rgba(255,255,255,0.16);
    border:1px solid rgba(255,255,255,0.25);
    padding:4px 10px;
    border-radius:999px;
  }

  /* sub-category chips */
  .chip-row{
    max-width:var(--container);
    margin:14px auto 0;
    padding:0 12px;
    display:flex;
    gap:8px;
    overflow-x:auto;
    scrollbar-width:none;
  }
  .chip-row::-webkit-scrollbar{ display:none; }
  .chip{
    flex-shrink:0;
    border:1.5px solid var(--line-2);
    background:#fff;
    color:var(--text-2);
    font-size:12.5px;
    font-weight:600;
    padding:8px 14px;
    border-radius:999px;
    cursor:pointer;
    white-space:nowrap;
    transition:all .15s ease;
    -webkit-tap-highlight-color:transparent;
  }
  .chip:hover{ border-color:var(--brand); color:var(--brand); }
  .chip.active{ background:var(--brand); border-color:var(--brand); color:#fff; }

  /* toolbar */
  .shop-toolbar{
    position:sticky;
    top:var(--header-h);
    z-index:40;
    background:#fff;
    border-bottom:1px solid var(--line);
    margin-top:14px;
  }
  .shop-toolbar-inner{
    max-width:var(--container);
    margin:0 auto;
    padding:10px 12px;
    display:flex;
    align-items:center;
    gap:10px;
  }
  .result-count{ font-size:12.5px; color:var(--muted); margin-right:auto; }
  .result-count b{ color:var(--text); }
  .tool-btn{
    display:flex;
    align-items:center;
    gap:6px;
    border:1.5px solid var(--line-2);
    background:#fff;
    color:var(--text-2);
    font-size:12.5px;
    font-weight:600;
    height:36px;
    padding:0 12px;
    border-radius:8px;
    cursor:pointer;
  }
  .tool-btn svg{ width:16px; height:16px; color:var(--brand); }
  .tool-btn .badge{
    min-width:18px;
    height:18px;
    padding:0 5px;
    border-radius:999px;
    background:var(--brand);
    color:#fff;
    font-size:10.5px;
    font-weight:700;
    display:inline-flex;
    align-items:center;
    justify-content:center;
  }
  .tool-btn .badge[hidden]{ display:none; }
  .sort-wrap{ position:relative; }
  .sort-wrap select{
    -webkit-appearance:none;
    appearance:none;
    border:1.5px solid var(--line-2);
    background:#fff;
    color:var(--text-2);
    font-size:12.5px;
    font-weight:600;
    height:36px;
    padding:0 30px 0 12px;
    border-radius:8px;
    cursor:pointer;
    outline:none;
  }
  .sort-wrap select:focus{ border-color:var(--brand); }
  .sort-wrap svg{
    position:absolute;
    right:10px; top:50%;
    width:14px; height:14px;
    transform:translateY(-50%);
    pointer-events:none;
    color:var(--muted);
  }

  /* active filter pills */
  .active-filters{
    max-width:var(--container);
    margin:0 auto;
    padding:10px 12px 0;
    display:flex;
    flex-wrap:wrap;
    gap:6px;
  }
  .active-filters:empty{ display:none; }
  .af-pill{
    display:inline-flex;
    align-items:center;
    gap:6px;
    font-size:11.5px;
    font-weight:600;
    color:var(--brand);
    background:var(--brand-soft);
    border:none;
    padding:6px 10px;
    border-radius:999px;
    cursor:pointer;
  }
  .af-pill svg{ width:10px; height:10px; }
  .af-clear{
    font-size:11.5px;
    font-weight:600;
    color:var(--muted);
    background:none;
    border:none;
    text-decoration:underline;
    cursor:pointer;
    padding:6px 4px;
  }

  /* layout */
  .shop-layout{
    max-width:var(--container);
    margin:0 auto;
    padding:14px 12px 0;
  }
  .shop-results .product-grid{ margin:0; }

  /* richer product card bits */

  .load-more-wrap{ text-align:center; padding:22px 0 4px; }
  .load-more-wrap p{ font-size:12px; color:var(--muted-2); margin:0 0 10px; }
  .load-more-bar{ width:160px; height:3px; border-radius:3px; background:var(--line); margin:0 auto 14px; overflow:hidden; }
  .load-more-bar span{ display:block; height:100%; background:var(--brand); border-radius:3px; transition:width .3s ease; }
  .load-more-btn{
    border:1.5px solid var(--brand);
    background:#fff;
    color:var(--brand);
    font-size:13px;
    font-weight:700;
    height:44px;
    padding:0 28px;
    border-radius:10px;
    cursor:pointer;
  }
  .load-more-btn:hover{ background:var(--brand); color:#fff; }
  .load-more-wrap[hidden]{ display:none; }

  .no-results{ text-align:center; padding:40px 16px; }
  .no-results[hidden]{ display:none; }
  .no-results .nr-icon{
    width:60px; height:60px;
    margin:0 auto 12px;
    border-radius:50%;
    background:var(--brand-soft);
    color:var(--brand);
    display:flex; align-items:center; justify-content:center;
  }
  .no-results .nr-icon svg{ width:26px; height:26px; }
  .no-results h2{ font-size:16px; margin:0 0 4px; color:var(--text); }
  .no-results p{ font-size:13px; color:var(--muted); margin:0 0 14px; }

  /* ---------- FILTER PANEL (bottom sheet on mobile, sidebar on desktop) ---------- */
  .filter-panel{
    position:fixed;
    left:0; right:0; bottom:0;
    z-index:101;
    max-height:86vh;
    display:flex;
    flex-direction:column;
    background:#fff;
    border-radius:20px 20px 0 0;
    transform:translateY(100%);
    visibility:hidden;
    transition:transform .28s ease, visibility .28s;
  }
  .filter-panel.open{ transform:translateY(0); visibility:visible; }
  .fp-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:16px 18px 12px;
    border-bottom:1px solid var(--line);
  }
  .fp-head h2{ margin:0; font-size:16px; color:var(--text); }
  .fp-close{
    width:30px; height:30px;
    border-radius:50%;
    border:none;
    background:var(--brand-soft);
    color:var(--text);
    display:flex; align-items:center; justify-content:center;
    cursor:pointer;
  }
  .fp-close svg{ width:14px; height:14px; }
  .fp-body{ overflow-y:auto; overscroll-behavior:contain; padding:4px 18px 10px; }
  .fp-group{ padding:14px 0; border-bottom:1px solid var(--line); }
  .fp-group:last-child{ border-bottom:none; }
  .fp-group h3{
    margin:0 0 10px;
    font-size:12px;
    font-weight:700;
    letter-spacing:.06em;
    text-transform:uppercase;
    color:var(--muted);
  }
  .fp-opt{
    display:flex;
    align-items:center;
    gap:10px;
    padding:7px 0;
    font-size:13.5px;
    color:var(--text-2);
    cursor:pointer;
  }
  .fp-opt input{ width:18px; height:18px; margin:0; accent-color:var(--brand); cursor:pointer; flex-shrink:0; }
  .fp-opt .n{ margin-left:auto; font-size:11.5px; color:var(--muted-2); }
  .fp-opt .stars-mini{ color:var(--star); letter-spacing:1px; }
  .fp-switch{ justify-content:space-between; }
  .fp-switch input{
    -webkit-appearance:none;
    appearance:none;
    width:40px; height:22px;
    border-radius:999px;
    background:var(--line-2);
    position:relative;
    transition:background .2s ease;
  }
  .fp-switch input::after{
    content:"";
    position:absolute;
    top:3px; left:3px;
    width:16px; height:16px;
    border-radius:50%;
    background:#fff;
    box-shadow:0 1px 3px rgba(0,0,0,.2);
    transition:transform .2s ease;
  }
  .fp-switch input:checked{ background:var(--brand); }
  .fp-switch input:checked::after{ transform:translateX(18px); }
  .fp-foot{
    display:flex;
    gap:10px;
    padding:12px 18px calc(14px + env(safe-area-inset-bottom));
    border-top:1px solid var(--line);
  }
  .fp-foot button{
    flex:1;
    height:46px;
    border-radius:10px;
    font-size:13.5px;
    font-weight:700;
    cursor:pointer;
  }
  .fp-reset{ background:#fff; border:1.5px solid var(--line-2); color:var(--text-2); }
  .fp-apply{ background:var(--brand); border:none; color:#fff; }

  /* ---------- DESKTOP ---------- */
  @media (min-width:1024px){
    .crumbs, .cat-hero, .chip-row, .active-filters{ max-width:var(--page-max); padding-left:32px; padding-right:32px; }
    .crumbs{ padding-top:16px; }
    .cat-hero-inner{ padding:34px 36px; }
    .cat-hero h1{ font-size:30px; }
    .cat-hero p{ font-size:14px; }
    .chip-row{ flex-wrap:wrap; overflow:visible; margin-top:18px; }

    .shop-toolbar{ position:static; border-bottom:none; margin-top:10px; }
    .shop-toolbar-inner{ max-width:var(--page-max); padding:10px 32px; }
    .shop-toolbar .filter-open-btn{ display:none; }

    .shop-layout{
      max-width:var(--page-max);
      padding:10px 32px 0;
      display:grid;
      grid-template-columns:250px minmax(0,1fr);
      gap:28px;
      align-items:start;
    }
    .filter-panel{
      position:sticky;
      top:96px;
      z-index:1;
      max-height:calc(100vh - 116px);
      transform:none;
      visibility:visible;
      border:1px solid var(--line);
      border-radius:14px;
      transition:none;
    }
    .fp-close{ display:none; }
    .fp-apply{ display:none; }
    .fp-head{ padding:14px 18px; }
    #filterOverlay{ display:none; }
    .shop-results .product-grid{ grid-template-columns:repeat(3, minmax(0,1fr)); gap:18px 10px; }
  }
  @media (min-width:1280px){
    .shop-results .product-grid{ grid-template-columns:repeat(4, minmax(0,1fr)); }
  }

  /* ---------- live store additions ---------- */
  .search-page-form{ max-width:var(--container); margin:14px auto 0; padding:0 12px; display:flex; gap:8px; }
  .search-page-form input{ flex:1; min-width:0; height:44px; border:1.5px solid var(--line-2); border-radius:10px; padding:0 14px; font-size:14px; outline:none; }
  .search-page-form input:focus{ border-color:var(--brand); }
  .search-page-form button{ display:flex; align-items:center; gap:6px; height:44px; padding:0 16px; border:none; border-radius:10px; background:var(--brand); color:#fff; font-size:13.5px; font-weight:700; cursor:pointer; }
  .search-page-form button svg{ width:16px; height:16px; }
  .no-results .load-more-btn{ height:44px; }
  @media (min-width:1024px){
    .search-page-form{ max-width:var(--page-max); padding:0 32px; }
    .search-page-form input{ max-width:520px; }
    .shop-layout.no-filters{ display:block; }
    .shop-layout.no-filters .shop-results .product-grid{ grid-template-columns:repeat(4, minmax(0,1fr)); }
  }
