.template-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 20px;
  justify-content: center; /* keeps it centered on desktop */
}

.template-card {
  flex: 1 1 300px;
  max-width: 320px;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 16px;
  background-color: #fff;
  box-sizing: border-box;
}

.template-card img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  object-fit: cover;
}

/* --- Responsive Fix --- */
@media (max-width: 600px) {
  .template-card {
    flex: 1 1 100%;   /* take full width */
    max-width: 100%;  /* no restriction */
  }

  .template-card img {
    max-height: 100%; /* keeps proportions nice */
  }
}


.pagination {
  margin: 20px auto;
  text-align: center;
}
.pagination a {
  padding: 8px 12px;
  margin: 0 5px;
  background: #007bff;
  color: white;
  text-decoration: none;
  border-radius: 5px;
}
.pagination span {
  margin: 0 10px;
  font-weight: bold;
}
.pagination a:hover {
  background: #0056b3;
}
