/* =============================================================================
 * ESTILOS ARTÍCULOS - AdoptaMascota.org  
 * Versión LIMPIA sin duplicados - 2025-12-13
 * ============================================================================= */

/* ----- LAYOUT PRINCIPAL ----- */
.article-container {
    max-width: 820px;
    margin: 0 auto;
    padding: clamp(1rem, 4vw, 2rem) clamp(0.75rem, 3vw, 1rem);
}

/* ----- CABECERA ----- */
.article-header {
    text-align: center;
    margin-bottom: clamp(1.5rem, 5vw, 2.5rem);
    padding-bottom: clamp(1.25rem, 4vw, 2rem);
    border-bottom: 1px solid #e9ecef;
}

.article-category-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: linear-gradient(135deg, #6f42c1 0%, #4a2a7e 100%);
    color: #fff;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.article-category-badge:hover {
    transform: translateY(-2px);
    color: #fff;
}

.article-header h1 {
    font-size: clamp(1.75rem, 5vw, 2.4rem);
    font-weight: 700;
    color: #212529;
    line-height: 1.2;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .article-header h1 {
        font-size: clamp(2rem, 4vw, 2.6rem);
    }
}

@media (min-width: 992px) {
    .article-header h1 {
        font-size: clamp(2.2rem, 3vw, 2.8rem);
    }
}

.article-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    color: #6c757d;
    font-size: 0.95rem;
}

.article-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.article-meta .meta-item i {
    color: #0dcaf0;
}

/* ----- IMAGEN DESTACADA ----- */
.article-featured-image {
    margin-bottom: clamp(1.5rem, 5vw, 2.5rem);
    text-align: center;
}

