/* ══════════════════════════════════════════════════
   Templates Gallery Page — templates.css
══════════════════════════════════════════════════ */

/* ── Hero ──────────────────────────────────────── */
.tpl-hero {
    background: #0B0D0F;
    padding: 170px 0 0;
    overflow: hidden;
    position: relative;
}
.tpl-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 60%, rgba(255,186,18,.06) 0%, transparent 55%);
    pointer-events: none;
}
.tpl-hero-inner {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 40px;
    align-items: end;
}
.tpl-hero-text { padding: 20px 0 56px; }
.tpl-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #FFBA12;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}
.tpl-hero h1 {
    font-size: 52px;
    font-weight: 800;
    color: #fff;
    line-height: 1.05;
    letter-spacing: -.5px;
    margin-bottom: 16px;
}
.tpl-hero-sub {
    font-size: 17px;
    color: rgba(255,255,255,.5);
    line-height: 1.7;
    max-width: 420px;
    margin-bottom: 32px;
}
.tpl-hero-stats {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}
.tpl-hero-stat-num {
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    margin-bottom: 2px;
}
.tpl-hero-stat-label { font-size: 12px; color: rgba(255,255,255,.4); font-weight: 500; }
.tpl-hero-stat-divider { width: 1px; height: 32px; background: rgba(255,255,255,.1); }

