/*
 * TodoReseña - Comparativa Template Styles (Premium, No-Emojis)
 */

:root {
    --comp-sidebar-width: 320px;
    --table-header-bg: #f8fafc;
    --table-border: #e2e8f0;
    --badge-general: #3b82f6;
    --badge-price: #10b981;
    --badge-light: #8b5cf6;
    /* Base variables (also in custom-home.css; defined here so comparativas work standalone) */
    --primary:        #4f46e5;
    --primary-dark:   #4338ca;
    --gray-50:  #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --star-gold:  #fbbf24;
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.025);
    --pro-green:  #16a34a;
    --con-red:    #dc2626;
}

.comp-main-container {
    background: var(--gray-50);
    padding-bottom: 5rem;
}

/* Limitar ancho del container dentro de comp */
.comp-main-container .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.comp-header {
    padding: 3rem 0;
    max-width: 900px;
    margin: 0 auto;
}

.comp-breadcrumbs {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}
.comp-breadcrumbs .current {
    font-weight: 600;
    color: var(--gray-900);
}

.comp-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.comp-h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}

.comp-meta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: var(--gray-600);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}
.badge-tested {
    background: #eff6ff;
    color: #1e3a8a;
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    font-weight: 600;
}

.update-notice {
    display: inline-block;
    background: white;
    border: 1px solid var(--gray-200);
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    color: var(--gray-600);
    box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */
.comp-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

@media (min-width: 1024px) {
    .comp-content-wrapper {
        flex-direction: row;
        align-items: flex-start;
    }
    .comp-body {
        flex: 1;
        min-width: 0;
    }
    .comp-sidebar {
        width: var(--comp-sidebar-width);
        position: sticky;
        top: 100px;
        flex-shrink: 0;
    }
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.comp-sidebar .table-of-contents {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--gray-200);
    margin-bottom: 2rem;
}

.quick-filters-box {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--gray-200);
}
.quick-filters-box h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--gray-700);
    cursor: pointer;
}

/* ==========================================================================
   SECCIONES Y TABLAS
   ========================================================================== */
.comp-section {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    border: 1px solid var(--gray-200);
}
.comp-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray-100);
}

.intro-lead {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

/* Main Table */
.table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    border: 1px solid var(--table-border);
}
.sortable-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    text-align: left;
}
.sortable-table th {
    background: var(--table-header-bg);
    padding: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    border-bottom: 2px solid var(--table-border);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: background 0.2s;
}
.sortable-table th:hover { background: var(--gray-200); }
.sortable-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--table-border);
    vertical-align: middle;
}
.sortable-table tr:hover td { background: var(--gray-50); }
.table-img { border-radius: 8px; object-fit: cover; }
.stars-sm { color: var(--star-gold); letter-spacing: 1px; }

.btn-primary-xs {
    display: inline-block;
    background: var(--primary);
    color: white !important;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none !important;
}

.badge-winner {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}
.badge-general { background: var(--badge-general); }
.badge-price   { background: var(--badge-price); }
.badge-light   { background: var(--badge-light); }

/* Criterios Methodology */
.methodology-box { background: linear-gradient(to right, #f8fafc, #f1f5f9); }
.criterios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.criterio-item {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}
.c-header { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 0.5rem; }
.c-bar { height: 6px; background: var(--gray-200); border-radius: 3px; margin-bottom: 1rem; overflow: hidden; }
.c-fill { height: 100%; background: var(--primary); }
.c-list { font-size: 0.85rem; color: var(--gray-600); padding-left: 1rem; }

/* Individual Reviews */
.product-review-block { margin-bottom: 3rem; }
.product-review-block h3 { font-size: 1.5rem; margin-bottom: 1.5rem; }

.product-card-hero {
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    background: var(--gray-50);
}
.product-card-badge {
    position: absolute;
    top: -12px; left: 1.5rem;
    background: var(--primary);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.product-card-badge.badge-price { background: var(--badge-price); }
.product-card-badge.badge-light { background: var(--badge-light); }

.product-card-split {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
}
.product-card-img {
    width: 200px;
    height: 180px;
    object-fit: contain;
    border-radius: 8px;
    background: white;
    padding: 0.5rem;
}
.product-card-data {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.rating-box { font-size: 1.1rem; }
.price-box  { font-size: 2rem; font-weight: 800; }

.product-specs-quick { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.spec-tag {
    background: var(--gray-100);
    color: var(--gray-700);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.product-divider {
    border: none;
    border-top: 1px dashed var(--gray-300);
    margin: 3rem 0;
}

.product-text h4 { font-size: 1.05rem; font-weight: 700; margin: 1rem 0 0.4rem; }
.product-text p  { line-height: 1.75; color: var(--gray-700); }

/* Interactive Comparator */
.interactive-comparator-box {
    background: var(--gray-900);
    color: white;
    padding: 2rem;
    border-radius: 16px;
}
.comp-picker-wrap {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.comp-picker {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 180px;
}
.comp-picker__btn {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.7);
    padding: 0.65rem 1rem;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.3;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: normal;
    word-break: break-word;
}
.comp-picker__btn:hover {
    background: rgba(255,255,255,0.12);
    color: white;
}
.comp-picker__btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    font-weight: 600;
}
.comp-picker__num {
    font-weight: 700;
    margin-right: 0.4rem;
    opacity: 0.7;
}
.comp-picker__btn.active .comp-picker__num { opacity: 1; }
.vs-text {
    font-weight: 800;
    color: var(--gray-400);
    font-size: 1rem;
    letter-spacing: 0.1em;
    flex-shrink: 0;
}
/* mantener .comp-select por si se usa en otro sitio */
.comp-select { display: none; }
.comp-results-table { background: white; border-radius: 12px; color: var(--gray-900); overflow: hidden; margin-top: 1.5rem; }
.comp-results-table table { width: 100%; border-collapse: collapse; }
.comp-results-table th,
.comp-results-table td { padding: 1rem; border: 1px solid var(--gray-200); text-align: center; }
.comp-results-table td.winner { background: #f0fdf4; font-weight: 700; }

/* Winners */
.section-winners { background: linear-gradient(135deg, #1e293b, #0f172a); color: white; }
.section-winners h2 { color: white; border-bottom-color: rgba(255,255,255,0.1); }
.winners-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.winner-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 1.5rem;
    border-radius: 16px;
    text-align: center;
}
.w-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 800;
    margin-bottom: 1rem;
}
.winner-card h4 { font-size: 1.25rem; margin-bottom: 0.5rem; color: #fff !important; }
.winner-card p  { color: rgba(255,255,255,0.75); font-size: 0.9rem; margin-bottom: 1.5rem; line-height: 1.5; }

/* TOC active state */
.toc-list a.active { color: var(--primary); font-weight: 700; }

/* Mobile overrides */
@media (max-width: 640px) {
    .product-card-split { flex-direction: column; }
    .product-card-img   { width: 100%; height: 200px; }
    .pros-cons-grid     { grid-template-columns: 1fr !important; }
    .comp-section       { padding: 1.5rem; }
    .comp-header        { padding: 2rem 0; }
    .price-box          { font-size: 1.5rem; }
}
