/* DS Informática — página de categoria | layout compacto */
.category-page { min-height: 60vh; padding-bottom: 38px; background: #f7f9fc; }
.category-hero { padding: 16px 0 12px; }
.category-hero-inner { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 16px; align-items: center; min-height: 0; padding: 18px 22px; background: #fff; border: 1px solid #e7ebf1; border-radius: 12px; }
.category-breadcrumb { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; color: #98a2b3; font-size: 11px; }
.category-breadcrumb a { color: #667085; text-decoration: none; }
.category-breadcrumb a:hover { color: #155eef; }
.category-eyebrow { display: none; }
.category-hero h1 { margin: 0; color: #111827; font-size: clamp(22px,2.5vw,30px); line-height: 1.15; letter-spacing: -.025em; }
.category-description { max-width: 720px; margin: 6px 0 0; color: #667085; font-size: 12px; line-height: 1.45; }
.category-count { display: inline-flex; margin-top: 8px; padding: 4px 8px; background: #f2f6fc; border-radius: 999px; color: #475467; font-size: 10px; font-weight: 700; }
.category-hero-image { display: flex; width: 100px; height: 75px; align-items: center; justify-content: center; padding: 4px; overflow: hidden; }
.category-hero-image img { display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; }
.category-catalog { padding-top: 4px; }
.category-toolbar { display: flex; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 14px; padding: 12px 16px; background: #fff; border: 1px solid #e7ebf1; border-radius: 10px; }
.category-toolbar h2 { margin: 0; color: #172033; font-size: 16px; letter-spacing: -.015em; }
.category-toolbar .search { width: min(320px,100%); min-height: 36px; font-size: 12px; }
.category-no-results { display: none; margin-top: 20px; text-align: center; }
.category-empty { padding: 36px 20px; background: #fff; border: 1px solid #e7ebf1; border-radius: 12px; text-align: center; }
.category-empty strong { display: block; margin-bottom: 8px; color: #172033; font-size: 18px; }
.category-empty p { margin: 0 auto 20px; max-width: 560px; color: #667085; line-height: 1.6; }

/* Escopo exclusivo da listagem de categorias: não afeta produto.php ou a Home. */
.category-page #categoryGrid.grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 12px; align-items: stretch; }
.category-page #categoryGrid .product { min-width: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid #e5eaf1; border-radius: 10px; background: #fff; box-shadow: none; }
.category-page #categoryGrid .product[hidden] { display: none !important; }
.category-page #categoryGrid .product > .category-product-image-link,
.category-page #categoryGrid .product > .product-image-placeholder { display: block; box-sizing: border-box; width: 100%; height: 154px; max-height: 154px; padding: 9px; object-fit: contain; background: #fff; border-bottom: 1px solid #f0f2f6; }
.category-page #categoryGrid .product > .product-image-placeholder { display: grid; place-items: center; font-size: 12px; color: #98a2b3; }
.category-page #categoryGrid .product-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 5px; padding: 10px; }
.category-page #categoryGrid .product-body > small:first-child { margin: 0; font-size: 9px; color: #667085; }
.category-page #categoryGrid .product h3 { min-height: 0; margin: 0; font-size: 12px; line-height: 1.35; font-weight: 650; overflow-wrap: anywhere; }
.category-page #categoryGrid .product-body > p { display: none; }
.category-page #categoryGrid .price { margin-top: auto; font-size: 17px; line-height: 1.2; font-weight: 800; }
.category-page #categoryGrid .product-body > small { font-size: 10px; line-height: 1.3; }
.category-page #categoryGrid .actions { display: grid; grid-template-columns: 1fr 1.2fr; gap: 5px; margin-top: 7px; }
.category-page #categoryGrid .actions .btn { box-sizing: border-box; width: 100%; min-height: 31px; padding: 5px 6px; border-radius: 6px; font-size: 10px; line-height: 1.15; }

@media (max-width: 1200px) { .category-page #categoryGrid.grid { grid-template-columns: repeat(5,minmax(0,1fr)); } }
@media (max-width: 980px) { .category-page #categoryGrid.grid { grid-template-columns: repeat(4,minmax(0,1fr)); } }
@media (max-width: 760px) {
  .category-page #categoryGrid.grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .category-hero-inner { grid-template-columns: minmax(0,1fr) auto; }
  .category-hero-image { width: 75px; height: 65px; }
  .category-toolbar { align-items: stretch; flex-direction: column; }
  .category-toolbar .search { width: 100%; }
}
@media (max-width: 560px) {
  .category-page { padding-bottom: 28px; }
  .category-hero { padding: 10px 0; }
  .category-hero-inner { padding: 13px; gap: 8px; }
  .category-hero h1 { font-size: 22px; }
  .category-description { font-size: 11px; }
  .category-hero-image { width: 60px; height: 55px; }
  .category-toolbar { padding: 10px; margin-bottom: 10px; }
  .category-toolbar h2 { font-size: 14px; }
  .category-page #categoryGrid.grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .category-page #categoryGrid .product > img,
  .category-page #categoryGrid .product > .product-image-placeholder { height: 135px; max-height: 135px; padding: 7px; }
  .category-page #categoryGrid .product-body { padding: 8px; }
  .category-page #categoryGrid .product h3 { font-size: 11px; }
  .category-page #categoryGrid .price { font-size: 15px; }
  .category-page #categoryGrid .actions { grid-template-columns: 1fr; }
  .category-page #categoryGrid .actions .btn { min-height: 30px; }
}

/* Links clicáveis somente nos cards da categoria. */
.category-page #categoryGrid .category-product-image-link { text-decoration: none; color: inherit; overflow: hidden; }
.category-page #categoryGrid .category-product-image-link img { display: block; width: 100%; height: 100%; object-fit: contain; }
.category-page #categoryGrid .category-product-title-link { color: inherit; text-decoration: none; }
.category-page #categoryGrid .category-product-title-link:hover { color: #155eef; }
.category-page #categoryGrid .category-product-title-link:focus-visible,
.category-page #categoryGrid .category-product-image-link:focus-visible { outline: 2px solid #155eef; outline-offset: -2px; }

/* V3: limita a foto mesmo quando envolvida por um link. */
.category-page #categoryGrid .product > a.category-product-image-link {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 154px; min-height: 154px; max-height: 154px;
  box-sizing: border-box; padding: 9px; overflow: hidden; flex: 0 0 154px;
}
.category-page #categoryGrid .product > a.category-product-image-link > img {
  display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%;
  min-height: 0; object-fit: contain; margin: 0; padding: 0;
}
@media (max-width: 560px) {
  .category-page #categoryGrid .product > a.category-product-image-link {
    height: 135px; min-height: 135px; max-height: 135px; flex-basis: 135px; padding: 7px;
  }
}