/* ── Hero right: staggered previews ────────────── */
.tpl-hero-previews {
    position: relative;
    height: 300px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0;
}
.tpl-mini-card {
    background: #fff;
    border-radius: 12px 12px 0 0;
    width: 140px;
    padding: 12px 14px;
    box-shadow: 0 -4px 24px rgba(0,0,0,.3);
    border: 1px solid rgba(255,255,255,.08);
    border-bottom: none;
}
.tpl-mini-card:nth-child(1) { transform: translateY(30px) rotate(-3deg); z-index: 1; opacity: .8; }
.tpl-mini-card:nth-child(2) { transform: translateY(0); z-index: 3; width: 160px; padding: 14px 16px; }
.tpl-mini-card:nth-child(3) { transform: translateY(20px) rotate(3deg); z-index: 1; opacity: .8; }
.tpl-mini-title { font-size: 9px; font-weight: 800; color: #0B0D0F; margin-bottom: 8px; }
.tpl-mini-label { font-size: 7px; font-weight: 600; color: #374151; margin-bottom: 2px; display: block; }
.tpl-mini-input {
    display: block; width: 100%;
    border: 1px solid #e5e7eb; border-radius: 3px;
    padding: 3px 6px; font-size: 7px; color: #9ca3af;
    margin-bottom: 4px; background: #f9fafb;
}
.tpl-mini-btn {
    display: block; width: 100%; padding: 5px;
    border-radius: 4px; font-size: 8px; font-weight: 700;
    text-align: center; color: #fff; margin-top: 6px;
}

/* ── Info nudge bar ────────────────────────────── */
.tpl-nudge-bar {
    background: #f9fafb;
    border-bottom: 1px solid #e9ecef;
    padding: 10px 0;
}
.tpl-nudge-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
    flex-wrap: wrap;
    text-align: center;
}
.tpl-nudge-link {
    color: #0B0D0F;
    font-weight: 700;
    text-decoration: none;
    transition: color .15s;
}
.tpl-nudge-link:hover { color: #FFBA12; text-decoration: none; }

/* ── Filter bar ────────────────────────────────── */
.tpl-filter-bar {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 72px;
    z-index: 100;
    padding: 12px 0;
}
.tpl-filter-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.tpl-tabs { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.tpl-tab {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.tpl-tab:hover { background: #e9ecef; color: #0B0D0F; }
.tpl-tab.active { background: #0B0D0F; color: #fff; }
.tpl-search-wrap { position: relative; }
.tpl-search-input {
    padding: 7px 14px 7px 34px;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    font-size: 13px;
    color: #0B0D0F;
    outline: none;
    width: 200px;
    transition: border-color .15s, width .2s;
    background: #f9fafb;
}
.tpl-search-input:focus { border-color: #0B0D0F; background: #fff; width: 240px; }
.tpl-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

/* ── Template grid ─────────────────────────────── */
.tpl-gallery { padding: 48px 0 80px; background: #f9fafb; }
.tpl-gallery #tpl-grid .tpl-item { margin-bottom: 28px; }
.tpl-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e9ecef;
    overflow: hidden;
    transition: box-shadow .2s, transform .15s;
    text-decoration: none;
    display: block;
    height: 100%;
}
.tpl-card:hover { box-shadow: 0 8px 28px rgba(0,0,0,.09); transform: translateY(-3px); text-decoration: none; }
.tpl-card-preview {
    height: 160px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
/* browser chrome mockup inside card */
.tpl-card-browser {
    width: 80%;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,.08);
    border-bottom: none;
    box-shadow: 0 -2px 12px rgba(0,0,0,.12);
    position: absolute;
    bottom: 0;
}
.tpl-card-chrome {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    background: rgba(0,0,0,.12);
}
.tpl-card-dots { display: flex; gap: 3px; }
.tpl-card-dots span { width: 5px; height: 5px; border-radius: 50%; display: block; }
.tpl-card-url {
    flex: 1;
    background: rgba(255,255,255,.15);
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 7px;
    color: rgba(255,255,255,.6);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.tpl-card-form {
    background: rgba(255,255,255,.96);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tpl-card-form-label { font-size: 6px; font-weight: 600; color: #374151; }
.tpl-card-form-input {
    height: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 2px;
    background: #f9fafb;
    font-size: 6px;
    color: #9ca3af;
    padding: 0 4px;
    display: flex;
    align-items: center;
}
.tpl-card-form-btn {
    margin-top: 2px;
    height: 14px;
    border-radius: 3px;
    font-size: 7px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* hover overlay */
.tpl-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(11,13,15,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s;
}
.tpl-card:hover .tpl-card-overlay { opacity: 1; }
.tpl-card-overlay-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: #0B0D0F;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}
/* card body */
.tpl-card-body { padding: 14px 16px 16px; }
.tpl-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
}
.tpl-card-cat {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #9ca3af;
}
.tpl-card-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    background: #FEF9C3;
    color: #854D0E;
}
.tpl-card-badge.quiz { background: #EDE9FE; color: #6D28D9; }
.tpl-card-name { font-size: 14px; font-weight: 700; color: #0B0D0F; line-height: 1.3; margin-bottom: 8px; }
.tpl-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
    margin-top: 4px;
}
.tpl-card-theme { font-size: 11px; color: #9ca3af; font-weight: 500; }
.tpl-card-cta { font-size: 12px; font-weight: 700; color: #0B0D0F; transition: color .15s; }
.tpl-card:hover .tpl-card-cta { color: #FFBA12; }

/* ── No results ────────────────────────────────── */
.tpl-no-results {
    display: none;
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}
.tpl-no-results h3 { font-size: 18px; font-weight: 700; color: #0B0D0F; margin-bottom: 8px; }

/* ── How it works ──────────────────────────────── */
.tpl-how {
    padding: 80px 0 72px;
    background: #fff;
    border-top: 1px solid #f0f1f3;
}
.tpl-how-row {
    display: flex;
    align-items: center;
    gap: 0;
}
.tpl-how-card {
    flex: 1;
    padding: 36px 32px;
    border-radius: 14px;
    background: #f9fafb;
    border: 1px solid #eef0f3;
    position: relative;
    transition: box-shadow .2s, border-color .2s;
}
.tpl-how-card:hover {
    border-color: #FFBA12;
    box-shadow: 0 8px 28px rgba(0,0,0,.07);
}
.tpl-how-num {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    color: #FFBA12;
    margin-bottom: 16px;
    text-transform: uppercase;
}
.tpl-how-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #eef0f3;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0B0D0F;
    margin-bottom: 18px;
    transition: background .2s, border-color .2s;
}
.tpl-how-card:hover .tpl-how-icon {
    background: #FFFBEB;
    border-color: #FFBA12;
    color: #B45309;
}
.tpl-how-card h3 {
    font-size: 17px;
    font-weight: 700;
    color: #0B0D0F;
    margin: 0 0 10px;
    line-height: 1.35;
}
.tpl-how-card p {
    font-size: 14px;
    line-height: 1.7;
    color: #6b7280;
    margin: 0;
}
.tpl-how-divider {
    flex: 0 0 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 20px;
}

/* ── Preview field type visuals (gallery cards) ── */
.tpl-card-form-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.tpl-card-form-stars {
    font-size: 8px;
    color: #FFBA12;
    letter-spacing: 1.5px;
    margin-bottom: 5px;
    line-height: 1;
}
.tpl-card-form-opts {
    display: flex;
    gap: 4px;
    margin-bottom: 5px;
    align-items: center;
}
.tpl-card-form-opts span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: 1.5px solid #9ca3af;
    flex-shrink: 0;
}
.tpl-card-form-opts span:first-child {
    background: #374151;
    border-color: #374151;
}

/* ── Preview field type visuals (hero mini cards) ── */
.tpl-mini-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.tpl-mini-stars {
    font-size: 8px;
    color: #FFBA12;
    letter-spacing: 1.5px;
    margin-bottom: 4px;
    line-height: 1;
    display: block;
}
.tpl-mini-opts {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
    align-items: center;
}
.tpl-mini-opts span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: 1.5px solid #9ca3af;
    flex-shrink: 0;
}
.tpl-mini-opts span:first-child {
    background: #374151;
    border-color: #374151;
}

/* ── Responsive ────────────────────────────────── */


@media (max-width: 991px) {
    .tpl-hero-inner { grid-template-columns: 1fr; }
    .tpl-hero-previews { display: none; }
    .tpl-hero h1 { font-size: 38px; }
    .tpl-search-input { width: 160px; }
    .tpl-search-input:focus { width: 180px; }
}
@media (max-width: 767px) {
    .tpl-hero h1 { font-size: 30px; }
    .tpl-filter-bar { position: static; }
    .tpl-filter-inner { flex-direction: column; align-items: stretch; }
    .tpl-search-wrap { width: 100%; }
    .tpl-search-input { width: 100%; border-radius: 8px; }
    .tpl-search-input:focus { width: 100%; }
    .tpl-how-row { flex-direction: column; gap: 16px; }
    .tpl-how-divider { transform: rotate(90deg); padding: 0; }
    .tpl-how { padding: 56px 0; }
}
@media (max-width: 991px) and (min-width: 768px) {
    .tpl-how-card { padding: 28px 20px; }
    .tpl-how-card h3 { font-size: 15px; }
    .tpl-how-divider { flex: 0 0 28px; }
}
