/* ============================================================================
 * TIENDAWEB EXTERNAL BLOG — ESTILOS AISLADOS (.tw-blog-scope)
 * Diseñados para convivir sin conflictos con el CSS del sitio cliente.
 * ============================================================================ */
:root {
    --tw-brand-primary: #2563eb;
    --tw-brand-accent: #1d4ed8;
    --tw-bg-page: #f8fafc;
    --tw-surface: #ffffff;
    --tw-text: #1e293b;
    --tw-text-muted: #64748b;
    --tw-border: #e2e8f0;
    --tw-radius: 14px;
}

.tw-blog-container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.tw-default-header {
    background: #ffffff;
    border-bottom: 1px solid var(--tw-border);
    padding: 16px 0;
}

.tw-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.tw-brand-link {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--tw-brand-primary);
    text-decoration: none;
}

.tw-header-nav {
    display: flex;
    gap: 20px;
}

.tw-header-nav a {
    color: var(--tw-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.tw-header-nav a.is-active,
.tw-header-nav a:hover {
    color: var(--tw-brand-primary);
}

.tw-blog-scope {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--tw-bg-page);
    color: var(--tw-text);
    line-height: 1.65;
    padding-bottom: 64px;
    min-height: 65vh;
}

.tw-blog-scope *,
.tw-blog-scope *::before,
.tw-blog-scope *::after {
    box-sizing: border-box;
}

.tw-blog-breadcrumbs {
    background: var(--tw-surface);
    border-bottom: 1px solid var(--tw-border);
    padding: 10px 0;
    font-size: 0.85rem;
    color: var(--tw-text-muted);
}

.tw-blog-breadcrumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.tw-blog-breadcrumbs li + li::before {
    content: "/";
    margin-right: 8px;
    color: #cbd5e1;
}

.tw-blog-breadcrumbs a {
    color: var(--tw-text-muted);
    text-decoration: none;
}

.tw-blog-breadcrumbs a:hover {
    color: var(--tw-brand-primary);
    text-decoration: underline;
}

.tw-blog-hero {
    background: linear-gradient(135deg, var(--tw-brand-primary), var(--tw-brand-accent));
    color: #ffffff;
    padding: 48px 0;
    text-align: center;
}

.tw-blog-hero h1 {
    margin: 0 0 12px;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    line-height: 1.2;
}

.tw-blog-hero p {
    margin: 0 auto 24px;
    max-width: 680px;
    opacity: 0.9;
    font-size: 1.05rem;
}

.tw-search-form {
    display: flex;
    max-width: 560px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 999px;
    padding: 5px;
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.25);
}

.tw-search-form input {
    flex: 1;
    border: 0;
    outline: 0;
    padding: 10px 18px;
    font-size: 0.95rem;
    border-radius: 999px;
    color: var(--tw-text);
}

.tw-search-form button {
    border: 0;
    background: #0f172a;
    color: #ffffff;
    font-weight: 700;
    padding: 10px 22px;
    border-radius: 999px;
    cursor: pointer;
}

.tw-categories-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 32px 0;
}

.tw-cat-pill {
    display: inline-block;
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--tw-text);
    background: var(--tw-surface);
    border: 1px solid var(--tw-border);
    transition: all 0.15s ease;
}

.tw-cat-pill:hover,
.tw-cat-pill.is-active {
    background: var(--tw-brand-primary);
    color: #ffffff;
    border-color: var(--tw-brand-primary);
}

.tw-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 24px;
}

.tw-post-card {
    background: var(--tw-surface);
    border: 1px solid var(--tw-border);
    border-radius: var(--tw-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tw-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px -10px rgba(15, 23, 42, 0.12);
}

.tw-post-card-img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #e2e8f0;
}

.tw-post-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tw-post-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tw-post-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--tw-text-muted);
    margin-bottom: 10px;
}

.tw-post-badge {
    background: rgba(37, 99, 235, 0.1);
    color: var(--tw-brand-primary);
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
}

.tw-post-card h2 {
    font-size: 1.15rem;
    line-height: 1.35;
    margin: 0 0 10px;
}

.tw-post-card h2 a {
    color: var(--tw-text);
    text-decoration: none;
}

.tw-post-card h2 a:hover {
    color: var(--tw-brand-primary);
}

.tw-post-excerpt {
    font-size: 0.92rem;
    color: var(--tw-text-muted);
    margin: 0 0 18px;
    flex: 1;
}

.tw-post-card-footer {
    border-top: 1px solid var(--tw-border);
    padding-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--tw-text-muted);
}

.tw-read-more {
    color: var(--tw-brand-primary);
    font-weight: 700;
    text-decoration: none;
}

.tw-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 40px;
}

.tw-pagination a,
.tw-pagination span {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--tw-border);
    background: var(--tw-surface);
    color: var(--tw-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.tw-pagination .is-current {
    background: var(--tw-brand-primary);
    color: #ffffff;
    border-color: var(--tw-brand-primary);
}

/* Vista Detalle */
.tw-article-wrapper {
    max-width: 860px;
    margin: 36px auto 0;
}

.tw-article-header h1 {
    font-size: clamp(1.75rem, 3.8vw, 2.4rem);
    line-height: 1.22;
    margin: 12px 0 16px;
    color: #0f172a;
}

.tw-article-hero-img {
    width: 100%;
    max-height: 460px;
    object-fit: cover;
    border-radius: var(--tw-radius);
    margin: 24px 0 32px;
    display: block;
}

.tw-article-card {
    background: var(--tw-surface);
    border: 1px solid var(--tw-border);
    border-radius: var(--tw-radius);
    padding: clamp(20px, 4vw, 44px);
    font-size: 1.075rem;
    line-height: 1.8;
    color: #334155;
}

.tw-article-card h2 {
    font-size: 1.5rem;
    color: #0f172a;
    margin: 32px 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--tw-border);
}

.tw-article-card h3 {
    font-size: 1.22rem;
    color: #1e293b;
    margin: 24px 0 10px;
}

.tw-article-card p {
    margin: 0 0 18px;
}

.tw-article-card blockquote {
    margin: 24px 0;
    padding: 16px 22px;
    border-left: 4px solid var(--tw-brand-primary);
    background: #f1f5f9;
    border-radius: 0 10px 10px 0;
    font-style: italic;
}

.tw-article-card table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.95rem;
}

.tw-article-card th,
.tw-article-card td {
    border: 1px solid var(--tw-border);
    padding: 10px 14px;
    text-align: left;
}

.tw-article-card th {
    background: #f1f5f9;
    font-weight: 700;
}

.tw-empty-state {
    background: var(--tw-surface);
    border: 1px solid var(--tw-border);
    border-radius: var(--tw-radius);
    padding: 48px 24px;
    text-align: center;
}

.tw-default-footer {
    background: #ffffff;
    border-top: 1px solid var(--tw-border);
    padding: 28px 0;
    font-size: 0.875rem;
    color: var(--tw-text-muted);
}

.tw-footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.tw-footer-links {
    display: flex;
    gap: 16px;
}

.tw-footer-links a {
    color: var(--tw-text-muted);
    text-decoration: none;
}
