/* ===== Top categories (2 rows on desktop) ===== */
.categories{
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* 3 columns → 2 rows with 6 items */
    gap: 10px 12px;
    padding: 12px;
    background: #fff;
    border-bottom: 1px solid var(--accent-light);
  
    /* layout & behavior */
    max-width: 1100px;
    margin: 0 auto;
    position: sticky;
    top: calc(var(--header-height)); /* sits just under your sticky header */
    z-index: 15;
  
    /* make sure it never scrolls sideways */
    overflow-x: hidden;
  }
  
  /* Category buttons */
  .categories button{
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  
    padding: 10px 0;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
  
    border: 1px solid #dfe9e3;
    background: #f2f6f4;
    color: #2a4e3c;
    text-align: center;
    white-space: normal;
  
    transition: background .2s ease, transform .1s ease, color .2s ease, border-color .2s ease;
  }
  
  .categories button:hover{ background:#e6efe9; }
  .categories button:active{ transform: translateY(1px); }
  
  .categories button.active{
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
  }
  
  /* Snow Monster special */
  .categories button[data-cat="snowmonster"]{
    background: #ffd6dc;
    color: #d22c4f;
    border-color: #f8c2cc;
    font-weight: 800;
  }
  
  /* ===== Subcategories strip (unchanged, wraps to multiple lines) ===== */
  .subcats{
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 14px;
    background: #fff;
    max-width: 1100px;
    margin: 0 auto;
  }
  
  .subcats button{
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid #d8e5dd;
    background: #fff;
    font-weight: 600;
    font-size: 14px;
    color: #294b3b;
    cursor: pointer;
  }
  .subcats button.active{
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
  }
  
  /* ===== Mobile: 2 per row ===== */
  @media (max-width: 600px){
    .categories{
      grid-template-columns: repeat(2, 1fr);
      top: calc(var(--header-height) - 2px);
    }
  }
  
  /* ===== Very small phones: tighten spacing a bit ===== */
  @media (max-width: 380px){
    .categories{ gap: 8px 10px; padding: 10px; }
    .categories button{ font-size: 14px; padding: 9px 0; }
  }

  /* Make categories bar sticky under header */
#categoriesBar.categories {
    position: sticky;
    top: var(--header-height);   /* sits under the fixed header */
    z-index: 90;
    transition: transform .22s ease, opacity .18s ease;
  }
  
  /* Collapsed state (mobile): slide up & hide clicks */
  @media (max-width: 768px) {
    #categoriesBar.categories.collapsed {
      transform: translateY(-110%);
      opacity: 0;
      pointer-events: none;
    }
  }
  
  /* Mobile toggle pill that appears when collapsed */
  .sections-toggle {
    display: none; /* only show on mobile */
    position: sticky;
    top: calc(var(--header-height) + 6px);
    margin: 6px auto 0;
    z-index: 95;
    border: 1px solid #dfe9e3;
    background: #f2f6f4;
    color: #2a4e3c;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    gap: 8px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 12px rgba(0,0,0,.06);
  }
  
  .sections-toggle .icon { font-size: 16px; line-height: 1; }
  
  @media (max-width: 768px) {
    .sections-toggle { 
      display: inline-flex; 
      /* Hide the toggle while the bar is visible; show when collapsed (JS flips a class) */
    }
  }
  
  /* When the bar is open via toggle, reflect state */
  .sections-toggle[aria-expanded="true"] {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
  }