/*!
 * facturatica-features — estilos de tablas de caracteristicas
 *
 * Origen: extraidos del HTML rendereado de la home (post 1017) y refinados.
 *
 * Naming (0.1.4):
 * - Wrapper:                    .facturatica_features_wrapper
 * - Clases custom del proyecto: .facturatica_features_*  (TODAS prefijadas)
 * - Clases de terceros:         Bootstrap, Font Awesome (`fas`,
 *   `fa-check-circle`, `fa-times-circle`, `fa-chevron-down`, etc.),
 *   Odometer.js (`odometer`) — sin prefijo.
 *
 * Doble proteccion: scoped al wrapper + selectores con clases prefijadas.
 */

/* ============================================================
 * Layout / contenedor
 * ============================================================ */

.facturatica_features_wrapper .container {
    padding-left: 0;
    padding-right: 0;
}

/* ============================================================
 * Controls bar (search + expand/collapse all) — 0.1.7
 * El controls bar vive DENTRO de la tabla, en un <tr> que sigue al
 * <thead>. Esto lo coloca visualmente despues de los pricing cards
 * (PREPAGO/FÍSICO/JURÍDICO) y antes de la primer categoria de
 * caracteristicas. El <td> contenedor es transparent/no-border.
 * ============================================================ */

.facturatica_features_wrapper td.facturatica_features_controls_cell {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
}

.facturatica_features_wrapper .facturatica_features_controls {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    margin: 1.5em 0;
    padding: 18px 22px;
    background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
    border: 1px solid #e6e8eb;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.facturatica_features_wrapper .facturatica_features_search_box {
    flex: 1 1 280px;
    min-width: 220px;
    position: relative;
    display: flex;
    align-items: center;
    margin: 0;
}

.facturatica_features_wrapper .facturatica_features_search_icon {
    position: absolute;
    left: 14px;
    color: #9ca3af;
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}

.facturatica_features_wrapper .facturatica_features_search {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: #1a1a1a;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.facturatica_features_wrapper .facturatica_features_search:focus {
    outline: none;
    border-color: #2E8B57;
    box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.18);
}

.facturatica_features_wrapper .facturatica_features_search::placeholder {
    color: #9ca3af;
}

.facturatica_features_wrapper .facturatica_features_controls_buttons {
    display: flex;
    gap: 10px;
    margin-left: auto; /* empuja botones a la derecha cuando hay espacio */
    flex-wrap: wrap;
}

.facturatica_features_wrapper .facturatica_features_controls_buttons button {
    padding: 11px 18px;
    border: 1px solid #2E8B57;
    background: white;
    color: #14501a;
    cursor: pointer;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    line-height: 1;
}

