/* Стили для секции с карточками категорий */
.templates-section {
    padding: 24px 0 40px 0;
    background: #f8fafc;
    font-family: 'Inter', Arial, sans-serif;
}
.templates-section h2 {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
    color: #1a202c;
    text-align: center;
}
.templates-section p {
    font-size: 1.15rem;
    color: #64748b;
    margin-bottom: 30px;
    text-align: center;
}

.template-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 36px;
}

.template-tag {
    display: inline-flex;
    align-items: center;
    background: #f3f4f6;
    color: #374151;
    font-size: 15px;
    font-weight: 500;
    border-radius: 999px;
    padding: 6px 16px;
    user-select: none;
    pointer-events: none;
    border: none;
    gap: 8px;
    letter-spacing: 0.01em;
}
/* Цветные карточки по циклу */
.template-card { background: #fff; }
.template-card:nth-child(4n+1) { background: #f9ddff; }
.template-card:nth-child(4n+2) { background: #ffe4c5; }
.template-card:nth-child(4n+3) { background: #cec1ff; }
.template-card:nth-child(4n+4) { background: #dbe5ff; }
.template-card:nth-child(4n+5) { background: #f9ddff; }
.template-card:nth-child(4n+6) { background: #ffe4c5; }
.template-card:nth-child(4n+7) { background: #cec1ff; }
.template-card:nth-child(4n+8) { background: #dbe5ff; }

.template-tag i {
    font-size: 15px;
    margin-right: 7px;
    color: #6366f1;
}

.templates-scroll {
    display: flex;
    overflow-x: auto;
    gap: 24px;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.template-card {
    min-width: 320px;
    max-width: 340px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 2px 14px 0 rgba(16, 30, 54, 0.09);
    padding: 28px 22px 22px 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    scroll-snap-align: start;
    transition: box-shadow 0.2s;
    text-align: left;
}

.template-card-emoji {
    font-size: 2.4rem;
    line-height: 1;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 900px) {
  .templates-section {
    padding: 16px 0 24px 0;
  }
  .templates-section h2 {
    font-size: 2rem;
  }
  .templates-scroll {
    gap: 16px;
    padding-bottom: 6px;
  }
  .template-card {
    min-width: 260px;
    max-width: 90vw;
    padding: 18px 10px 18px 14px;
  }
  .template-card-title {
    font-size: 1.08rem;
  }
  .template-card-desc {
    font-size: 0.97rem;
  }
  .template-card-emoji {
    font-size: 1.6rem;
  }
}
@media (max-width: 600px) {
  .templates-section {
    padding: 8px 0 14px 0;
  }
  .templates-section h2 {
    font-size: 1.35rem;
  }
  .template-card {
    min-width: 86vw;
    max-width: 92vw;
    padding: 14px 6vw 14px 6vw;
    font-size: 0.98rem;
  }
  .templates-scroll {
    gap: 10px;
  }
  .template-card-title {
    font-size: 1.01rem;
  }
  .template-card-desc {
    font-size: 0.93rem;
  }
  .template-card-emoji {
    font-size: 2.1rem;
  }
}
.template-card:hover {
    box-shadow: 0 4px 24px 0 rgba(16, 30, 54, 0.14);
}
.template-card-title {
    font-size: 1.18rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #232323;
}
.template-card-desc {
    font-size: 1rem;
    color: #475569;
    margin-bottom: 18px;
}
.template-card-btn {
    margin-top: 12px;
    background: #ededed;
    color: #444;
    border: none;
    border-radius: 8px;
    padding: 8px 22px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
    box-shadow: none;
}
.template-card-btn:hover {
    background: #e0e0e0;
    color: #222;
}