/* === Custom Templates Page (same as editable) === */

.template-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 20px;
  justify-content: center; /* keeps items 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: 4px;
  object-fit: cover;
}

/* Titles & Text */
.template-card h4 {
  margin: 10px 0 5px;
  font-size: 20px;
}

.template-card p {
  margin: 4px 0;
  font-size: 14px;
  color: #555;
}

/* Buttons */
.buy-btn,
.rating-form button,
.review-form button,
.comment-form button {
  background: #007bff;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  margin-top: 8px;
}

.buy-btn:hover,
.rating-form button:hover,
.review-form button:hover,
.comment-form button:hover {
  background: #0056b3;
}

.like-btn {
  background: none;
  border: none;
  color: red;
  cursor: pointer;
  font-size: 16px;
}

/* Comment area */
#comment-section textarea {
  width: 100%;
  min-height: 60px;
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical;
}

/* --- Responsive Fix --- */
@media (max-width: 600px) {
  .template-card {
    flex: 1 1 100%;   /* full width on mobile */
    max-width: 100%;
  }

  .template-card img {
    max-height: 100%; /* bigger preview on phones */
  }

  .template-card h4 {
    font-size: 18px;
  }

  .template-card p {
    font-size: 13px;
  }
}