.article-featured-image img {
    max-width: 100%;
    max-height: 500px;
    height: auto;
    object-fit: contain;
    border-radius: clamp(10px, 2vw, 16px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* ----- CONTENIDO DEL ARTÍCULO ----- */
.article-body {
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    line-height: clamp(1.65, 0.5vw + 1.5, 1.8);
    color: #343a40;
}

.article-body p {
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
}

.article-body h2,
.article-body h3,
.article-body h4 {
    font-weight: 600;
    color: #212529;
    margin-top: clamp(2rem, 6vw, 3rem);
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.article-body h2 { font-size: clamp(1.45rem, 4vw, 2rem); }
.article-body h3 { font-size: clamp(1.25rem, 3.5vw, 1.6rem); }
.article-body h4 { font-size: clamp(1.1rem, 3vw, 1.3rem); }

.article-body h2 i,
.article-body h3 i {
    margin-right: 0.35rem;
}

.article-body a {
    color: #0dcaf0;
    text-decoration: none;
    border-bottom: 1px dotted #0dcaf0;
    transition: all 0.3s ease;
}

.article-body a:hover {
    color: #0a9ebf;
    background-color: rgba(13, 202, 240, 0.05);
    border-bottom: 1px solid #0a9ebf;
}

.article-body ul,
.article-body ol {
    padding-left: clamp(1.25rem, 4vw, 2rem);
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
}

.article-body li {
    margin-bottom: clamp(0.5rem, 2vw, 0.75rem);
}

/* Blockquote normal - EXCLUIR producto-recomendado */
.article-body blockquote:not(.producto-recomendado) {
    border-left: 4px solid #0dcaf0;
    padding: clamp(0.75rem, 3vw, 1rem) clamp(1rem, 4vw, 1.5rem);
    margin: clamp(1.25rem, 4vw, 2rem) 0;
    background-color: #f8f9fa;
    font-style: italic;
    color: #495057;
    border-radius: 0 8px 8px 0;
}

.article-body blockquote:not(.producto-recomendado) p {
    margin-bottom: 0;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: clamp(1.25rem, 4vw, 2rem) 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.article-body figure {
    margin: clamp(1.25rem, 4vw, 2rem) 0;
}

.article-body figcaption {
    font-size: clamp(0.75rem, 2vw, 0.875rem);
}

.article-body strong {
    color: #212529;
}

/* =============================================================================
 * BLOQUES DE AFILIADOS - ESTILOS PRINCIPALES
 * Soporte para div.producto-recomendado (CKEditor 4) y blockquotes (legacy)
 * ============================================================================= */

/* ===== ESTILO PRINCIPAL: div.producto-recomendado (CKEditor 4 preserva clases) ===== */
.article-body .producto-recomendado {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-left: 3px solid #f59e0b;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin: 1.5rem 0;
    display: block;
    transition: all 0.3s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.article-body .producto-recomendado:hover {
    border-color: #f59e0b;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.15);
}

/* Imagen del producto */
.article-body .producto-recomendado .producto-imagen,
.article-body .producto-recomendado img:first-of-type {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
    padding: 0.25rem;
    float: left;
    margin-right: 1rem;
}

/* Info del producto */
.article-body .producto-recomendado .producto-info {
    flex: 1;
    min-width: 200px;
}

/* Nombre del producto (h4) */
.article-body .producto-recomendado .producto-nombre,
.article-body .producto-recomendado strong:first-of-type,
.article-body .producto-recomendado h4 {
    display: inline;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1.4;
}

/* Descripción (p) */
.article-body .producto-recomendado .producto-descripcion,
.article-body .producto-recomendado > p {
    display: inline;
    color: #475569;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.4;
}

/* Botón Amazon */
.article-body .producto-recomendado .btn-amazon,
.article-body .producto-recomendado a[href*="/go/"] {
    display: inline-block;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff !important;
    padding: 0.35rem 0.85rem;
    border-radius: 5px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    margin-left: 0.5rem;
    vertical-align: middle;
    transition: all 0.2s ease;
}

.article-body .producto-recomendado .btn-amazon:hover,
.article-body .producto-recomendado a[href*="/go/"]:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: #fff !important;
}

/* Precio / Enlace secundario */
.article-body .producto-recomendado .precio,
.article-body .producto-recomendado a:not(.btn-amazon):not([href*="/go/"]) {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #059669;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* ----- BOTONES DE COMPARTIR ----- */
.article-share {
    text-align: center;
    margin: 1rem 0;
    padding: 0.75rem 0;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}

.article-share h5 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 1.5rem;
}

.share-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 50%;
    font-size: 1.3rem;
    text-decoration: none;
    color: #fff;
    transition: all 0.3s ease;
    position: relative;
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .share-buttons {
        gap: 0.5rem;
    }
    
    .share-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        font-size: 1.2rem;
    }
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
    color: #fff;
}

.share-btn.copy-link { background-color: #6c757d; }
.share-btn.whatsapp { background-color: #25D366; }
.share-btn.facebook { background-color: #1877F2; }
.share-btn.twitter { background-color: #1DA1F2; }
.share-btn.email { background-color: #fbbc05; }

.share-btn .tooltip-text {
    visibility: hidden;
    width: 140px;
    background-color: #343a40;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -70px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.9rem;
}

.share-btn .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #343a40 transparent transparent transparent;
}

.share-btn:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ----- TAGS DEL ARTÍCULO ----- */
.article-tags {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
}

.article-tags h5 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 1rem;
}

/* ----- BLOQUE CTA ADOPCIÓN ----- */
.article-body .alert {
    padding: clamp(0.85rem, 3vw, 1rem) clamp(1rem, 4vw, 1.5rem);
    margin: clamp(1.25rem, 4vw, 2rem) 0;
    border-radius: 10px;
    border: 1px solid #badbcc;
    background: #d1e7dd;
}

.article-body .alert h2,
.article-body .alert h3,
.article-body .alert h4,
.article-body .alert .h5 {
    font-size: clamp(1rem, 3vw, 1.2rem);
    margin: 0 0 0.75rem 0;
    font-weight: 700;
    color: #0f5132;
    border-bottom: none;
    padding-bottom: 0;
}

.article-body .alert ul,
.article-body .alert ol {
    padding-left: 1.25rem;
    margin-bottom: 0;
}

.article-body .alert li {
    margin-bottom: 0.5rem;
    font-size: clamp(0.92rem, 2.5vw, 1rem);
}

.article-body .alert p {
    margin-bottom: 0.8rem;
    font-size: clamp(0.92rem, 2.5vw, 0.95rem);
    color: #0f5132;
}

.article-body .alert .btn {
    padding: 0.4rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    background: #198754;
    border-color: #198754;
}

/* ----- ACORDEÓN FAQ ----- */
.article-body .accordion {
    margin: 1.25rem 0 1rem;
}

.article-body .accordion h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
    text-align: center;
}

.accordion-item {
    border: none;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.accordion-item:first-child {
    border-top: 1px solid #e5e7eb;
}

.accordion-header,
.accordion-item h4 {
    margin: 0;
    padding: 0;
    border: none;
}

.accordion-button {
    background: #fff;
    color: #334155;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 12px;
    border: none;
    box-shadow: none;
    text-align: left;
    line-height: 1.3;
}

.accordion-button:not(.collapsed) {
    background: #3b82f6;
    color: #fff;
}

.accordion-button:hover {
    background: #e2e8f0;
}

.accordion-button:not(.collapsed):hover {
    background: #2563eb;
}

.accordion-button:focus {
    box-shadow: none;
}

.accordion-button::after {
    width: 0.9rem;
    height: 0.9rem;
    opacity: 0.7;
}

.accordion-button:not(.collapsed)::after {
    opacity: 1;
    filter: brightness(0) invert(1);
}

.accordion-body {
    padding: 10px 12px;
    background: #fafafa;
    color: #475569;
    line-height: 1.4;
    font-size: 0.88rem;
    border-top: 1px solid #f0f0f0;
}

/* ----- ÍNDICE DE CONTENIDOS ----- */
.article-body .card .card-body {
    padding: clamp(1rem, 3vw, 1.5rem);
}

.article-body .card .card-body h3,
.article-body .card .card-body .h5 {
    font-size: clamp(1.05rem, 3vw, 1.25rem);
    margin-bottom: 0.75rem;
    border-bottom: none;
    padding-bottom: 0;
}

.article-body .card .nav-link {
    padding: 0.5rem 0.65rem;
    border-radius: 0.375rem;
    font-size: clamp(0.9rem, 2.5vw, 0.95rem);
    line-height: 1.35;
}

.article-body .card .nav-link:hover {
    background: rgba(13, 202, 240, 0.08);
}

/* ----- TABLAS ----- */
.article-body .table {
    font-size: clamp(0.85rem, 2.5vw, 1rem);
}

.article-body .table th,
.article-body .table td {
    padding: clamp(0.5rem, 2vw, 0.75rem);
}

/* ----- LIST-GROUP ----- */
.article-body .list-group-item {
    padding: clamp(0.75rem, 3vw, 1rem) clamp(0.85rem, 3vw, 1.25rem);
    font-size: clamp(0.95rem, 2.5vw, 1rem);
}

/* ----- BOTONES CTA AL FINAL ----- */
.article-body .text-center a.btn {
    white-space: normal;
    line-height: 1.3;
}

/* =============================================================================
 * RESPONSIVE
 * ============================================================================= */
@media (max-width: 768px) {
    .article-meta {
        gap: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    /* Afiliados - nuevo formato con clases */
    .article-body .producto-recomendado {
        padding: 0.65rem 0.85rem;
    }
    
    .article-body .producto-recomendado h4 {
        display: block;
        margin-bottom: 0.35rem;
    }
    
    .article-body .producto-recomendado > p {
        display: block;
        margin-bottom: 0.5rem;
    }
    
    .article-body .producto-recomendado .btn-amazon,
    .article-body .producto-recomendado a[href*="/go/"] {
        margin-left: 0;
        margin-right: 0.5rem;
    }
    
    /* Afiliados - formato legacy blockquote */
    .article-body blockquote:has(a[href*="/go/"]) {
        padding: 1rem !important;
    }
    
    .article-body blockquote:has(a[href*="/go/"]) img {
        max-width: 140px !important;
        max-height: 140px !important;
    }
    
    /* Acordeón */
    .article-body .accordion h3 {
        font-size: 1.1rem;
    }
    
    .accordion-button {
        font-size: 0.85rem;
        padding: 8px 10px;
    }
    
    .accordion-body {
        padding: 8px 10px;
        font-size: 0.82rem;
    }
    
    /* Tablas */
    .article-body .table th,
    .article-body .table td {
        padding: 0.5rem;
    }
}

@media (max-width: 576px) {
    .article-body .text-center a.btn {
        width: 100% !important;
        padding: 0.9rem 1rem !important;
        font-size: 0.95rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .article-body .text-center a.btn:last-child {
        margin-bottom: 0 !important;
    }
    
    /* Tablas densas (TOP 5 con 5+ columnas) */
    .article-body .table {
        font-size: 0.8rem;
    }
    
    .article-body .table th,
    .article-body .table td {
        padding: 0.4rem 0.35rem;
        line-height: 1.35;
    }
    
    .article-body .table thead th {
        white-space: nowrap;
    }
    
    /* Listas numeradas del resumen rápido */
    .article-body .alert ol,
    .article-body .alert ul {
        padding-left: 1.1rem;
    }
    
    .article-body .alert ol li,
    .article-body .alert ul li {
        font-size: 0.92rem;
        line-height: 1.45;
    }
}


/* =============================================================================
 * CTA BUTTON - Estilo coherente con artículo
 * Bootstrap friendly + Mobile First
 * ============================================================================= */
.btn-cta-boost {
    background-color: #f7e6a8 !important;
    color: #1f2937 !important;
    border: 2px solid #000 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-cta-boost:hover {
    background-color: #ffe07d !important;
    border-color: #000 !important;
    color: #1f2937 !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.btn-cta-boost:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

@media (max-width: 576px) {
    .article-body .text-center a.btn {
        width: 100% !important;
        padding: 1rem !important;
        font-size: 0.95rem !important;
    }
}

/* =============================================
   QUIZÁS TE INTERESE — Barras de relevancia
   ============================================= */
.qti-section {
    background: #f8fafc;
    border-radius: 1.25rem;
    padding: 1.5rem;
    margin-top: 2.5rem;
}

.qti-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
    margin-bottom: 1.25rem;
}

.qti-title i {
    margin-right: 0.25rem;
}

.qti-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.qti-card {
    background: #fff;
    border-radius: 1rem;
    padding: 1rem 1.125rem;
    text-decoration: none;
    color: inherit;
    border: 1.5px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.2s;
}

.qti-card:hover {
    border-color: #a5b4fc;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.1);
    color: inherit;
    text-decoration: none;
}

.qti-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.qti-ic {
    width: 34px;
    height: 34px;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.qti-name {
    font-size: 0.86rem;
    font-weight: 700;
    color: #1e293b;
    flex: 1;
    line-height: 1.3;
}

.qti-pct {
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: auto;
    flex-shrink: 0;
}

.qti-bar-bg {
    height: 4px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
}

.qti-bar {
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s ease;
}

@media (max-width: 576px) {
    .qti-section {
        padding: 1.25rem 1rem;
    }

    .qti-card {
        padding: 0.875rem 1rem;
    }

    .qti-ic {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .qti-name {
        font-size: 0.8rem;
    }
}

