/* Product list responsive correction layer */
#products{scroll-margin-top:calc(var(--header) + 16px)}

.mobile-category-toggle{
  position:relative!important;
  isolation:isolate;
  min-width:132px!important;
  height:46px!important;
  display:none!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  padding:0 10px 0 13px!important;
  border:1px solid var(--primary)!important;
  border-radius:9px!important;
  color:#fff!important;
  background:var(--primary)!important;
  box-shadow:0 8px 18px rgba(7,31,49,.14)!important;
  font-size:13px!important;
  font-weight:600!important;
  line-height:1!important;
  white-space:nowrap;
}
.mobile-category-toggle::before,.mobile-category-toggle::after{content:none!important}
.mobile-category-toggle:hover,.mobile-category-toggle:focus-visible,.mobile-category-toggle[aria-expanded="true"]{
  color:#fff!important;
  background:var(--accent-strong)!important;
  border-color:var(--accent-strong)!important;
}
.category-toggle-icon{flex:0 0 18px;width:18px;height:18px}
.category-toggle-label{min-width:0}
.category-toggle-count{
  min-width:22px;height:22px;display:grid;place-items:center;
  padding:0 5px;border-radius:99px;
  color:var(--primary);background:#fff;
  font-size:11px;font-weight:700;line-height:1;
}

/* A product card always owns its own image and content areas. */
.simple-product-card{min-width:0}
.simple-product-image{display:block!important;width:100%!important;aspect-ratio:1/1!important;height:auto!important;overflow:hidden!important;background:#edf2f3!important}
.simple-product-image img{display:block!important;width:100%!important;height:100%!important;object-fit:cover!important;object-position:center!important;padding:0!important}
.simple-product-body{position:relative!important;min-width:0!important;background:#fff!important}
.simple-product-card h3,.simple-product-card h3 a,.simple-product-desc,.simple-product-link{position:relative!important;z-index:1}

@media (max-width:1080px){
  .mobile-category-toggle{display:inline-flex!important}
  .directory-top{position:relative;z-index:2}
  .directory-tools{
    display:grid!important;
    grid-template-columns:auto minmax(260px,360px)!important;
    justify-content:end!important;
    align-items:center!important;
    gap:10px!important;
  }
  .product-search{width:100%!important;min-width:0!important}
  .product-search input{height:46px!important;font-size:14px!important}

  .simple-product-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:16px!important}
  .simple-product-card{
    display:flex!important;
    grid-template-columns:none!important;
    flex-direction:column!important;
    align-items:stretch!important;
    overflow:hidden!important;
    border-radius:11px!important;
  }
  .simple-product-body{display:flex!important;flex:1!important;flex-direction:column!important;padding:18px!important}
  .simple-product-category{margin-bottom:7px!important;font-size:11px!important;line-height:1.35!important}
  .simple-product-card h3{font-size:19px!important;line-height:1.34!important}
  .simple-product-desc{margin:10px 0 15px!important;font-size:14px!important;line-height:1.62!important;display:block!important;overflow:visible!important}
  .simple-product-link{padding-top:13px!important;font-size:13px!important}
}

@media (max-width:720px){
  .product-directory{padding-top:42px!important}
  .directory-top{display:block!important;margin-bottom:18px!important}
  .directory-top h2{font-size:27px!important}
  .directory-tools{
    width:100%!important;
    margin-top:16px!important;
    grid-template-columns:132px minmax(0,1fr)!important;
    justify-content:stretch!important;
    gap:8px!important;
  }
  .mobile-category-toggle{width:132px!important;min-width:132px!important;padding-inline:10px!important}
  .simple-product-grid{grid-template-columns:1fr!important;gap:18px!important}
  .simple-product-card{display:flex!important;flex-direction:column!important;grid-template-columns:none!important}
  .simple-product-body{padding:18px!important}
  .simple-product-card h3{font-size:21px!important;line-height:1.3!important}
  .simple-product-desc{font-size:14px!important;line-height:1.65!important;-webkit-line-clamp:unset!important}
  .simple-product-link{font-size:14px!important}
}

@media (max-width:380px){
  .directory-tools{grid-template-columns:1fr!important}
  .mobile-category-toggle{width:100%!important;min-width:0!important}
  .product-search{grid-row:2}
  .simple-product-body{padding:16px!important}
  .simple-product-card h3{font-size:19px!important}
}

/* Prevent square media from shrinking underneath the body in flex cards. */
.simple-product-card>.simple-product-image{flex:0 0 auto!important}
.simple-product-card>.simple-product-body{flex:0 0 auto!important}

@media (max-width:480px){
  .category-toggle-count{display:none!important}
  .mobile-category-toggle{min-width:132px!important;width:132px!important}
}
@media (max-width:380px){
  .mobile-category-toggle{width:100%!important;min-width:0!important}
}

/* Final mobile category control: single-column toolbar and proper list icon */
.category-toggle-main{
  display:inline-flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.category-toggle-icon{
  flex:0 0 20px!important;
  width:20px!important;
  height:20px!important;
}
.category-toggle-count{
  flex:0 0 auto;
  margin-left:auto;
  min-width:24px!important;
  height:24px!important;
  padding:0 7px!important;
  border-radius:999px!important;
  color:var(--accent-strong)!important;
  background:var(--accent-soft)!important;
  border:1px solid rgba(22,170,145,.22)!important;
  font-size:11px!important;
  font-weight:700!important;
}
.directory-nav,
.related-category-links{
  grid-template-columns:1fr!important;
}

@media (max-width:820px){
  .directory-tools{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    width:100%!important;
    gap:10px!important;
  }
  .mobile-category-toggle{
    width:100%!important;
    min-width:0!important;
    height:48px!important;
    justify-content:flex-start!important;
    padding:0 14px!important;
    color:var(--primary)!important;
    background:#fff!important;
    border:1px solid var(--border)!important;
    box-shadow:0 6px 18px rgba(7,31,49,.055)!important;
  }
  .mobile-category-toggle:hover,
  .mobile-category-toggle:focus-visible,
  .mobile-category-toggle[aria-expanded="true"]{
    color:var(--accent-strong)!important;
    background:var(--accent-soft)!important;
    border-color:rgba(22,170,145,.45)!important;
  }
  .product-search{
    width:100%!important;
    min-width:0!important;
    grid-row:auto!important;
  }
  .product-search input{
    height:48px!important;
  }
}

@media (max-width:480px){
  .category-toggle-count{
    display:grid!important;
  }
  .mobile-category-toggle{
    width:100%!important;
    min-width:0!important;
  }
}
