/* Design catalogue grid + lightbox. Shared by gates.html and railings.html. */

.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (min-width: 768px) and (max-width: 1024px) {
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
}
@media (min-width: 1025px) {
  .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
}

.cat-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.045);
  transition: transform .35s cubic-bezier(.22, 1, .36, 1), box-shadow .35s cubic-bezier(.22, 1, .36, 1);
}
@media (hover: hover) {
  .cat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(17, 24, 39, 0.1);
  }
}

.cat-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #f3f4f6;
  cursor: zoom-in;
  font: inherit;
}
.cat-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cat-media:focus-visible {
  outline: 2px solid #ea6112;
  outline-offset: -2px;
}

.cat-id {
  display: inline-flex;
  align-items: center;
  height: 1.7rem;
  padding: 0 .7rem;
  border-radius: 999px;
  background: #ea6112;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1;
}
.cat-media .cat-id {
  position: absolute;
  z-index: 1;
  top: 10px;
  left: 10px;
  pointer-events: none;
}

.cat-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 46px;
  padding: 8px 14px;
  border-top: 1px solid rgba(17, 24, 39, 0.06);
  background: #fff;
}
.cat-view,
.cat-enquire {
  font-family: inherit;
  font-size: 12px;
  line-height: 1;
}
.cat-view {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #6b7280;
  font-weight: 600;
  cursor: pointer;
}
.cat-view:hover { color: #111827; }
.cat-enquire {
  font-weight: 800;
  color: #111827;
  text-decoration: none;
}
.cat-enquire:hover { color: #ea6112; }
.cat-view:focus-visible,
.cat-enquire:focus-visible {
  outline: 2px solid #ea6112;
  outline-offset: 3px;
  border-radius: 4px;
}

.lb[hidden] { display: none !important; }
.lb {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom));
  background: rgba(8, 8, 8, .72);
}
.lb-frame {
  display: flex;
  flex-direction: column;
  width: min(880px, 92vw);
  max-height: 88vh;
  padding: 14px;
  overflow: auto;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 25px 60px rgba(0, 0, 0, .45);
}
.lb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  color: #111827;
}
.lb-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.lb-count {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  color: #111827;
}
.lb-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #f3f4f6;
  color: #111827;
  cursor: pointer;
}
.lb-x svg { display: block; width: 16px; height: 16px; }
.lb-x:hover { background: #111827; color: #fff; }
.lb-x:focus-visible { outline: 2px solid #ea6112; outline-offset: 3px; }

.lb-stage {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #f4f4f5;
  touch-action: none;
  user-select: none;
}
.lb-stage img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 62vh;
  object-fit: contain;
  border-radius: 16px;
  background: #f4f4f5;
  pointer-events: none;
}
.lb-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 24, 39, .65);
  color: #fff;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transform: translateY(-50%);
  cursor: pointer;
  touch-action: manipulation;
}
.lb-arrow svg { display: block; width: 18px; height: 18px; }
.lb-arrow-l { left: 10px; }
.lb-arrow-r { right: 10px; }
.lb-arrow:hover { background: rgba(17, 24, 39, .85); }
.lb-arrow:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.lb-bottom { padding-top: 14px; }
.lb-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 0 1.25rem;
  border-radius: 999px;
  background: #ea6112;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}
.lb-cta svg { display: block; width: 16px; height: 16px; flex-shrink: 0; }
.lb-cta:hover { background: #d4550d; }
.lb-cta:focus-visible { outline: 2px solid #111827; outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .cat-card { transition: none; }
  .cat-card:hover { transform: none; }
}