.facturatica_features_wrapper .facturatica_features_controls_buttons button:hover {
    background: linear-gradient(135deg, #14501a, #2E8B57);
    color: white;
    border-color: #14501a;
    box-shadow: 0 2px 6px rgba(20, 80, 26, 0.25);
    transform: translateY(-1px);
}

.facturatica_features_wrapper .facturatica_features_controls_buttons button:active {
    transform: translateY(0);
}

.facturatica_features_wrapper .facturatica_features_controls_buttons button i {
    font-size: 12px;
}

/* ============================================================
 * Tabla
 * ============================================================ */

.facturatica_features_wrapper table.facturatica_features_pricing_table {
    width: 100%;
}

.facturatica_features_wrapper th.facturatica_features_th_licencia {
    vertical-align: top !important;
    position: relative;
    border: 1px solid #e9eaea;
}

.facturatica_features_wrapper .facturatica_features_value_cell {
    text-align: center;
    max-width: 120px;
    border-bottom: 1px solid #e9eaea;
}

/* ============================================================
 * Pricing card (cabecera de cada tier)
 * ============================================================ */

.facturatica_features_wrapper .facturatica_features_pricing_card h3 {
    font-size: 1rem;
    padding-top: 4.3rem;
    text-align: center;
}

.facturatica_features_wrapper .facturatica_features_price_card_hero_text {
    background-color: black;
    height: 30px;
    color: white;
    line-height: 30px;
    text-align: center;
    font-weight: 600;
    font-size: 0.6rem;
}

.facturatica_features_wrapper .facturatica_features_price_card_note {
    font-variant: small-caps;
    font-size: 10px;
    color: grey;
    text-align: center;
}

.facturatica_features_wrapper .facturatica_features_price_card_price {
    text-align: center;
    padding: 0;
    cursor: pointer;
}

.facturatica_features_wrapper .facturatica_features_price_card_price:hover {
    background: #eaeaea;
    border-radius: 3px;
}

.facturatica_features_wrapper .facturatica_features_price_card_price_text {
    font-size: 20px;
}

.facturatica_features_wrapper .facturatica_features_price_card_price_number {
    font-weight: 500;
    opacity: 0.89;
}

.facturatica_features_wrapper .facturatica_features_price_card_price_number:before {
    content: "$";
    font-size: 12px;
    top: -5px;
    display: inline-block;
    position: relative;
}

.facturatica_features_wrapper .facturatica_features_price_card_price_conditions {
    font-size: 0.6rem;
    color: gray;
}

.facturatica_features_wrapper .facturatica_features_custom_separator {
    width: 5rem;
    height: 6px;
    border-radius: 1rem;
    background-color: #4CAF50;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-bottom: 0.5rem !important;
    margin-top: 0.5rem !important;
}

.facturatica_features_wrapper .odometer div {
    display: inline-block;
}

/* ============================================================
 * Ribbon
 * ============================================================ */

.facturatica_features_wrapper .facturatica_features_ribbon {
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    overflow: hidden;
}

.facturatica_features_wrapper .facturatica_features_ribbon span {
    position: absolute;
    top: 14px;
    right: -30px;
    z-index: 1;
    display: block;
    width: 120px;
    padding: 5px 0;
    background-color: #3CB371;
    color: #fff;
    text-align: center;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    transform: rotate(45deg);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
}

.facturatica_features_wrapper .facturatica_features_ribbon_black span {
    background-image: linear-gradient(to left bottom, #1d0095, #2200aa, #2600c1, #2b00d7, #2f00ee);
}

/* ============================================================
 * CTA "Activar"
 * ============================================================ */

.facturatica_features_wrapper button.btn.btn-lg.btn-block.btn-primary {
    background-color: #4CAF50;
    color: white;
    border: 2px solid #2E8B57;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
    background-image: linear-gradient(to bottom, #4CAF50, #2E8B57);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    width: 100%;
    margin-bottom: 1em;
    margin-top: 1em;
}

.facturatica_features_wrapper button.btn.btn-lg.btn-block.btn-primary.facturatica_features_btn_prepago {
    margin-top: 88px;
}

/* ============================================================
 * Filas de categoria (tr_modulo) — verde oscuro elegante  (0.1.4)
 * ============================================================ */

.facturatica_features_wrapper tbody.facturatica_features_cat_header tr.facturatica_features_tr_modulo {
    cursor: pointer;
    user-select: none;
    transition: filter 0.2s ease;
}

.facturatica_features_wrapper tbody.facturatica_features_cat_header tr.facturatica_features_tr_modulo > td {
    background: linear-gradient(135deg, #14501a 0%, #2E8B57 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 14px 18px;
    text-align: left;
    border: none;
    border-top: 1px solid rgba(255,255,255,0.12);
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.18);
    text-shadow: 0 1px 1px rgba(0,0,0,0.25);
}

.facturatica_features_wrapper tbody.facturatica_features_cat_header tr.facturatica_features_tr_modulo:hover > td {
    background: linear-gradient(135deg, #1a6b25 0%, #3CB371 100%);
}

.facturatica_features_wrapper .facturatica_features_chevron {
    margin-right: 12px;
    font-size: 0.85em;
    transition: transform 0.2s ease;
    display: inline-block;
}

.facturatica_features_wrapper tr.facturatica_features_tr_modulo.collapsed .facturatica_features_chevron {
    transform: rotate(-90deg);
}

.facturatica_features_wrapper .facturatica_features_cat_name {
    vertical-align: middle;
}

/* ============================================================
 * Fila de nombre de caracteristica (gradiente dorado/verde 2026)
 * + links negros con hover verde oscuro  (0.1.4)
 * ============================================================ */

/* Fila de nombre de caracteristica — gradiente dorado/verde "2026"
 * (replica byte-identica del SnS de la home post 1017). */
.facturatica_features_wrapper td.facturatica_features_caracteristica_row {
    background: linear-gradient(90deg, rgba(212,175,55,.12), rgba(14,165,107,.12)),
                linear-gradient(180deg, #fff, #f7f8fa);
    color: #1a1a1a;
    font-weight: 600;
    letter-spacing: .25px;
    border-top: 1px solid rgba(212,175,55,.35);
    border-bottom: 1px solid rgba(14,165,107,.25);
    text-transform: uppercase;
    padding: 15px;
    text-align: center;
}

.facturatica_features_wrapper td.facturatica_features_caracteristica_row a {
    color: #1a1a1a;
    text-decoration: none;
    border-bottom: 1px dotted rgba(20, 80, 26, 0.4);
    transition: color 0.15s ease, border-color 0.15s ease;
}

.facturatica_features_wrapper td.facturatica_features_caracteristica_row a:hover,
.facturatica_features_wrapper td.facturatica_features_caracteristica_row a:focus {
    color: #14501a;
    border-bottom-color: #14501a;
}

/* ============================================================
 * Iconos de incluido / no incluido  (0.1.4)
 * ============================================================ */

.facturatica_features_wrapper .facturatica_features_icono_caracteristicas {
    font-size: 1.6rem;
    vertical-align: middle;
}

/* `!important` para ganar contra overrides del tema. El render tambien
   incluye `style="color: ..."` inline como cinturon + tirantes. */
.facturatica_features_wrapper .facturatica_features_icono_check {
    color: #34D399 !important;
}

.facturatica_features_wrapper .facturatica_features_icono_times {
    color: #D1D5DB !important;
}

.facturatica_features_wrapper td:has(.facturatica_features_icono_caracteristicas) {
    padding: 15px;
    text-align: center;
    vertical-align: middle;
}

/* ============================================================
 * Tooltip "i" en categorias y features (0.1.16)
 * ============================================================ */

.facturatica_features_wrapper .facturatica_features_info_icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    color: currentColor;
    cursor: help;
    position: relative;
    vertical-align: middle;
    opacity: 0.55;
    transition: opacity 0.15s ease, transform 0.15s ease;
    font-size: 14px;
    line-height: 1;
    outline: none;
}

.facturatica_features_wrapper .facturatica_features_info_icon:hover,
.facturatica_features_wrapper .facturatica_features_info_icon:focus,
.facturatica_features_wrapper .facturatica_features_info_icon.facturatica_features_tooltip_open {
    opacity: 1;
    transform: scale(1.08);
}

/* Tooltip bubble (CSS-only, via ::after) */
.facturatica_features_wrapper .facturatica_features_info_icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #14501a;
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.45;
    white-space: normal;
    width: max-content;
    max-width: 280px;
    text-align: left;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
    z-index: 1000;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

/* Flecha del tooltip */
.facturatica_features_wrapper .facturatica_features_info_icon::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #14501a;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 1001;
}

/* Mostrar tooltip en hover, focus, y class manual (toggle JS para mobile) */
.facturatica_features_wrapper .facturatica_features_info_icon:hover::after,
.facturatica_features_wrapper .facturatica_features_info_icon:hover::before,
.facturatica_features_wrapper .facturatica_features_info_icon:focus::after,
.facturatica_features_wrapper .facturatica_features_info_icon:focus::before,
.facturatica_features_wrapper .facturatica_features_info_icon.facturatica_features_tooltip_open::after,
.facturatica_features_wrapper .facturatica_features_info_icon.facturatica_features_tooltip_open::before {
    opacity: 1;
    visibility: visible;
}

/* En cabeceras de categoria (fondo verde oscuro) el icono se ve claro */
.facturatica_features_wrapper tr.facturatica_features_tr_modulo .facturatica_features_info_icon {
    color: #ffffff;
}

/* ============================================================
 * Estados: collapsed (categoria cerrada) / filtrado por busqueda
 * ============================================================ */

.facturatica_features_wrapper tbody.facturatica_features_cat_features.collapsed {
    display: none;
}

.facturatica_features_wrapper tr.facturatica_features_filtered_out {
    display: none;
}

.facturatica_features_wrapper tbody.facturatica_features_empty {
    display: none;
}

/* Cuando hay busqueda activa, se ignora el estado collapsed para que las
   coincidencias sean visibles. Se preserva el ocultamiento de tbodies vacios. */
.facturatica_features_wrapper.facturatica_features_searching tbody.facturatica_features_cat_features.collapsed {
    display: table-row-group;
}

.facturatica_features_wrapper.facturatica_features_searching tbody.facturatica_features_cat_features.facturatica_features_empty,
.facturatica_features_wrapper.facturatica_features_searching tbody.facturatica_features_cat_header.facturatica_features_empty {
    display: none;
}

/* Resaltado opcional de matches */
.facturatica_features_wrapper.facturatica_features_searching tr[data-feature-name]:not(.facturatica_features_filtered_out) td.facturatica_features_caracteristica_row {
    background: linear-gradient(90deg, rgba(255, 235, 153, 0.35), rgba(14, 165, 107, 0.10)),
                linear-gradient(180deg, #fff, #fffae6);
}
