/* /products — filterable portfolio.
   Markup is emitted by layouts/partials/products_grid.html.
   Per-group colour comes in via the --group-color custom property. */

.products-page-title {
  margin-top: 1em;
  margin-bottom: 0.25em;
  color: #38a7bb;
}

.products-page-intro {
  color: #666;
  margin-bottom: 1.5em;
  max-width: 60em;
}

.products-viewer {
  margin: 1em 0 3em;
}

/* === filter bar === */

.products-filter-bar {
  background: #f7f9fa;
  border: 1px solid #e3e8eb;
  border-radius: 4px;
  padding: 1em 1.25em 0.75em;
  margin-bottom: 1.75em;
}

.products-filter-toggle {
  display: none;
  cursor: pointer;
  font-weight: 600;
  color: #38a7bb;
  list-style: none;
  margin-bottom: 0.5em;
}

.products-filter-toggle::-webkit-details-marker { display: none; }

.filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5em 0.75em;
  padding: 0.5em 0;
  border-bottom: 1px solid #ecf0f2;
}

.filter-group:last-child { border-bottom: 0; }

.filter-group-label {
  flex: 0 0 7em;
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--group-color, #555);
}

.filter-group-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
}

.filter-btn {
  font: inherit;
  font-size: 0.85em;
  padding: 0.3em 0.85em;
  border: 1px solid var(--group-color, #aaa);
  border-radius: 999px;
  background: #fff;
  color: var(--group-color, #333);
  cursor: pointer;
  transition: background-color 120ms, color 120ms, transform 120ms;
}

.filter-btn:hover {
  background: var(--group-color, #eee);
  color: #fff;
}

.filter-btn.is-active {
  background: var(--group-color, #333);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
}

/* === grid === */

.products-grid {
  /* Isotope handles positioning; this is fallback before init. */
  display: flex;
  flex-wrap: wrap;
  margin: 0 -0.5em;
}

.product-card {
  width: 25%;                      /* desktop: 4 across */
  padding: 0.5em;
  box-sizing: border-box;
}

@media (max-width: 991px) {
  .product-card { width: 33.3333%; }   /* tablet: 3 across */
}

@media (max-width: 767px) {
  .product-card { width: 50%; }        /* small: 2 across */
}

@media (max-width: 480px) {
  .product-card { width: 100%; }       /* phone: 1 */
}

.product-card-link {
  display: block;
  height: 100%;
  background: #fff;
  border: 1px solid #e8ecee;
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.product-card-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(20, 40, 60, 0.10);
  border-color: #38a7bb;
  text-decoration: none;
}

.product-card-image {
  position: relative;
  width: 100%;
  padding-top: 56.25%;             /* 16:9 */
  background: #eef2f4;
  overflow: hidden;
}

.product-card-image img,
.product-card-image-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-image-placeholder {
  background:
    linear-gradient(135deg, #eef2f4 25%, #e3e8eb 25%, #e3e8eb 50%, #eef2f4 50%, #eef2f4 75%, #e3e8eb 75%);
  background-size: 14px 14px;
}

.product-card-body {
  padding: 0.85em 1em 1em;
}

.product-card-title {
  margin: 0 0 0.35em;
  font-size: 1em;
  font-weight: 600;
  line-height: 1.3;
  color: #1f3947;
}

.product-card-summary {
  margin: 0;
  font-size: 0.85em;
  line-height: 1.45;
  color: #5b6b74;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === homepage highlights variant === */

/* 3 across on desktop; cards keep variable heights for a masonry feel.
   Imageless cards skip the image area entirely (the partial omits the
   .product-card-image wrapper), so they sit compact next to image cards. */
.products-grid--highlights .product-card { width: 33.3333%; }

@media (max-width: 991px) {
  .products-grid--highlights .product-card { width: 50%; }
}

@media (max-width: 600px) {
  .products-grid--highlights .product-card { width: 100%; }
}

.products-grid--highlights {
  align-items: flex-start;
}

.products-highlights .heading h2 {
  margin-top: 0.5em;
}

.products-highlights .lead {
  color: #666;
  margin-bottom: 2em;
}

/* === single product page === */

.product-single-title {
  margin-top: 0.5em;
  color: #1f3947;
}

.product-single-image {
  border-radius: 4px;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.product-links {
  margin: 1.5em 0;
}

.product-links .btn { margin-right: 0.5em; }

.back-to-products {
  margin-top: 2em;
  font-size: 0.9em;
}

/* === mobile filter collapse === */

@media (max-width: 600px) {
  .products-filter-bar { padding: 0.75em 1em; }
  .products-filter-bar:not([open]) .filter-group { display: none; }
  .products-filter-toggle { display: block; }
  .filter-group-label { flex-basis: 100%; }
}
