/* Two ranked Community groups in the existing Home Community shelf. */
#view-home.cw-home-v11 #hwCommunity[data-all-products-replacement="true"] #hwCommunityGrid {
  display:none!important;
}

#view-home.cw-home-v11 #hwCommunity #hwAllProductsGrid.hw-all-products-grid {
  display:block;
  align-content:start;
}

body#typewriterWorkshop #view-home.cw-home-v11 #hwAllProductsGrid .hw-all-product-card {
  display:grid;
  grid-template-columns:max-content minmax(0,1fr);
  grid-template-rows:auto minmax(0,1fr) auto;
  min-width:0;
  container-type:inline-size;
}

/* Neutral white cards; both shelves share the same neutral-gray image board. */
body#typewriterWorkshop #view-home.cw-home-v11 :is(#hwReadyGrid > article,#hwAllProductsGrid .hw-all-products-row-grid > article) {
  display:flex;
  flex-direction:column;
  min-width:0;
  padding:0;
  border:0;
  border-radius:0;
  background:#ffffff;
  box-shadow:none;
}
body#typewriterWorkshop #view-home.cw-home-v11 :is(#hwAllProductsGrid,#hwReadyGrid) .hw-card-state { order:4; margin-inline:20px; }
body#typewriterWorkshop #view-home.cw-home-v11 :is(#hwAllProductsGrid,#hwReadyGrid) .hw-card-state:empty { display:none; }

/* Home shelf framing is independent of the image URL or cutout-map version. */
#typewriterWorkshop #view-home.cw-home-v11 #hwAllProductsGrid .hw-media {
  --ready-art-board:#f5f5f5!important;
  --phase2-product-size:74%!important;
}

#typewriterWorkshop #view-home.cw-home-v11 #hwReadyGrid .hw-media {
  --ready-art-board:#f5f5f5!important;
  --phase2-product-size:74%!important;
}

#typewriterWorkshop #view-home.cw-home-v11 :is(#hwAllProductsGrid,#hwReadyGrid) .hw-media {
  position:relative;
  display:block;
  aspect-ratio:1;
  border-radius:4px;
  background:var(--ready-art-board)!important;
}

/* Existing cutout layers keep their own aligned base/tissue/shadow rules. */
#typewriterWorkshop #view-home.cw-home-v11 :is(#hwAllProductsGrid,#hwReadyGrid) .hw-media>img:not(.phase2-product-base):not(.phase2-product-tissue) {
  position:absolute!important;
  inset:auto!important;
  top:50%!important;
  left:50%!important;
  width:var(--phase2-product-size)!important;
  height:var(--phase2-product-size)!important;
  max-width:none;
  max-height:none;
  padding:0!important;
  object-fit:contain;
  object-position:center;
  transform:translate(-50%,-50%)!important;
  background:transparent!important;
}

#view-home.cw-home-v11 #hwAllProductsGrid .hw-all-product-ai {
  position:absolute;
  top:9px;
  right:9px;
  z-index:5;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  padding:7px 10px;
  border:1px solid rgba(0,0,0,.18);
  border-radius:999px;
  background:rgba(255,255,255,.94);
  box-shadow:0 4px 14px rgba(0,0,0,.09);
  color:var(--hw-ai-accent,#171717);
  font-size:11px;
  font-weight:600;
  line-height:1.2;
  text-decoration:none;
  white-space:nowrap;
}

#view-home.cw-home-v11 #hwAllProductsGrid .hw-all-product-card .hw-community-image {
  grid-column:1 / -1;
  grid-row:1;
}

#view-home.cw-home-v11 #hwAllProductsGrid .hw-all-product-card h3 {
  grid-column:1 / -1;
  grid-row:2;
  margin:13px 0 3px;
  overflow-wrap:anywhere;
}

#view-home.cw-home-v11 #hwAllProductsGrid .hw-all-product-card .hw-card-state {
  grid-column:1 / -1;
  grid-row:4;
}

#view-home.cw-home-v11 #hwAllProductsGrid .hw-all-product-price {
  grid-column:1;
  grid-row:3;
  display:flex;
  align-items:baseline;
  gap:7px;
  align-self:center;
  margin:0;
  color:var(--hw-ink,#171717);
  font-size:15px;
  font-weight:600;
  font-variant-numeric:tabular-nums;
  line-height:1.5;
}

#view-home.cw-home-v11 #hwAllProductsGrid .hw-all-product-price-original {
  color:var(--hw-muted,#6d716c);
  font-size:12px;
  font-weight:400;
  text-decoration-thickness:1px;
}

#view-home.cw-home-v11 #hwAllProductsGrid .hw-all-product-actions {
  grid-column:2;
  grid-row:3;
  align-self:stretch;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:8px 10px;
  margin-top:0;
  padding-top:12px;
}

#view-home.cw-home-v11 #hwAllProductsGrid .hw-all-product-detail {
  min-height:44px;
}

#view-home.cw-home-v11 #hwAllProductsGrid .hw-all-product-add {
  margin-left:0;
}

@container (max-width:280px) {
  #view-home.cw-home-v11 #hwAllProductsGrid .hw-all-product-card .hw-card-state {
    grid-row:5;
  }

  #view-home.cw-home-v11 #hwAllProductsGrid .hw-all-product-price {
    grid-column:1 / -1;
    grid-row:3;
  }

  #view-home.cw-home-v11 #hwAllProductsGrid .hw-all-product-actions {
    grid-column:1 / -1;
    grid-row:4;
    justify-content:flex-end;
  }
}

#view-home.cw-home-v11 #hwAllProductsGrid .hw-all-product-add:disabled {
  cursor:not-allowed;
  opacity:.55;
}

#view-home.cw-home-v11 #hwAllProductsGrid .hw-all-products-status {
  min-height:96px;
}

#view-home.cw-home-v11 #hwAllProductsGrid .hw-all-products-status .btn {
  margin-top:12px;
}

#view-home.cw-home-v11 #hwAllProductsGrid :where(a,button):focus-visible {
  outline:2px solid var(--hw-ink,#171717);
  outline-offset:3px;
}

/* Each group owns a grid so a short first group never leaks into the second. */
#view-home.cw-home-v11 #hwAllProductsGrid .hw-all-products-row + .hw-all-products-row {
  margin-top:clamp(28px,4vw,48px);
}

#view-home.cw-home-v11 #hwAllProductsGrid .hw-all-products-row-title {
  margin:0 0 12px;
  color:var(--hw-muted,#696969);
  font-size:12px;
  font-weight:600;
  letter-spacing:.08em;
  line-height:1.2;
  text-transform:uppercase;
}

#view-home.cw-home-v11 #hwAllProductsGrid .hw-all-products-row-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:var(--hw-community-gap,20px);
}

@media (max-width:900px) {
  #view-home.cw-home-v11 #hwAllProductsGrid .hw-all-products-row-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media (max-width:560px) {
  #view-home.cw-home-v11 #hwAllProductsGrid .hw-all-products-row-grid {
    grid-template-columns:minmax(0,1fr);
  }
}

/* Keep price and actions on the same row inside ranked shelf wrappers. */
body#typewriterWorkshop #view-home.cw-home-v11 #hwAllProductsGrid .hw-all-products-row-grid > article.hw-all-product-card { display:grid; }
