/* DaruGet category pages — authoritative layout, filters, grid & mobile comparison */
.category-page,
.category-page *{box-sizing:border-box}

/* Main layout */
.category-page .category-content>.category-layout{
  display:grid!important;
  grid-template-columns:240px minmax(0,1fr)!important;
  gap:18px!important;
  align-items:start!important;
}
.category-page .products-area{
  min-width:0!important;width:100%!important;
  overflow:visible!important;background:#fff!important;
}

/* Toolbar only */
.category-page .filters-control-row{
  display:flex!important;align-items:center!important;justify-content:flex-end!important;
  width:100%!important;min-width:0!important;min-height:50px!important;
  gap:8px!important;padding:9px 10px!important;margin:0 0 8px!important;
  position:relative!important;inset:auto!important;z-index:4!important;
  background:#fff!important;background-image:none!important;
  border:1px solid #e6ece8!important;border-radius:15px!important;
  box-shadow:none!important;transform:none!important;
}
.category-page .toolbar-actions{
  display:flex!important;align-items:center!important;justify-content:flex-end!important;
  flex-wrap:wrap!important;gap:7px!important;min-width:0!important;max-width:100%!important;
}
.category-page .product-count{white-space:nowrap!important}
.category-page .view-switch{display:flex!important;flex:0 0 auto!important}

/* Selected filters have their own row */
.category-page .active-filters-row{
  display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;
  padding:8px 10px!important;margin:0 0 10px!important;position:relative!important;inset:auto!important;
  z-index:3!important;overflow:hidden!important;background:#f9fcfa!important;background-image:none!important;
  border:1px solid #e5eee8!important;border-radius:14px!important;
}
.category-page .active-filters-row.is-empty{
  display:none!important;height:0!important;min-height:0!important;padding:0!important;margin:0!important;border:0!important;
}
.category-page .active-filters{
  display:flex!important;align-items:center!important;justify-content:flex-start!important;
  flex-wrap:wrap!important;gap:7px!important;width:100%!important;min-width:0!important;
  margin:0!important;padding:0!important;position:static!important;transform:none!important;
}
.category-page .active-filters.is-empty{display:none!important}
.category-page .filter-hint{display:none!important}
.category-page .active-filter-chip{
  display:inline-flex!important;align-items:center!important;gap:5px!important;
  max-width:100%!important;padding:6px 10px!important;margin:0!important;
  position:static!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
  border:1px solid #d8e8dd!important;border-radius:999px!important;background:#f1f9f4!important;color:#176139!important;
  font-size:12px!important;font-weight:800!important;line-height:1.5!important;
}

/* Filter panel */
.category-page .filter-panel{
  position:sticky!important;top:88px!important;max-height:calc(100vh - 104px)!important;
  overflow:auto!important;background:#fff!important;background-image:none!important;
}

/* Grid */
.category-page .category-products-grid{
  display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:14px!important;align-items:stretch!important;width:100%!important;min-width:0!important;margin:0!important;
}
.category-page .category-product{
  display:flex!important;flex-direction:column!important;width:auto!important;min-width:0!important;height:100%!important;
  position:relative!important;overflow:hidden!important;isolation:isolate!important;
  background:#fff!important;background-image:none!important;border:1px solid #e4ebe7!important;border-radius:18px!important;
  box-shadow:0 7px 22px rgba(15,23,42,.045)!important;transform:none!important;
}
.category-page .category-product::before,.category-page .category-product::after,
.category-page .category-product-media::before,.category-page .category-product-media::after{
  content:none!important;display:none!important;background:none!important;
}
.category-page .category-product.hidden{display:none!important}
.category-page .category-product:hover{
  transform:translateY(-2px)!important;background:#fff!important;background-image:none!important;
  box-shadow:0 12px 30px rgba(15,23,42,.08)!important;border-color:#cbded1!important;
}
.category-page .category-product-media{
  display:grid!important;place-items:center!important;width:100%!important;height:205px!important;min-height:205px!important;
  padding:8px!important;overflow:hidden!important;background:#fff!important;background-image:none!important;
  border-bottom:1px solid #eff3f0!important;
}
.category-page .category-product-media img{
  display:block!important;width:100%!important;height:100%!important;max-width:none!important;
  object-fit:contain!important;padding:0!important;transform:none!important;transform-origin:center!important;
  mix-blend-mode:normal!important;filter:none!important;opacity:1!important;background:transparent!important;
}
.category-page .category-product-body{
  display:flex!important;flex-direction:column!important;flex:1 1 auto!important;
  min-width:0!important;padding:14px!important;background:#fff!important;background-image:none!important;
}
.category-page .category-product h3{min-height:50px!important;margin:6px 0!important}
.category-page .category-product p{min-height:38px!important;margin:0 0 12px!important}
.category-page .product-price-row{margin-top:auto!important}

