.product-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.role-grid.public-role-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}


.product-preview {
  appearance: none;
  display: grid;
  grid-template-rows: auto auto;
  gap: 0;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: zoom-in;
  box-shadow: 0 12px 32px rgba(12, 13, 99, 0.06);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.product-preview:hover,
.product-preview:focus-visible {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 42px rgba(11, 36, 66, 0.14);
}

.product-preview:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.product-preview img {
  width: 100%;
  height: auto;
  aspect-ratio: 640 / 334;
  object-fit: cover;
  object-position: top left;
  background: #050b14;
}

.product-preview:first-child img {
  aspect-ratio: 640 / 314;
}

.product-preview span {
  display: block;
  padding: 14px 16px 16px;
  font-weight: 800;
  line-height: 1.3;
}

.product-lightbox {
  width: min(96vw, 1600px);
  max-width: none;
  max-height: 94vh;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: #050b14;
  color: #ffffff;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
}

.product-lightbox::backdrop {
  background: rgba(2, 8, 18, 0.82);
  backdrop-filter: blur(4px);
}

.product-lightbox-shell {
  display: grid;
  max-height: 94vh;
  grid-template-rows: auto minmax(0, 1fr);
}

.product-lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 14px 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.product-lightbox-bar h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.product-lightbox-close {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font: inherit;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.product-lightbox-close:hover,
.product-lightbox-close:focus-visible {
  background: rgba(255, 255, 255, 0.16);
}

.product-lightbox-close:focus-visible {
  outline: 3px solid #5bbcf2;
  outline-offset: 2px;
}

.product-lightbox img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: calc(94vh - 70px);
  object-fit: contain;
  object-position: top center;
  background: #050b14;
}

@media (max-width: 860px) {
  .product-preview-grid,
  .role-grid.public-role-grid {
    grid-template-columns: 1fr;
  }

  .product-preview img,
  .product-preview:first-child img {
    aspect-ratio: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-preview {
    transition: none;
  }
}
