/* ============================================
   VITRINE - Página principal de templates
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* ---- NAVBAR ---- */
.navbar {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 65px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar-brand { font-size: 22px; font-weight: 800; color: #667eea; text-decoration: none; }
.navbar-brand span { color: #764ba2; }
.navbar-links { display: flex; align-items: center; gap: 20px; }
.navbar-links a { color: #555; text-decoration: none; font-size: 14px; font-weight: 500; transition: color .2s; }
.navbar-links a:hover { color: #667eea; }
.btn-nav {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff !important;
    padding: 9px 22px;
    border-radius: 25px;
    font-weight: 600 !important;
    transition: opacity .2s !important;
}
.btn-nav:hover { opacity: .85; }

/* ---- HERO DA VITRINE ---- */
.vitrine-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-align: center;
    padding: 70px 20px 80px;
}
.vitrine-hero h1 { font-size: 42px; font-weight: 800; margin-bottom: 16px; }
.vitrine-hero p  { font-size: 18px; opacity: .9; max-width: 550px; margin: 0 auto; }

/* ---- GRID DE TEMPLATES ---- */
.vitrine-section { padding: 60px 40px; max-width: 1200px; margin: 0 auto; }
.vitrine-section h2 { font-size: 28px; font-weight: 700; text-align: center; margin-bottom: 10px; color: #222; }
.vitrine-section .subtitle { text-align: center; color: #666; margin-bottom: 45px; font-size: 16px; }

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 30px;
}

/* ---- CARD DE TEMPLATE ---- */
.template-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,.07);
    overflow: hidden;
    transition: transform .25s, box-shadow .25s;
}
.template-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 35px rgba(102,126,234,.2);
}
.template-thumb {
    width: 100%;
    height: 210px;
    object-fit: cover;
    display: block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.template-thumb-placeholder {
    width: 100%;
    height: 210px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
}
.t1-bg { background: linear-gradient(135deg, #1a1a2e, #16213e); }
.t2-bg { background: linear-gradient(135deg, #0f3460, #533483); }
.t3-bg { background: linear-gradient(135deg, #0d7377, #14a085); }

.template-body { padding: 24px; }
.template-badge {
    display: inline-block;
    background: #eef0ff;
    color: #667eea;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 10px;
}
.template-body h3 { font-size: 20px; font-weight: 700; color: #222; margin-bottom: 8px; }
.template-body p  { font-size: 14px; color: #666; line-height: 1.6; margin-bottom: 20px; }

.template-actions { display: flex; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; border: none; transition: all .2s; }
.btn-outline { border: 2px solid #667eea; color: #667eea; background: transparent; flex: 1; }
.btn-outline:hover { background: #667eea; color: #fff; }
.btn-primary { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; flex: 1; }
.btn-primary:hover { opacity: .85; transform: translateY(-1px); }

/* ---- GRID DE NICHOS (vitrine home) ---- */
.nichos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
}

.nicho-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,.07);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .25s, box-shadow .25s;
    display: flex;
    flex-direction: column;
}
.nicho-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 40px rgba(102,126,234,.22);
}

.nicho-card-thumb {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 14px 16px;
    position: relative;
}
.nicho-card-thumb svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    width: 56px;
    height: 56px;
    color: rgba(255,255,255,.35);
}
.nicho-card-thumb.has-thumb svg { display: none; }

.nicho-count-badge {
    background: rgba(255,255,255,.2);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    position: relative;
    z-index: 1;
}

.nicho-card-body {
    padding: 22px 24px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.nicho-card-body h3 {
    font-size: 19px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}
.nicho-card-body p {
    font-size: 14px;
    color: #666;
    line-height: 1.55;
    margin: 0;
    flex: 1;
}
.nicho-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #667eea;
    font-size: 14px;
    font-weight: 600;
    margin-top: 10px;
}

/* ---- NICHO — página interna ---- */
.nicho-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,.8);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color .2s;
}
.nicho-back:hover { color: #fff; }

/* ---- FOOTER ---- */
.vitrine-footer { background: #1a1a2e; color: #aaa; text-align: center; padding: 30px; font-size: 14px; margin-top: 60px; }
.vitrine-footer a { color: #667eea; text-decoration: none; }

/* ---- RESPONSIVO ---- */
@media (max-width: 768px) {
    .navbar { padding: 0 20px; }
    .vitrine-hero h1 { font-size: 28px; }
    .vitrine-section { padding: 40px 20px; }
    .templates-grid { grid-template-columns: 1fr; }
}
