/**
 * Elementor Custom Table Widget - Styles
 */

.ect-table-outer {
    width: 100%;
}

.ect-table-wrapper {
    background: transparent;
    max-width: 100%;
}

.ect-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: auto;
}

.ect-table th,
.ect-table td {
    vertical-align: middle;
    word-wrap: break-word;
}

.ect-table thead th {
    font-weight: 600;
    text-align: left;
}

.ect-table tbody td {
    border-bottom: 1px solid #e5e7eb;
}

.ect-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================================
 * MODO RESPONSIVO: SCROLL HORIZONTAL
 * ============================================================ */
.ect-responsive-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ect-responsive-scroll .ect-table {
    min-width: 600px;
}

/* ============================================================
 * MODO RESPONSIVO: APILADO EN MÓVIL
 * ============================================================ */
@media (max-width: 767px) {

    .ect-responsive-stack .ect-table,
    .ect-responsive-stack .ect-table thead,
    .ect-responsive-stack .ect-table tbody,
    .ect-responsive-stack .ect-table tr,
    .ect-responsive-stack .ect-table td {
        display: block;
        width: 100%;
    }

    .ect-responsive-stack .ect-table thead {
        display: none;
    }

    .ect-responsive-stack .ect-table tbody tr {
        margin-bottom: 15px;
        border: 1px solid #e5e7eb;
        border-radius: 6px;
        overflow: hidden;
    }

    .ect-responsive-stack .ect-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        text-align: right !important;
        border-bottom: 1px solid #e5e7eb;
    }

    .ect-responsive-stack .ect-table tbody tr td:last-child {
        border-bottom: none;
    }

    .ect-responsive-stack .ect-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
        flex: 1;
        opacity: 0.7;
        font-size: 0.85em;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .ect-responsive-stack .ect-table tbody td:empty,
    .ect-responsive-stack .ect-table tbody td[data-label=""]:has(> :empty) {
        display: none;
    }
}

/* ============================================================
 * EDITOR DE ELEMENTOR (previsualizacion)
 * ============================================================ */
.elementor-editor-active .ect-table-wrapper {
    min-height: 40px;
}
