
/* DaruGet v32 — mobile category stability */
@media(max-width:900px){
  .category-content,
  .category-layout,
  .products-area,
  .category-products-grid,
  .category-product{
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }

  .category-content{
    padding-top:10px!important;
    overflow-x:hidden!important;
  }

  .category-layout{
    display:block!important;
    width:100%!important;
    margin:0!important;
    padding:0 10px 18px!important;
  }

  .products-area{
    width:100%!important;
    margin:0!important;
  }

  /* mobile filter stays out of normal flow until explicitly opened */
  .filter-panel{
    position:fixed!important;
    top:0!important;
    right:0!important;
    bottom:0!important;
    width:min(90vw,360px)!important;
    max-width:360px!important;
    height:100%!important;
    margin:0!important;
    z-index:25000!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    transform:translate3d(102%,0,0)!important;
    background:#fff!important;
  }
  .filter-panel.open,
  .filter-panel.is-open{
    transform:translate3d(0,0,0)!important;
  }

  .filters-control-row{
    width:100%!important;
    margin:0 0 10px!important;
    overflow:visible!important;
  }

  .toolbar-actions{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:8px!important;
    align-items:stretch!important;
    width:100%!important;
  }

  .toolbar-actions > *{
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }

  .product-count{
    grid-column:1 / -1!important;
    display:flex!important;
    align-items:center!important;
    min-height:34px!important;
    padding:0 2px!important;
    font-size:12px!important;
  }

  .compare-toggle,
  .mobile-filter-btn{
    min-height:40px!important;
    width:100%!important;
    padding:8px 10px!important;
    font-size:12px!important;
    white-space:normal!important;
    line-height:1.45!important;
  }

  .sort-box{
    grid-column:1 / -1!important;
    display:grid!important;
    grid-template-columns:auto minmax(0,1fr)!important;
    align-items:center!important;
    gap:8px!important;
    min-height:42px!important;
    padding:7px 9px!important;
    font-size:12px!important;
  }

  .sort-box select{
    width:100%!important;
    min-width:0!important;
    font-size:12px!important;
  }

  .view-switch{
    display:none!important;
  }

  .active-filters-row{
    width:100%!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch!important;
  }

  .active-filters{
    display:flex!important;
    flex-wrap:nowrap!important;
    gap:6px!important;
    min-width:max-content!important;
  }

  /* Stable two-column product grid */
  .category-products-grid{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
    width:100%!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
  }

  .category-product{
    display:flex!important;
    flex-direction:column!important;
    width:auto!important;
    min-width:0!important;
    height:100%!important;
    margin:0!important;
    padding:9px!important;
    overflow:hidden!important;
    border-radius:12px!important;
  }

  .category-product-media{
    position:relative!important;
    width:100%!important;
    height:150px!important;
    min-height:150px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    overflow:hidden!important;
  }

  .category-product-media img{
    width:auto!important;
    max-width:100%!important;
    height:auto!important;
    max-height:138px!important;
    object-fit:contain!important;
    display:block!important;
  }

  .product-top-actions{
    position:absolute!important;
    inset:0!important;
    pointer-events:none!important;
    z-index:5!important;
  }

  .product-top-actions button,
  .product-top-actions a{
    pointer-events:auto!important;
  }

  .category-product-body{
    display:flex!important;
    flex:1 1 auto!important;
    flex-direction:column!important;
    min-width:0!important;
  }

  .product-meta-row{
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:5px!important;
    min-width:0!important;
  }

  .product-brand-link{
    min-width:0!important;
    max-width:65%!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }

  .stock-badge{
    flex:0 0 auto!important;
    max-width:45%!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }

  .category-product h3{
    margin:5px 0!important;
    min-height:43px!important;
    font-size:13px!important;
    line-height:1.65!important;
  }

  .product-title-link{
    display:-webkit-box!important;
    -webkit-box-orient:vertical!important;
    -webkit-line-clamp:2!important;
    overflow:hidden!important;
  }

  .product-rating-row{
    min-height:24px!important;
  }

  .product-price-row{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:end!important;
    gap:5px!important;
    width:100%!important;
    margin-top:auto!important;
  }

  .price-stack{
    min-width:0!important;
    display:flex!important;
    flex-direction:column!important;
  }

  .old-price,
  .sale-price{
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }

  .sale-price{
    font-size:14px!important;
    line-height:1.5!important;
  }

  .discount-pill{
    align-self:end!important;
    flex:0 0 auto!important;
  }

  .purchase-area{
    min-width:0!important;
    width:100%!important;
    margin-top:8px!important;
  }

  .purchase-btn{
    width:100%!important;
    min-height:40px!important;
  }

  .qty-panel{
    width:100%!important;
    display:grid!important;
    grid-template-columns:40px minmax(0,1fr) 40px!important;
    align-items:center!important;
  }

  .stock-limit{
    display:block!important;
    width:100%!important;
    margin-top:5px!important;
    line-height:1.55!important;
  }
}

@media(max-width:390px){
  .category-layout{padding-inline:7px!important}
  .category-products-grid{gap:7px!important}
  .category-product{padding:7px!important}
  .category-product-media{
    height:132px!important;
    min-height:132px!important;
  }
  .category-product-media img{max-height:122px!important}
  .category-product h3{font-size:12px!important}
  .sale-price{font-size:13px!important}
}
