/* Templates gallery */

.hp-templates-hero {
  padding: 56px 0 24px;
  text-align: center;
}

.hp-templates-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 14px;
}

.hp-templates-hero p {
  max-width: 560px;
  margin: 0 auto;
  color: var(--hp-muted);
  font-size: 1.05rem;
}

.hp-template-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 36px 0 28px;
}

.hp-template-filter {
  border: 1px solid var(--hp-line);
  background: #fff;
  color: #3f3f46;
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.hp-template-filter:hover {
  border-color: #d4d4dd;
}

.hp-template-filter.is-active {
  background: var(--hp-primary);
  border-color: var(--hp-primary);
  color: #fff;
}

.hp-template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  padding-bottom: 70px;
}

.hp-template-card {
  background: #fff;
  border: 1px solid var(--hp-line);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.hp-template-card:hover {
  transform: translateY(-4px);
  border-color: transparent;
  box-shadow: 0 24px 50px -28px rgba(60, 40, 120, 0.35);
}

.hp-template-card__preview {
  position: relative;
  height: 300px;
  background: var(--hp-soft);
  overflow: hidden;
}

.hp-template-card__preview iframe {
  position: absolute;
  top: 0;
  left: 50%;
  width: 390px;
  height: 720px;
  border: 0;
  transform: translateX(-50%) scale(0.42);
  transform-origin: top center;
  pointer-events: none;
  background: #fff;
}

.hp-template-card__preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hp-muted);
  font-size: 0.9rem;
}

.hp-template-card__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.hp-template-card__tag {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--hp-primary-soft);
  color: var(--hp-primary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.hp-template-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.hp-template-card p {
  font-size: 0.92rem;
  color: var(--hp-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}

.hp-template-card__actions {
  display: flex;
  gap: 10px;
}

.hp-template-card__actions .hp-btn {
  flex: 1;
}

.hp-templates-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  color: var(--hp-muted);
}

@media (max-width: 1024px) {
  .hp-template-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .hp-templates-hero { padding: 40px 0 12px; }
  .hp-template-grid { grid-template-columns: 1fr; }
  .hp-template-card__preview { height: 260px; }
  .hp-template-card__actions { flex-direction: column; }
}
