.cement-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.cement-filters[hidden],
.cement-filters:empty {
  display: none;
}

.subfilter-hint {
  color: var(--color-text-secondary);
  font-size: .78rem;
}

.subfilter-hint:empty {
  display: none;
}

.cement-subfilters-active .category-badge-chip {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-primary-navy);
  font-size: .9rem;
}

.cement-subfilters-active .subfilter-pill-group {
  flex-wrap: wrap !important;
  overflow: visible !important;
  gap: 6px;
  padding: 0;
}

.cement-subfilters-active .subfilter-pill {
  min-height: 40px;
  padding-inline: 10px;
  white-space: normal;
}

.cement-subfilters-active .subfilter-pill:is(.active, :hover) {
  border-color: #f3be82;
  background: #fff1e1;
  color: #843600;
}

#cementFilters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
}

#cementFilters:has(details[open]) {
  grid-template-columns: minmax(0, 1fr);
}

.cement-advanced-filters summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid #b9c7d6;
  border-radius: 8px;
  color: var(--color-primary-navy);
  cursor: pointer;
  font-size: .85rem;
  font-weight: 700;
}

.cement-advanced-filters summary::after {
  content: "+";
  font-size: 1rem;
}

.cement-advanced-filters[open] summary::after {
  content: "−";
}

.cement-advanced-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.cement-filter-field {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: #061426;
  font-size: .85rem;
  font-weight: 700;
}

.cement-filter-field select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 6px 8px;
  border: 1px solid #b9c7d6;
  border-radius: 8px;
  background: white;
  color: #061426;
  font: inherit;
}

.cement-product-card .product-item-thumb,
.cement-detail .gallery-main {
  background: radial-gradient(ellipse at 50% 40%, #fff 12%, #eef2f7 88%);
}

.cement-product-card .product-item-thumb {
  aspect-ratio: 1.22;
  border-bottom: 1px solid #e6ebf1;
}

.cement-product-card .product-item-thumb img[data-cement-photo] {
  padding: clamp(7px, 1vw, 14px);
  object-fit: contain;
  mix-blend-mode: multiply;
}

.cement-photo-fallback {
  display: grid;
  height: 100%;
  align-content: center;
  justify-items: center;
  gap: 4px;
  padding: 8px;
  background: #f3f6f9;
  color: var(--color-text-secondary);
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

.cement-product-card .cement-photo-fallback img,
.cement-detail .cement-photo-fallback img {
  width: min(100%, 165px);
  height: 36px;
  object-fit: cover;
  object-position: center 48%;
  transform: none;
}

.cement-card-brand {
  color: var(--orange-text);
  font-size: .73rem;
  font-weight: 750;
  line-height: 1.2;
}

.cement-product-card .product-item-title {
  flex: initial;
  margin: 0;
}

.cement-product-card .product-card-details-link {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  margin-top: 0;
}

.cement-product-card .cement-card-pack {
  color: #475569;
  font-size: .77rem;
  line-height: 1.35;
}

.cement-detail-pack {
  margin-bottom: 16px;
  color: #475569;
  font-size: .9rem;
}

.cement-product-card .product-price-row {
  margin-top: auto;
  padding-top: 5px;
}

.cement-product-card :is(.product-price-label, .product-qty-row, .card-subtotal-text) {
  margin-bottom: 0;
}

.cement-detail .gallery-main {
  border: 1px solid #e6ebf1;
}

.cement-detail .gallery-main:has(.cement-photo-fallback) {
  aspect-ratio: 1.7;
  max-height: 280px;
}

.cement-detail .gallery-main .cement-zoom-trigger img {
  max-height: min(100%, var(--packshot-display-height, 100%));
  mix-blend-mode: multiply;
}

.gallery-main:has(.cement-zoom-trigger) {
  position: relative;
}

.cement-zoom-trigger {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: clamp(12px, 2.3vw, 34px);
  cursor: zoom-in;
}

.cement-zoom-trigger img {
  display: block;
}

.cement-zoom-trigger:focus-visible {
  outline-offset: -4px;
}

.cement-packshot-dialog {
  position: fixed;
  inset: 0;
  width: min(90vw, 790px);
  max-height: 92vh;
  margin: auto;
  padding: 14px;
  border: 1px solid #d9e3ed;
  border-radius: 12px;
  background: white;
}

.cement-packshot-dialog::backdrop {
  background: #061426c2;
}

.cement-packshot-dialog form {
  display: flex;
  justify-content: flex-end;
}

.cement-packshot-dialog button {
  min-height: 44px;
  padding: 6px 14px;
  border-radius: 6px;
  background: #061426;
  color: white;
  font-weight: 700;
}

.cement-packshot-dialog img {
  display: block;
  width: 100%;
  height: min(72vh, calc(var(--packshot-display-height, 440px) * 1.5));
  margin: 0 auto;
  object-fit: contain;
}

.details-section .cement-source-link {
  color: #984100;
  text-decoration: underline;
}

@media (width < 600px) {
  .cement-subfilters-active {
    padding: 11px;
  }

  .cement-subfilters-active .subfilter-pill {
    padding-inline: 8px;
    font-size: .76rem;
  }

  .cement-product-card .product-qty-row {
    gap: 3px 6px;
  }

  .cement-product-card .qty-control {
    display: grid;
    width: 100%;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }

  .cement-product-card .qty-input {
    width: 100% !important;
  }
}
