.template-catalog-v2 {
  background: #fbfaf8;
  overflow-x: hidden;
  padding: 72px 0;
}

.template-catalog-v2 *,
.template-catalog-v2 *::before,
.template-catalog-v2 *::after {
  box-sizing: border-box;
}

.template-catalog-v2 a {
  white-space: normal;
}

.template-catalog-v2__inner {
  margin: 0 auto;
  max-width: 1180px;
  padding: 0 24px;
  width: 100%;
}

.template-catalog-v2__header {
  margin: 0 auto 36px;
  max-width: 880px;
  text-align: center;
}

.template-catalog-v2__badge {
  color: #0f766e;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.template-catalog-v2__header h1 {
  color: #181818;
  font-family: "Alata", "Inter", sans-serif;
  font-size: clamp(38px, 5vw, 58px);
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0;
  overflow-wrap: anywhere;
}

.template-catalog-v2__header p {
  color: #51463f;
  font-size: 18px;
  line-height: 1.65;
  margin: 18px 0 0;
}

.template-catalog-v2__toolbar {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0 0 24px;
}

.template-catalog-v2__search {
  display: grid;
  gap: 7px;
  max-width: 460px;
  width: 100%;
}

.template-catalog-v2__search span {
  color: #51463f;
  font-size: 13px;
  font-weight: 700;
}

.template-catalog-v2__search input {
  background: #ffffff;
  border: 1px solid #d8d2ca;
  border-radius: 8px;
  color: #181818;
  font-size: 15px;
  min-height: 46px;
  padding: 0 14px;
  width: 100%;
}

.template-catalog-v2__search input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
  outline: none;
}

.template-catalog-v2__summary {
  color: #51463f;
  font-size: 14px;
  font-weight: 800;
  padding-bottom: 12px;
  white-space: nowrap;
}

.template-catalog-v2__category-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  min-width: 0;
}

.template-catalog-v2__category {
  background: #ffffff;
  border: 1px solid #e0d9d1;
  border-radius: 8px;
  color: inherit;
  min-height: 190px;
  padding: 22px;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.template-catalog-v2__category:hover {
  border-color: #ff6738;
  box-shadow: 0 14px 34px rgba(33, 37, 41, 0.08);
  transform: translateY(-2px);
}

.template-catalog-v2__category > div {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}

.template-catalog-v2__count {
  align-items: center;
  background: #2563eb;
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 14px;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  min-width: 34px;
  padding: 0 10px;
}

.template-catalog-v2__priority {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  color: #047857;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
}

.template-catalog-v2__category h2 {
  color: #181818;
  font-size: 22px;
  line-height: 1.2;
  margin: 0 0 10px;
  overflow-wrap: anywhere;
}

.template-catalog-v2__category p {
  color: #5f554d;
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
}

.template-catalog-v2__subhead {
  margin: 46px 0 22px;
}

.template-catalog-v2__subhead h2 {
  color: #181818;
  font-size: 28px;
  line-height: 1.2;
  margin: 0 0 6px;
}

.template-catalog-v2__subhead p {
  color: #5f554d;
  margin: 0;
}

.template-catalog-v2__template-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  min-width: 0;
}

.template-catalog-v2__template {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  min-height: 260px;
  padding: 22px;
}

.template-catalog-v2__template-category {
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.template-catalog-v2__template h3 {
  font-size: 21px;
  line-height: 1.25;
  margin: 0 0 10px;
  overflow-wrap: anywhere;
}

.template-catalog-v2__template h3 a {
  color: #181818;
  text-decoration: none;
}

.template-catalog-v2__template h3 a:hover {
  color: #ff6738;
}

.template-catalog-v2__template p {
  color: #5f554d;
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
}

.template-catalog-v2__mini-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.template-catalog-v2__mini-chips span {
  background: #f3f4f6;
  border-radius: 999px;
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 8px;
}

.template-catalog-v2__template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 20px;
}

.template-catalog-v2__template-actions a {
  align-items: center;
  border: 1px solid #d8d2ca;
  border-radius: 7px;
  color: #181818;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  min-height: 36px;
  padding: 0 11px;
  text-decoration: none;
  white-space: nowrap;
}

.template-catalog-v2__template-actions a:first-child {
  background: #ff6738;
  border-color: #ff6738;
  color: #ffffff;
}

.template-catalog-v2__template-actions a:hover {
  border-color: #ff6738;
}

[data-template-card][hidden] {
  display: none;
}

@media (max-width: 640px) {
  .template-catalog-v2 {
    padding: 52px 0;
  }

  .template-catalog-v2__inner {
    padding: 0 16px;
  }

  .template-catalog-v2__header {
    margin-bottom: 28px;
    text-align: left;
  }

  .template-catalog-v2__header h1 {
    font-size: 32px;
    line-height: 1.12;
  }

  .template-catalog-v2__header p {
    font-size: 16px;
    line-height: 1.55;
  }

  .template-catalog-v2__toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .template-catalog-v2__summary {
    padding-bottom: 0;
    white-space: normal;
  }

  .template-catalog-v2__category-grid,
  .template-catalog-v2__template-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .template-catalog-v2__category,
  .template-catalog-v2__template {
    min-width: 0;
    width: 100%;
  }

  .template-catalog-v2__category > div {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }

  .template-catalog-v2__template-actions a {
    flex: 1 1 96px;
    justify-content: center;
  }
}