/* List */
.category-page .category-products-grid.list-view{grid-template-columns:1fr!important;gap:12px!important}
.category-page .category-products-grid.list-view .category-product{
  display:grid!important;grid-template-columns:190px minmax(0,1fr)!important;height:auto!important;min-height:210px!important;
}
.category-page .category-products-grid.list-view .category-product-media{
  height:100%!important;min-height:210px!important;border-bottom:0!important;border-left:1px solid #eff3f0!important;
}
.category-page .category-products-grid.list-view .category-product h3,
.category-page .category-products-grid.list-view .category-product p{min-height:0!important}

/* Comparison — desktop */
.category-page~.compare-bar,
.compare-bar{
  --mobile-nav-clearance:0px;
}
body .compare-bar{
  position:fixed!important;right:50%!important;bottom:18px!important;transform:translate(50%,140%)!important;
  z-index:85!important;width:min(780px,calc(100% - 28px))!important;
  display:grid!important;grid-template-columns:auto minmax(0,1fr) auto!important;align-items:center!important;
  gap:12px!important;padding:11px 12px!important;background:#0f172a!important;color:#fff!important;
  border:1px solid rgba(255,255,255,.12)!important;border-radius:17px!important;
  box-shadow:0 18px 50px rgba(15,23,42,.28)!important;transition:transform .28s ease,opacity .28s ease!important;
  opacity:0!important;pointer-events:none!important;
}
body .compare-bar.show{transform:translate(50%,0)!important;opacity:1!important;pointer-events:auto!important}
body .compare-head{display:flex!important;align-items:center!important;gap:8px!important}
body .compare-title-wrap{display:flex!important;flex-direction:column!important;min-width:max-content!important}
body .compare-title-wrap strong{font-size:12px!important}
body .compare-title-wrap small{font-size:12px!important;color:#cbd5e1!important;margin-top:2px!important}
body .compare-close-mobile{display:none!important}
body .compare-items{
  display:flex!important;align-items:center!important;gap:6px!important;min-width:0!important;
  overflow-x:auto!important;overflow-y:hidden!important;scrollbar-width:none!important;
}
body .compare-items::-webkit-scrollbar{display:none}
body .compare-item{
  flex:0 0 auto!important;max-width:150px!important;padding:7px 9px!important;border-radius:10px!important;
  background:rgba(255,255,255,.09)!important;font-size:12px!important;white-space:nowrap!important;
  overflow:hidden!important;text-overflow:ellipsis!important;
}
body .compare-actions{display:flex!important;align-items:center!important;gap:6px!important}
body .compare-actions button{
  height:38px!important;border:0!important;border-radius:10px!important;padding:0 12px!important;
  font-weight:900!important;white-space:nowrap!important;
}
body .compare-submit{background:#22c55e!important;color:#052e16!important}
body .clear-compare{background:rgba(255,255,255,.1)!important;color:#fff!important}

/* Hide category comparison on every non-category page */
body:not(.is-category-page) .compare-bar{display:none!important}

/* Tablet */
@media(max-width:980px){
  .category-page .category-content>.category-layout{grid-template-columns:1fr!important}
  .category-page .category-products-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .category-page .filter-panel{
    position:fixed!important;top:0!important;right:0!important;bottom:0!important;width:min(340px,88vw)!important;
    max-height:none!important;overflow:auto!important;z-index:100!important;transform:translateX(105%)!important;border-radius:0!important;
  }
  .category-page .filter-panel.open{transform:translateX(0)!important}
  .category-page .filters-control-row{justify-content:stretch!important}
  .category-page .toolbar-actions{width:100%!important;justify-content:space-between!important}
}

/* Mobile comparison sits above bottom navigation, never in footer */
@media(max-width:680px){
  .category-page{padding-bottom:88px!important}
  .category-page .view-switch{display:none!important}
  .category-page .filters-control-row{min-height:0!important;padding:8px!important}
  .category-page .toolbar-actions{gap:6px!important}
  .category-page .active-filters-row{padding:7px 8px!important;margin-bottom:9px!important}
  .category-page .category-products-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  .category-page .category-product-media{height:158px!important;min-height:158px!important;padding:6px!important}
  .category-page .category-product-media img{transform:scale(1.10)!important}
  .category-page .category-product-body{padding:11px!important}

  body.is-category-page .compare-bar{
    right:8px!important;left:8px!important;bottom:calc(76px + env(safe-area-inset-bottom,0px))!important;
    transform:translateY(calc(100% + 110px))!important;width:auto!important;max-width:none!important;
    grid-template-columns:1fr!important;gap:8px!important;padding:10px!important;border-radius:15px!important;
    max-height:min(46vh,340px)!important;overflow:hidden!important;
  }
  body.is-category-page .compare-bar.show{transform:translateY(0)!important}
  body.is-category-page .compare-head{justify-content:space-between!important}
  body.is-category-page .compare-title-wrap{min-width:0!important}
  body.is-category-page .compare-title-wrap strong{font-size:12px!important}
  body.is-category-page .compare-close-mobile{
    display:grid!important;place-items:center!important;width:30px!important;height:30px!important;flex:0 0 30px!important;
    border:0!important;border-radius:9px!important;background:rgba(255,255,255,.10)!important;color:#fff!important;
    font-size:19px!important;padding:0!important;
  }
  body.is-category-page .compare-items{
    width:100%!important;min-height:35px!important;padding-bottom:1px!important;
  }
  body.is-category-page .compare-item{
    max-width:170px!important;padding:7px 9px!important;font-size:12px!important;
  }
  body.is-category-page .compare-actions{
    display:grid!important;grid-template-columns:1fr 1.4fr!important;width:100%!important;gap:7px!important;
  }
  body.is-category-page .compare-actions button{width:100%!important;height:40px!important}
}

/* Narrow phones */
@media(max-width:460px){
  .category-page .category-products-grid,
  .category-page .category-products-grid.list-view{grid-template-columns:1fr!important}
  .category-page .category-product-media,
  .category-page .category-products-grid.list-view .category-product-media{height:220px!important;min-height:220px!important}
  .category-page .sort-box{flex:1 1 145px!important;min-width:0!important}
  body.is-category-page .compare-bar{right:6px!important;left:6px!important;padding:9px!important}
}

/* Stable image rendering patch */
.category-page .category-product-media{
  background:#fff!important;
  overflow:hidden!important;
}
.category-page .category-product-media img{
  display:block!important;
  width:100%!important;
  height:100%!important;
  object-fit:contain!important;
  object-position:center!important;
  transform:none!important;
  opacity:1!important;
  visibility:visible!important;
  filter:none!important;
  mix-blend-mode:normal!important;
  background:#fff!important;
}

/* FINAL category product image fit */
.category-page .category-product-media{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
  padding:0!important;
  background:#fff!important;
}
.category-page .category-product-media img{
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  max-height:100%!important;
  object-fit:contain!important;
  object-position:center!important;
  margin:0!important;
  padding:2px!important;
  transform:none!important;
  filter:none!important;
  opacity:1!important;
  visibility:visible!important;
}
.category-page .category-product-media picture{
  display:block!important;
  width:100%!important;
  height:100%!important;
}
.category-page .category-product-media picture img{
  width:100%!important;
  height:100%!important;
}
