/* Templates Gallery */
.templates-hero {
    padding: var(--space-3xl) 0;
    text-align: center;
}

.templates-hero h1 {
    margin-bottom: var(--space-md);
}

.templates-hero p {
    font-size: 1.15rem;
    max-width: 550px;
    margin: 0 auto;
}

/* Filter bar */
.filter-bar {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    flex-wrap: wrap;
    padding: var(--space-xl) 0 var(--space-3xl);
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-muted);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.03);
}

.filter-btn--active {
    background: var(--gradient-brand);
    border-color: transparent;
    color: white;
}

.filter-btn--active:hover {
    color: white;
}

/* Template cards */
.template-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
}

.template-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition-base);
    display: flex;
    flex-direction: column;
}

.template-card:hover {
    border-color: var(--border-default);
}

.template-card[style*="display: none"] {
    display: none !important;
}

.template-card__preview {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    position: relative;
    overflow: hidden;
}

.template-card__body {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.template-card__badge {
    margin-bottom: var(--space-sm);
}

.template-card__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.template-card__text {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: var(--space-lg);
    flex: 1;
}

.template-card__action {
    display: block;
    text-align: center;
}

.template-card__actions {
    display: flex;
    gap: var(--space-sm);
}

.template-card__actions .btn {
    flex: 1;
    text-align: center;
}

/* Preview background variations */
.template-card__preview--cafe {
    background: linear-gradient(135deg, #1a1210 0%, #2d1f15 100%);
}
.template-card__preview--retail {
    background: linear-gradient(135deg, #1a1020 0%, #2d1535 100%);
}
.template-card__preview--fitness {
    background: linear-gradient(135deg, #0f1a12 0%, #152d1a 100%);
}
.template-card__preview--community {
    background: linear-gradient(135deg, #101520 0%, #152035 100%);
}
.template-card__preview--education {
    background: linear-gradient(135deg, #1a1810 0%, #2d2815 100%);
}
.template-card__preview--services {
    background: linear-gradient(135deg, #10181a 0%, #152d30 100%);
}

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

@media (max-width: 768px) {
    .template-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        gap: var(--space-xs);
    }

    .filter-btn {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
    }
}
