/* Product-page guideline templates section */

.product-page-content .ff-tpl-section,
.ff-tpl-section {
  display: block;
  margin: 0 0 2rem;
  padding: 1.4rem 1.35rem 1.25rem;
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9fd 100%);
  box-shadow: 0 8px 24px rgba(30, 41, 59, 0.05);
  scroll-margin-top: 1.25rem;
}

.ff-tpl-section__head {
  margin-bottom: 1.05rem;
}

.ff-tpl-section__eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #3a6da8;
  margin-bottom: 0.35rem;
}

.ff-tpl-section__title {
  margin: 0 0 0.45rem;
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  line-height: 1.25;
  font-weight: 800;
  color: #0f172a;
}

.ff-tpl-section__intro {
  font-size: 0.95rem;
  line-height: 1.55;
  color: #475569;
  max-width: 42rem;
  margin-bottom: 0.7rem;
}

.ff-tpl-section__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1e4f86;
  background: #e8f0fa;
  border: 1px solid #b7d0ea;
}

.ff-tpl-section__toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ff-tpl-section__search {
  position: relative;
  display: block;
  max-width: 28rem;
}

.ff-tpl-section__search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  display: flex;
  pointer-events: none;
}

.ff-tpl-section__input {
  width: 100%;
  padding: 0.72rem 2.4rem 0.72rem 2.35rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 0.95rem;
  color: #0f172a;
  outline: none;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.ff-tpl-section__input:focus {
  border-color: #558bca;
  box-shadow: 0 0 0 3px rgba(85, 139, 202, 0.2);
}

.ff-tpl-section__clear {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.7rem;
  height: 1.7rem;
  border: 0;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.ff-tpl-section__chips,
.ff-tpl-section__folders {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ff-tpl-section__chip,
.ff-tpl-section__folder {
  appearance: none;
  border: 1px solid #d0dbe8;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ff-tpl-section__chip:hover,
.ff-tpl-section__folder:hover {
  border-color: #558bca;
  color: #1e4f86;
}

.ff-tpl-section__chip.is-active,
.ff-tpl-section__folder.is-active {
  background: #558bca;
  border-color: #558bca;
  color: #fff;
}

.ff-tpl-section__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 0.85rem;
}

.ff-tpl-section__card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.ff-tpl-section__card:hover {
  transform: translateY(-2px);
  border-color: #9fc0e0;
  box-shadow: 0 10px 24px rgba(85, 139, 202, 0.14);
}

.ff-tpl-section__card.is-hidden {
  display: none;
}

.ff-tpl-section__preview-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.ff-tpl-section__preview {
  height: 112px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fafc, #eef4fa);
  border: 1px solid #e2e8f0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ff-tpl-section__preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
}

.ff-tpl-section__preview-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.ff-tpl-section__name {
  margin: 0.15rem 0 0;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
  color: #0f172a;
  min-height: 2.3em;
}

.ff-tpl-section__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  min-height: 1.2rem;
}

.ff-tpl-section__size,
.ff-tpl-section__ext {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ff-tpl-section__size {
  color: #1e4f86;
  background: #e8f0fa;
}

.ff-tpl-section__ext {
  color: #475569;
  background: #f1f5f9;
}

.ff-tpl-section__download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  padding: 0.5rem 0.7rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #558bca, #3a6da8);
  color: #fff !important;
  font-weight: 700;
  font-size: 0.8rem;
  text-decoration: none !important;
  box-shadow: 0 5px 14px rgba(85, 139, 202, 0.28);
}

.ff-tpl-section__download:hover {
  background: linear-gradient(135deg, #3a6da8, #2f5a8c);
}

.ff-tpl-section__empty {
  text-align: center;
  color: #64748b;
  font-size: 0.92rem;
  padding: 1.25rem 0.5rem;
}

.ff-tpl-section__foot {
  margin-top: 1.1rem;
  padding-top: 0.95rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: center;
  justify-content: space-between;
}

.ff-tpl-section__foot-note {
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.45;
}

.ff-tpl-section__library {
  font-size: 0.88rem;
  font-weight: 700;
  color: #3a6da8;
  text-decoration: none;
}

.ff-tpl-section__library:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .ff-tpl-section {
    padding: 1.1rem 0.9rem 1.05rem;
  }

  .ff-tpl-section__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .ff-tpl-section__preview {
    height: 96px;
  }

  .ff-tpl-section__foot {
    flex-direction: column;
    align-items: flex-start;
  }
}
