/* ============================================
   CODZY — Templates Page Styles
   ============================================ */

/* Page hero reuses about.css page-hero — duplicated for standalone loading */
.page-hero {
    padding: calc(var(--navbar-height) + var(--space-20)) 0 var(--space-16);
    background: linear-gradient(135deg, var(--navy-deep), var(--navy-mid));
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    left: -10%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.page-hero-content h1 {
    font-size: var(--text-5xl);
    margin-bottom: var(--space-4);
}

.page-hero-content p {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
}

.page-hero-content .hero-badge {
    display: inline-block;
    padding: var(--space-2) var(--space-6);
    border-radius: var(--radius-full);
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.2);
    color: var(--gold-primary);
    font-size: var(--text-sm);
    font-weight: var(--fw-medium);
    letter-spacing: 1px;
    margin-bottom: var(--space-6);
}

@media (max-width: 768px) {
    .page-hero-content h1 {
        font-size: var(--text-3xl);
    }
}

/* ── Filter Bar ── */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    justify-content: center;
    margin-bottom: var(--space-10);
}

.filter-btn {
    padding: var(--space-2) var(--space-6);
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: var(--fw-medium);
    cursor: pointer;
    transition: all var(--transition-base);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent);
    color: var(--navy-deep);
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

/* ── Templates Grid ── */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-8);
}

.template-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.template-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: var(--shadow-glow-lg), var(--shadow-xl);
}

.template-card-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid var(--border-subtle);
    transition: transform 0.5s ease;
}

.template-card:hover .template-card-img {
    transform: scale(1.04);
}

.template-card-img-wrapper {
    overflow: hidden;
    position: relative;
}

/* Gradient preview fallback */
.template-preview-gradient {
    width: 100%;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid var(--border-subtle);
}

.template-card-body {
    padding: var(--space-6);
}

.template-card-tag {
    display: inline-block;
    padding: 2px var(--space-3);
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.2);
    color: var(--gold-primary);
    font-size: var(--text-xs);
    font-weight: var(--fw-semibold);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-3);
}

.template-card-body h3 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-2);
}

.template-card-body p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-4);
    min-height: 40px;
}

.template-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-6) var(--space-6);
}

.template-price {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: var(--fw-bold);
    color: var(--accent);
}

.template-actions {
    display: flex;
    gap: var(--space-2);
}

.template-actions .btn {
    font-size: var(--text-xs);
    padding: var(--space-2) var(--space-4);
}

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

    .template-card-footer {
        flex-direction: column;
        gap: var(--space-3);
        align-items: stretch;
    }

    .template-actions {
        justify-content: stretch;
    }

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